Commit graph

842 commits

Author SHA1 Message Date
Ignacio Roldán Etcheverry
f90e8c41a2
Merge pull request #34604 from neikeq/issue-27674
Mono/C#: Fix memory leak with new Reference instances created from C#
2019-12-25 20:47:07 +01:00
Ignacio Etcheverry
0ef635c0e3 Mono/C#: Fix memory leak with new Reference instances created from C# 2019-12-25 19:33:59 +01:00
Ivan.Shakhov
682dd04b2d fix Rider path on Mac 2019-12-25 00:14:31 +01:00
Haoyu Qiu
078c0d75f2 Cleans up headers included in editor_node.h 2019-12-24 21:46:05 +08:00
Dan Kramer
097d1c9383 add suggested fix 2019-12-21 13:26:29 -05:00
Rémi Verschelde
a10449bbbc
Merge pull request #34514 from neikeq/remove-dep-on-mono-posix
Mono/C#: Remove GodotTools dependency on the Mono.Posix assembly
2019-12-21 17:07:18 +01:00
Ignacio Etcheverry
5a3ccf4f14 Mono/C#: Remove GodotTools dependency on the Mono.Posix assembly
MSBuild on Windows uses the system .NET Framework BCL instead of Mono's. Because
of this, it may not be able to find the Mono.Posix assembly, so it's better
not to depend on it. We needed Mono.Posix to call Syscall.access, so we can
replace this with an internal call that does the same in C++.
2019-12-21 15:55:45 +01:00
Rémi Verschelde
2a4c528d06
Merge pull request #34465 from neikeq/no-hardcode-debugger-wait
Mono/C#: Remove hard-coded debugger wait at initialization
2019-12-19 21:27:59 +01:00
Ignacio Etcheverry
f3c6c63b94 Mono/C#: Remove hard-coded debugger wait at initialization
Up until now debug builds would always wait up to 500 ms during initialization
to give time for debuggers to attach to the game.
We no longer want this as it increases startup time unnecesarily.
The way forward is to setup the debugger agent as client instead of server.
This way it's the game that connect to the debugger, not the other way around.
If server mode is still desired, suspend=y can be used to indefinitely wait
for the debugger to attach. This all can be specified with the environment
variable 'GODOT_MONO_DEBUGGER_AGENT' when launching the game.
2019-12-19 17:07:20 +01:00
Ignacio Etcheverry
98dc07f25f Mono/C#: Fix Variant -> MonoString* when type is Variant:NIL
`Variant::operator String()` returns "Null" if the type is `Variant:NIL`.
We must consider that and return a null `MonoString*` instead when marshalling.
This was also causing a "Null" error to be displayed when exporting a game
because null string members would be set to "Null" during hot-reload.
2019-12-19 16:51:32 +01:00
Rémi Verschelde
1c6b9bfdff Mono: Copy native and btls libs on macOS 2019-12-18 08:39:37 +01:00
Ignacio Etcheverry
20d7013c60 Mono/C#: Fix project export and fix FindLast/GetFile regression
d09193b08a introduced a regression in
StringExtensions.FindLast. StringExtensions.GetFile was also affected as it
relies on FindLast. This in turn broke the project exporter as it uses GetFile.
The cause of the regression is that now FindLast is calling LastIndexOf
with 'startIndex: 0'. This should be 'startIndex: str.Length - 1' instead.

Also fixed another regression in the project exporter:
de7c2ad21b moved 'GodotTools/GodotSharpExport.cs'
to 'GodotTools/Export/ExportPlugin.cs' and in doing so accidently reverted
the changes from commit e439581198.
2019-12-17 13:06:41 +01:00
Rémi Verschelde
c3ea4ea9b7
Merge pull request #34382 from van800/profiler
Allow attaching any external profiler, including JetBrains dotTrace
2019-12-16 22:00:36 +01:00
Ivan Shakhov
7c64779516 Allow attaching any external profiler, including JetBrains dotTrace 2019-12-16 20:34:30 +01:00
Rémi Verschelde
a866028a7a Mono: Enable threads suspend workaround on Windows
This appears to be necessary for current official builds cross-compiled
with MinGW from Linux, using Mono 6.6.0.160.

