Skip to content

Commit 446c1fe

Browse files
Initial commit
0 parents  commit 446c1fe

26 files changed

+680
-0
lines changed

.clang-format

+199
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

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Normalize EOL for all files that Git considers text files.
2+
* text=auto eol=lf

.github/ISSUE_TEMPLATE/bug_report.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Bug report
2+
description: Report a bug with the godot-cpp template
3+
body:
4+
5+
- type: markdown
6+
attributes:
7+
value: |
8+
- Write a descriptive issue title above.
9+
- Search [open](https://github.com/godotengine/godot-cpp-template/issues) and [closed](https://github.com/godotengine/godot-cpp-template/issues?q=is%3Aissue+is%3Aclosed) issues to ensure it has not already been reported.
10+
- type: input
11+
attributes:
12+
label: Godot version
13+
description: >
14+
Specify the Git commit hash of your Godot build.
15+
placeholder: v4.0.stable.official [92bee43ad]
16+
validations:
17+
required: true
18+
19+
- type: input
20+
attributes:
21+
label: godot-cpp version
22+
description: >
23+
Specify the Git commit hash of the godot-cpp submodule in your project. You can run `git status` inside the folder to check it.
24+
placeholder: v4.0.stable.official [9d1c396c5]
25+
validations:
26+
required: true
27+
28+
- type: input
29+
attributes:
30+
label: System information
31+
description: |
32+
Specify the OS version.
33+
placeholder: Windows 10
34+
validations:
35+
required: true
36+
37+
- type: textarea
38+
attributes:
39+
label: Issue description
40+
description: |
41+
Describe your issue briefly. What doesn't work, and how do you expect it to work instead?
42+
You can include images or videos with drag and drop, and format code blocks or logs with <code>```</code> tags.
43+
validations:
44+
required: true

.github/ISSUE_TEMPLATE/config.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
blank_issues_enabled: false
2+
3+
contact_links:
4+
- name: Godot proposals
5+
url: https://github.com/godotengine/godot-proposals
6+
about: Please submit feature proposals on the Godot proposals repository, not here.
7+
8+
- name: Godot documentation repository
9+
url: https://github.com/godotengine/godot-docs
10+
about: Please report issues with documentation on the Godot documentation repository, not here.
11+
12+
- name: Godot community channels
13+
url: https://godotengine.org/community
14+
about: Please ask for technical support on one of the other community channels, not here.

.github/workflows/builds.yml

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: Builds
2+
3+
on: push
4+
5+
env:
6+
LIBNAME: example
7+
8+
concurrency:
9+
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-macos
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build:
14+
runs-on: ${{matrix.os}}
15+
name: ${{matrix.name}}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- identifier: windows-debug
21+
os: windows-latest
22+
name: 🏁 Windows Debug
23+
target: template_debug
24+
platform: windows
25+
arch: x86_64
26+
- identifier: windows-release
27+
os: windows-latest
28+
name: 🏁 Windows Release
29+
target: template_release
30+
platform: windows
31+
arch: x86_64
32+
- identifier: macos-debug
33+
os: macos-latest
34+
name: 🍎 macOS (universal) Debug
35+
target: template_debug
36+
platform: macos
37+
arch: universal
38+
- identifier: macos-release
39+
os: macos-latest
40+
name: 🍎 macOS (universal) Release
41+
target: template_release
42+
platform: macos
43+
arch: universal
44+
- identifier: linux-debug
45+
os: ubuntu-latest
46+
name: 🐧 Linux Debug
47+
runner: ubuntu-20.04
48+
target: template_debug
49+
platform: linux
50+
arch: x86_64
51+
- identifier: linux-release
52+
os: ubuntu-latest
53+
name: 🐧 Linux Release
54+
runner: ubuntu-20.04
55+
target: template_release
56+
platform: linux
57+
arch: x86_64
58+
59+
steps:
60+
- name: Checkout project
61+
uses: actions/checkout@v3
62+
with:
63+
submodules: recursive
64+
65+
- name: Set up Python
66+
uses: actions/setup-python@v4
67+
with:
68+
python-version: '3.x'
69+
70+
- name: Set up SCons
71+
shell: bash
72+
run: |
73+
python -c "import sys; print(sys.version)"
74+
python -m pip install scons
75+
scons --version
76+
- name: Linux dependencies
77+
if: ${{ matrix.platform == 'linux' }}
78+
run: |
79+
sudo apt-get update -qq
80+
sudo apt-get install -qqq build-essential pkg-config
81+
- name: Setup MinGW for Windows/MinGW build
82+
if: ${{ matrix.platform == 'windows' }}
83+
uses: egor-tensin/setup-mingw@v2
84+
with:
85+
version: 12.2.0
86+
87+
- name: Compile godot-cpp
88+
shell: sh
89+
run: |
90+
scons target='${{ matrix.target }}' platform='${{ matrix.platform }}' arch='${{ matrix.arch }}'
91+
working-directory: godot-cpp
92+
93+
- name: Compile Extension
94+
shell: sh
95+
run: |
96+
scons target='${{ matrix.target }}' platform='${{ matrix.platform }}' arch='${{ matrix.arch }}'
97+
- name: Delete compilation files
98+
if: ${{ matrix.platform == 'windows' }}
99+
run: |
100+
Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force
101+
- name: Upload artifact
102+
uses: actions/upload-artifact@v3
103+
with:
104+
name: ${{ github.event.repository.name }}
105+
path: |
106+
${{ github.workspace }}/bin/*
107+
- name: Archive Release
108+
uses: thedoctor0/zip-release@0.7.1
109+
with:
110+
type: 'zip'
111+
filename: '${{ env.LIBNAME }}.${{ matrix.platform }}.${{ matrix.arch }}.zip'
112+
path: '${{ github.workspace }}/bin/'
113+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
114+
115+
- name: Create and upload asset
116+
if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
117+
uses: ncipollo/release-action@v1
118+
with:
119+
allowUpdates: true
120+
artifacts: "${{ env.LIBNAME }}.${{ matrix.platform }}.${{ matrix.arch }}.zip"
121+
omitNameDuringUpdate: true
122+
omitBodyDuringUpdate: true
123+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)