Skip to content

Commit

Permalink
GODOT-DOTNET IS OPEN SOURCE
Browse files Browse the repository at this point in the history
  • Loading branch information
raulsntos committed Apr 4, 2024
0 parents commit bdad9d1
Show file tree
Hide file tree
Showing 389 changed files with 350,655 additions and 0 deletions.
118 changes: 118 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = tab
insert_final_newline = true

# YAML requires indentation with spaces instead of tabs.
[*.{yml,yaml}]
indent_style = space
indent_size = 2

[*.{sh,ps1,psd1}]
indent_style = space
indent_size = 2

[*.py]
indent_style = space
indent_size = 4

[*.sln]
indent_style = tab

[*.{csproj,proj,props,targets,nuspec,resx}]
indent_style = space
indent_size = 2

[*.cs]
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 120

csharp_indent_case_contents_when_block = false
csharp_style_prefer_primary_constructors = false

csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true

dotnet_style_require_accessibility_modifiers = always

# IDE0040: Add accessibility modifiers.
dotnet_diagnostic.IDE0040.severity = warning

# IDE1006: Naming rule violation.
dotnet_diagnostic.IDE1006.severity = suggestion

# Severity levels for dotnet_naming_rule only affect IDE environments.
# To have them extra visible to people, we can set them as 'warning' here without affecting compilation.

# Everything should be PascalCase by default.
dotnet_naming_rule.all_should_be_camel_case.severity = warning
dotnet_naming_rule.all_should_be_camel_case.symbols = all
dotnet_naming_rule.all_should_be_camel_case.style = pascal_case_style
# Non-public fields should be _camelCase.
dotnet_naming_rule.non_public_fields_should_be_underscore_camel_case.severity = warning
dotnet_naming_rule.non_public_fields_should_be_underscore_camel_case.symbols = non_public_fields
dotnet_naming_rule.non_public_fields_should_be_underscore_camel_case.style = underscore_camel_case_style
# Constant fields (and local vars) should be PascalCase.
dotnet_naming_rule.constants_should_be_pascal_case.severity = warning
dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants
dotnet_naming_rule.constants_should_be_pascal_case.style = pascal_case_style
# Locals variables should be camelCase.
dotnet_naming_rule.local_vars_should_be_camel_case.severity = warning
dotnet_naming_rule.local_vars_should_be_camel_case.symbols = local_vars
dotnet_naming_rule.local_vars_should_be_camel_case.style = camel_case_style
# Parameters should be camelCase.
dotnet_naming_rule.parameters_should_be_camel_case.severity = warning
dotnet_naming_rule.parameters_should_be_camel_case.symbols = parameters
dotnet_naming_rule.parameters_should_be_camel_case.style = camel_case_style

dotnet_naming_symbols.all.applicable_kinds = *
dotnet_naming_symbols.local_vars.applicable_kinds = local
dotnet_naming_symbols.parameters.applicable_kinds = parameter
dotnet_naming_symbols.constants.applicable_kinds = field, local
dotnet_naming_symbols.constants.required_modifiers = const
dotnet_naming_symbols.non_public_fields.applicable_kinds = field
dotnet_naming_symbols.non_public_fields.applicable_accessibilities = private, protected, private_protected

dotnet_naming_style.camel_case_style.capitalization = camel_case
dotnet_naming_style.camel_case_style.required_prefix =
dotnet_naming_style.underscore_camel_case_style.capitalization = camel_case
dotnet_naming_style.underscore_camel_case_style.required_prefix = _
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
dotnet_naming_style.pascal_case_style.required_prefix =