Follow-up to #31784, see #29812 for details.
2019-12-16 15:40:26 +01:00
Rémi Verschelde
12ee35737f
Merge pull request #34334 from neikeq/issue-33503
Mono/C#: Fix class parser bug with 'where T : struct'
2019-12-13 20:13:28 +01:00
Ignacio Etcheverry
f2a2293709 Mono/C#: Fix class parser incorrectly handling nested namespaces
It would incorrectly error thinking the nested namespace is being declared inside a struct/class. This was because of an incorrect nesting level being used for classes and structs.
2019-12-13 19:55:32 +01:00
Ignacio Etcheverry
c1ab956dd0 Mono/C#: Fix class parser bug with 'where T : struct'
The struct decl parsing was outdated. Make both struct decl and class declparsing share the same code.
2019-12-13 19:50:42 +01:00
Rémi Verschelde
9f68626fb2 doc: Sync classref with current source
Also apply clang-format.
2019-12-13 10:41:06 +01:00
Rémi Verschelde
d39284a65f
Merge pull request #34295 from aaronfranke/potato-knishes
[Mono] Fix string Find methods having reversed case sensitivity
2019-12-13 08:47:26 +01:00
Aaron Franke
d09193b08a
Fix string Find methods having reversed case sensitivity 2019-12-12 02:21:16 -05:00
Aaron Franke
5771f9959c
Mono formatting
No space for casting, add spaces inside braces, 4 space indentation, remove trailing indentation, remove BOM.
2019-12-11 16:32:47 -05:00
Rémi Verschelde
cd9d513285
Merge pull request #34181 from van800/rider
Support Rider as external editor for Godot mono version
2019-12-11 09:20:31 +01:00
Ivan Shakhov
8fbc9d33fd Support Rider as External Editor 2019-12-11 08:39:04 +01:00
Jonas
11258db001
Fix missing null checks in Mono Binding of GD
The print methods of mono binding was missing null checks for the params
2019-12-06 11:56:50 +01:00
Ignacio Roldán Etcheverry
6544a0e908
Merge pull request #34018 from dsge/show-template-directory-path-in-error-message
Make sure to include the path in the "Data template directory not found" error message
2019-12-05 14:17:23 +01:00
Ignacio Etcheverry
066ae9d83b Mono/C#: Several android fixes
- Added correct config file for android dllmaps.
- Fix __Internal DllImports with a dlopen fallback.
- Add missing P/Invoke functions and internal calls expected by the monodroid BCL and our custom version of the 'Android.Runtime.AndroidEnvironment' class (this last one can be found in the godot-mono-builds repo).
- Make sure to set 'btls' instead of 'legacy' as the default TLS provider on Android.
2019-12-04 19:03:42 +01:00
Ignacio Etcheverry
3797f19926 C#: Add Duplicate method to the Array and Dictionary bindings 2019-12-04 15:22:30 +01:00
dsge
81cae314b4 Make sure to include the path in the "Data template directory not found" error message 2019-11-30 15:44:18 +01:00
Rémi Verschelde
fa0e682027
Merge pull request #33982 from neikeq/issue-29349
Mono/C#: Add option to export assemblies outside of PCK
2019-11-29 11:37:18 +01:00
Ignacio Etcheverry
85d8c42763 Mono/C#: Fix crash on exported games that don't use C# 2019-11-29 01:35:46 +01:00
Ignacio Etcheverry
66de28eda8 Mono/C#: Add option to export assemblies outside of PCK
When using this options, assemblies will be saved in the Assemblies folder of the  data directory: 'data_AppName/Assemblies/'.
2019-11-29 00:36:05 +01:00
Rémi Verschelde
636bc5c32f
Merge pull request #33828 from neikeq/貴様
Mono/C#: Prevent SCons from building API solutions in parallel
2019-11-23 11:24:48 +01:00
Ignacio Etcheverry
ebdd2bc474 Mono/C#: Prevent SCons from building API solutions in parallel 2019-11-22 23:42:24 +01:00
Rémi Verschelde
c41c24562d Style: Add missing copyright headers 2019-11-22 08:37:09 +01:00
Ignacio Roldán Etcheverry
63b321dbbb
Merge pull request #33791 from neikeq/issue-33761
C#: Fix PathWhich on Windows when name already has extension
2019-11-21 21:34:12 +01:00
Ignacio Etcheverry
f91416d9ac C#: Fix PathWhich on Windows when name already has extension
Also make the Posix version of PathWhich check if the file has executable access.
2019-11-21 14:53:00 +01:00
Rémi Verschelde
73323a2838
Merge pull request #33763 from neikeq/issue-33725
Fix C# export error dialog showing up when it should not
2019-11-20 13:23:20 +01:00
Ignacio Etcheverry
d79aeca599 Fix C# export error dialog showing up when it should not 2019-11-20 13:07:26 +01:00
Ignacio Etcheverry
3f247ea507 Mono/C#: Bundle libmono-btls-shared.dll on Windows if it exists 2019-11-19 17:22:06 +01:00
Ignacio Etcheverry
008769aee9 C#: Throw NullReferenceException for null NodePath/RID params 2019-11-18 12:23:54 +01:00
Ignacio Etcheverry
8cbe4a3db4 Make C# internal calls return structs as ref parameters
The Mono IL interpreter's WebAssembly to native trampolines don't support passing structs by value, so we need to do it this way.

