1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-04 17:04:49 +00:00
Commit Graph

327 Commits

Author SHA1 Message Date
Thaddeus Crews
817bf95756 C#: Ensure mono editor supports Visual Studio 2026 2025-11-20 10:32:08 -06:00
Thaddeus Crews
98014e504e Merge pull request #108885 from aaronfranke/csharp-public-explicit
Use explicit public access modifier in C# code
2025-11-04 19:48:17 -06:00
Haoyu Qiu
ba6b7d2818 Make editor language setting default to Auto 2025-11-03 20:11:52 +08:00
samuelll3d
b53af55462 Find solution file by project assembly name
Instead of looking for a solution file with the same name as the project and
its assembly, this commit updates the logic to find all .sln and .slnx files in
the specified solution directory. If no matching solution is found, it will fall
back to the old behaviour.

This commit will also consider .. markings to go up one directory level allowing
for Godot projects as part of multi-project solutions.

Co-authored-by: Eric Johnson <eric.johnson@revention.com>
2025-10-30 11:42:45 +01:00
Thaddeus Crews
092b7c6427 Merge pull request #110799 from AR-DEV-1/master
Update Godot's .NET version from 6.0 to 8.0
2025-10-09 11:46:51 -05:00
Aaron Franke
9993438a9e Use explicit public access modifier in C# code 2025-09-24 14:32:38 -07:00
AR-DEV-1
1036bfd7ad Update .NET version to 8.0 & lang version to 12 2025-09-23 21:04:05 +05:00
Thaddeus Crews
491ecff31e Merge pull request #99195 from shitake2333/csharp_translation_parser_support
Add c# translation parser support
2025-09-22 21:01:01 -05:00
molingyu
da8f647fa1 feat: Add c# translation parser support
Use semantic model to analyze the method to be selected

Support translation comment

Make C# multi-line comments also ignore translation

Add  preprocessor symbols support
2025-09-19 13:46:01 +08:00
Raul Santos
f0c9253bec [.NET] Require net9.0 for Android exports
To ensure Android exports are compatible with the new Play Store
requirement that all `.so` libraries included are aligned to 16k,
we now require C# projects to target `net9.0` which uses the
correct alignment (as opposed to the current one of 4k).

The thirdparty jar library has also been updated to the one from
the 9.0.4 runtime package so it's compatible with non-gradle
builds targeting `net9.0`.

