Skip to content

Commit 38fb1d5

Browse files
m4gr3ddsnopek
authored andcommitted
Initial commit.
0 parents  commit 38fb1d5

File tree

177 files changed

+13903
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+13903
-0
lines changed

.clang-format

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
# Commented out parameters are those with the same value as base LLVM style.
2+
# We can uncomment them if we want to change their value, or enforce the
3+
# chosen value in case the base style changes (last sync: Clang 14.0).
4+
---
5+
### General config, applies to all languages ###
6+
BasedOnStyle: LLVM
7+
AccessModifierOffset: -4
8+
AlignAfterOpenBracket: DontAlign
9+
# AlignArrayOfStructures: None
10+
# AlignConsecutiveMacros: None
11+
# AlignConsecutiveAssignments: None
12+
# AlignConsecutiveBitFields: None
13+
# AlignConsecutiveDeclarations: None
14+
# AlignEscapedNewlines: Right
15+
AlignOperands: DontAlign
16+
AlignTrailingComments: false
17+
# AllowAllArgumentsOnNextLine: true
18+
AllowAllParametersOfDeclarationOnNextLine: false
19+
# AllowShortEnumsOnASingleLine: true
20+
# AllowShortBlocksOnASingleLine: Never
21+
# AllowShortCaseLabelsOnASingleLine: false
22+
# AllowShortFunctionsOnASingleLine: All
23+
# AllowShortLambdasOnASingleLine: All
24+
# AllowShortIfStatementsOnASingleLine: Never
25+
# AllowShortLoopsOnASingleLine: false
26+
# AlwaysBreakAfterDefinitionReturnType: None
27+
# AlwaysBreakAfterReturnType: None
28+
# AlwaysBreakBeforeMultilineStrings: false
29+
# AlwaysBreakTemplateDeclarations: MultiLine
30+
# AttributeMacros:
31+
# - __capability
32+
# BinPackArguments: true
33+
# BinPackParameters: true
34+
# BraceWrapping:
35+
# AfterCaseLabel: false
36+
# AfterClass: false
37+
# AfterControlStatement: Never
38+
# AfterEnum: false
39+
# AfterFunction: false
40+
# AfterNamespace: false
41+
# AfterObjCDeclaration: false
42+
# AfterStruct: false
43+
# AfterUnion: false
44+
# AfterExternBlock: false
45+
# BeforeCatch: false
46+
# BeforeElse: false
47+
# BeforeLambdaBody: false
48+
# BeforeWhile: false
49+
# IndentBraces: false
50+
# SplitEmptyFunction: true
51+
# SplitEmptyRecord: true
52+
# SplitEmptyNamespace: true
53+
# BreakBeforeBinaryOperators: None
54+
# BreakBeforeConceptDeclarations: true
55+
# BreakBeforeBraces: Attach
56+
# BreakBeforeInheritanceComma: false
57+
# BreakInheritanceList: BeforeColon
58+
# BreakBeforeTernaryOperators: true
59+
# BreakConstructorInitializersBeforeComma: false
60+
BreakConstructorInitializers: AfterColon
61+
# BreakStringLiterals: true
62+
ColumnLimit: 0
63+
# CommentPragmas: '^ IWYU pragma:'
64+
# QualifierAlignment: Leave
65+
# CompactNamespaces: false
66+
ConstructorInitializerIndentWidth: 8
67+
ContinuationIndentWidth: 8
68+
Cpp11BracedListStyle: false
69+
# DeriveLineEnding: true
70+
# DerivePointerAlignment: false
71+
# DisableFormat: false
72+
# EmptyLineAfterAccessModifier: Never
73+
# EmptyLineBeforeAccessModifier: LogicalBlock
74+
# ExperimentalAutoDetectBinPacking: false
75+
# PackConstructorInitializers: BinPack
76+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
77+
# AllowAllConstructorInitializersOnNextLine: true
78+
# FixNamespaceComments: true
79+
# ForEachMacros:
80+
# - foreach
81+
# - Q_FOREACH
82+
# - BOOST_FOREACH
83+
# IfMacros:
84+
# - KJ_IF_MAYBE
85+
# IncludeBlocks: Preserve
86+
IncludeCategories:
87+
- Regex: '".*"'
88+
Priority: 1
89+
- Regex: '^<.*\.h>'
90+
Priority: 2
91+
- Regex: '^<.*'
92+
Priority: 3
93+
# IncludeIsMainRegex: '(Test)?$'
94+
# IncludeIsMainSourceRegex: ''
95+
# IndentAccessModifiers: false
96+
IndentCaseLabels: true
97+
# IndentCaseBlocks: false
98+
# IndentGotoLabels: true
99+
# IndentPPDirectives: None
100+
# IndentExternBlock: AfterExternBlock
101+
# IndentRequires: false
102+
IndentWidth: 4
103+
# IndentWrappedFunctionNames: false
104+
# InsertTrailingCommas: None
105+
# JavaScriptQuotes: Leave
106+
# JavaScriptWrapImports: true
107+
KeepEmptyLinesAtTheStartOfBlocks: false
108+
# LambdaBodyIndentation: Signature
109+
# MacroBlockBegin: ''
110+
# MacroBlockEnd: ''
111+
# MaxEmptyLinesToKeep: 1
112+
# NamespaceIndentation: None
113+
# PenaltyBreakAssignment: 2
114+
# PenaltyBreakBeforeFirstCallParameter: 19
115+
# PenaltyBreakComment: 300
116+
# PenaltyBreakFirstLessLess: 120
117+
# PenaltyBreakOpenParenthesis: 0
118+
# PenaltyBreakString: 1000
119+
# PenaltyBreakTemplateDeclaration: 10
120+
# PenaltyExcessCharacter: 1000000
121+
# PenaltyReturnTypeOnItsOwnLine: 60
122+
# PenaltyIndentedWhitespace: 0
123+
# PointerAlignment: Right
124+
# PPIndentWidth: -1
125+
# ReferenceAlignment: Pointer
126+
# ReflowComments: true
127+
# RemoveBracesLLVM: false
128+
# SeparateDefinitionBlocks: Leave
129+
# ShortNamespaceLines: 1
130+
# SortIncludes: CaseSensitive
131+
# SortJavaStaticImport: Before
132+
# SortUsingDeclarations: true
133+
# SpaceAfterCStyleCast: false
134+
# SpaceAfterLogicalNot: false
135+
# SpaceAfterTemplateKeyword: true
136+
# SpaceBeforeAssignmentOperators: true
137+
# SpaceBeforeCaseColon: false
138+
# SpaceBeforeCpp11BracedList: false
139+
# SpaceBeforeCtorInitializerColon: true
140+
# SpaceBeforeInheritanceColon: true
141+
# SpaceBeforeParens: ControlStatements
142+
# SpaceBeforeParensOptions:
143+
# AfterControlStatements: true
144+
# AfterForeachMacros: true
145+
# AfterFunctionDefinitionName: false
146+
# AfterFunctionDeclarationName: false
147+
# AfterIfMacros: true
148+
# AfterOverloadedOperator: false
149+
# BeforeNonEmptyParentheses: false
150+
# SpaceAroundPointerQualifiers: Default
151+
# SpaceBeforeRangeBasedForLoopColon: true
152+
# SpaceInEmptyBlock: false
153+
# SpaceInEmptyParentheses: false
154+
# SpacesBeforeTrailingComments: 1
155+
# SpacesInAngles: Never
156+
# SpacesInConditionalStatement: false
157+
# SpacesInContainerLiterals: true
158+
# SpacesInCStyleCastParentheses: false
159+
## Godot TODO: We'll want to use a min of 1, but we need to see how to fix
160+
## our comment capitalization at the same time.
161+
SpacesInLineCommentPrefix:
162+
Minimum: 0
163+
Maximum: -1
164+
# SpacesInParentheses: false
165+
# SpacesInSquareBrackets: false
166+
# SpaceBeforeSquareBrackets: false
167+
# BitFieldColonSpacing: Both
168+
# StatementAttributeLikeMacros:
169+
# - Q_EMIT
170+
# StatementMacros:
171+
# - Q_UNUSED
172+
# - QT_REQUIRE_VERSION
173+
TabWidth: 4
174+
# UseCRLF: false
175+
UseTab: Always
176+
# WhitespaceSensitiveMacros:
177+
# - STRINGIZE
178+
# - PP_STRINGIZE
179+
# - BOOST_PP_STRINGIZE
180+
# - NS_SWIFT_NAME
181+
# - CF_SWIFT_NAME
182+
---
183+
### C++ specific config ###
184+
Language: Cpp
185+
Standard: c++17
186+
---
187+
### ObjC specific config ###
188+
Language: ObjC
189+
# ObjCBinPackProtocolList: Auto
190+
ObjCBlockIndentWidth: 4
191+
# ObjCBreakBeforeNestedBlockParam: true
192+
# ObjCSpaceAfterProperty: false
193+
# ObjCSpaceBeforeProtocolList: true
194+
---
195+
### Java specific config ###
196+
Language: Java
197+
# BreakAfterJavaFieldAnnotations: false
198+
JavaImportGroups: ['org.godotengine', 'android', 'androidx', 'com.android', 'com.google', 'java', 'javax']
199+
...

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.so filter=lfs diff=lfs merge=lfs -text
2+
*.dll filter=lfs diff=lfs merge=lfs -text
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# Workflow to automatically create the Godot Meta Toolkit addon
2+
name: Build on push
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- '*'
11+
12+
env:
13+
# Only used for the cache key. Increment version to force clean build.
14+
GODOT_BASE_BRANCH: main
15+
SCONS_CACHE: ${{ github.workspace }}/.scons-cache/
16+
17+
jobs:
18+
build:
19+
name: Building for ${{ matrix.name }} (${{ matrix.os }})
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: true
23+
matrix:
24+
include:
25+
# Godot Meta Toolkit
26+
- name: Godot Meta Toolkit Linux (x86_64)
27+
os: ubuntu-20.04
28+
platform: linux
29+
flags: arch=x86_64
30+
artifact_name: godotmetatoolkit-build-files-linux-x86_64
31+
artifact_path: godot_meta_toolkit/demo/addons/godot_meta_toolkit/.bin/linux/*/*/*.so
32+
cache-name: linux-x86_64
33+
- name: Godot Meta Toolkit Windows
34+
os: windows-latest
35+
platform: windows
36+
artifact_name: godotmetatoolkit-build-files-windows
37+
artifact_path: godot_meta_toolkit/demo/addons/godot_meta_toolkit/.bin/windows/*/*/*.dll
38+
cache-name: windows-x86_64
39+
- name: Godot Meta Toolkit MacOS
40+
os: macos-latest
41+
platform: macos
42+
flags: arch=universal
43+
artifact_name: godotmetatoolkit-build-files-macos
44+
artifact_path: godot_meta_toolkit/demo/addons/godot_meta_toolkit/.bin/macos/*/*.framework
45+
cache-name: macos-universal
46+
- name: Godot Meta Toolkit Android
47+
os: ubuntu-20.04
48+
platform: android
49+
flags: arch=arm64
50+
artifact_name: godotmetatoolkit-build-files-android
51+
artifact_path: |
52+
godot_meta_toolkit/demo/addons/godot_meta_toolkit/.bin/android/*/*.aar
53+
godot_meta_toolkit/demo/addons/godot_meta_toolkit/.bin/android/*/*/*.so
54+
cache-name: android
55+
56+
# Note, to satisfy the asset library we need to make sure our zip files have a root folder
57+
# this is why we checkout into godot_meta_toolkit and build into asset
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v3
61+
with:
62+
path: godot_meta_toolkit
63+
submodules: recursive
64+
lfs: 'true'
65+
- name: Setup Godot build cache
66+
uses: ./godot_meta_toolkit/thirdparty/godot-cpp/.github/actions/godot-cache
67+
with:
68+
cache-name: ${{ matrix.cache-name }}
69+
continue-on-error: true
70+
- name: Download Meta Platform SDK (POSIX)
71+
run: |
72+
wget "${{ secrets.META_PLATFORM_SDK_URL }}" -O meta_platform_sdk.zip
73+
cd godot_meta_toolkit/thirdparty/ovr_platform_sdk
74+
unzip -a ../../../meta_platform_sdk.zip
75+
cd ../../..
76+
rm meta_platform_sdk.zip
77+
if: runner.os != 'Windows'
78+
- name: Download Meta Platform SDK (Windows)
79+
shell: pwsh
80+
run: |
81+
Invoke-WebRequest -Uri "${{ secrets.META_PLATFORM_SDK_URL }}" -OutFile "meta_platform_sdk.zip"
82+
Set-Location "godot_meta_toolkit/thirdparty/ovr_platform_sdk"
83+
Expand-Archive -Path "../../../meta_platform_sdk.zip" -DestinationPath "."
84+
Set-Location "../../.."
85+
Remove-Item "meta_platform_sdk.zip"
86+
if: runner.os == 'Windows'
87+
- name: Set up Python (for SCons)
88+
uses: actions/setup-python@v4
89+
with:
90+
python-version: "3.x"
91+
- name: Android dependencies
92+
uses: nttld/setup-ndk@v1
93+
with:
94+
ndk-version: r23c
95+
link-to-sdk: true
96+
- name: Install scons
97+
run: |
98+
python -m pip install scons==4.0.0
99+
- name: Create extension library
100+
run: |
101+
cd godot_meta_toolkit
102+
scons platform=${{ matrix.platform }} target=template_debug ${{ matrix.flags }}
103+
scons platform=${{ matrix.platform }} target=template_release ${{ matrix.flags }}
104+
cd ..
105+
106+
# On Android we build our loaders and build our extension with gradlew
107+
- name: Setup java
108+
uses: actions/setup-java@v3
109+
with:
110+
java-version: 17
111+
distribution: "adopt"
112+
if: matrix.platform == 'android'
113+
- name: Validate Gradle wrapper
114+
uses: gradle/wrapper-validation-action@v1
115+
if: matrix.platform == 'android'
116+
- name: Create Godot-CPP library
117+
run: |
118+
cd godot_meta_toolkit/thirdparty/godot-cpp
119+
scons platform=${{ matrix.platform }} target=template_debug arch=arm64
120+
scons platform=${{ matrix.platform }} target=template_release arch=arm64
121+
scons platform=${{ matrix.platform }} target=template_debug arch=x86_64
122+
scons platform=${{ matrix.platform }} target=template_release arch=x86_64
123+
cd ../../..
124+
if: matrix.platform == 'android'
125+
- name: Create Godot Meta Toolkit AARs
126+
uses: burrunan/gradle-cache-action@v1
127+
with:
128+
build-root-directory: godot_meta_toolkit
129+
arguments: build
130+
if: matrix.platform == 'android'
131+
132+
- name: Upload build files (artifacts)
133+
uses: actions/upload-artifact@v3
134+
with:
135+
name: ${{ matrix.artifact_name }}
136+
path: |
137+
${{ matrix.artifact_path }}
138+
139+
# GODOT 4.2 ADDON GENERATION SECTION
140+
asset:
141+
name: Assembling the asset
142+
runs-on: ubuntu-20.04
143+
needs: build
144+
145+
# Steps represent a sequence of tasks that will be executed as part of the job
146+
steps:
147+
- name: Checkout
148+
uses: actions/checkout@v3
149+
with:
150+
path: godot_meta_toolkit
151+
- name: Download all workflow run artifacts
152+
uses: actions/download-artifact@v3
153+
- name: Create Godot Meta Toolkit Addon
154+
run: |
155+
mkdir asset
156+
cp -r godot_meta_toolkit/demo/addons asset
157+
158+
- name: Copying artifacts
159+
run: |
160+
mkdir -p asset/addons/godot_meta_toolkit/.bin/android/
161+
cp -r godotmetatoolkit-build-files-android/* asset/addons/godot_meta_toolkit/.bin/android/
162+
163+
mkdir -p asset/addons/godot_meta_toolkit/.bin/linux/
164+
cp -r godotmetatoolkit-build-files-linux-x86_64/* asset/addons/godot_meta_toolkit/.bin/linux/
165+
166+
mkdir -p asset/addons/godot_meta_toolkit/.bin/windows/
167+
cp -r godotmetatoolkit-build-files-windows/* asset/addons/godot_meta_toolkit/.bin/windows/
168+
169+
mkdir -p asset/addons/godot_meta_toolkit/.bin/macos/
170+
cp -r godotmetatoolkit-build-files-macos/* asset/addons/godot_meta_toolkit/.bin/macos/
171+
172+
- name: Create Godot Meta Toolkit addon artifact
173+
uses: actions/upload-artifact@v3
174+
with:
175+
name: GodotMetaToolkitAddon
176+
path: |
177+
asset
178+
- name: Zip addon
179+
run: |
180+
zip -qq -r godotmetatoolkitaddon.zip asset
181+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
182+
- name: Create and upload asset
183+
uses: ncipollo/release-action@v1
184+
with:
185+
allowUpdates: true
186+
artifacts: "godotmetatoolkitaddon.zip"
187+
omitNameDuringUpdate: true
188+
omitBodyDuringUpdate: true
189+
omitDraftDuringUpdate: true
190+
omitPrereleaseDuringUpdate: true
191+
token: ${{ secrets.GITHUB_TOKEN }}
192+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

0 commit comments

Comments
 (0)