virtualx-engine/modules
Ignacio Etcheverry e2afe700f6 Add C# source generator for a new ScriptPath attribute
This source generator adds a newly introduced attribute,
`ScriptPath` to all classes that:

- Are top-level classes (not inner/nested).
- Have the `partial` modifier.
- Inherit `Godot.Object`.
- The class name matches the file name.

A build error is thrown if the generator finds a class that meets these
conditions but is not declared `partial`, unless the class is annotated
with the `DisableGodotGenerators` attribute.

We also generate an `AssemblyHasScripts` assembly attribute which Godot
uses to get all the script classes in the assembly, eliminating the need
for Godot to search them. We can also avoid searching in assemblies that
don't have this attribute. This will be good for performance in the
future once we support multiple assemblies with Godot script classes.

This is an example of what the generated code looks like:

```
using Godot;
namespace Foo {
	[ScriptPathAttribute("res://Player.cs")]
	// Multiple partial declarations are allowed
	[ScriptPathAttribute("res://Foo/Player.cs")]
	partial class Player {}
}

[assembly:AssemblyHasScripts(new System.Type[] { typeof(Foo.Player) })]
```

The new attributes replace script metadata which we were generating by
determining the namespace of script classes with a very simple parser.
This fixes several issues with the old approach related to parser
errors and conditional compilation.
It also makes the task part of the MSBuild project build, rather than
a separate step executed by the Godot editor.
2021-03-06 21:50:32 +01:00
..
basis_universal Initialize class/struct variables with default values in modules/ 2021-02-08 10:57:18 +01:00
bmp Initialize class/struct variables with default values in modules/ 2021-02-08 10:57:18 +01:00
bullet Make Servers truly Thread Safe 2021-02-10 13:21:46 -03:00
camera Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
csg Removed _change_notify 2021-02-10 19:31:24 -03:00
cvtt Modernize atomics 2021-02-18 17:12:46 +01:00
dds Improve resource load cache 2021-02-11 15:44:28 -03:00
denoise Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
enet Initialize class/struct variables with default values in modules/ 2021-02-08 10:57:18 +01:00
etc Improve resource load cache 2021-02-11 15:44:28 -03:00
fbx Fix zero scaling and material mappings being mapped to wrong fields 2021-01-26 19:48:18 +00:00
freetype Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
gdnative Merge pull request #45617 from RandomShaper/modernize_atomics 2021-02-18 19:40:31 +01:00
gdnavigation Initialize class/struct variables with default values in modules/ 2021-02-08 10:57:18 +01:00
gdscript Fixed Invalid function bindings #46135 2021-02-18 11:12:54 +05:30
glslang Added GPU based cluster builder 2021-01-19 23:31:06 +01:00
gltf doc: Sync classref with current source 2021-02-19 14:39:14 +01:00
gridmap Fix LineEdit minimum width 2021-02-12 17:04:38 +01:00
hdr Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
jpg Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
jsonrpc Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
lightmapper_rd Reorganize Project Settings 2021-02-18 11:23:34 -03:00
mbedtls Initialize class/struct variables with default values in modules/ 2021-02-08 10:57:18 +01:00
meshoptimizer Scale error in mesh optimizer so it uses absolute scale. 2021-01-11 06:07:54 -08:00
minimp3 Fail mp3 loading when attempting to load invalid mp3s 2021-02-15 10:02:19 -08:00
mobile_vr Initialize class/struct variables with default values in modules/ 2021-02-08 10:57:18 +01:00
mono Add C# source generator for a new ScriptPath attribute 2021-03-06 21:50:32 +01:00
ogg Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
opensimplex Removed _change_notify 2021-02-10 19:31:24 -03:00
opus Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
pvr Improve resource load cache 2021-02-11 15:44:28 -03:00
regex Initialize class/struct variables with default values in modules/ 2021-02-08 10:57:18 +01:00
squish Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
stb_vorbis Fix mono->stereo conversion for oggs (see #40630) 2021-02-15 20:42:45 -08:00
svg Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
text_server_adv Make FreeType optional for export templates. 2021-02-19 15:01:46 +02:00
text_server_fb Make FreeType optional for export templates. 2021-02-19 15:01:46 +02:00
tga Initialize class/struct variables with default values in modules/ 2021-02-08 10:57:18 +01:00
theora Merge pull request #45617 from RandomShaper/modernize_atomics 2021-02-18 19:40:31 +01:00
tinyexr Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
upnp Initialize class/struct variables with default values in modules/ 2021-02-08 10:57:18 +01:00
vhacd Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
visual_script Removed hardcoded shortcuts from /scene and converted to input actions 2021-02-18 16:22:51 +01:00
vorbis Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
webm Reorganize Project Settings 2021-02-18 11:23:34 -03:00
webp Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
webrtc Initialize class/struct variables with default values in modules/ 2021-02-08 10:57:18 +01:00
websocket Initialize class/struct variables with default values in modules/ 2021-02-08 10:57:18 +01:00
webxr Add missing semicolons to webxr.eterns.js 2021-02-21 16:10:26 +00:00
xatlas_unwrap Fix memory leak in Xatlas module 2021-02-14 11:59:57 +01:00
modules_builders.py Enable support for C++ modules tests 2020-07-26 17:41:46 +03:00
register_module_types.h Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
SCsub [iOS] Remove plugins from modules. 2021-01-17 14:33:39 +03:00