Also now we pass and return long, ulong, float and double as ref parameters as well. This is due to missing trampolines for float and long types. This is likely a temporary workaround that will be reverted in the future. The correct solution would be to patch 'mono/mini/m2n-gen.cs' when building the Mono runtime for WASM in order to generate the trampolines we need.
2019-11-15 03:22:25 +01:00
Ignacio Etcheverry
2b67924a0b Mono/C#: Initial exporter support for AOT compilation 2019-11-15 03:22:18 +01:00
Ignacio Etcheverry
de7c2ad21b Mono/C#: WebAssembly support 2019-11-13 21:41:11 +01:00
Ignacio Roldán Etcheverry
953f37f49b
Merge pull request #33249 from JoshLee0915/MonoHeadlessServer
Added missing server platform checks to template dir and shared lib copy in mono_configure.py
2019-11-12 14:57:29 +01:00
Rémi Verschelde
77816fea8b
Merge pull request #32477 from aaronfranke/equal-approx-separate
Make is_equal_approx separate and make == exact again
2019-11-07 14:54:15 +01:00
Aaron Franke
4922a48a9e
[Mono] Alphabetize Mathf 2019-10-29 10:10:24 -04:00
Rémi Verschelde
e96319c7f3
Merge pull request #32670 from aaronfranke/mono-plane
[Mono] Change Plane intersect methods to return nullable Vector3
2019-10-23 21:44:05 +02:00
JoshLee0915
cbd98d0fcf Added the server platform checks to template dir and shared lib copy 2019-10-21 20:47:24 -06:00
Aaron Franke
218f38c7ec
Expose is_equal_approx and restore == to be exact again
This commit changes behavior for GDScript and C#.

Also did some organizing of the order to logically group related methods, mostly for Rect2 and AABB.
2019-10-14 16:48:59 -04:00
Aaron Franke
86922ff70b
Make is_equal_approx separate for structures
This commit adds exposed behavior for C#
2019-10-14 16:46:54 -04:00
Ignacio Etcheverry
8a0c0371d4 C#: Fix regression from #32732 caused a crash on domain reload 2019-10-12 21:27:56 +02:00
Rémi Verschelde
3cc94b2c0b Mono: Fix template build after #32732 2019-10-11 15:17:36 +02:00
Ignacio Etcheverry
8c438a2197 C#: Fix detection of outdated release Godot API assemblies 2019-10-11 01:46:06 +02:00
Aaron Franke
643874f8ca
[Mono] Change Plane intersect methods to return nullable Vector3 2019-10-08 22:47:22 -04:00
Rémi Verschelde
f3f2fdfbab Mono: Fix detection of MsBuild from Visual Studio
This was a wrong check as an exit code of 0 means success,
not failure. It used to be fine as blocking mode always returned
-2, but this was changed in #32033 to return the exit code.