Non-android projects are not affect, the minimum TFM is still
`net8.0`.
2025-09-05 04:14:27 +02:00
Rémi Verschelde
25525bcfa5 Merge pull request #108053 from raulsntos/dotnet/check-msbuild-panel-for-details
[.NET] Mention MSBuild panel when building fails
2025-06-28 13:03:27 +02:00
Raul Santos
c67f95d80e [.NET] Mention MSBuild panel when building fails 2025-06-27 20:30:12 +02:00
Raul Santos
70d0ecbb16 [.NET] Avoid exporting to duplicate architectures
Use a `HashSet` to avoid adding duplicate architectures on exporting. It seems we were adding `x86_64` and `arm64` twice to macOS exports because they are also included in the features.
2025-06-25 21:41:29 +02:00
Ricardo Sanchez-Saez
457299449d Introduce 'drivers/apple_embedded' abstract platform for code reuse 2025-05-19 15:37:13 -07:00
Thaddeus Crews
c87f23ce7d Merge pull request #89324 from KoBeWi/pandora's_can_of_worms
Allow exporting variables of type Variant
2025-04-28 10:01:33 -05:00
Ivan Shakhov
45a07c1ab9 split Rider and Fleet as different external editors for Godot C#
Co-authored-by: Paul Joannon <437025+paulloz@users.noreply.github.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2025-04-11 13:21:50 +02:00
Thaddeus Crews
0c8f4f3d91 Merge pull request #97908 from atlasapplications/just-linux-bionic
Add `linux-bionic` RID export option
2025-03-07 15:12:32 -06:00
Raul Santos
57d5b664d3 [.NET] Skip re-saving .csproj when TFM is unchanged
Avoids updating the platform-specific `TargetFramework` properties if they already match the minimum required version.
2025-03-06 18:49:08 +01:00
kobewi
012d47b089 Allow exporting variables of type Variant 2025-02-15 18:00:55 +01:00
Travis Lange
5e2fd7b1d7 fix android mono export causing conflicts 2025-02-10 10:09:52 -05:00
Justin Sasso
8a4bc9881f Add linux-bionic RID Export Option
Adds an export option to enable the linux-bionic RID so Android can export with NativeAOT enabled.
2025-01-28 12:54:10 -05:00
Raul Santos
8d41b5a582 [.NET] Upgrade user project's TargetFramework to net8.0
- Upgrades the TFM for new created  projects to `net8.0`.
- Implements system to upgrade TFM for existing projects to `net8.0`.
2024-12-18 02:44:32 +01:00
Rémi Verschelde
cb0d731daf Merge pull request #100351 from raulsntos/dotnet/android-gradle-fix
[.NET] Fix gradle builds for multiple ABIs
2024-12-17 22:59:58 +01:00
Paul Joannon
fb8553e4d7 Move to .NET8
- Change TFM and LangVersion
- Better exception throwing (CA1510, CA1512, CA1513)
- Better exception utility method definition (CA1859)
- Prefer comparing `.Count` over calling `.Any()` (CA1860)
- Prefer `.AsSpan()` over `.Substring()` (CA1846)
- Add a few more `scoped`
- Use `RuntimeHelpers.GetUninitializedObject()` instead of `FormatterServices.GetUninitializedObject()`
- Use delegate instead of delegate pointer in variant generic conversions
- Enable EnforceExtendedAnalyzerRules in source generator projects
- Disable CS8981 on structs named movable in Godot.NativeInterop
2024-12-13 14:00:13 +01:00
Raul Santos
d526d523b4 [.NET] Fix gradle builds for multiple ABIs
Include the needed .NET jar in the Godot templates so it's always available, then we don't need to include the jar from a .NET publish which could fail when exporting to multiple architectures because it would attempt to add the same jar for each architecture.
2024-12-13 08:01:13 +01:00
RedworkDE
f0b6b24d9e C#: Update to net7.0
Because of ref safety changes in the languages, all methods that return an interop struct have to have all other reference parameters marked as scoped to signal the the method does not capture that reference.

The variant change is necessary, because for some reason a type of the exact shape godot_variant is in, crashes the .NET 7 JIT, but when changing it to be sequential with the same effective layout it works.
2024-12-12 17:42:39 +01:00
Hugo Locurcio
9f2bd57b7b Add Codium support to C# external editors
Selecting the VS Code option will now work if Codium is installed,
picking it as the last option after attempting to run VS Code.
2024-11-02 00:00:41 +01:00
Rémi Verschelde
ea8d20d35b Merge pull request #96955 from Delsin-Yu/generator-based-CreateManagedForGodotObjectBinding
[.NET] Replace Reflection-Based implementation with Generated one in `CreateManagedForGodotObjectBinding`
2024-09-23 16:13:49 +02:00
DE YU
307224927c Replace Reflection-Based implementation with Generated one
Co-authored-by: Raul Santos <raulsntos@gmail.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-09-22 18:01:14 +08:00
Raul Santos
ec189b1574 C#: Use dotnet CLI to launch OpenVisualStudio.dll
Use the DLL instead of the EXE, so we can rely on the dotnet CLI handling the architecture.
2024-09-19 19:23:01 +02:00
Raul Santos
0aa46e19c5 C#: Fallback to CoreCLR/MonoVM hosting APIs when hostfxr/NativeAOT fails
Some platforms don't support hostfxr but we can use the coreclr/monosgen library directly to initialize the runtime.

Android exports now use the `android` runtime identifier instead of `linux-bionic`, this removes the restrictions we previously had:
- Adds support for all Android architectures (arm32, arm64, x32, and x64), previously only the 64-bit architectures were supported.
- Loads `System.Security.Cryptography.Native.Android` (the .NET library that binds to the Android OS crypto functions).
2024-09-16 17:07:03 +02:00
Raul Santos
4c14421602 C#: Use export platform to determine the target OS and log errors
- Use the export platform's `get_os_name` to determine the platform name instead of guessing from the features.
- Use the export platform's `add_message` to add error messages instead of a custom error dialog. Integrates .NET error messages with the export log dialog.
2024-08-30 12:45:24 +02:00
RedOrbweaver
81799b8fa3 Fix build logger unable to handle an event without an associated file 2024-08-29 20:33:47 +02:00
Raul Santos
c2efbf3012 C#: Use Godot's LipO implementation instead of Xcode's lipo command 2024-08-17 17:52:35 +02:00
Marius Hanl
32be459e54 Fix ContextMenu Copy Error is off in MSBuild Panel 2024-05-15 22:55:05 +02:00
Paul Joannon
c2d72a691f Specify a runtime rollforward for OpenVisualStudio
Use `LatestMajor`

