diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b797b2fb5..ecd3b602e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Implemented a new CodeWriter in the code generator which provides a fluent interface for generating C# code. [#1237](https://github.com/spatialos/gdk-for-unity/pull/1237) - The `CodeGenerationLib` has been migrated to the new `CodeWriter`. - Added support for defining namespaces, structs, classes, enums and methods in the new CodeWriter. [#1239](https://github.com/spatialos/gdk-for-unity/pull/1239) +- Ported test-project to new CodeWriter. [#1241](https://github.com/spatialos/gdk-for-unity/pull/1241) ## `0.3.2` - 2019-12-23 diff --git a/test-project/Assets/Generated/Source/improbable/dependentschema/DependentComponentComponentReaderWriter.cs b/test-project/Assets/Generated/Source/improbable/dependentschema/DependentComponentComponentReaderWriter.cs index 09c88c2b47..b5926a06e1 100644 --- a/test-project/Assets/Generated/Source/improbable/dependentschema/DependentComponentComponentReaderWriter.cs +++ b/test-project/Assets/Generated/Source/improbable/dependentschema/DependentComponentComponentReaderWriter.cs @@ -1,6 +1,6 @@ -// =========== +// ===================================================== // DO NOT EDIT - this file is automatically regenerated. -// =========== +// ===================================================== using System; using System.Collections.Generic; diff --git a/test-project/Assets/Generated/Source/improbable/dependentschema/DependentDataComponentCommandSenderReceiver.cs b/test-project/Assets/Generated/Source/improbable/dependentschema/DependentDataComponentCommandSenderReceiver.cs index 9db71fd820..109806bc1b 100644 --- a/test-project/Assets/Generated/Source/improbable/dependentschema/DependentDataComponentCommandSenderReceiver.cs +++ b/test-project/Assets/Generated/Source/improbable/dependentschema/DependentDataComponentCommandSenderReceiver.cs @@ -1,6 +1,6 @@ -// =========== +// ===================================================== // DO NOT EDIT - this file is automatically regenerated. -// =========== +// ===================================================== using System; using System.Collections.Generic; diff --git a/test-project/Assets/Generated/Source/improbable/dependentschema/DependentDataComponentComponentReaderWriter.cs b/test-project/Assets/Generated/Source/improbable/dependentschema/DependentDataComponentComponentReaderWriter.cs index 585445b4ba..35a90a5116 100644 --- a/test-project/Assets/Generated/Source/improbable/dependentschema/DependentDataComponentComponentReaderWriter.cs +++ b/test-project/Assets/Generated/Source/improbable/dependentschema/DependentDataComponentComponentReaderWriter.cs @@ -1,6 +1,6 @@ -// =========== +// ===================================================== // DO NOT EDIT - this file is automatically regenerated. -// =========== +// ===================================================== using System; using System.Collections.Generic; diff --git a/test-project/Assets/Generated/Source/improbable/tests/DependencyTestChildComponentReaderWriter.cs b/test-project/Assets/Generated/Source/improbable/tests/DependencyTestChildComponentReaderWriter.cs index ab0c069268..75e285aea2 100644 --- a/test-project/Assets/Generated/Source/improbable/tests/DependencyTestChildComponentReaderWriter.cs +++ b/test-project/Assets/Generated/Source/improbable/tests/DependencyTestChildComponentReaderWriter.cs @@ -1,6 +1,6 @@ -// =========== +// ===================================================== // DO NOT EDIT - this file is automatically regenerated. -// =========== +// ===================================================== using System; using System.Collections.Generic; diff --git a/test-project/Assets/Generated/Source/improbable/tests/DependencyTestComponentReaderWriter.cs b/test-project/Assets/Generated/Source/improbable/tests/DependencyTestComponentReaderWriter.cs index 1aeb491413..bf20a2ef73 100644 --- a/test-project/Assets/Generated/Source/improbable/tests/DependencyTestComponentReaderWriter.cs +++ b/test-project/Assets/Generated/Source/improbable/tests/DependencyTestComponentReaderWriter.cs @@ -1,6 +1,6 @@ -// =========== +// ===================================================== // DO NOT EDIT - this file is automatically regenerated. -// =========== +// ===================================================== using System; using System.Collections.Generic; diff --git a/test-project/Assets/Generated/Source/improbable/tests/DependencyTestGrandchildComponentReaderWriter.cs b/test-project/Assets/Generated/Source/improbable/tests/DependencyTestGrandchildComponentReaderWriter.cs index 21137530a5..4d682e3364 100644 --- a/test-project/Assets/Generated/Source/improbable/tests/DependencyTestGrandchildComponentReaderWriter.cs +++ b/test-project/Assets/Generated/Source/improbable/tests/DependencyTestGrandchildComponentReaderWriter.cs @@ -1,6 +1,6 @@ -// =========== +// ===================================================== // DO NOT EDIT - this file is automatically regenerated. -// =========== +// ===================================================== using System; using System.Collections.Generic; diff --git a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveEntityComponentReaderWriter.cs b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveEntityComponentReaderWriter.cs index 463acf996c..76b5a634da 100644 --- a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveEntityComponentReaderWriter.cs +++ b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveEntityComponentReaderWriter.cs @@ -1,6 +1,6 @@ -// =========== +// ===================================================== // DO NOT EDIT - this file is automatically regenerated. -// =========== +// ===================================================== using System; using System.Collections.Generic; diff --git a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveMapKeyComponentReaderWriter.cs b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveMapKeyComponentReaderWriter.cs index 3aaf65f365..084d6643db 100644 --- a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveMapKeyComponentReaderWriter.cs +++ b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveMapKeyComponentReaderWriter.cs @@ -1,6 +1,6 @@ -// =========== +// ===================================================== // DO NOT EDIT - this file is automatically regenerated. -// =========== +// ===================================================== using System; using System.Collections.Generic; diff --git a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveMapValueComponentReaderWriter.cs b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveMapValueComponentReaderWriter.cs index b31ede390a..363557e89b 100644 --- a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveMapValueComponentReaderWriter.cs +++ b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveMapValueComponentReaderWriter.cs @@ -1,6 +1,6 @@ -// =========== +// ===================================================== // DO NOT EDIT - this file is automatically regenerated. -// =========== +// ===================================================== using System; using System.Collections.Generic; diff --git a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveOptionalComponentReaderWriter.cs b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveOptionalComponentReaderWriter.cs index bb3db74656..62286e69ca 100644 --- a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveOptionalComponentReaderWriter.cs +++ b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveOptionalComponentReaderWriter.cs @@ -1,6 +1,6 @@ -// =========== +// ===================================================== // DO NOT EDIT - this file is automatically regenerated. -// =========== +// ===================================================== using System; using System.Collections.Generic; diff --git a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveRepeatedComponentReaderWriter.cs b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveRepeatedComponentReaderWriter.cs index 916b7f9ea8..24ff0a141b 100644 --- a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveRepeatedComponentReaderWriter.cs +++ b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveRepeatedComponentReaderWriter.cs @@ -1,6 +1,6 @@ -// =========== +// ===================================================== // DO NOT EDIT - this file is automatically regenerated. -// =========== +// ===================================================== using System; using System.Collections.Generic; diff --git a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveSingularComponentReaderWriter.cs b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveSingularComponentReaderWriter.cs index 06f3d87f4d..a9834a46c6 100644 --- a/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveSingularComponentReaderWriter.cs +++ b/test-project/Assets/Generated/Source/improbable/testschema/ExhaustiveSingularComponentReaderWriter.cs @@ -1,6 +1,6 @@ -// =========== +// ===================================================== // DO NOT EDIT - this file is automatically regenerated. -// =========== +// ===================================================== using System; using System.Collections.Generic; diff --git a/test-project/Packages/io.improbable.gdk.dependencytest/.codegen/Source/Generators/ModularCodegenTestGeneratorPart.cs b/test-project/Packages/io.improbable.gdk.dependencytest/.codegen/Source/Generators/ModularCodegenTestGeneratorPart.cs deleted file mode 100644 index 4b6d1efb84..0000000000 --- a/test-project/Packages/io.improbable.gdk.dependencytest/.codegen/Source/Generators/ModularCodegenTestGeneratorPart.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Improbable.Gdk.CodeGenerator -{ - public partial class ModularCodegenTestGenerator - { - public string Generate() - { - return TransformText(); - } - } -} diff --git a/test-project/Packages/io.improbable.gdk.dependencytest/.codegen/Source/Generators/TestProject/ModularCodegenTestGenerator.cs b/test-project/Packages/io.improbable.gdk.dependencytest/.codegen/Source/Generators/TestProject/ModularCodegenTestGenerator.cs new file mode 100644 index 0000000000..5ff3778044 --- /dev/null +++ b/test-project/Packages/io.improbable.gdk.dependencytest/.codegen/Source/Generators/TestProject/ModularCodegenTestGenerator.cs @@ -0,0 +1,20 @@ +using Improbable.Gdk.CodeGeneration.CodeWriter; + +namespace Improbable.Gdk.CodeGenerator +{ + public static class ModularCodegenTestGenerator + { + public static string Generate() + { + return CodeWriter.Populate(cgw => + { + cgw.Namespace("Improbable.Gdk.ModularCodegenTests", ns => + { + ns.Type("public class TemplateTest", t => + { + }); + }); + }).Format(); + } + } +} diff --git a/test-project/Packages/io.improbable.gdk.dependencytest/.codegen/Source/TestCodegenJob.cs b/test-project/Packages/io.improbable.gdk.dependencytest/.codegen/Source/TestCodegenJob.cs index afa5298806..7b4f9c2165 100644 --- a/test-project/Packages/io.improbable.gdk.dependencytest/.codegen/Source/TestCodegenJob.cs +++ b/test-project/Packages/io.improbable.gdk.dependencytest/.codegen/Source/TestCodegenJob.cs @@ -31,7 +31,7 @@ public TestCodegenJob(string baseOutputDir, IFileSystem fileSystem, DetailsStore protected override void RunImpl() { AddContent(relativeOutputPath, testContent); - AddContent(relativeTemplateOutputPath, new ModularCodegenTestGenerator().Generate()); + AddContent(relativeTemplateOutputPath, ModularCodegenTestGenerator.Generate()); } } } diff --git a/test-project/Packages/io.improbable.gdk.dependencytest/.codegen/Templates/ModularCodegenTestGenerator.tt b/test-project/Packages/io.improbable.gdk.dependencytest/.codegen/Templates/ModularCodegenTestGenerator.tt deleted file mode 100644 index 5001330d52..0000000000 --- a/test-project/Packages/io.improbable.gdk.dependencytest/.codegen/Templates/ModularCodegenTestGenerator.tt +++ /dev/null @@ -1,7 +0,0 @@ -<#@ template language="C#" #> -<#@ output extension=".cs" #> - -namespace Improbable.Gdk.ModularCodegenTests -{ - public class TemplateTest {} -} \ No newline at end of file