# Severity override to diagnostics, in order to make generated code compilation readable.
# We want to limit the scope of suppression as much as possible.
[**/Generated/**.cs]
# IDE1006: Naming rule violation.
dotnet_diagnostic.IDE1006.severity = none
# CA1062: Validate parameter is non-null before using it.
# Useful for generated code, since it disables nullable.
dotnet_diagnostic.CA1062.severity = error
# CA1069: Enums should not have duplicate values.
dotnet_diagnostic.CA1069.severity = none
# CA1707: Identifiers should not contain underscores.
dotnet_diagnostic.CA1707.severity = none
# CA1708: Identifiers should differ by more than case.
dotnet_diagnostic.CA1708.severity = none
# CA1711: Identifiers should not have incorrect suffix.
# Disable warning for suffixes like EventHandler, Flags, Enum, etc.
dotnet_diagnostic.CA1711.severity = none
# CA1716: Identifiers should not match keywords.
# This is suppressed, because it will report `@event` as well as `event`.
dotnet_diagnostic.CA1716.severity = none
# CA1720: Identifiers should not contain type names.
dotnet_diagnostic.CA1720.severity = none
# CS1591: Missing XML comment for publicly visible type or member.
dotnet_diagnostic.CS1591.severity = none
# CS1573: Parameter has no matching param tag in the XML comment.
dotnet_diagnostic.CS1573.severity = none
79 changes: 79 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Bug report
description: Report a bug in Godot .NET
body:

- type: markdown
attributes:
value: |
- When reporting bugs, you'll make our life simpler (and the fix will come sooner) if you follow the guidelines in this template.
- Write a descriptive issue title above.
- The golden rule is to **always open *one* issue for *one* bug**. If you notice several bugs and want to report them, make sure to create one new issue for each of them.
- Search [open](https://github.com/godotengine/godot-dotnet/issues) and [closed](https://github.com/godotengine/godot-dotnet/issues?q=is%3Aissue+is%3Aclosed) issues to ensure it has not already been reported. If you don't find a relevant match or if you're unsure, don't hesitate to **open a new issue**. The bugsquad will handle it from there if it's a duplicate.
- Verify that you are using a [supported Godot version](https://docs.godotengine.org/en/latest/about/release_policy.html).
- type: input
attributes:
label: Godot version
description: >
Specify the Git commit hash if using a development or non-official build.
If you use a custom build, please test if your issue is reproducible in official builds too.
placeholder: 3.3.stable, 4.0.dev (3041becc6)
validations:
required: true

- type: input
attributes:
label: Godot .NET packages version
description: >
Specify the Git commit hash if using a development build.
placeholder: 3.3.stable, 4.0.dev (3041becc6)
validations:
required: true

- type: input
attributes:
label: System information
description: |
- Specify the OS version, and when relevant hardware information.
- For issues that are likely OS-specific and/or graphics-related, please specify the CPU model and architecture.
- **Bug reports not including the required information may be closed at the maintainers' discretion.** If in doubt, always include all the requested information; it's better to include too much information than not enough information.
placeholder: Windows 10, Intel Core i5-7200U
validations:
required: true

- type: input
attributes:
label: .NET information
description: >
Include the output of the `dotnet --info` command. This contains important information for contributors to diagnose your issue, like the installed .NET SDKs and runtimes, and the environment variables.
validations:
required: true

- type: textarea
attributes:
label: Issue description
description: |
Describe your issue briefly. What doesn't work, and how do you expect it to work instead?
You can include images or videos with drag and drop, and format code blocks or logs with <code>```</code> tags.
validations:
required: true

- type: textarea
attributes:
label: Steps to reproduce
description: |
List of steps or sample code that reproduces the issue. Having reproducible issues is a prerequisite for contributors to be able to solve them.
If you include a minimal reproduction project below, you can detail how to use it here.
validations:
required: true

- type: textarea
attributes:
label: Minimal reproduction project
description: |
- A small Godot project which reproduces the issue, with no unnecessary files included. Be sure to not include the `.godot` folder in the archive (but keep `project.godot`).
- Required, unless the reproduction steps are trivial and don't require any project files to be followed. In this case, write "N/A" in the field.
- Drag and drop a ZIP archive to upload it. **Do not select another field until the project is done uploading.**
- **If you've been asked by a maintainer to upload a minimal reproduction project, you *must* do so within 7 days.** Otherwise, your bug report will be closed as it'll be considered too difficult to diagnose.
validations:
required: true
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
blank_issues_enabled: false

contact_links:
- name: Godot proposals
url: https://github.com/godotengine/godot-proposals
about: Please submit feature proposals on the Godot proposals repository, not here.

- name: Godot documentation repository
url: https://github.com/godotengine/godot-docs
about: Please report issues with documentation on the Godot documentation repository, not here.

- name: Godot community channels
url: https://godotengine.org/community
about: Please ask for technical support on one of the other community channels, not here.
107 changes: 107 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Continuous integration
on: [push, pull_request]

concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}
cancel-in-progress: true

jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: 🐧 Linux (x64)
os: ubuntu-20.04
rid: linux-x64
run-sample-project: true
cibuild-script: ./eng/common/cibuild.sh --warnaserror false

- name: 🏁 Windows (x64)
os: windows-2019
rid: win-x64
run-sample-project: false
cibuild-script: ./eng/common/CIBuild.cmd -warnAsError 0

- name: 🍎 macOS (x64)
os: macos-11
rid: osx-x64
run-sample-project: false
cibuild-script: ./eng/common/cibuild.sh --warnaserror false

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Linux dependencies
if: ${{ matrix.rid == 'linux-x64' }}
run: |
sudo apt-get update -qq
sudo apt-get install -qqq build-essential pkg-config
# Setting up .NET with the GitHub action to register the
# problem matchers for error output.
- name: Setup .NET
uses: actions/setup-dotnet@v4

- name: Build and test solution
run: |
${{ matrix.cibuild-script }} /p:GenerateGodotBindings=true
- name: Generate bindings
run: |
cd src/Godot.BindingsGenerator
dotnet run --extension-api ../../gdextension/extension_api.json --extension-interface ../../gdextension/gdextension_interface.h --output ../Godot.Bindings/Generated --test-output ../../tests/Godot.Bindings.Tests/Generated
- name: Build bindings
run: |
cd src/Godot.Bindings
dotnet publish -r ${{ matrix.rid }}
- name: Run tests
run: |
cd tests/Godot.Bindings.Tests
dotnet test
- name: Build sample project
run: |
cd samples/Summator
dotnet publish Extension -r ${{ matrix.rid }} -o Game/lib
- name: Download latest Godot artifacts
uses: dsnopek/action-download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9
if: ${{ matrix.run-sample-project }}
with:
repo: godotengine/godot
branch: master
event: push
workflow: linux_builds.yml
workflow_conclusion: success
name: linux-editor-mono
search_artifacts: true
check_artifacts: true
ensure_latest: true
path: godot-artifacts

- name: Run sample project
if: ${{ matrix.run-sample-project }}
timeout-minutes: 10
run: |
chmod +x ./godot-artifacts/godot.linuxbsd.editor.x86_64.mono
./godot-artifacts/godot.linuxbsd.editor.x86_64.mono --version
# Need to run the editor so .godot is generated... but it crashes! Ignore that :-)
./godot-artifacts/godot.linuxbsd.editor.x86_64.mono --path samples/Summator/Game --editor --headless --quit >/dev/null 2>&1 || true
./godot-artifacts/godot.linuxbsd.editor.x86_64.mono --path samples/Summator/Game --debug --headless --quit
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: godot-dotnet-${{ matrix.rid }}-artifacts
path: artifacts/
if-no-files-found: error
41 changes: 41 additions & 0 deletions .github/workflows/nightly-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Nightly builds
on: [workflow_dispatch]

env:
AZURE_ARTIFACTS_FEED_URL: https://pkgs.dev.azure.com/godotengine/godot-dotnet/_packaging/godot-nightly/nuget/v3/index.json

jobs:
az-artifacts-build-and-deploy:
name: Build and deploy nightly artifacts
runs-on: ubuntu-20.04
strategy:
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Linux dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qqq build-essential pkg-config
- name: Setup NuGet feed authentication
uses: actions/setup-dotnet@v4
with:
source-url: ${{ env.AZURE_ARTIFACTS_FEED_URL }}
env:
NUGET_AUTH_TOKEN: ${{ secrets.AZURE_DEVOPS_TOKEN }}

- name: Build nightly packages
run: |
./build.sh --productBuild --test --publish --ci --warnaserror false /p:GenerateGodotBindings=true /p:OfficialBuildId=$(date '+%Y%m%d').1
- name: Publish NuGet packages
run: |
cd artifacts/packages/Release/Shipping
for pkg in "$@"; do
dotnet nuget push $pkg --api-key "az" --skip-duplicate
done
Loading

0 comments on commit bdad9d1

Please sign in to comment.