Fixes #91638
2024-05-07 19:40:25 +02:00
Thaddeus Crews
64f2e8b64f Dotnet: Fix attributes for sln/csproj files 2024-05-03 12:21:51 -05:00
Konstantin Kretov
2b46e009fa Fill copyright field in .csproj files
This ensures that nuget packages will have both license and copyright fields filled.
2024-04-26 11:41:04 +02:00
bruvzg
bf558adcdd [.NET] Disable output embedding on macOS, move it to the advanced options on other platforms. 2024-04-09 17:47:39 +03:00
Nông Văn Tình
316f253558 Show errors when solution file is missing in C# project
Fixes: #86591

Co-authored-by: Raul Santos <raulsntos@gmail.com>
2024-04-07 00:25:34 +07:00
AyOhEe
e18fb27d70 Fixed "Create C# solution" dialog
Flipped the title and dialog text to how they should be. It seemed that the title was being put in the dialog text, and vice versa.
2024-04-01 23:01:40 +01:00
Rémi Verschelde
a64cb8eff3 Merge pull request #88570 from paulloz/dotnet/warnings-editorconfig-cleanup
[.NET] Better `.editorconfig` setup in `modules/mono/`
2024-02-27 21:23:03 +01:00
Paul Joannon
139a5df821 Cleanup C# projects, code quality & style
New rules:
- Do not silence CA1805 any more
- Limit where we silence CA1707, CA1711, CA1720
- Enforce severity=warning for IDE0040
- Enforce Allman style braces
- Enforce naming conventions (IDE1006 is still severity=suggestion)

Fixes:
- Fix REFL045, CS1572, CS1573
- Suppress CS0618 when generating `InvokeGodotClassMethod`
- Fix indent when generating GD_constants.cs
- Temporarily silence CS1734 in generated code
- Fix a lot of naming rule violations

Misc.:
- Remove ReSharper comments for RedundantNameQualifier
- Remove suppression attributes for RedundantNameQualifier
- Remove severity=warnings for CA1716, CA1304 (already included in the level of analysis we run)
2024-02-27 20:11:24 +01:00
Matt Enad
f75cffcd46 Fix hover style margin with extra borders enabled
The content margins for FlatMenuButton and RunBarButton are now handled correctly when the "Draw Extra Borders" user option is enabled
2024-02-21 21:36:48 -05:00
Rémi Verschelde
1aab6e96b9 Merge pull request #87133 from Repiteo/dotnet/enforce-globalization-rules
C#: Enforce globalization code quality rules
2024-02-20 20:04:30 +01:00
Rémi Verschelde
9e9dcdbba4 Merge pull request #86378 from RobProductions/update-hover-styling
Add hover highlight to main editor buttons
2024-02-20 19:34:40 +01:00
Thaddeus Crews
000d12d237 C#: Enforce Globalization code quality rules 2024-02-20 11:15:12 -06:00
Ivan Shakhov
703c34a788 Bump Rider.PathLocator nuget version, which provides a fix for detecting Rider installations 2024-02-19 21:04:28 +03:00
Raul Santos
fe280ef9ae C#: Various fixes to generic scripts
- Report a diagnostic when there are multiple classes that match the script file name in the same script since that will result in a duplicate path key in the bimap and it's not allowed.
- Fix InspectorPlugin to handle empty paths in case the project was built with a previous version of Godot that used empty paths for generic scripts.
- Add tests for the new diagnostic GD0003.
2024-02-19 06:33:13 +01:00
Raul Santos
dcb411daee C#: Fix building OpenVisualStudio executable
Since moving the TFM to .NET Core we need to add some configuration to cross-compile a Windows executable from Linux.
2024-02-18 05:40:06 +01:00