Fixes #32424.
2019-10-03 14:13:41 +02:00
Ignacio Roldán Etcheverry
763a4d8402
Merge pull request #32401 from neikeq/Kisaama!
Mono: Don't compare API hashes on release builds
2019-09-28 03:31:37 +02:00
Ignacio Etcheverry
1509890dbc Mono: Don't compare API hashes on release builds
API hashes cannot be calculated on release builds, as bindings information is lacking. Therefore, we should not be comparing it with the generated glue hash as they will never match.
2019-09-28 01:07:57 +02:00
Rémi Verschelde
e067a54988
Merge pull request #32353 from neikeq/yamero
Mono: Improve API assembly load error message on exported games
2019-09-26 07:31:03 +02:00
Rémi Verschelde
0a10e07124
Merge pull request #32352 from neikeq/issue-32237
Mono: Don't use project settings for debugger agent on exported games
2019-09-26 07:29:25 +02:00
Ignacio Etcheverry
2325fb11a8 Mono: Improve API assembly load error message on exported games 2019-09-25 22:32:39 +02:00
Ignacio Etcheverry
5ff4e0516b Mono: Don't use project settings for debugger agent on exported games 2019-09-25 22:03:24 +02:00
Rémi Verschelde
dec10dd776
Merge pull request #32051 from qarmin/some_error_explanation
Added some obvious errors explanations
2019-09-25 11:51:54 +02:00
qarmin
17732fe698 Added some obvious errors explanations 2019-09-25 10:28:50 +02:00
Ignacio Etcheverry
c4fa027614 Improve C# bindings generator errors for default param values 2019-09-24 15:09:54 +02:00
Rémi Verschelde
9c116f4f1d
Merge pull request #32223 from neikeq/cs_glue_version_fix
C#: Make sure cs_glue_version is present when building export templates
2019-09-20 17:46:34 +02:00
Ignacio Etcheverry
95c685143a C#: Make sure cs_glue_version is present when building export templates 2019-09-20 17:41:20 +02:00
Rémi Verschelde
f9db6ad8c5
Merge pull request #31919 from m4gr3d/use_aar_for_custom_build
Leverage Android archive (AAR) file for Godot custom build
2019-09-19 20:22:09 +02:00
Chaosus89
46bb523db7 [Mono] Corrected rectangle intersection 2019-09-16 09:49:04 +03:00
Rémi Verschelde
24e1039eb6
Merge pull request #32045 from neikeq/fix-cannot-create-mono-log-file
Mono: Fix unable to create log file due to str_format bug
2019-09-08 22:31:52 +02:00
Ignacio Etcheverry
3dcd7e54f4 Mono: Fix unable to create log file due to str_format bug 2019-09-08 19:40:17 +02:00
Ignacio Roldán Etcheverry
da2af72d73
Merge pull request #32022 from neikeq/fix-mono-export-windows-backslash
Mono: Fix PCK assembly paths when exporting from Windows
2019-09-07 21:39:27 +02:00
Ignacio Etcheverry
93897fb884 Fix missing method for internal_MonoWindowsInstallRoot 2019-09-07 02:31:01 +02:00
Ignacio Etcheverry
e439581198 Mono: Fix PCK assembly paths when exporting from Windows
Assembly paths were written to PCK files with backslash as path separator and PackedData only supports forward slash.
This would make exported games unable to find the assemblies.
2019-09-07 02:19:25 +02:00
fhuya
7fabfd402f Split the Android platform java logic into an Android library module (lib) and an application module (app).
The application module `app` serves double duties of providing the prebuilt Godot binaries ('android_debug.apk', 'android_release.apk') and the Godot custom build template ('android_source.zip').
2019-09-04 16:20:22 -07:00
iwek7
617797c47c Adds skip-breakpoints feature 2019-09-03 20:49:09 +02:00
Aaron Franke
f8b4cf0fc4
Check for exact equality before approximate equality 2019-09-01 14:02:14 -04:00
Ignacio Etcheverry
5a6070dde3 Mono: Force preemptive thread suspend mode as a temporary workaround 2019-08-30 01:33:50 +02:00
Rémi Verschelde
a5e0aa32d9
Merge pull request #31770 from neikeq/supercedes-31008
Fix GodotTools.ProjectEditor HintPaths for referenced packages
2019-08-29 21:16:49 +02:00
Ignacio Etcheverry
6d2883c9bf Fix GodotTools.ProjectEditor HintPaths for referenced packages 2019-08-29 18:19:01 +02:00
Rémi Verschelde
65d1b0b427
Merge pull request #31729 from aaronfranke/mono-color
[Mono] Various Color fixes and improvements
2019-08-28 21:29:47 +02:00
Rémi Verschelde
538328898b Style: Fix copyright headers in new files 2019-08-28 09:19:52 +02:00
Rémi Verschelde
185072015f
Merge pull request #31606 from toasteater/fix/nativescript-new-json-return-type
Fix the return type of NativeScript::new in API json
2019-08-28 09:15:40 +02:00
Aaron Franke
34ab6549b1
[Mono] Various Color improvements
I also slid in a fix to C++ Vector3 > and >=
2019-08-27 22:05:18 -04:00
Rémi Verschelde
92ead83913 Mono: Fix OSX build due to invalid function call 2019-08-27 09:48:54 +02:00
toasteater
e2121c97ae Make VarArg methods return types show up as Variant in API json
VarArg methods have the return type Object in the API json for GDNative. This
can cause undefined behavior in some language bindings due to lack of
documentation on VarArg methods' behavior.

This changes the MethodInfo of:

- CSharpScript::_new
- GDScript::_new
- PluginScript::_new
2019-08-26 16:36:51 +00:00
Ignacio Roldán Etcheverry
be99e7b68f
Merge pull request #31680 from neikeq/fix-android-gen-sources
Fix 'android_mono_config.gen.cpp' not compiled first time it's generated
2019-08-26 18:28:12 +02:00
Ignacio Etcheverry
aa805e2699 Fix 'android_mono_config.gen.cpp' not compiled first time it's generated 2019-08-26 17:46:57 +02:00
Rémi Verschelde
57afa90f0c
Merge pull request #31652 from Calinou/csharp-alpha-dialog-android
Mention Android support in the C# alpha dialog message
2019-08-26 10:18:27 +02:00
Ignacio Etcheverry
3af8bd071e Set C# 7 as LangVersion for GodotTools and Godot API projects
This will make it harder for someone to accidentally commit code that requires a newer version.
2019-08-25 15:53:47 +02:00
Hugo Locurcio
27f5ab2d7b
Mention Android support in the C# alpha dialog message 2019-08-25 15:08:32 +02:00
lamonte
1df0e88ae8 default is only supported by 7.1, reverted to support 7.0 out of the box (no conflict) 2019-08-25 06:48:37 -05:00
Rémi Verschelde
51d50e167d
Merge pull request #31094 from aaronfranke/vector-sign-mod-etc
Add Vector2/3 sign and posmod functions, axis, docs, misc additions
2019-08-23 09:07:47 +02:00
Ignacio Etcheverry
dae2a335c5 Make sure '.mono/metadata/' exists before creating file
Fixes #31549
2019-08-22 14:32:55 +02:00
Aaron Franke
092346d82b
Add Vector2/3 sign and posmod functions, misc additions
Also make the docs more consistent, add Axis enum to Vector2, add > and >=. and C# also gets % and an override for vector-vector mod.
2019-08-17 18:31:55 -04:00
Rémi Verschelde
8995d95da0
Merge pull request #31347 from neikeq/monodevelop-addin
C#: Add Ide Connection library and server for the editor
2019-08-14 11:39:41 +02:00
Hugo Locurcio
05daf5c78b
Always use lists for LIBS in SCons
This closes #31288.
2019-08-12 22:31:55 +02:00
Ignacio Etcheverry
bda461c2b1 Add C# language editor icon 2019-08-12 18:57:26 +02:00
Ignacio Roldán Etcheverry
3c78837218
Merge pull request #31322 from neikeq/mono-gitignore-override-sln
Make git no longer ignore solution files inside the mono module
2019-08-12 16:50:18 +02:00
Ignacio Etcheverry
33c0d47273 Make git no longer ignore solution files inside the mono module 2019-08-12 15:59:06 +02:00