From 1af3741f06538db4b8041e701535c53b2a193307 Mon Sep 17 00:00:00 2001 From: Matthew Pirocchi Date: Thu, 9 Aug 2018 10:39:52 -0700 Subject: [PATCH 1/7] Emit new package-related properties in generated C# project file. --- packages/jsii-calc-base-of-base/package.json | 3 +- .../jsii-calc-base-of-base/test/assembly.jsii | 5 +- packages/jsii-calc-base/package.json | 3 +- packages/jsii-calc-base/test/assembly.jsii | 8 +- packages/jsii-calc-lib/package.json | 3 +- packages/jsii-calc-lib/test/assembly.jsii | 11 +- packages/jsii-calc/package.json | 3 +- packages/jsii-calc/test/assembly.jsii | 20 +- .../src/Amazon.JSII.Generator.CLI/Program.cs | 2 +- .../AssemblyExtensionsTests.cs | 196 ++++++++- .../AssemblyGeneratorTests.cs | 124 +++++- .../SymbolMapTests.cs | 376 +++++++++++++--- .../TypeMetadataTests.cs | 48 +- .../AssemblyExtensions.cs | 42 ++ .../AssemblyGenerator.cs | 18 +- .../jsii-dotnet-generator/src/NuGet.config | 6 - .../jsii-dotnet-generator/src/NuGet.config.vs | 12 + .../Spec/AssemblyTests.cs | 414 ++++++++++++++++-- .../Converters/TypeConverter.cs | 6 +- .../Amazon.JSII.JsonModel/Spec/Assembly.cs | 63 ++- .../Spec/AssemblyTargets.cs | 64 +++ .../Spec/DependencyRoot.cs | 4 +- .../Spec/PackageVersion.cs | 2 +- .../src/Amazon.JSII.JsonModel/Spec/Person.cs | 40 ++ .../src/Amazon.JSII.JsonModel/Spec/Targets.cs | 40 -- .../Client/ClientTests.cs | 33 +- .../Amazon.JSII.Runtime/Services/Client.cs | 2 +- packages/jsii-dotnet-runtime/src/NuGet.config | 6 - .../jsii-dotnet-runtime/src/NuGet.config.vs | 12 + packages/jsii-kernel/test/test.kernel.ts | 10 +- .../Amazon.JSII.Tests.Calculator.Base/.jsii | 8 +- .../Amazon.JSII.Tests.Calculator.Base.csproj | 8 +- .../Amazon.JSII.Tests.Calculator.Lib/.jsii | 11 +- .../Amazon.JSII.Tests.Calculator.Lib.csproj | 8 +- .../dotnet/Amazon.JSII.Tests.Calculator/.jsii | 20 +- .../Amazon.JSII.Tests.Calculator.csproj | 8 +- 36 files changed, 1380 insertions(+), 259 deletions(-) create mode 100644 packages/jsii-dotnet-generator/src/NuGet.config.vs create mode 100644 packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/AssemblyTargets.cs create mode 100644 packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Person.cs delete mode 100644 packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Targets.cs create mode 100644 packages/jsii-dotnet-runtime/src/NuGet.config.vs diff --git a/packages/jsii-calc-base-of-base/package.json b/packages/jsii-calc-base-of-base/package.json index 0b09410858..5c4ffb12e6 100644 --- a/packages/jsii-calc-base-of-base/package.json +++ b/packages/jsii-calc-base-of-base/package.json @@ -15,7 +15,8 @@ } }, "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", + "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" }, "sphinx": {} } diff --git a/packages/jsii-calc-base-of-base/test/assembly.jsii b/packages/jsii-calc-base-of-base/test/assembly.jsii index 3bd1ae40e4..1951e5e429 100644 --- a/packages/jsii-calc-base-of-base/test/assembly.jsii +++ b/packages/jsii-calc-base-of-base/test/assembly.jsii @@ -1,5 +1,5 @@ { - "fingerprint": "I/HF4zJK5eV4ZLmNLDEzShkHVsxngX3K/y2SEYjXsxU=", + "fingerprint": "4UjBtqw6VsSJSEq49KOthIVWab5cZb3gjgvF7DPh2dk=", "author": { "name": "Amazon Web Services", "organization": true, @@ -19,7 +19,8 @@ "schema": "jsii/1.0", "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", + "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" }, "java": { "maven": { diff --git a/packages/jsii-calc-base/package.json b/packages/jsii-calc-base/package.json index 8927c5b33e..696d1a7a2c 100644 --- a/packages/jsii-calc-base/package.json +++ b/packages/jsii-calc-base/package.json @@ -15,7 +15,8 @@ } }, "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.Calculator.Base", + "packageId": "Amazon.JSII.Tests.Calculator.Base" }, "sphinx": {} } diff --git a/packages/jsii-calc-base/test/assembly.jsii b/packages/jsii-calc-base/test/assembly.jsii index 62ac6482ca..8d8c26712e 100644 --- a/packages/jsii-calc-base/test/assembly.jsii +++ b/packages/jsii-calc-base/test/assembly.jsii @@ -1,5 +1,5 @@ { - "fingerprint": "b+UZfT/No0vxqTQ1n3lIsyw7olqARDbeGj853lNFoE8=", + "fingerprint": "nY7bYOUnP/71hy4cDOOXssKcfB/Oz1tAhMPMw1QcZyI=", "author": { "name": "Amazon Web Services", "organization": true, @@ -12,7 +12,8 @@ "@scope/jsii-calc-base-of-base": { "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", + "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" }, "java": { "maven": { @@ -39,7 +40,8 @@ "schema": "jsii/1.0", "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.Calculator.Base", + "packageId": "Amazon.JSII.Tests.Calculator.Base" }, "java": { "maven": { diff --git a/packages/jsii-calc-lib/package.json b/packages/jsii-calc-lib/package.json index f229bf2296..afb117cded 100644 --- a/packages/jsii-calc-lib/package.json +++ b/packages/jsii-calc-lib/package.json @@ -15,7 +15,8 @@ } }, "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Lib" + "namespace": "Amazon.JSII.Tests.Calculator.Lib", + "packageId": "Amazon.JSII.Tests.Calculator.Lib" }, "sphinx": {} } diff --git a/packages/jsii-calc-lib/test/assembly.jsii b/packages/jsii-calc-lib/test/assembly.jsii index 71a27dff10..e7151a1e23 100644 --- a/packages/jsii-calc-lib/test/assembly.jsii +++ b/packages/jsii-calc-lib/test/assembly.jsii @@ -1,5 +1,5 @@ { - "fingerprint": "qwjIHOtTOSWOv5qzVdHj4SDgxmnWYsacVvR7BkAVlo8=", + "fingerprint": "TG5iHDURFXP3eGuVFwCU45xgyr1bMUgsWPdXDH55o4Y=", "author": { "name": "Amazon Web Services", "organization": true, @@ -14,7 +14,8 @@ "@scope/jsii-calc-base-of-base": { "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", + "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" }, "java": { "maven": { @@ -32,7 +33,8 @@ }, "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.Calculator.Base", + "packageId": "Amazon.JSII.Tests.Calculator.Base" }, "java": { "maven": { @@ -59,7 +61,8 @@ "schema": "jsii/1.0", "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Lib" + "namespace": "Amazon.JSII.Tests.Calculator.Lib", + "packageId": "Amazon.JSII.Tests.Calculator.Lib" }, "java": { "maven": { diff --git a/packages/jsii-calc/package.json b/packages/jsii-calc/package.json index 6edd6bf33c..fac5c56bcf 100644 --- a/packages/jsii-calc/package.json +++ b/packages/jsii-calc/package.json @@ -15,7 +15,8 @@ } }, "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator" + "namespace": "Amazon.JSII.Tests.Calculator", + "packageId": "Amazon.JSII.Tests.Calculator" }, "sphinx": {} } diff --git a/packages/jsii-calc/test/assembly.jsii b/packages/jsii-calc/test/assembly.jsii index 355277ea09..ea35343e15 100644 --- a/packages/jsii-calc/test/assembly.jsii +++ b/packages/jsii-calc/test/assembly.jsii @@ -1,5 +1,5 @@ { - "fingerprint": "nIH7ZdupMWqiPid9t2N934g0BDqSHVKuq6mrGdRpuYk=", + "fingerprint": "4hr7d742QVoXg5SKsc71Byf1QABcdQ0HEixthntx9g4=", "author": { "name": "Amazon Web Services", "organization": true, @@ -40,7 +40,8 @@ "@scope/jsii-calc-base-of-base": { "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", + "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" }, "java": { "maven": { @@ -58,7 +59,8 @@ }, "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.Calculator.Base", + "packageId": "Amazon.JSII.Tests.Calculator.Base" }, "java": { "maven": { @@ -80,7 +82,8 @@ "@scope/jsii-calc-base-of-base": { "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", + "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" }, "java": { "maven": { @@ -98,7 +101,8 @@ }, "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.Calculator.Base", + "packageId": "Amazon.JSII.Tests.Calculator.Base" }, "java": { "maven": { @@ -116,7 +120,8 @@ }, "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Lib" + "namespace": "Amazon.JSII.Tests.Calculator.Lib", + "packageId": "Amazon.JSII.Tests.Calculator.Lib" }, "java": { "maven": { @@ -146,7 +151,8 @@ "schema": "jsii/1.0", "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator" + "namespace": "Amazon.JSII.Tests.Calculator", + "packageId": "Amazon.JSII.Tests.Calculator" }, "java": { "maven": { diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.CLI/Program.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.CLI/Program.cs index 2b16609f81..ee697a72ad 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.CLI/Program.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.CLI/Program.cs @@ -20,7 +20,7 @@ static void HandleParseError(IEnumerable errors) static void Generate(Options options) { - AssemblyGenerator generator = new AssemblyGenerator(options.OutputDirectory, "", ""); + AssemblyGenerator generator = new AssemblyGenerator(options.OutputDirectory); generator.Generate(options.JsiiFile, options.Tarball); } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyExtensionsTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyExtensionsTests.cs index 368dca4ef0..215b8aeb6c 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyExtensionsTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyExtensionsTests.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Text; +using System.Xml.Linq; using Xunit; namespace Amazon.JSII.Generator.UnitTests @@ -26,6 +27,12 @@ public void ThrowsOnMissingDotNetKey() { Assembly assembly = new Assembly( name: "myName", + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", targets: null, version: "myVersion", types: new Dictionary() @@ -35,12 +42,21 @@ public void ThrowsOnMissingDotNetKey() Assert.Equal("root", exception.ParamName); } - [Fact(DisplayName = _Prefix + nameof(ThrowsOnEmptyDotNetKey))] - public void ThrowsOnEmptyDotNetKey() + [Fact(DisplayName = _Prefix + nameof(ThrowsOnEmptyDotNetNamespace))] + public void ThrowsOnEmptyDotNetNamespace() { Assembly assembly = new Assembly( name: "myName", - targets: new Targets(new Targets.DotNetTarget(" ")), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: " ", + packageId: "") + ), version: "myVersion", types: new Dictionary() ); @@ -54,7 +70,16 @@ public void RetrievesDotNetName() { Assembly assembly = new Assembly( name: "myName", - targets: new Targets(new Targets.DotNetTarget("myNativeName")), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "myNativeName", + packageId: "myPackageId" + )), version: "myVersion", types: new Dictionary() ); @@ -80,14 +105,26 @@ public void ThrowsOnNullPackage() { Assembly assembly = new Assembly( name: "myName", - targets: new Targets(new Targets.DotNetTarget("myNativeName")), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "myNativeName", + packageId: "myPackageId1" + )), dependencies: new Dictionary { { "myPackage", new PackageVersion( "0.0.1", - new Targets(new Targets.DotNetTarget("myPackageNativeName")) + new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "myPackageNativeName", + packageId: "myPackageId2" + )) ) } }, @@ -104,14 +141,27 @@ public void ThrowsOnMissingPackage() { Assembly assembly = new Assembly( name: "myName", - targets: new Targets(new Targets.DotNetTarget("myNativeName")), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "myNativeName", + packageId: "myPackageId1" + )), dependencies: new Dictionary { { "myPackage", new PackageVersion( "0.0.1", - new Targets(new Targets.DotNetTarget("myPackageNativeName")) + new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "myPackageNativeName", + packageId: "myPackageId2" + + )) ) } }, @@ -128,7 +178,16 @@ public void ThrowsOnMissingDotNetKey() { Assembly assembly = new Assembly( name: "myName", - targets: new Targets(new Targets.DotNetTarget("myNativeName")), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "myNativeName", + packageId: "myPackageId" + )), dependencies: new Dictionary { { @@ -149,14 +208,26 @@ public void ThrowsOnEmptyDotNetKey() { Assembly assembly = new Assembly( name: "myName", - targets: new Targets(new Targets.DotNetTarget("myNativeName")), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "myNativeName", + packageId: "myPackageId1" + )), dependencies: new Dictionary { { "myPackage", new PackageVersion( "0.0.1", - new Targets(new Targets.DotNetTarget(" ")) + new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: " ", + packageId: "myPackageId2" + )) ) } }, @@ -173,14 +244,26 @@ public void RetrievesDotNetName() { Assembly assembly = new Assembly( name: "myName", - targets: new Targets(new Targets.DotNetTarget("myNativeName")), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "myNativeName", + packageId: "myPackageId1" + )), dependencies: new Dictionary { { "myPackage", new PackageVersion( "0.0.1", - new Targets(new Targets.DotNetTarget("myPackageNativeName")) + new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "myPackageNativeName", + packageId: "myPackageId2" + )) ) } }, @@ -192,5 +275,92 @@ public void RetrievesDotNetName() Assert.Equal("myPackageNativeName", actual); } } + + public class GetMsBuildProperties + { + const string _Prefix = Prefix + nameof(GetMsBuildProperties) + "."; + + public void IncludesAllPresentProperties() + { + Assembly assembly = new Assembly( + name: "my-assembly", + description: "my description", + homepage: "https://www.example.com/", + repository: new Assembly.AssemblyRepository + ( + type: "git", + url: "https://github.com/" + ), + author: new Person + ( + name: "Jane Doe", + roles: new string[] { "Administrator" } + ), + fingerprint: "myFingerprint", + version: "1.2.3", + license: "Apache-2.0", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace", + packageId: "My.PackageId", + title: "My Human Readable Title", + signAssembly: true, + assemblyOriginatorKey: "key.snk", + tags: new[] { "tag1", "tag2" }, + iconUrl: "https://www.example.com/icon.svg" + )) + ); + + IEnumerable actual = assembly.GetMsBuildProperties(); + Assert.Collection(actual, + element => Assert.Equal("netstandard2.0", element.ToString()), + element => Assert.Equal("true", element.ToString()), + element => Assert.Equal("1.2.3", element.ToString()), + element => Assert.Equal("My.PackageId", element.ToString()), + element => Assert.Equal("my description", element.ToString()), + element => Assert.Equal("https://www.example.com/", element.ToString()), + element => Assert.Equal("https://spdx.org/licenses/Apache-2.0.html", element.ToString()), + element => Assert.Equal("Jane Doe", element.ToString()), + element => Assert.Equal("My Human Readable Title", element.ToString()), + element => Assert.Equal("true", element.ToString()), + element => Assert.Equal("key.snk", element.ToString()), + element => Assert.Equal("tag1 tag2", element.ToString()), + element => Assert.Equal("http://www.example.com/icon.svg", element.ToString()) + ); + } + + public void SkipsNullProperties() + { + Assembly assembly = new Assembly( + description: "my description", + homepage: "https://www.example.com/", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person + ( + name: "Jane Doe", + roles: new string[] { } + ), + fingerprint: "", + license: "Apache-2.0", + name: "my-assembly", + version: "1.2.3", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace", + packageId: "My.PackageId" + )) + ); + + IEnumerable actual = assembly.GetMsBuildProperties(); + Assert.Collection(actual, + element => Assert.Equal("netstandard2.0", element.ToString()), + element => Assert.Equal("true", element.ToString()), + element => Assert.Equal("1.2.3", element.ToString()), + element => Assert.Equal("My.PackageId", element.ToString()), + element => Assert.Equal("my description", element.ToString()), + element => Assert.Equal("https://www.example.com/", element.ToString()), + element => Assert.Equal("https://spdx.org/licenses/Apache-2.0.html", element.ToString()), + element => Assert.Equal("Jane Doe", element.ToString()) + ); + } + } } } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyGeneratorTests.cs index a7f96acd24..f2b259f8a8 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyGeneratorTests.cs @@ -40,10 +40,22 @@ public void AccessesFileSystemThroughShim() const string json = @"{ ""name"": ""jsii$aws_cdk_cx_api$"", - ""package"": ""aws-cdk-cx-api"", + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", + ""license"": """", ""targets"": { ""dotnet"": { - ""namespace"": ""Aws.Cdk.CxApi"" + ""namespace"": ""Aws.Cdk.CxApi"", + ""packageId"": ""Aws.Cdk.CxApi"" } }, ""version"": """", @@ -83,8 +95,6 @@ public void AccessesFileSystemThroughShim() AssemblyGenerator generator = new AssemblyGenerator ( OutputRoot, - "", - "", fileSystem ); generator.Generate @@ -107,9 +117,22 @@ public void CopiesJsiiToOutput() const string json = @"{ ""name"": ""jsii$aws_cdk_cx_api$"", + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", + ""license"": """", ""targets"": { ""dotnet"": { - ""namespace"": ""Aws.Cdk.CxApi"" + ""namespace"": ""Aws.Cdk.CxApi"", + ""packageId"": ""Aws.Cdk.CxApi"" } }, ""version"": """", @@ -131,8 +154,6 @@ public void CopiesJsiiToOutput() AssemblyGenerator generator = new AssemblyGenerator ( OutputRoot, - "myAuthors", - "myCompany", fileSystem ); generator.Generate @@ -151,10 +172,22 @@ public void CreatesBasicProjectFile() const string json = @"{ ""name"": ""jsii$aws_cdk_cx_api$"", - ""package"": ""aws-cdk-cx-api"", + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", + ""license"": """", ""targets"": { ""dotnet"": { - ""namespace"": ""Aws.Cdk.CxApi"" + ""namespace"": ""Aws.Cdk.CxApi"", + ""packageId"": ""Aws.Cdk.CxApi"" } }, ""version"": ""1.2.3"", @@ -176,8 +209,6 @@ public void CreatesBasicProjectFile() AssemblyGenerator generator = new AssemblyGenerator ( OutputRoot, - "myAuthors", - "myCompany", fileSystem ); generator.Generate @@ -212,10 +243,22 @@ public void CreatesProjectFileWithDependencies() string json = @"{ ""name"": ""jsii$aws_cdk$"", - ""package"": ""aws-cdk"", + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", + ""license"": """", ""targets"": { ""dotnet"": { - ""namespace"": ""Aws.Cdk"" + ""namespace"": ""Aws.Cdk"", + ""packageId"": ""Aws.Cdk"" } }, ""version"": ""1.2.3"", @@ -226,7 +269,8 @@ public void CreatesProjectFileWithDependencies() ""version"": """", ""targets"": { ""dotnet"": { - ""namespace"": ""Aws.Cdk.CxApi"" + ""namespace"": ""Aws.Cdk.CxApi"", + ""packageId"": ""Aws.Cdk.CxApi"" } } } @@ -235,10 +279,23 @@ public void CreatesProjectFileWithDependencies() string cxJson = @"{ ""name"": ""jsii$aws_cdk_cx_api$"", + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", + ""license"": """", ""version"": """", ""targets"": { ""dotnet"": { - ""namespace"": ""Aws.Cdk.CxApi"" + ""namespace"": ""Aws.Cdk.CxApi"", + ""packageId"": ""Aws.Cdk.CxApi"" } }, ""types"": {} @@ -266,8 +323,6 @@ public void CreatesProjectFileWithDependencies() AssemblyGenerator generator = new AssemblyGenerator ( OutputRoot, - "myAuthors", - "myCompany", fileSystem ); generator.Generate @@ -303,9 +358,22 @@ public void CreatesAssemblyInfo() const string json = @"{ ""name"": ""jsii$aws_cdk_cx_api$"", + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", + ""license"": """", ""targets"": { ""dotnet"": { - ""namespace"": ""Aws.Cdk.CxApi"" + ""namespace"": ""Aws.Cdk.CxApi"", + ""packageId"": ""Aws.Cdk.CxApi"" } }, ""version"": """", @@ -327,8 +395,6 @@ public void CreatesAssemblyInfo() AssemblyGenerator generator = new AssemblyGenerator ( OutputRoot, - "myAuthors", - "myCompany", fileSystem ); generator.Generate @@ -357,10 +423,22 @@ public void CreatesBasicTypeFile() const string json = @"{ ""name"": ""jsii$aws_cdk_cx_api$"", - ""package"": ""aws-cdk-cx-api"", + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", + ""license"": """", ""targets"": { ""dotnet"": { - ""namespace"": ""Aws.Cdk.CxApi"" + ""namespace"": ""Aws.Cdk.CxApi"", + ""packageId"": ""Aws.Cdk.CxApi"" } }, ""version"": """", @@ -395,8 +473,6 @@ public void CreatesBasicTypeFile() AssemblyGenerator generator = new AssemblyGenerator ( OutputRoot, - "", - "", fileSystem ); generator.Generate diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/SymbolMapTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/SymbolMapTests.cs index 6b10817e0c..bcffa1a2d4 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/SymbolMapTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/SymbolMapTests.cs @@ -19,7 +19,16 @@ static ISymbolMap GetSymbolMap(out Assembly assembly, params Type[] types) assembly = new Assembly ( name: "my-package", - targets: new Targets(dotnet: "My.Assembly"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace", + packageId: "My.PackageId" + )), version: "myVersion", types: types.ToDictionary(t => t.FullyQualifiedName) ); @@ -40,7 +49,7 @@ public void LoadsEmptyAssembly() ISymbolMap symbolMap = GetSymbolMap(out Assembly assembly); string actual = symbolMap.GetName(assembly); - Assert.Equal("My.Assembly", actual, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace", actual, ignoreLineEndingDifferences: true); } [Fact(DisplayName = Prefix + nameof(RenamesTypeOnNamespaceConflict))] @@ -66,7 +75,16 @@ public void RenamesTypeOnNamespaceConflict() Assembly assembly = new Assembly ( name: "my-package", - targets: new Targets(dotnet: "MyNamespace"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace", + packageId: "My.PackageId" + )), version: "myVersion", types: new Dictionary { @@ -101,7 +119,16 @@ public void RenamesTypeOnMemberConflict() Assembly assembly = new Assembly ( name: "my-package", - targets: new Targets(dotnet: "MyNamespace"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace", + packageId: "My.PackageId" + )), version: "myVersion", types: new Dictionary { @@ -165,18 +192,45 @@ public void DisambiguatesTypeNameOnConflict() Assembly assembly1 = new Assembly ( name: "my-package-1", - targets: new Targets(dotnet: "MyNamespace1"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace1", + packageId: "My.PackageId1" + )), version: "myVersion", types: new Dictionary { { type1.FullyQualifiedName, type1 } }, dependencies: new Dictionary { - { "my-package-2", new PackageVersion("myVersion", new Targets(dotnet: "MyNamespace2")) } + { + "my-package-2", + new PackageVersion( + version: "myVersion", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )) + ) + } } ); Assembly assembly2 = new Assembly ( name: "my-package-2", - targets: new Targets(dotnet: "MyNamespace2"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )), version: "myVersion", types: new Dictionary { { type2.FullyQualifiedName, type2 } } ); @@ -188,14 +242,14 @@ public void DisambiguatesTypeNameOnConflict() // GetName(Type type) string actual1 = symbolMap.GetName(type1, true); string actual2 = symbolMap.GetName(type2, true); - Assert.Equal("MyNamespace1.MyType", actual1, ignoreLineEndingDifferences: true); - Assert.Equal("MyNamespace2.MyType", actual2, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace1.MyType", actual1, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace2.MyType", actual2, ignoreLineEndingDifferences: true); // GetName(string fullyQualifiedName) actual1 = symbolMap.GetName("myFqn1", true); actual2 = symbolMap.GetName("myFqn2", true); - Assert.Equal("MyNamespace1.MyType", actual1, ignoreLineEndingDifferences: true); - Assert.Equal("MyNamespace2.MyType", actual2, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace1.MyType", actual1, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace2.MyType", actual2, ignoreLineEndingDifferences: true); } [Fact(DisplayName = Prefix + nameof(DoesNotDisambiguateTypeNameIfNoConflict))] @@ -221,18 +275,45 @@ public void DoesNotDisambiguateTypeNameIfNoConflict() Assembly assembly1 = new Assembly ( name: "my-package-1", - targets: new Targets(dotnet: "MyNamespace1"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace1", + packageId: "My.PackageId1" + )), version: "myVersion", types: new Dictionary { { type1.FullyQualifiedName, type1 } }, dependencies: new Dictionary { - { "my-package-2", new PackageVersion("myVersion", new Targets(dotnet: "MyNamespace2")) } + { + "my-package-2", + new PackageVersion( + version: "myVersion", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )) + ) + } } ); Assembly assembly2 = new Assembly ( name: "my-package-2", - targets: new Targets(dotnet: "MyNamespace2"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )), version: "myVersion", types: new Dictionary { { type2.FullyQualifiedName, type2 } } ); @@ -277,18 +358,45 @@ public void DoesNotDisambiguateTypeNameIfFlagNotSet() Assembly assembly1 = new Assembly ( name: "my-package-1", - targets: new Targets(dotnet: "MyNamespace1"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace1", + packageId: "My.PackageId1" + )), version: "myVersion", types: new Dictionary { { type1.FullyQualifiedName, type1 } }, dependencies: new Dictionary { - { "my-package-2", new PackageVersion("myVersion", new Targets(dotnet: "MyNamespace2")) } + { + "my-package-2", + new PackageVersion( + version: "myVersion", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )) + ) + } } ); Assembly assembly2 = new Assembly ( name: "my-package-2", - targets: new Targets(dotnet: "MyNamespace2"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )), version: "myVersion", types: new Dictionary { { type2.FullyQualifiedName, type2 } } ); @@ -459,18 +567,45 @@ public void DisambiguatesTypeNameOnConflict() Assembly assembly1 = new Assembly ( name: "my-package-1", - targets: new Targets(dotnet: "MyNamespace1"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace1", + packageId: "My.PackageId1" + )), version: "myVersion", types: new Dictionary { { type1.FullyQualifiedName, type1 } }, dependencies: new Dictionary { - { "my-package-2", new PackageVersion("myVersion", new Targets(dotnet: "MyNamespace2")) } + { + "my-package-2", + new PackageVersion( + version: "myVersion", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )) + ) + } } ); Assembly assembly2 = new Assembly ( name: "my-package-2", - targets: new Targets(dotnet: "MyNamespace2"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )), version: "myVersion", types: new Dictionary { { type2.FullyQualifiedName, type2 } } ); @@ -482,14 +617,14 @@ public void DisambiguatesTypeNameOnConflict() // GetNameSyntaxToken(Type type) string actual1 = symbolMap.GetNameSyntaxToken(type1, true).ToString(); string actual2 = symbolMap.GetNameSyntaxToken(type2, true).ToString(); - Assert.Equal("MyNamespace1.MyType", actual1, ignoreLineEndingDifferences: true); - Assert.Equal("MyNamespace2.MyType", actual2, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace1.MyType", actual1, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace2.MyType", actual2, ignoreLineEndingDifferences: true); // GetNameSyntaxToken(string fullyQualifiedName) actual1 = symbolMap.GetNameSyntaxToken("myFqn1", true).ToString(); actual2 = symbolMap.GetNameSyntaxToken("myFqn2", true).ToString(); - Assert.Equal("MyNamespace1.MyType", actual1, ignoreLineEndingDifferences: true); - Assert.Equal("MyNamespace2.MyType", actual2, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace1.MyType", actual1, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace2.MyType", actual2, ignoreLineEndingDifferences: true); } [Fact(DisplayName = Prefix + nameof(DoesNotDisambiguateTypeNameIfNoConflict))] @@ -515,18 +650,45 @@ public void DoesNotDisambiguateTypeNameIfNoConflict() Assembly assembly1 = new Assembly ( name: "my-package-1", - targets: new Targets(dotnet: "MyNamespace1"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace1", + packageId: "My.PackageId1" + )), version: "myVersion", types: new Dictionary { { type1.FullyQualifiedName, type1 } }, dependencies: new Dictionary { - { "my-package-2", new PackageVersion("myVersion", new Targets(dotnet: "MyNamespace2")) } + { + "my-package-2", + new PackageVersion( + version: "myVersion", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )) + ) + } } ); Assembly assembly2 = new Assembly ( name: "my-package-2", - targets: new Targets(dotnet: "MyNamespace2"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )), version: "myVersion", types: new Dictionary { { type2.FullyQualifiedName, type2 } } ); @@ -571,21 +733,48 @@ public void DoesNotDisambiguateTypeNameIfFlagNotSet() Assembly assembly1 = new Assembly ( name: "my-package-1", - targets: new Targets(dotnet: "MyNamespace1"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace1", + packageId: "My.PackageId1" + )), version: "myVersion", types: new Dictionary { { type1.FullyQualifiedName, type1 } }, dependencies: new Dictionary { - { "my-package-2", new PackageVersion("myVersion", new Targets(dotnet: "MyNamespace2")) } + { + "my-package-2", + new PackageVersion( + version: "myVersion", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )) + ) + } } ); Assembly assembly2 = new Assembly ( - name: "my-package-2", - targets: new Targets(dotnet: "MyNamespace2"), - version: "myVersion", - types: new Dictionary { { type2.FullyQualifiedName, type2 } } - ); + name: "my-package-2", + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )), + version: "myVersion", + types: new Dictionary { { type2.FullyQualifiedName, type2 } } + ); ISymbolMap symbolMap = new SymbolMap(); symbolMap.Add(assembly1); @@ -753,18 +942,45 @@ public void DisambiguatesTypeNameOnConflict() Assembly assembly1 = new Assembly ( name: "my-package-1", - targets: new Targets(dotnet: "MyNamespace1"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace1", + packageId: "My.PackageId1" + )), version: "myVersion", types: new Dictionary { { type1.FullyQualifiedName, type1 } }, dependencies: new Dictionary { - { "my-package-2", new PackageVersion("myVersion", new Targets(dotnet: "MyNamespace2")) } + { + "my-package-2", + new PackageVersion( + version: "myVersion", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )) + ) + } } ); Assembly assembly2 = new Assembly ( name: "my-package-2", - targets: new Targets(dotnet: "MyNamespace2"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )), version: "myVersion", types: new Dictionary { { type2.FullyQualifiedName, type2 } } ); @@ -776,14 +992,14 @@ public void DisambiguatesTypeNameOnConflict() // GetNameSyntax(Type type) string actual1 = symbolMap.GetNameSyntax(type1, true).ToString(); string actual2 = symbolMap.GetNameSyntax(type2, true).ToString(); - Assert.Equal("MyNamespace1.MyType", actual1, ignoreLineEndingDifferences: true); - Assert.Equal("MyNamespace2.MyType", actual2, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace1.MyType", actual1, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace2.MyType", actual2, ignoreLineEndingDifferences: true); // GetNameSyntax(string fullyQualifiedName) actual1 = symbolMap.GetNameSyntax("myFqn1", true).ToString(); actual2 = symbolMap.GetNameSyntax("myFqn2", true).ToString(); - Assert.Equal("MyNamespace1.MyType", actual1, ignoreLineEndingDifferences: true); - Assert.Equal("MyNamespace2.MyType", actual2, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace1.MyType", actual1, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace2.MyType", actual2, ignoreLineEndingDifferences: true); } [Fact(DisplayName = Prefix + nameof(DoesNotDisambiguateTypeNameIfNoConflict))] @@ -809,18 +1025,45 @@ public void DoesNotDisambiguateTypeNameIfNoConflict() Assembly assembly1 = new Assembly ( name: "my-package-1", - targets: new Targets(dotnet: "MyNamespace1"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace1", + packageId: "My.PackageId1" + )), version: "myVersion", types: new Dictionary { { type1.FullyQualifiedName, type1 } }, dependencies: new Dictionary { - { "my-package-2", new PackageVersion("myVersion", new Targets(dotnet: "MyNamespace2")) } + { + "my-package-2", + new PackageVersion( + version: "myVersion", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )) + ) + } } ); Assembly assembly2 = new Assembly ( name: "my-package-2", - targets: new Targets(dotnet: "MyNamespace2"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )), version: "myVersion", types: new Dictionary { { type2.FullyQualifiedName, type2 } } ); @@ -865,18 +1108,45 @@ public void DoesNotDisambiguateTypeNameIfFlagNotSet() Assembly assembly1 = new Assembly ( name: "my-package-1", - targets: new Targets(dotnet: "MyNamespace1"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace1", + packageId: "My.PackageId1" + )), version: "myVersion", types: new Dictionary { { type1.FullyQualifiedName, type1 } }, dependencies: new Dictionary { - { "my-package-2", new PackageVersion("myVersion", new Targets(dotnet: "MyNamespace2")) } + { + "my-package-2", + new PackageVersion( + "myVersion", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )) + ) + } } ); Assembly assembly2 = new Assembly ( name: "my-package-2", - targets: new Targets(dotnet: "MyNamespace2"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(dotnet: new AssemblyTargets.DotNetTarget( + @namespace: "My.Namespace2", + packageId: "My.PackageId2" + )), version: "myVersion", types: new Dictionary { { type2.FullyQualifiedName, type2 } } ); @@ -1018,7 +1288,7 @@ public void GetsFrameworkNamespaceFromType() ISymbolMap symbolMap = GetSymbolMap(type); string actual = symbolMap.GetNamespace(type); - Assert.Equal("My.Assembly", actual, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace", actual, ignoreLineEndingDifferences: true); } [Fact(DisplayName = _Prefix + nameof(GetsFrameworkNamespaceFromFqn))] @@ -1036,7 +1306,7 @@ public void GetsFrameworkNamespaceFromFqn() ISymbolMap symbolMap = GetSymbolMap(type); string actual = symbolMap.GetNamespace("myFqn"); - Assert.Equal("My.Assembly", actual, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace", actual, ignoreLineEndingDifferences: true); } } @@ -1059,7 +1329,7 @@ public void GetsFrameworkNamespaceFromType() ISymbolMap symbolMap = GetSymbolMap(type); string actual = symbolMap.GetNamespaceSyntaxToken(type).ToString(); - Assert.Equal("My.Assembly", actual, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace", actual, ignoreLineEndingDifferences: true); } [Fact(DisplayName = _Prefix + nameof(GetsFrameworkNamespaceFromFqn))] @@ -1077,7 +1347,7 @@ public void GetsFrameworkNamespaceFromFqn() ISymbolMap symbolMap = GetSymbolMap(type); string actual = symbolMap.GetNamespaceSyntaxToken("myFqn").ToString(); - Assert.Equal("My.Assembly", actual, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace", actual, ignoreLineEndingDifferences: true); } } @@ -1100,7 +1370,7 @@ public void GetsFrameworkNamespaceFromType() ISymbolMap symbolMap = GetSymbolMap(type); string actual = symbolMap.GetNamespaceSyntax(type).ToString(); - Assert.Equal("My.Assembly", actual, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace", actual, ignoreLineEndingDifferences: true); } [Fact(DisplayName = _Prefix + nameof(GetsFrameworkNamespaceFromFqn))] @@ -1118,7 +1388,7 @@ public void GetsFrameworkNamespaceFromFqn() ISymbolMap symbolMap = GetSymbolMap(type); string actual = symbolMap.GetNamespaceSyntax("myFqn").ToString(); - Assert.Equal("My.Assembly", actual, ignoreLineEndingDifferences: true); + Assert.Equal("My.Namespace", actual, ignoreLineEndingDifferences: true); } } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/TypeMetadataTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/TypeMetadataTests.cs index 1d6809155e..05dc4959d5 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/TypeMetadataTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/TypeMetadataTests.cs @@ -16,14 +16,26 @@ public class Class readonly Assembly _assembly = new Assembly( name: "myName", - targets: new Targets(new Targets.DotNetTarget("myNativeName")), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "myNativeName", + packageId: "myPackageId1" + )), dependencies: new Dictionary { { "myModule", new PackageVersion( "0.0.1", - new Targets(new Targets.DotNetTarget("myPackageNativeName")) + new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "myPackageNativeName", + packageId: "myPackageId2" + )) ) } }, @@ -152,14 +164,26 @@ public class Enum readonly Assembly _assembly = new Assembly( name: "myName", - targets: new Targets(new Targets.DotNetTarget("myNativeName")), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "myNativeName", + packageId: "myPackageId1" + )), dependencies: new Dictionary { { "myModule", new PackageVersion( "0.0.1", - new Targets(new Targets.DotNetTarget("myPackageNativeName")) + new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "myPackageNativeName", + packageId: "myPackageId2" + )) ) } }, @@ -258,14 +282,26 @@ public class Interface readonly Assembly _assembly = new Assembly( name: "myName", - targets: new Targets(new Targets.DotNetTarget("myNativeName")), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "myNativeName", + packageId: "myPackageId1" + )), dependencies: new Dictionary { { "myModule", new PackageVersion( "0.0.1", - new Targets(new Targets.DotNetTarget("myPackageNativeName")) + new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "myPackageNativeName", + packageId: "myPackageId2" + )) ) } }, diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyExtensions.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyExtensions.cs index af282cc69b..0716b2f358 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyExtensions.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyExtensions.cs @@ -1,6 +1,7 @@ using Amazon.JSII.JsonModel.Spec; using System; using System.Collections.Generic; +using System.Xml.Linq; namespace Amazon.JSII.Generator { @@ -29,5 +30,46 @@ public static string GetNativeName(this Assembly assembly, string packageName) return name; } + + public static IEnumerable GetMsBuildProperties(this Assembly assembly) + { + yield return new XElement("TargetFramework", "netstandard2.0"); + yield return new XElement("GeneratePackageOnBuild", true); + yield return new XElement("PackageVersion", assembly.Version); + yield return new XElement("PackageId", assembly.Targets.DotNet.PackageId); + yield return new XElement("Description", assembly.Description); + yield return new XElement("ProjectUrl", assembly.Homepage); + yield return new XElement("LicenseUrl", $"https://spdx.org/licenses/{assembly.License}.html"); + yield return new XElement("Authors", $"{assembly.Author.Name}"); + + // TODO: Update once we have a localization story. + yield return new XElement("Language", "en-US"); + + if (assembly.Targets.DotNet.Title != null) + { + yield return new XElement("Title", assembly.Targets.DotNet.Title); + } + + if (assembly.Targets.DotNet.SignAssembly != null) + { + yield return new XElement("SignAssembly", assembly.Targets.DotNet.SignAssembly); + } + + if (assembly.Targets.DotNet.AssemblyOriginatorKey != null) + { + yield return new XElement("AssemblyOriginatorKey", assembly.Targets.DotNet.AssemblyOriginatorKey); + } + + if (assembly.Targets.DotNet.Tags != null) + { + // NuGet expects the list of tags to be space-delimited. + yield return new XElement("Tags", string.Join(" ", assembly.Targets.DotNet.Tags)); + } + + if (assembly.Targets.DotNet.IconUrl != null) + { + yield return new XElement("IconUrl", assembly.Targets.DotNet.IconUrl); + } + } } } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyGenerator.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyGenerator.cs index 46de4f45f2..ac2d1246d2 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyGenerator.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyGenerator.cs @@ -23,21 +23,15 @@ namespace Amazon.JSII.Generator public class AssemblyGenerator { readonly string _outputRoot; - readonly string _authors; - readonly string _company; readonly IFileSystem _fileSystem; public AssemblyGenerator ( string outputRoot, - string authors, - string company, IFileSystem fileSystem = null ) { _outputRoot = outputRoot ?? throw new ArgumentNullException(nameof(outputRoot)); - _authors = authors ?? throw new ArgumentNullException(nameof(authors)); - _company = company ?? throw new ArgumentNullException(nameof(company)); _fileSystem = fileSystem ?? new FileSystem(); } @@ -103,7 +97,7 @@ void Save(string packageOutputRoot, ISymbolMap symbols, Assembly assembly, strin if (assembly.Docs != null) { // TODO: Use Microsoft.Extensions.Logging instead of Console.Error. - Console.Error.WriteLine("Warning: Ignoring documentation comment on assembly ${assembly.Name}. Assembly-level documentation comments are not supported for .NET"); + Console.Error.WriteLine($"Warning: Ignoring documentation comment on assembly {assembly.Name}. Assembly-level documentation comments are not supported for .NET"); } SaveProjectFile(); @@ -119,13 +113,7 @@ void SaveProjectFile() XElement project = new XElement("Project", new XAttribute("Sdk", "Microsoft.NET.Sdk"), - new XElement("PropertyGroup", - new XElement("TargetFramework", "netstandard2.0"), - new XElement("GeneratePackageOnBuild", true), - new XElement("Authors", _authors), - new XElement("Company", _company), - new XElement("PackageVersion", assembly.Version) - ), + new XElement("PropertyGroup", assembly.GetMsBuildProperties()), new XElement("ItemGroup", new XElement("EmbeddedResource", new XAttribute("Include", tarballFileName) @@ -138,7 +126,7 @@ void SaveProjectFile() ), GetDependencies() .Distinct() - .Select(d => new { Package = symbols.GetAssemblyName(d.Key), Version = d.Value.Version}) + .Select(d => new { Package = symbols.GetAssemblyName(d.Key), d.Value.Version}) .Select(d => new XElement("PackageReference", new XAttribute("Include", d.Package), diff --git a/packages/jsii-dotnet-generator/src/NuGet.config b/packages/jsii-dotnet-generator/src/NuGet.config index 5038d0a46d..c84bdd28da 100644 --- a/packages/jsii-dotnet-generator/src/NuGet.config +++ b/packages/jsii-dotnet-generator/src/NuGet.config @@ -3,11 +3,5 @@ - - diff --git a/packages/jsii-dotnet-generator/src/NuGet.config.vs b/packages/jsii-dotnet-generator/src/NuGet.config.vs new file mode 100644 index 0000000000..f0b88f301d --- /dev/null +++ b/packages/jsii-dotnet-generator/src/NuGet.config.vs @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/AssemblyTests.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/AssemblyTests.cs index 35af0c6bed..7f55c348ff 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/AssemblyTests.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/AssemblyTests.cs @@ -21,27 +21,85 @@ public void ShouldSerializeAllMembers() Assembly assembly = new Assembly ( name: "myName", - targets: new Targets("Dot.Net.Namespace"), + description: "My description", + homepage: "http://www.example.com/", + repository: new Assembly.AssemblyRepository( + type: "git", + url: "http://github.com/" + ), + author: new Person( + name: "Jane Doe", + roles: new[] { "Administrator" } + ), + fingerprint: "myFingerprint", version: "myVersion", - types: new Dictionary(), - dependencies : new Dictionary(), + license: "Apache-2.0", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "Dot.Net.Namespace", + packageId: "Dot.Net.PackageId", + signAssembly: true, + assemblyOriginatorKey: "key.snk", + tags: new [] { "tag1", "tag2" }, + iconUrl: "http://www.example.com/icon.png" + )), + dependencies: new Dictionary(), + contributors: new Person[] { + new Person( + name: "John Doe", + roles: new[] { "Contributor" } + ) + }, bundled: new Dictionary(), - docs: new Docs() - + types: new Dictionary(), + docs: new Docs(), + readme: new Readme("myReadme") ); string actual = JsonConvert.SerializeObject(assembly, Formatting.Indented); const string expected = @"{ ""schema"": ""jsii/1.0"", ""name"": ""myName"", + ""description"": ""My description"", + ""homepage"": ""http://www.example.com/"", + ""repository"": { + ""type"": ""git"", + ""url"": ""http://github.com/"" + }, + ""author"": { + ""name"": ""Jane Doe"", + ""roles"": [ + ""Administrator"" + ] + }, + ""fingerprint"": ""myFingerprint"", ""version"": ""myVersion"", - ""types"": {}, + ""license"": ""Apache-2.0"", + ""contributors"": [ + { + ""name"": ""John Doe"", + ""roles"": [ + ""Contributor"" + ] + } + ], ""bundled"": {}, + ""types"": {}, ""docs"": {}, + ""readme"": { + ""markdown"": ""myReadme"" + }, ""dependencies"": {}, ""targets"": { ""dotnet"": { - ""namespace"": ""Dot.Net.Namespace"" + ""namespace"": ""Dot.Net.Namespace"", + ""packageId"": ""Dot.Net.PackageId"", + ""signAssembly"": true, + ""assemblyOriginatorKey"": ""key.snk"", + ""tags"": [ + ""tag1"", + ""tag2"" + ], + ""iconUrl"": ""http://www.example.com/icon.png"" } } }"; @@ -55,11 +113,24 @@ public void ShouldThrowOnMissingName() Assert.Throws(() => new Assembly ( name: null, - targets: new Targets("Dot.Net.Namespace"), - version: "myVersion", - types: new Dictionary(), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + version: "", + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "Dot.Net.Namespace", + packageId: "Dot.Net.PackageId", + signAssembly: true, + assemblyOriginatorKey: "key.snk", + tags: new[] { "tag1", "tag2" }, + iconUrl: "http://www.example.com/icon.png" + )), dependencies: new Dictionary(), bundled: new Dictionary(), + types: new Dictionary(), docs: new Docs() )); } @@ -70,8 +141,21 @@ public void ShouldThrowOnMissingVersion() Assert.Throws(() => new Assembly ( name: "myName", - targets: new Targets("Dot.Net.Namespace"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", version: null, + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "Dot.Net.Namespace", + packageId: "Dot.Net.PackageId", + signAssembly: true, + assemblyOriginatorKey: "key.snk", + tags: new[] { "tag1", "tag2" }, + iconUrl: "http://www.example.com/icon.png" + )), types: new Dictionary(), dependencies: new Dictionary(), bundled: new Dictionary(), @@ -85,8 +169,21 @@ public void ShouldNotSerializeMissingDependencies() Assembly assembly = new Assembly ( name: "myName", - targets: new Targets("Dot.Net.Namespace"), - version: "myVersion", + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + version: "", + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "Dot.Net.Namespace", + packageId: "Dot.Net.PackageId", + signAssembly: true, + assemblyOriginatorKey: "key.snk", + tags: new[] { "tag1", "tag2" }, + iconUrl: "http://www.example.com/icon.png" + )), types: new Dictionary(), dependencies: null, bundled: new Dictionary(), @@ -97,13 +194,33 @@ public void ShouldNotSerializeMissingDependencies() const string expected = @"{ ""schema"": ""jsii/1.0"", ""name"": ""myName"", - ""version"": ""myVersion"", - ""types"": {}, + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", + ""version"": """", + ""license"": """", ""bundled"": {}, + ""types"": {}, ""docs"": {}, ""targets"": { ""dotnet"": { - ""namespace"": ""Dot.Net.Namespace"" + ""namespace"": ""Dot.Net.Namespace"", + ""packageId"": ""Dot.Net.PackageId"", + ""signAssembly"": true, + ""assemblyOriginatorKey"": ""key.snk"", + ""tags"": [ + ""tag1"", + ""tag2"" + ], + ""iconUrl"": ""http://www.example.com/icon.png"" } } }"; @@ -117,8 +234,21 @@ public void ShouldNotSerializeMissingBundled() Assembly assembly = new Assembly ( name: "myName", - targets: new Targets("Dot.Net.Namespace"), - version: "myVersion", + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + version: "", + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "Dot.Net.Namespace", + packageId: "Dot.Net.PackageId", + signAssembly: true, + assemblyOriginatorKey: "key.snk", + tags: new[] { "tag1", "tag2" }, + iconUrl: "http://www.example.com/icon.png" + )), types: new Dictionary(), dependencies: new Dictionary(), bundled: null, @@ -129,13 +259,33 @@ public void ShouldNotSerializeMissingBundled() const string expected = @"{ ""schema"": ""jsii/1.0"", ""name"": ""myName"", - ""version"": ""myVersion"", + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", + ""version"": """", + ""license"": """", ""types"": {}, ""docs"": {}, ""dependencies"": {}, ""targets"": { ""dotnet"": { - ""namespace"": ""Dot.Net.Namespace"" + ""namespace"": ""Dot.Net.Namespace"", + ""packageId"": ""Dot.Net.PackageId"", + ""signAssembly"": true, + ""assemblyOriginatorKey"": ""key.snk"", + ""tags"": [ + ""tag1"", + ""tag2"" + ], + ""iconUrl"": ""http://www.example.com/icon.png"" } } }"; @@ -149,8 +299,21 @@ public void ShouldNotSerializeMissingDocs() Assembly assembly = new Assembly ( name: "myName", - targets: new Targets("Dot.Net.Namespace"), - version: "myVersion", + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + version: "", + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "Dot.Net.Namespace", + packageId: "Dot.Net.PackageId", + signAssembly: true, + assemblyOriginatorKey: "key.snk", + tags: new[] { "tag1", "tag2" }, + iconUrl: "http://www.example.com/icon.png" + )), types: new Dictionary(), dependencies: new Dictionary(), bundled: new Dictionary(), @@ -161,13 +324,33 @@ public void ShouldNotSerializeMissingDocs() const string expected = @"{ ""schema"": ""jsii/1.0"", ""name"": ""myName"", - ""version"": ""myVersion"", - ""types"": {}, + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", + ""version"": """", + ""license"": """", ""bundled"": {}, + ""types"": {}, ""dependencies"": {}, ""targets"": { ""dotnet"": { - ""namespace"": ""Dot.Net.Namespace"" + ""namespace"": ""Dot.Net.Namespace"", + ""packageId"": ""Dot.Net.PackageId"", + ""signAssembly"": true, + ""assemblyOriginatorKey"": ""key.snk"", + ""tags"": [ + ""tag1"", + ""tag2"" + ], + ""iconUrl"": ""http://www.example.com/icon.png"" } } }"; @@ -186,7 +369,19 @@ public void ShouldDeserializeAllMembers() const string json = @"{ ""schema"": ""jsii/1.0"", ""name"": ""myName"", + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", ""version"": ""myVersion"", + ""license"": """", ""types"": {}, ""dependencies"": {}, ""bundled"": {}, @@ -211,7 +406,19 @@ public void ShouldDeserializeAllMembersWithNoTypes() const string json = @"{ ""schema"": ""jsii/1.0"", ""name"": ""myName"", + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", ""version"": ""myVersion"", + ""license"": """", ""dependencies"": {}, ""bundled"": {}, ""docs"": {} @@ -237,10 +444,32 @@ public void ShouldDeserializeAllMembersWithDotNetTarget() ""schema"": ""jsii/1.0"", ""name"": ""myName"", ""targets"": { - ""dotnet"": { ""namespace"": ""AWS.Cdk.Test"" }, + ""dotnet"": { + ""namespace"": ""Dot.Net.Namespace"", + ""packageId"": ""Dot.Net.PackageId"", + ""signAssembly"": true, + ""assemblyOriginatorKey"": ""key.snk"", + ""tags"": [ + ""tag1"", + ""tag2"" + ], + ""iconUrl"": ""http://www.example.com/icon.png"" + }, ""java"": { ""package"": ""com.amazonaws.cdk.Test"" } }, + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", ""version"": ""myVersion"", + ""license"": """", ""types"": {}, ""dependencies"": {}, ""bundled"": {}, @@ -251,7 +480,21 @@ public void ShouldDeserializeAllMembersWithDotNetTarget() Assert.Equal("jsii/1.0", actual.Schema, ignoreLineEndingDifferences: true); Assert.Equal("myName", actual.Name, ignoreLineEndingDifferences: true); - Assert.Equal("AWS.Cdk.Test", actual.Targets.DotNet?.Namespace); + + AssemblyTargets.DotNetTarget dotNetTarget = actual.Targets.DotNet; + Assert.NotNull(dotNetTarget); + Assert.Equal("Dot.Net.Namespace", dotNetTarget.Namespace); + Assert.Equal("Dot.Net.PackageId", dotNetTarget.PackageId); + Assert.True(dotNetTarget.SignAssembly); + Assert.Equal("key.snk", dotNetTarget.AssemblyOriginatorKey); + Assert.Collection + ( + dotNetTarget.Tags, + tag => Assert.Equal("tag1", tag), + tag => Assert.Equal("tag2", tag) + ); + Assert.Equal("http://www.example.com/icon.png", dotNetTarget.IconUrl); + Assert.Equal("myVersion", actual.Version, ignoreLineEndingDifferences: true); Assert.Empty(actual.Types); Assert.Empty(actual.Dependencies); @@ -264,8 +507,25 @@ public void ShouldThrowOnMissingName() { const string json = @"{ ""schema"": ""jsii/1.0"", - ""targets"": { ""dotnet"": { ""namespace"": ""AWS.Cdk.Test"" } }, - ""version"": ""myVersion"", + ""targets"": { + ""dotnet"": { + ""namespace"": ""AWS.Cdk.Test"", + ""packageId"": ""AWS.Cdk.Test"" + } + }, + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", + ""version"": """", + ""license"": """", ""types"": {}, ""dependencies"": {}, ""bundled"": {}, @@ -281,7 +541,19 @@ public void ShouldThrowOnMissingDotNetTarget() const string json = @"{ ""schema"": ""jsii/1.0"", ""name"": ""myName"", - ""version"": ""myVersion"", + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", + ""version"": """", + ""license"": """", ""targets"": {}, ""types"": {}, ""dependencies"": {}, @@ -298,7 +570,24 @@ public void ShouldThrowOnMissingVersion() const string json = @"{ ""schema"": ""jsii/1.0"", ""name"": ""myName"", - ""targets"": { ""dotnet"": { ""namespace"": ""AWS.Cdk.Test"" } }, + ""targets"": { + ""dotnet"": { + ""namespace"": ""AWS.Cdk.Test"", + ""packageId"": ""AWS.Cdk.Test"" + } + }, + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", + ""license"": """", ""types"": {}, ""dependencies"": {}, ""bundled"": {}, @@ -314,8 +603,25 @@ public void ShouldNotDeserializeMissingDependencies() const string json = @"{ ""schema"": ""jsii/1.0"", ""name"": ""myName"", - ""targets"": { ""dotnet"": { ""namespace"": ""AWS.Cdk.Test"" } }, - ""version"": ""myVersion"", + ""targets"": { + ""dotnet"": { + ""namespace"": ""AWS.Cdk.Test"", + ""packageId"": ""AWS.Cdk.Test"" + } + }, + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", + ""version"": """", + ""license"": """", ""types"": {}, ""bundled"": {}, ""docs"": {} @@ -331,8 +637,25 @@ public void ShouldNotDeserializeMissingBundled() const string json = @"{ ""schema"": ""jsii/1.0"", ""name"": ""myName"", - ""targets"": { ""dotnet"": { ""namespace"": ""AWS.Cdk.Test"" } }, - ""version"": ""myVersion"", + ""targets"": { + ""dotnet"": { + ""namespace"": ""AWS.Cdk.Test"", + ""packageId"": ""AWS.Cdk.Test"" + } + }, + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", + ""version"": """", + ""license"": """", ""types"": {}, ""dependencies"": {}, ""docs"": {} @@ -348,8 +671,25 @@ public void ShouldNotDeserializeMissingDocs() const string json = @"{ ""schema"": ""jsii/1.0"", ""name"": ""myName"", - ""targets"": { ""dotnet"": { ""namespace"": ""AWS.Cdk.Test"" } }, - ""version"": ""myVersion"", + ""targets"": { + ""dotnet"": { + ""namespace"": ""AWS.Cdk.Test"", + ""packageId"": ""AWS.Cdk.Test"" + } + }, + ""description"": """", + ""homepage"": """", + ""repository"": { + ""type"": """", + ""url"": """" + }, + ""author"": { + ""name"": """", + ""roles"": [] + }, + ""fingerprint"": """", + ""version"": """", + ""license"": """", ""types"": {}, ""dependencies"": {}, ""bundled"": {} diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Converters/TypeConverter.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Converters/TypeConverter.cs index db540c5313..a58f1521c2 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Converters/TypeConverter.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Converters/TypeConverter.cs @@ -29,21 +29,21 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s { case TypeKind.Enum: { - EnumType derivedType = value as EnumType ?? throw new ArgumentException($"Value has type kind '${type.Kind}', but is not an instance of {nameof(EnumType)}", nameof(value)); + EnumType derivedType = value as EnumType ?? throw new ArgumentException($"Value has type kind '{type.Kind}', but is not an instance of {nameof(EnumType)}", nameof(value)); string json = JsonConvert.SerializeObject(derivedType); writer.WriteRawValue(json); break; } case TypeKind.Class: { - ClassType derivedType = value as ClassType ?? throw new ArgumentException($"Value has type kind '${type.Kind}', but is not an instance of {nameof(ClassType)}", nameof(value)); + ClassType derivedType = value as ClassType ?? throw new ArgumentException($"Value has type kind '{type.Kind}', but is not an instance of {nameof(ClassType)}", nameof(value)); string json = JsonConvert.SerializeObject(derivedType); writer.WriteRawValue(json); break; } case TypeKind.Interface: { - InterfaceType derivedType = value as InterfaceType ?? throw new ArgumentException($"Value has type kind '${type.Kind}', but is not an instance of {nameof(InterfaceType)}", nameof(value)); + InterfaceType derivedType = value as InterfaceType ?? throw new ArgumentException($"Value has type kind '{type.Kind}', but is not an instance of {nameof(InterfaceType)}", nameof(value)); string json = JsonConvert.SerializeObject(derivedType); writer.WriteRawValue(json); break; diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Assembly.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Assembly.cs index 85627d0dd8..bcb6bc7fa8 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Assembly.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Assembly.cs @@ -8,22 +8,52 @@ namespace Amazon.JSII.JsonModel.Spec [JsonObject(MemberSerialization = MemberSerialization.OptIn)] public class Assembly : DependencyRoot, IDocumentable { + [JsonObject(MemberSerialization = MemberSerialization.OptIn)] + public class AssemblyRepository + { + public AssemblyRepository(string type, string url) + { + Type = type ?? throw new ArgumentNullException(nameof(type)); + Url = url ?? throw new ArgumentNullException(nameof(url)); + } + + [JsonProperty("type")] + public string Type { get; } + + [JsonProperty("url")] + public string Url { get; } + } + public Assembly ( string name, + string description, + string homepage, + AssemblyRepository repository, + Person author, + string fingerprint, string version, - IDictionary types = null, - Targets targets = null, + string license, + AssemblyTargets targets = null, IDictionary dependencies = null, + Person[] contributors = null, IDictionary bundled = null, + IDictionary types = null, Docs docs = null, Readme readme = null ): base(targets, dependencies) { Name = name ?? throw new ArgumentNullException(nameof(name)); + Description = description ?? throw new ArgumentNullException(nameof(description)); + Homepage = homepage ?? throw new ArgumentNullException(nameof(homepage)); + Repository = repository ?? throw new ArgumentNullException(nameof(repository)); + Author = author ?? throw new ArgumentNullException(nameof(author)); + Fingerprint = fingerprint ?? throw new ArgumentNullException(nameof(fingerprint)); Version = version ?? throw new ArgumentNullException(nameof(version)); - Types = types; + License = license ?? throw new ArgumentNullException(nameof(license)); + Contributors = contributors; Bundled = bundled; + Types = types; Docs = docs; Readme = readme; } @@ -34,16 +64,37 @@ public Assembly [JsonProperty("name")] public string Name { get; } + [JsonProperty("description")] + public string Description { get; } + + [JsonProperty("homepage")] + public string Homepage { get; } + + [JsonProperty("repository")] + public AssemblyRepository Repository { get; } + + [JsonProperty("author")] + public Person Author { get; } + + [JsonProperty("fingerprint")] + public string Fingerprint { get; } + [JsonProperty("version")] public string Version { get; } - [JsonProperty("types", ItemConverterType = typeof(TypeConverter))] - [JsonConverter(typeof(TypeDictionaryConverter))] - public IDictionary Types { get; } + [JsonProperty("license")] + public string License { get; } + + [JsonProperty("contributors", NullValueHandling = NullValueHandling.Ignore)] + public Person[] Contributors { get; } [JsonProperty("bundled", NullValueHandling = NullValueHandling.Ignore)] public IDictionary Bundled { get; } + [JsonProperty("types", ItemConverterType = typeof(TypeConverter))] + [JsonConverter(typeof(TypeDictionaryConverter))] + public IDictionary Types { get; } + [JsonProperty("docs", NullValueHandling = NullValueHandling.Ignore)] public Docs Docs { get; } diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/AssemblyTargets.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/AssemblyTargets.cs new file mode 100644 index 0000000000..57e584b71d --- /dev/null +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/AssemblyTargets.cs @@ -0,0 +1,64 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; + +namespace Amazon.JSII.JsonModel.Spec +{ + [JsonObject(MemberSerialization = MemberSerialization.OptIn)] + public class AssemblyTargets + { + public AssemblyTargets(DotNetTarget dotnet, IDictionary others = null) + { + DotNet = dotnet ?? throw new ArgumentNullException(nameof(dotnet)); + } + + [JsonProperty("dotnet", NullValueHandling = NullValueHandling.Ignore)] + public DotNetTarget DotNet { get; } + + [JsonObject(MemberSerialization = MemberSerialization.OptIn)] + public class DotNetTarget + { + public DotNetTarget + ( + string @namespace, + string packageId, + string title = null, + bool? signAssembly = null, + string assemblyOriginatorKey = null, + string[] tags = null, + string iconUrl = null + ) + { + Namespace = @namespace ?? throw new ArgumentNullException(nameof(@namespace)); + PackageId = packageId ?? throw new ArgumentNullException(nameof(packageId)); + + Title = title; + SignAssembly = signAssembly; + AssemblyOriginatorKey = assemblyOriginatorKey; + Tags = tags; + IconUrl = iconUrl; + } + + [JsonProperty("namespace")] + public string Namespace { get; } + + [JsonProperty("packageId")] + public string PackageId { get; } + + [JsonProperty("title", NullValueHandling = NullValueHandling.Ignore)] + public string Title { get; } + + [JsonProperty("signAssembly", NullValueHandling = NullValueHandling.Ignore)] + public bool? SignAssembly { get; } + + [JsonProperty("assemblyOriginatorKey", NullValueHandling = NullValueHandling.Ignore)] + public string AssemblyOriginatorKey { get; } + + [JsonProperty("tags", NullValueHandling = NullValueHandling.Ignore)] + public string[] Tags { get; } + + [JsonProperty("iconUrl", NullValueHandling = NullValueHandling.Ignore)] + public string IconUrl { get; } + } + } +} diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/DependencyRoot.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/DependencyRoot.cs index ff7af5c841..30edd79aa0 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/DependencyRoot.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/DependencyRoot.cs @@ -8,7 +8,7 @@ public abstract class DependencyRoot { public DependencyRoot ( - Targets targets = null, + AssemblyTargets targets = null, IDictionary dependencies = null ) { @@ -20,6 +20,6 @@ public DependencyRoot public IDictionary Dependencies { get; } [JsonProperty("targets")] - public Targets Targets { get; } + public AssemblyTargets Targets { get; } } } diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/PackageVersion.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/PackageVersion.cs index 55b38a4854..7ffec179ef 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/PackageVersion.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/PackageVersion.cs @@ -10,7 +10,7 @@ public class PackageVersion: DependencyRoot public PackageVersion ( string version, - Targets targets = null, + AssemblyTargets targets = null, IDictionary dependencies = null ): base(targets, dependencies) { diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Person.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Person.cs new file mode 100644 index 0000000000..cba11d02c1 --- /dev/null +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Person.cs @@ -0,0 +1,40 @@ +using Newtonsoft.Json; +using System; + +namespace Amazon.JSII.JsonModel.Spec +{ + [JsonObject(MemberSerialization = MemberSerialization.OptIn)] + public class Person + { + public Person + ( + string name, + string[] roles, + string email = null, + string url = null, + bool? organization = null + ) + { + Name = name ?? throw new ArgumentNullException(nameof(name)); + Roles = roles ?? throw new ArgumentNullException(nameof(roles)); + Email = email; + Url = url; + Organization = organization; + } + + [JsonProperty("name")] + public string Name { get; } + + [JsonProperty("roles")] + public string[] Roles { get; } + + [JsonProperty("email", NullValueHandling = NullValueHandling.Ignore)] + public string Email { get; } + + [JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)] + public string Url { get; } + + [JsonProperty("organization", NullValueHandling = NullValueHandling.Ignore)] + public bool? Organization { get; } + } +} diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Targets.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Targets.cs deleted file mode 100644 index d69de250aa..0000000000 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Targets.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace Amazon.JSII.JsonModel.Spec -{ - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class Targets - { - public Targets(DotNetTarget dotnet, IDictionary others = null) - { - DotNet = dotnet ?? throw new ArgumentNullException(nameof(dotnet)); - } - - [JsonProperty("dotnet", NullValueHandling = NullValueHandling.Ignore)] - public DotNetTarget DotNet { get; } - - [JsonObject(MemberSerialization = MemberSerialization.OptIn)] - public class DotNetTarget - { - public DotNetTarget(string @namespace) - { - Namespace = @namespace ?? throw new ArgumentNullException(nameof(@namespace)); - } - - public static implicit operator DotNetTarget(string @namespace) - { - return new DotNetTarget(@namespace); - } - - public static implicit operator string(DotNetTarget target) - { - return target.Namespace; - } - - [JsonProperty("namespace")] - public string Namespace { get; } - } - } -} diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Client/ClientTests.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Client/ClientTests.cs index d5e7cbda4e..d75f82bc29 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Client/ClientTests.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime.UnitTests/Client/ClientTests.cs @@ -99,7 +99,16 @@ public void LoadsBasicPackage() Assembly assembly = new Assembly ( name: "myName", - targets: new Targets("Dot.Net.Namespace"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[]{ }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "Dot.Net.Namespace", + packageId: "Dot.Net.PackageId" + )), version: "myVersion", types: new Dictionary() ); @@ -123,7 +132,16 @@ public void DoesNotLoadPackageMultipleTimes() Assembly assembly = new Assembly ( name: "myName", - targets: new Targets("Dot.Net.Namespace"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "Dot.Net.Namespace", + packageId: "Dot.Net.PackageId" + )), version: "myVersion", types: new Dictionary() ); @@ -167,7 +185,16 @@ public void SendsAndReceives() Assembly assembly = new Assembly ( name: "myName", - targets: new Targets("Dot.Net.Namespace"), + description: "", + homepage: "", + repository: new Assembly.AssemblyRepository(type: "", url: ""), + author: new Person(name: "", roles: new string[] { }), + fingerprint: "", + license: "", + targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( + @namespace: "Dot.Net.Namespace", + packageId: "Dot.Net.PackageId" + )), version: "myVersion", types: new Dictionary() ); diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Client.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Client.cs index 8a9fddca4a..0a073cd659 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Client.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Services/Client.cs @@ -168,7 +168,7 @@ public void LoadPackage(string package, string version, string tarballPath) return; } - _logger.LogDebug($"Loading package {package}@${version}..."); + _logger.LogDebug($"Loading package {package}@{version}..."); _loadedPackages.Add(package); LoadResponse response = Load(package, version, tarballPath); diff --git a/packages/jsii-dotnet-runtime/src/NuGet.config b/packages/jsii-dotnet-runtime/src/NuGet.config index 1d4bf7e6ba..7958051028 100644 --- a/packages/jsii-dotnet-runtime/src/NuGet.config +++ b/packages/jsii-dotnet-runtime/src/NuGet.config @@ -3,12 +3,6 @@ - - diff --git a/packages/jsii-dotnet-runtime/src/NuGet.config.vs b/packages/jsii-dotnet-runtime/src/NuGet.config.vs new file mode 100644 index 0000000000..f0b88f301d --- /dev/null +++ b/packages/jsii-dotnet-runtime/src/NuGet.config.vs @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/jsii-kernel/test/test.kernel.ts b/packages/jsii-kernel/test/test.kernel.ts index f721623062..0fdde6fd72 100644 --- a/packages/jsii-kernel/test/test.kernel.ts +++ b/packages/jsii-kernel/test/test.kernel.ts @@ -225,7 +225,10 @@ defineTest('naming allows returns the module name for different languages', asyn package: 'software.amazon.jsii.tests.calculator', maven: { groupId: 'software.amazon.jsii.tests', artifactId: 'calculator' } }, - dotnet: { namespace: 'Amazon.JSII.Tests.Calculator' }, + dotnet: { + namespace: 'Amazon.JSII.Tests.Calculator', + packageId: 'Amazon.JSII.Tests.Calculator', + }, js: { npm: 'jsii-calc' } }); test.deepEqual(sandbox.naming({ assembly: '@scope/jsii-calc-lib' }).naming, { @@ -233,7 +236,10 @@ defineTest('naming allows returns the module name for different languages', asyn package: 'software.amazon.jsii.tests.calculator.lib', maven: { groupId: 'software.amazon.jsii.tests', artifactId: 'calculator-lib' } }, - dotnet: { namespace: 'Amazon.JSII.Tests.Calculator.Lib' }, + dotnet: { + namespace: 'Amazon.JSII.Tests.Calculator.Lib', + packageId: 'Amazon.JSII.Tests.Calculator.Lib' + }, js: { npm: '@scope/jsii-calc-lib' } }); }); diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/.jsii index 62ac6482ca..8d8c26712e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/.jsii +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/.jsii @@ -1,5 +1,5 @@ { - "fingerprint": "b+UZfT/No0vxqTQ1n3lIsyw7olqARDbeGj853lNFoE8=", + "fingerprint": "nY7bYOUnP/71hy4cDOOXssKcfB/Oz1tAhMPMw1QcZyI=", "author": { "name": "Amazon Web Services", "organization": true, @@ -12,7 +12,8 @@ "@scope/jsii-calc-base-of-base": { "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", + "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" }, "java": { "maven": { @@ -39,7 +40,8 @@ "schema": "jsii/1.0", "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.Calculator.Base", + "packageId": "Amazon.JSII.Tests.Calculator.Base" }, "java": { "maven": { diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/Amazon.JSII.Tests.Calculator.Base.csproj b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/Amazon.JSII.Tests.Calculator.Base.csproj index 35458d19f4..4763c56482 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/Amazon.JSII.Tests.Calculator.Base.csproj +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/Amazon.JSII.Tests.Calculator.Base.csproj @@ -2,9 +2,13 @@ netstandard2.0 true - - 0.6.4 + Amazon.JSII.Tests.Calculator.Base + @scope/jsii-calc-base + https://github.com/awslabs/jsii.git + https://spdx.org/licenses/$Apache-2.0.html + Amazon Web Services + en-US diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/.jsii index 71a27dff10..e7151a1e23 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/.jsii +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/.jsii @@ -1,5 +1,5 @@ { - "fingerprint": "qwjIHOtTOSWOv5qzVdHj4SDgxmnWYsacVvR7BkAVlo8=", + "fingerprint": "TG5iHDURFXP3eGuVFwCU45xgyr1bMUgsWPdXDH55o4Y=", "author": { "name": "Amazon Web Services", "organization": true, @@ -14,7 +14,8 @@ "@scope/jsii-calc-base-of-base": { "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", + "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" }, "java": { "maven": { @@ -32,7 +33,8 @@ }, "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.Calculator.Base", + "packageId": "Amazon.JSII.Tests.Calculator.Base" }, "java": { "maven": { @@ -59,7 +61,8 @@ "schema": "jsii/1.0", "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Lib" + "namespace": "Amazon.JSII.Tests.Calculator.Lib", + "packageId": "Amazon.JSII.Tests.Calculator.Lib" }, "java": { "maven": { diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Amazon.JSII.Tests.Calculator.Lib.csproj b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Amazon.JSII.Tests.Calculator.Lib.csproj index 05e9e9a7ce..864f101548 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Amazon.JSII.Tests.Calculator.Lib.csproj +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Amazon.JSII.Tests.Calculator.Lib.csproj @@ -2,9 +2,13 @@ netstandard2.0 true - - 0.6.4 + Amazon.JSII.Tests.Calculator.Lib + @scope/jsii-calc-lib + https://github.com/awslabs/jsii.git + https://spdx.org/licenses/$Apache-2.0.html + Amazon Web Services + en-US diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/.jsii index 355277ea09..ea35343e15 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/.jsii +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/.jsii @@ -1,5 +1,5 @@ { - "fingerprint": "nIH7ZdupMWqiPid9t2N934g0BDqSHVKuq6mrGdRpuYk=", + "fingerprint": "4hr7d742QVoXg5SKsc71Byf1QABcdQ0HEixthntx9g4=", "author": { "name": "Amazon Web Services", "organization": true, @@ -40,7 +40,8 @@ "@scope/jsii-calc-base-of-base": { "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", + "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" }, "java": { "maven": { @@ -58,7 +59,8 @@ }, "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.Calculator.Base", + "packageId": "Amazon.JSII.Tests.Calculator.Base" }, "java": { "maven": { @@ -80,7 +82,8 @@ "@scope/jsii-calc-base-of-base": { "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", + "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" }, "java": { "maven": { @@ -98,7 +101,8 @@ }, "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.Calculator.Base", + "packageId": "Amazon.JSII.Tests.Calculator.Base" }, "java": { "maven": { @@ -116,7 +120,8 @@ }, "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Lib" + "namespace": "Amazon.JSII.Tests.Calculator.Lib", + "packageId": "Amazon.JSII.Tests.Calculator.Lib" }, "java": { "maven": { @@ -146,7 +151,8 @@ "schema": "jsii/1.0", "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator" + "namespace": "Amazon.JSII.Tests.Calculator", + "packageId": "Amazon.JSII.Tests.Calculator" }, "java": { "maven": { diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Amazon.JSII.Tests.Calculator.csproj b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Amazon.JSII.Tests.Calculator.csproj index 4945db4766..a6e6b02901 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Amazon.JSII.Tests.Calculator.csproj +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Amazon.JSII.Tests.Calculator.csproj @@ -2,9 +2,13 @@ netstandard2.0 true - - 0.6.4 + Amazon.JSII.Tests.Calculator + jsii-calc + https://github.com/awslabs/jsii.git + https://spdx.org/licenses/$Apache-2.0.html + Amazon Web Services + en-US From 2bd4319327186f0621818aead496ff34c6bd090f Mon Sep 17 00:00:00 2001 From: Matthew Pirocchi Date: Thu, 9 Aug 2018 16:27:11 -0700 Subject: [PATCH 2/7] Fix test expectations. --- .../Amazon.JSII.Tests.Calculator.Base.csproj | 2 +- .../Amazon.JSII.Tests.Calculator.Lib.csproj | 2 +- .../Amazon.JSII.Tests.Calculator.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/Amazon.JSII.Tests.Calculator.Base.csproj b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/Amazon.JSII.Tests.Calculator.Base.csproj index 4763c56482..be2e60e824 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/Amazon.JSII.Tests.Calculator.Base.csproj +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/Amazon.JSII.Tests.Calculator.Base.csproj @@ -6,7 +6,7 @@ Amazon.JSII.Tests.Calculator.Base @scope/jsii-calc-base https://github.com/awslabs/jsii.git - https://spdx.org/licenses/$Apache-2.0.html + https://spdx.org/licenses/Apache-2.0.html Amazon Web Services en-US diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Amazon.JSII.Tests.Calculator.Lib.csproj b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Amazon.JSII.Tests.Calculator.Lib.csproj index 864f101548..b26b419134 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Amazon.JSII.Tests.Calculator.Lib.csproj +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Amazon.JSII.Tests.Calculator.Lib.csproj @@ -6,7 +6,7 @@ Amazon.JSII.Tests.Calculator.Lib @scope/jsii-calc-lib https://github.com/awslabs/jsii.git - https://spdx.org/licenses/$Apache-2.0.html + https://spdx.org/licenses/Apache-2.0.html Amazon Web Services en-US diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Amazon.JSII.Tests.Calculator.csproj b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Amazon.JSII.Tests.Calculator.csproj index a6e6b02901..032bc6709f 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Amazon.JSII.Tests.Calculator.csproj +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Amazon.JSII.Tests.Calculator.csproj @@ -6,7 +6,7 @@ Amazon.JSII.Tests.Calculator jsii-calc https://github.com/awslabs/jsii.git - https://spdx.org/licenses/$Apache-2.0.html + https://spdx.org/licenses/Apache-2.0.html Amazon Web Services en-US From 19f9ef88b6ee8a8c2dcda154d91a7273886afd5a Mon Sep 17 00:00:00 2001 From: Matthew Pirocchi Date: Fri, 10 Aug 2018 15:41:26 -0700 Subject: [PATCH 3/7] Address feedback from code review, and allow dotnet packages to have different names than their root namespaces. --- packages/jsii-calc-base-of-base/package.json | 5 +- .../jsii-calc-base-of-base/test/assembly.jsii | 8 +- packages/jsii-calc-base/package.json | 5 +- packages/jsii-calc-base/test/assembly.jsii | 12 +-- packages/jsii-calc-lib/package.json | 5 +- packages/jsii-calc-lib/test/assembly.jsii | 16 ++-- packages/jsii-calc/package.json | 5 +- packages/jsii-calc/test/assembly.jsii | 28 +++---- .../AssemblyExtensionsTests.cs | 66 ++++------------ .../AssemblyGeneratorTests.cs | 77 ++++++++++--------- .../SymbolMapTests.cs | 2 +- .../AssemblyExtensions.cs | 52 ++++++++----- .../AssemblyGenerator.cs | 4 +- .../DependencyRootExtensions.cs | 42 ++++------ .../src/Amazon.JSII.Generator/SymbolMap.cs | 2 +- .../src/Amazon.JSII.Generator/TypeMetadata.cs | 2 +- .../Spec/AssemblyTests.cs | 32 -------- .../Spec/AssemblyTargets.cs | 5 -- ...mazon.JSII.Runtime.IntegrationTests.csproj | 2 +- .../ComplianceTests.cs | 30 ++++---- .../Amazon.JSII.Runtime.csproj | 1 - packages/jsii-kernel/test/test.kernel.ts | 8 +- packages/jsii-pacmak/lib/targets/dotnet.ts | 6 +- .../.jsii | 12 +-- ....CalculatorPackageId.BasePackageId.csproj} | 6 +- .../BaseNamespace/Base.cs} | 12 +-- .../BaseNamespace}/BaseProps.cs | 4 +- .../BaseNamespace}/BasePropsProxy.cs | 4 +- .../BaseNamespace}/IBaseProps.cs | 4 +- .../AssemblyInfo.cs | 0 .../scope-jsii-calc-base-0.6.4.tgz | 0 .../test/expected.jsii-calc-base/java/pom.xml | 2 +- .../.jsii | 16 ++-- ...s.CalculatorPackageId.LibPackageId.csproj} | 8 +- .../LibNamespace}/EnumFromScopedModule.cs | 2 +- .../LibNamespace}/IFriendlyProxy.cs | 2 +- .../LibNamespace}/IIFriendly.cs | 2 +- .../LibNamespace}/IMyFirstStruct.cs | 2 +- .../LibNamespace}/IStructWithOnlyOptionals.cs | 2 +- .../LibNamespace}/MyFirstStruct.cs | 2 +- .../LibNamespace}/MyFirstStructProxy.cs | 2 +- .../LibNamespace}/Number.cs | 2 +- .../LibNamespace}/Operation.cs | 2 +- .../LibNamespace}/StructWithOnlyOptionals.cs | 2 +- .../StructWithOnlyOptionalsProxy.cs | 2 +- .../LibNamespace}/Value_.cs | 6 +- .../AssemblyInfo.cs | 0 .../scope-jsii-calc-lib-0.6.4.tgz | 0 .../test/expected.jsii-calc-lib/java/pom.xml | 2 +- .../Amazon.JSII.Tests.Calculator.csproj | 24 ------ .../.jsii | 28 +++---- ...azon.JSII.Tests.CalculatorPackageId.csproj | 24 ++++++ .../JSII/Tests/CalculatorNamespace}/Add.cs | 4 +- .../Tests/CalculatorNamespace}/AllTypes.cs | 4 +- .../CalculatorNamespace}/AllTypesEnum.cs | 2 +- .../AllowedMethodNames.cs | 2 +- .../AsyncVirtualMethods.cs | 2 +- .../CalculatorNamespace}/BinaryOperation.cs | 4 +- .../Tests/CalculatorNamespace/Calculator.cs} | 16 ++-- .../CalculatorNamespace}/CalculatorProps.cs | 2 +- .../CalculatorPropsProxy.cs | 2 +- .../DerivedClassHasNoProperties/Base.cs | 2 +- .../DerivedClassHasNoProperties/Derived.cs | 4 +- .../CalculatorNamespace}/DerivedStruct.cs | 4 +- .../DerivedStructProxy.cs | 4 +- .../CalculatorNamespace}/DoubleTrouble.cs | 2 +- .../CalculatorNamespace}/GiveMeStructs.cs | 4 +- .../CalculatorNamespace}/ICalculatorProps.cs | 2 +- .../CalculatorNamespace}/IDerivedStruct.cs | 4 +- .../CalculatorNamespace}/IFriendlierProxy.cs | 2 +- .../IFriendlyRandomGeneratorProxy.cs | 2 +- .../CalculatorNamespace}/IIFriendlier.cs | 4 +- .../IIFriendlyRandomGenerator.cs | 4 +- .../IIInterfaceWithProperties.cs | 2 +- .../IIInterfaceWithPropertiesExtension.cs | 2 +- .../IIRandomNumberGenerator.cs | 2 +- .../IImplictBaseOfBase.cs | 4 +- .../IInterfaceWithProperties.cs | 2 +- .../IInterfaceWithPropertiesExtension.cs | 2 +- .../IInterfaceWithPropertiesExtensionProxy.cs | 2 +- .../IInterfaceWithPropertiesProxy.cs | 2 +- .../IRandomNumberGeneratorProxy.cs | 2 +- .../CalculatorNamespace}/IReturnsNumber.cs | 2 +- .../CalculatorNamespace}/IUnionProperties.cs | 2 +- .../CalculatorNamespace}/ImplictBaseOfBase.cs | 4 +- .../ImplictBaseOfBaseProxy.cs | 4 +- .../JSObjectLiteralForInterface.cs | 4 +- .../JSObjectLiteralToNative.cs | 2 +- .../JSObjectLiteralToNativeClass.cs | 2 +- .../CalculatorNamespace}/JavaReservedWords.cs | 2 +- .../Tests/CalculatorNamespace}/Multiply.cs | 4 +- .../JSII/Tests/CalculatorNamespace}/Negate.cs | 4 +- .../NodeStandardLibrary.cs | 2 +- .../CalculatorNamespace}/NumberGenerator.cs | 2 +- .../ObjectRefsInCollections.cs | 4 +- .../OverrideReturnsObject.cs | 2 +- .../CalculatorNamespace}/Polymorphism.cs | 4 +- .../JSII/Tests/CalculatorNamespace}/Power.cs | 6 +- .../ReferenceEnumFromScopedPackage.cs | 4 +- .../ReturnsNumberProxy.cs | 2 +- .../RuntimeTypeChecking.cs | 2 +- .../Tests/CalculatorNamespace}/Statics.cs | 2 +- .../Tests/CalculatorNamespace}/StringEnum.cs | 2 +- .../JSII/Tests/CalculatorNamespace}/Sum.cs | 6 +- .../SyncVirtualMethods.cs | 2 +- .../Tests/CalculatorNamespace}/Thrower.cs | 2 +- .../CalculatorNamespace}/UnaryOperation.cs | 4 +- .../CalculatorNamespace}/UnionProperties.cs | 2 +- .../UnionPropertiesProxy.cs | 2 +- .../UseBundledDependency.cs | 2 +- .../Tests/CalculatorNamespace}/UseCalcBase.cs | 8 +- .../UsesInterfaceWithProperties.cs | 2 +- .../CalculatorNamespace}/VariadicMethod.cs | 2 +- .../VirtualMethodPlayground.cs | 2 +- .../composition/CompositeOperation.cs | 4 +- .../composition/CompositionStringStyle.cs | 2 +- .../AssemblyInfo.cs | 0 .../jsii-calc-0.6.4.tgz | 0 .../test/expected.jsii-calc/java/pom.xml | 2 +- packages/jsii-ruby-runtime/package.json | 35 --------- 120 files changed, 361 insertions(+), 463 deletions(-) rename packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/{Amazon.JSII.Tests.Calculator.Base => Amazon.JSII.Tests.CalculatorPackageId.BasePackageId}/.jsii (84%) rename packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/{Amazon.JSII.Tests.Calculator.Base/Amazon.JSII.Tests.Calculator.Base.csproj => Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj} (70%) rename packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/{Amazon.JSII.Tests.Calculator.Base/Base_.cs => Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/Base.cs} (56%) rename packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/{Amazon.JSII.Tests.Calculator.Base => Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace}/BaseProps.cs (76%) rename packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/{Amazon.JSII.Tests.Calculator.Base => Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace}/BasePropsProxy.cs (85%) rename packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/{Amazon.JSII.Tests.Calculator.Base => Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace}/IBaseProps.cs (70%) rename packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/{Amazon.JSII.Tests.Calculator.Base => Amazon.JSII.Tests.CalculatorPackageId.BasePackageId}/AssemblyInfo.cs (100%) rename packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/{Amazon.JSII.Tests.Calculator.Base => Amazon.JSII.Tests.CalculatorPackageId.BasePackageId}/scope-jsii-calc-base-0.6.4.tgz (100%) rename packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/{Amazon.JSII.Tests.Calculator.Lib => Amazon.JSII.Tests.CalculatorPackageId.LibPackageId}/.jsii (92%) rename packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/{Amazon.JSII.Tests.Calculator.Lib/Amazon.JSII.Tests.Calculator.Lib.csproj => Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj} (63%) rename packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/{Amazon.JSII.Tests.Calculator.Lib => Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace}/EnumFromScopedModule.cs (87%) rename packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/{Amazon.JSII.Tests.Calculator.Lib => Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace}/IFriendlyProxy.cs (92%) rename packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/{Amazon.JSII.Tests.Calculator.Lib => Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace}/IIFriendly.cs (89%) rename packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/{Amazon.JSII.Tests.Calculator.Lib => Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace}/IMyFirstStruct.cs (93%) rename packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/{Amazon.JSII.Tests.Calculator.Lib => Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace}/IStructWithOnlyOptionals.cs (93%) rename packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/{Amazon.JSII.Tests.Calculator.Lib => Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace}/MyFirstStruct.cs (93%) rename packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/{Amazon.JSII.Tests.Calculator.Lib => Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace}/MyFirstStructProxy.cs (95%) rename packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/{Amazon.JSII.Tests.Calculator.Lib => Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace}/Number.cs (94%) rename packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/{Amazon.JSII.Tests.Calculator.Lib => Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace}/Operation.cs (91%) rename packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/{Amazon.JSII.Tests.Calculator.Lib => Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace}/StructWithOnlyOptionals.cs (92%) rename packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/{Amazon.JSII.Tests.Calculator.Lib => Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace}/StructWithOnlyOptionalsProxy.cs (95%) rename packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/{Amazon.JSII.Tests.Calculator.Lib => Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace}/Value_.cs (85%) rename packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/{Amazon.JSII.Tests.Calculator.Lib => Amazon.JSII.Tests.CalculatorPackageId.LibPackageId}/AssemblyInfo.cs (100%) rename packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/{Amazon.JSII.Tests.Calculator.Lib => Amazon.JSII.Tests.CalculatorPackageId.LibPackageId}/scope-jsii-calc-lib-0.6.4.tgz (100%) delete mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Amazon.JSII.Tests.Calculator.csproj rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId}/.jsii (98%) create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon.JSII.Tests.CalculatorPackageId.csproj rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/Add.cs (91%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/AllTypes.cs (98%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/AllTypesEnum.cs (87%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/AllowedMethodNames.cs (97%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/AsyncVirtualMethods.cs (97%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/BinaryOperation.cs (92%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator/Calculator_.cs => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs} (86%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/CalculatorProps.cs (91%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/CalculatorPropsProxy.cs (94%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/DerivedClassHasNoProperties/Base.cs (89%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/DerivedClassHasNoProperties/Derived.cs (68%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/DerivedStruct.cs (95%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/DerivedStructProxy.cs (96%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/DoubleTrouble.cs (95%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/GiveMeStructs.cs (94%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/ICalculatorProps.cs (92%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/IDerivedStruct.cs (92%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/IFriendlierProxy.cs (95%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/IFriendlyRandomGeneratorProxy.cs (94%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/IIFriendlier.cs (84%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/IIFriendlyRandomGenerator.cs (68%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/IIInterfaceWithProperties.cs (91%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/IIInterfaceWithPropertiesExtension.cs (88%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/IIRandomNumberGenerator.cs (90%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/IImplictBaseOfBase.cs (75%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/IInterfaceWithProperties.cs (90%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/IInterfaceWithPropertiesExtension.cs (92%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/IInterfaceWithPropertiesExtensionProxy.cs (95%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/IInterfaceWithPropertiesProxy.cs (94%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/IRandomNumberGeneratorProxy.cs (93%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/IReturnsNumber.cs (89%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/IUnionProperties.cs (92%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/ImplictBaseOfBase.cs (83%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/ImplictBaseOfBaseProxy.cs (89%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/JSObjectLiteralForInterface.cs (90%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/JSObjectLiteralToNative.cs (94%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/JSObjectLiteralToNativeClass.cs (95%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/JavaReservedWords.cs (99%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/Multiply.cs (94%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/Negate.cs (94%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/NodeStandardLibrary.cs (97%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/NumberGenerator.cs (96%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/ObjectRefsInCollections.cs (93%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/OverrideReturnsObject.cs (94%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/Polymorphism.cs (87%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/Power.cs (89%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/ReferenceEnumFromScopedPackage.cs (93%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/ReturnsNumberProxy.cs (93%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/RuntimeTypeChecking.cs (95%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/Statics.cs (98%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/StringEnum.cs (84%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/Sum.cs (87%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/SyncVirtualMethods.cs (98%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/Thrower.cs (92%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/UnaryOperation.cs (88%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/UnionProperties.cs (91%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/UnionPropertiesProxy.cs (94%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/UseBundledDependency.cs (93%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/UseCalcBase.cs (74%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/UsesInterfaceWithProperties.cs (97%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/VariadicMethod.cs (95%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/VirtualMethodPlayground.cs (97%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/composition/CompositeOperation.cs (95%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace}/composition/CompositionStringStyle.cs (86%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId}/AssemblyInfo.cs (100%) rename packages/jsii-pacmak/test/expected.jsii-calc/dotnet/{Amazon.JSII.Tests.Calculator => Amazon.JSII.Tests.CalculatorPackageId}/jsii-calc-0.6.4.tgz (100%) delete mode 100644 packages/jsii-ruby-runtime/package.json diff --git a/packages/jsii-calc-base-of-base/package.json b/packages/jsii-calc-base-of-base/package.json index 5c4ffb12e6..73cb64bb8b 100644 --- a/packages/jsii-calc-base-of-base/package.json +++ b/packages/jsii-calc-base-of-base/package.json @@ -1,6 +1,7 @@ { "name": "@scope/jsii-calc-base-of-base", "version": "0.6.4", + "description": "An example transitive dependency for jsii-calc.", "main": "lib/index.js", "types": "lib/index.d.ts", "private": true, @@ -15,8 +16,8 @@ } }, "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", - "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, "sphinx": {} } diff --git a/packages/jsii-calc-base-of-base/test/assembly.jsii b/packages/jsii-calc-base-of-base/test/assembly.jsii index 1951e5e429..6b1107cac9 100644 --- a/packages/jsii-calc-base-of-base/test/assembly.jsii +++ b/packages/jsii-calc-base-of-base/test/assembly.jsii @@ -1,5 +1,5 @@ { - "fingerprint": "4UjBtqw6VsSJSEq49KOthIVWab5cZb3gjgvF7DPh2dk=", + "fingerprint": "2YF/qObQgbuJSs52vT9/Z7sgEO0mc2zP0jCuFWGUM4w=", "author": { "name": "Amazon Web Services", "organization": true, @@ -8,7 +8,7 @@ ], "url": "https://aws.amazon.com" }, - "description": "@scope/jsii-calc-base-of-base", + "description": "An example transitive dependency for jsii-calc.", "homepage": "https://github.com/awslabs/jsii.git", "license": "Apache-2.0", "name": "@scope/jsii-calc-base-of-base", @@ -19,8 +19,8 @@ "schema": "jsii/1.0", "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", - "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, "java": { "maven": { diff --git a/packages/jsii-calc-base/package.json b/packages/jsii-calc-base/package.json index 696d1a7a2c..fed8d3ffcd 100644 --- a/packages/jsii-calc-base/package.json +++ b/packages/jsii-calc-base/package.json @@ -1,6 +1,7 @@ { "name": "@scope/jsii-calc-base", "version": "0.6.4", + "description": "An example direct dependency for jsii-calc.", "main": "lib/index.js", "types": "lib/index.d.ts", "private": true, @@ -15,8 +16,8 @@ } }, "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base", - "packageId": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId" }, "sphinx": {} } diff --git a/packages/jsii-calc-base/test/assembly.jsii b/packages/jsii-calc-base/test/assembly.jsii index 8d8c26712e..b7c02873bc 100644 --- a/packages/jsii-calc-base/test/assembly.jsii +++ b/packages/jsii-calc-base/test/assembly.jsii @@ -1,5 +1,5 @@ { - "fingerprint": "nY7bYOUnP/71hy4cDOOXssKcfB/Oz1tAhMPMw1QcZyI=", + "fingerprint": "3lcys0/Cd5ZbPR/CXccsL3Fdb66mNsVBs8jb+ySL0oU=", "author": { "name": "Amazon Web Services", "organization": true, @@ -12,8 +12,8 @@ "@scope/jsii-calc-base-of-base": { "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", - "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, "java": { "maven": { @@ -29,7 +29,7 @@ "version": "0.6.4" } }, - "description": "@scope/jsii-calc-base", + "description": "An example direct dependency for jsii-calc.", "homepage": "https://github.com/awslabs/jsii.git", "license": "Apache-2.0", "name": "@scope/jsii-calc-base", @@ -40,8 +40,8 @@ "schema": "jsii/1.0", "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base", - "packageId": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId" }, "java": { "maven": { diff --git a/packages/jsii-calc-lib/package.json b/packages/jsii-calc-lib/package.json index afb117cded..d76f389a16 100644 --- a/packages/jsii-calc-lib/package.json +++ b/packages/jsii-calc-lib/package.json @@ -1,6 +1,7 @@ { "name": "@scope/jsii-calc-lib", "version": "0.6.4", + "description": "A simple calcuator library built on JSII.", "main": "lib/index.js", "types": "lib/index.d.ts", "private": true, @@ -15,8 +16,8 @@ } }, "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Lib", - "packageId": "Amazon.JSII.Tests.Calculator.Lib" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.LibNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.LibPackageId" }, "sphinx": {} } diff --git a/packages/jsii-calc-lib/test/assembly.jsii b/packages/jsii-calc-lib/test/assembly.jsii index e7151a1e23..0dcc1f95b7 100644 --- a/packages/jsii-calc-lib/test/assembly.jsii +++ b/packages/jsii-calc-lib/test/assembly.jsii @@ -1,5 +1,5 @@ { - "fingerprint": "TG5iHDURFXP3eGuVFwCU45xgyr1bMUgsWPdXDH55o4Y=", + "fingerprint": "euaH0hTUT38hFuqtItWxu9uK4iO1iSCGEHecTSHwY5o=", "author": { "name": "Amazon Web Services", "organization": true, @@ -14,8 +14,8 @@ "@scope/jsii-calc-base-of-base": { "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", - "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, "java": { "maven": { @@ -33,8 +33,8 @@ }, "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base", - "packageId": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId" }, "java": { "maven": { @@ -50,7 +50,7 @@ "version": "0.6.4" } }, - "description": "@scope/jsii-calc-lib", + "description": "A simple calcuator library built on JSII.", "homepage": "https://github.com/awslabs/jsii.git", "license": "Apache-2.0", "name": "@scope/jsii-calc-lib", @@ -61,8 +61,8 @@ "schema": "jsii/1.0", "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Lib", - "packageId": "Amazon.JSII.Tests.Calculator.Lib" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.LibNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.LibPackageId" }, "java": { "maven": { diff --git a/packages/jsii-calc/package.json b/packages/jsii-calc/package.json index fac5c56bcf..9911aaffdd 100644 --- a/packages/jsii-calc/package.json +++ b/packages/jsii-calc/package.json @@ -1,6 +1,7 @@ { "name": "jsii-calc", "version": "0.6.4", + "description": "A simple calcuator built on JSII.", "main": "lib/index.js", "types": "lib/index.d.ts", "private": true, @@ -15,8 +16,8 @@ } }, "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator", - "packageId": "Amazon.JSII.Tests.Calculator" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId" }, "sphinx": {} } diff --git a/packages/jsii-calc/test/assembly.jsii b/packages/jsii-calc/test/assembly.jsii index ea35343e15..26bbaf49c2 100644 --- a/packages/jsii-calc/test/assembly.jsii +++ b/packages/jsii-calc/test/assembly.jsii @@ -1,5 +1,5 @@ { - "fingerprint": "4hr7d742QVoXg5SKsc71Byf1QABcdQ0HEixthntx9g4=", + "fingerprint": "TTYo91AyKTcjF5jv1DjNFwJ1qLxMdEUIY8f3WkFycBQ=", "author": { "name": "Amazon Web Services", "organization": true, @@ -40,8 +40,8 @@ "@scope/jsii-calc-base-of-base": { "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", - "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, "java": { "maven": { @@ -59,8 +59,8 @@ }, "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base", - "packageId": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId" }, "java": { "maven": { @@ -82,8 +82,8 @@ "@scope/jsii-calc-base-of-base": { "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", - "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, "java": { "maven": { @@ -101,8 +101,8 @@ }, "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base", - "packageId": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId" }, "java": { "maven": { @@ -120,8 +120,8 @@ }, "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Lib", - "packageId": "Amazon.JSII.Tests.Calculator.Lib" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.LibNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.LibPackageId" }, "java": { "maven": { @@ -137,7 +137,7 @@ "version": "0.6.4" } }, - "description": "jsii-calc", + "description": "A simple calcuator built on JSII.", "homepage": "https://github.com/awslabs/jsii.git", "license": "Apache-2.0", "name": "jsii-calc", @@ -151,8 +151,8 @@ "schema": "jsii/1.0", "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator", - "packageId": "Amazon.JSII.Tests.Calculator" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId" }, "java": { "maven": { diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyExtensionsTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyExtensionsTests.cs index 215b8aeb6c..a19af00cc9 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyExtensionsTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyExtensionsTests.cs @@ -18,8 +18,8 @@ public class GetNativeName [Fact(DisplayName = _Prefix + nameof(ThrowsOnNullAssembly))] public void ThrowsOnNullAssembly() { - ArgumentNullException exception = Assert.Throws(() => ((Assembly)null).GetNativeName()); - Assert.Equal("root", exception.ParamName); + ArgumentNullException exception = Assert.Throws(() => ((Assembly)null).GetNativeNamespace()); + Assert.Equal("assembly", exception.ParamName); } [Fact(DisplayName = _Prefix + nameof(ThrowsOnMissingDotNetKey))] @@ -38,8 +38,8 @@ public void ThrowsOnMissingDotNetKey() types: new Dictionary() ); - ArgumentException exception = Assert.Throws(() => assembly.GetNativeName()); - Assert.Equal("root", exception.ParamName); + ArgumentException exception = Assert.Throws(() => assembly.GetNativeNamespace()); + Assert.Equal("assembly", exception.ParamName); } [Fact(DisplayName = _Prefix + nameof(ThrowsOnEmptyDotNetNamespace))] @@ -61,8 +61,8 @@ public void ThrowsOnEmptyDotNetNamespace() types: new Dictionary() ); - ArgumentException exception = Assert.Throws(() => assembly.GetNativeName()); - Assert.Equal("root", exception.ParamName); + ArgumentException exception = Assert.Throws(() => assembly.GetNativeNamespace()); + Assert.Equal("assembly", exception.ParamName); } [Fact(DisplayName = _Prefix + nameof(RetrievesDotNetName))] @@ -84,7 +84,7 @@ public void RetrievesDotNetName() types: new Dictionary() ); - string actual = assembly.GetNativeName(); + string actual = assembly.GetNativeNamespace(); Assert.Equal("myNativeName", actual); } } @@ -96,46 +96,10 @@ public class GetNativeName_WithPackage [Fact(DisplayName = _Prefix + nameof(ThrowsOnNullAssembly))] public void ThrowsOnNullAssembly() { - ArgumentNullException exception = Assert.Throws(() => ((Assembly)null).GetNativeName("myPackage")); + ArgumentNullException exception = Assert.Throws(() => ((Assembly)null).GetNativeNamespace("myPackage")); Assert.Equal("assembly", exception.ParamName); } - [Fact(DisplayName = _Prefix + nameof(ThrowsOnNullPackage))] - public void ThrowsOnNullPackage() - { - Assembly assembly = new Assembly( - name: "myName", - description: "", - homepage: "", - repository: new Assembly.AssemblyRepository(type: "", url: ""), - author: new Person(name: "", roles: new string[] { }), - fingerprint: "", - license: "", - targets: new AssemblyTargets(new AssemblyTargets.DotNetTarget( - @namespace: "myNativeName", - packageId: "myPackageId1" - )), - dependencies: new Dictionary - { - { - "myPackage", - new PackageVersion( - "0.0.1", - new AssemblyTargets(new AssemblyTargets.DotNetTarget( - @namespace: "myPackageNativeName", - packageId: "myPackageId2" - )) - ) - } - }, - version: "myVersion", - types: new Dictionary() - ); - - ArgumentNullException exception = Assert.Throws(() => assembly.GetNativeName(null)); - Assert.Equal("packageName", exception.ParamName); - } - [Fact(DisplayName = _Prefix + nameof(ThrowsOnMissingPackage))] public void ThrowsOnMissingPackage() { @@ -169,7 +133,7 @@ public void ThrowsOnMissingPackage() types: new Dictionary() ); - ArgumentException exception = Assert.Throws(() => assembly.GetNativeName("notMyPackage")); + ArgumentException exception = Assert.Throws(() => assembly.GetNativeNamespace("notMyPackage")); Assert.Equal("assembly", exception.ParamName); } @@ -199,8 +163,8 @@ public void ThrowsOnMissingDotNetKey() types: new Dictionary() ); - ArgumentException exception = Assert.Throws(() => assembly.GetNativeName("myPackage")); - Assert.Equal("root", exception.ParamName); + ArgumentException exception = Assert.Throws(() => assembly.GetNativeNamespace("myPackage")); + Assert.Equal("assembly", exception.ParamName); } [Fact(DisplayName = _Prefix + nameof(ThrowsOnEmptyDotNetKey))] @@ -235,8 +199,8 @@ public void ThrowsOnEmptyDotNetKey() types: new Dictionary() ); - ArgumentException exception = Assert.Throws(() => assembly.GetNativeName("myPackage")); - Assert.Equal("root", exception.ParamName); + ArgumentException exception = Assert.Throws(() => assembly.GetNativeNamespace("myPackage")); + Assert.Equal("assembly", exception.ParamName); } [Fact(DisplayName = _Prefix + nameof(RetrievesDotNetName))] @@ -271,7 +235,7 @@ public void RetrievesDotNetName() types: new Dictionary() ); - string actual = assembly.GetNativeName("myPackage"); + string actual = assembly.GetNativeNamespace("myPackage"); Assert.Equal("myPackageNativeName", actual); } } @@ -305,7 +269,6 @@ public void IncludesAllPresentProperties() title: "My Human Readable Title", signAssembly: true, assemblyOriginatorKey: "key.snk", - tags: new[] { "tag1", "tag2" }, iconUrl: "https://www.example.com/icon.svg" )) ); @@ -323,7 +286,6 @@ public void IncludesAllPresentProperties() element => Assert.Equal("My Human Readable Title", element.ToString()), element => Assert.Equal("true", element.ToString()), element => Assert.Equal("key.snk", element.ToString()), - element => Assert.Equal("tag1 tag2", element.ToString()), element => Assert.Equal("http://www.example.com/icon.svg", element.ToString()) ); } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyGeneratorTests.cs index f2b259f8a8..6dae151662 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/AssemblyGeneratorTests.cs @@ -29,9 +29,10 @@ static string GetProjectFilePath(string dotnetPackage, string dotnetAssembly) return $"{Path.Combine(GetPackageOutputRoot(dotnetPackage), dotnetAssembly)}.csproj"; } - static string GetTypeFilePath(string dotnetPackage, string dotnetType) + static string GetTypeFilePath(string dotnetPackage, string dotnetNamespace, string dotnetType) { - return $"{Path.Combine(GetPackageOutputRoot(dotnetPackage), dotnetType)}.cs"; + string directory = Path.Combine(GetPackageOutputRoot(dotnetPackage), Path.Combine(dotnetNamespace.Split('.'))); + return $"{Path.Combine(directory, dotnetType)}.cs"; } [Fact(DisplayName = Prefix + nameof(AccessesFileSystemThroughShim))] @@ -54,8 +55,8 @@ public void AccessesFileSystemThroughShim() ""license"": """", ""targets"": { ""dotnet"": { - ""namespace"": ""Aws.Cdk.CxApi"", - ""packageId"": ""Aws.Cdk.CxApi"" + ""namespace"": ""Aws.Cdk.CxApiNamespace"", + ""packageId"": ""Aws.Cdk.CxApiPackageId"" } }, ""version"": """", @@ -74,9 +75,9 @@ public void AccessesFileSystemThroughShim() }"; string jsonPath = GetJsonPath("aws-cdk-cx-api"); - string packageOutputRoot = GetPackageOutputRoot("Aws.Cdk.CxApi"); - string projectFilePath = GetProjectFilePath("Aws.Cdk.CxApi", "Aws.Cdk.CxApi"); - string typeFilePath = GetTypeFilePath("Aws.Cdk.CxApi", "MissingContext"); + string packageOutputRoot = GetPackageOutputRoot("Aws.Cdk.CxApiPackageId"); + string projectFilePath = GetProjectFilePath("Aws.Cdk.CxApiPackageId", "Aws.Cdk.CxApiPackageId"); + string typeFilePath = GetTypeFilePath("Aws.Cdk.CxApiPackageId", "Aws.Cdk.CxApiNamespace", "MissingContext"); IDirectory directory = Substitute.For(); directory.Exists(packageOutputRoot).Returns(true, false); @@ -88,9 +89,9 @@ public void AccessesFileSystemThroughShim() fileSystem.Directory.Returns(directory); fileSystem.File.Returns(file); - Symbols.MapTypeToPackage("aws-cdk-cx-api", "Aws.Cdk.CxApi"); - Symbols.MapNamespace("jsii$aws_cdk_cx_api$", "Aws.Cdk.CxApi"); - Symbols.MapTypeName("jsii$aws_cdk_cx_api$.MissingContext", "MissingContext", JsonModel.Spec.TypeKind.Class); + //Symbols.MapTypeToPackage("aws-cdk-cx-api", "Aws.Cdk.CxApi"); + Symbols.MapNamespace("jsii$aws_cdk_cx_api$", "Aws.Cdk.CxApiNamespace"); + Symbols.MapTypeName("jsii$aws_cdk_cx_api$.MissingContext", "MissingContext", TypeKind.Class); AssemblyGenerator generator = new AssemblyGenerator ( @@ -131,8 +132,8 @@ public void CopiesJsiiToOutput() ""license"": """", ""targets"": { ""dotnet"": { - ""namespace"": ""Aws.Cdk.CxApi"", - ""packageId"": ""Aws.Cdk.CxApi"" + ""namespace"": ""Aws.Cdk.CxApiNamespace"", + ""packageId"": ""Aws.Cdk.CxApiPackageId"" } }, ""version"": """", @@ -149,7 +150,7 @@ public void CopiesJsiiToOutput() fileSystem.Directory.Returns(Substitute.For()); fileSystem.File.Returns(file); - Symbols.MapTypeToPackage("aws-cdk-cx-api", "Aws.Cdk.CxApi"); + Symbols.MapTypeToPackage("aws-cdk-cx-api", "Aws.Cdk.CxApiPackageId"); AssemblyGenerator generator = new AssemblyGenerator ( @@ -163,7 +164,7 @@ public void CopiesJsiiToOutput() Symbols ); - file.Received().Copy(jsonPath, Path.Combine(OutputRoot, "Aws.Cdk.CxApi", ".jsii")); + file.Received().Copy(jsonPath, Path.Combine(OutputRoot, "Aws.Cdk.CxApiPackageId", ".jsii")); } [Fact(DisplayName = Prefix + nameof(CreatesBasicProjectFile))] @@ -186,8 +187,8 @@ public void CreatesBasicProjectFile() ""license"": """", ""targets"": { ""dotnet"": { - ""namespace"": ""Aws.Cdk.CxApi"", - ""packageId"": ""Aws.Cdk.CxApi"" + ""namespace"": ""Aws.Cdk.CxApiNamespace"", + ""packageId"": ""Aws.Cdk.CxApiPackageId"" } }, ""version"": ""1.2.3"", @@ -195,7 +196,7 @@ public void CreatesBasicProjectFile() }"; string jsonPath = GetJsonPath("aws-cdk-cx-api"); - string projectFilePath = GetProjectFilePath("Aws.Cdk.CxApi", "Aws.Cdk.CxApi"); + string projectFilePath = GetProjectFilePath("Aws.Cdk.CxApiPackageId", "Aws.Cdk.CxApiPackageId"); IFile file = Substitute.For(); file.ReadAllText(jsonPath).Returns(json); @@ -204,7 +205,7 @@ public void CreatesBasicProjectFile() fileSystem.Directory.Returns(Substitute.For()); fileSystem.File.Returns(file); - Symbols.MapTypeToPackage("aws-cdk-cx-api", "Aws.Cdk.CxApi"); + Symbols.MapTypeToPackage("aws-cdk-cx-api", "Aws.Cdk.CxApiPackageId"); AssemblyGenerator generator = new AssemblyGenerator ( @@ -257,8 +258,8 @@ public void CreatesProjectFileWithDependencies() ""license"": """", ""targets"": { ""dotnet"": { - ""namespace"": ""Aws.Cdk"", - ""packageId"": ""Aws.Cdk"" + ""namespace"": ""Aws.CdkNamespace"", + ""packageId"": ""Aws.CdkPackageId"" } }, ""version"": ""1.2.3"", @@ -294,8 +295,8 @@ public void CreatesProjectFileWithDependencies() ""version"": """", ""targets"": { ""dotnet"": { - ""namespace"": ""Aws.Cdk.CxApi"", - ""packageId"": ""Aws.Cdk.CxApi"" + ""namespace"": ""Aws.Cdk.CxApiNamespace"", + ""packageId"": ""Aws.Cdk.CxApiPackageId"" } }, ""types"": {} @@ -303,7 +304,7 @@ public void CreatesProjectFileWithDependencies() string jsonPath = GetJsonPath("aws-cdk"); string cxJsonPath = Path.Combine(Path.GetDirectoryName(jsonPath), "node_modules", "jsii$aws_cdk_cx_api$"); - string projectFilePath = GetProjectFilePath("Aws.Cdk", "Aws.Cdk"); + string projectFilePath = GetProjectFilePath("Aws.CdkPackageId", "Aws.CdkPackageId"); IFile file = Substitute.For(); file.ReadAllText(jsonPath).Returns(json); @@ -316,9 +317,9 @@ public void CreatesProjectFileWithDependencies() fileSystem.Directory.Returns(directory); fileSystem.File.Returns(file); - Symbols.MapTypeToPackage("aws-cdk", "Aws.Cdk"); - Symbols.MapTypeToPackage("aws-cdk-cx-api", "Aws.Cdk.CxApi"); - Symbols.MapAssemblyName("jsii$aws_cdk_cx_api$", "Aws.Cdk.CxApi"); + Symbols.MapTypeToPackage("aws-cdk", "Aws.CdkPackageId"); + Symbols.MapTypeToPackage("aws-cdk-cx-api", "Aws.Cdk.CxApiNamespace"); + Symbols.MapAssemblyName("jsii$aws_cdk_cx_api$", "Aws.Cdk.CxApiPackageId"); AssemblyGenerator generator = new AssemblyGenerator ( @@ -372,8 +373,8 @@ public void CreatesAssemblyInfo() ""license"": """", ""targets"": { ""dotnet"": { - ""namespace"": ""Aws.Cdk.CxApi"", - ""packageId"": ""Aws.Cdk.CxApi"" + ""namespace"": ""Aws.Cdk.CxApiNamespace"", + ""packageId"": ""Aws.Cdk.CxApiPackageId"" } }, ""version"": """", @@ -381,7 +382,7 @@ public void CreatesAssemblyInfo() }"; string jsonPath = GetJsonPath("aws-cdk-cx-api"); - string projectFilePath = GetProjectFilePath("Aws.Cdk.CxApi", "Aws.Cdk.CxApi"); + string projectFilePath = GetProjectFilePath("Aws.Cdk.CxApiPackageId", "Aws.Cdk.CxApiPackageId"); IFile file = Substitute.For(); file.ReadAllText(jsonPath).Returns(json); @@ -390,7 +391,7 @@ public void CreatesAssemblyInfo() fileSystem.Directory.Returns(Substitute.For()); fileSystem.File.Returns(file); - Symbols.MapTypeToPackage("aws-cdk-cx-api", "Aws.Cdk.CxApi"); + Symbols.MapTypeToPackage("aws-cdk-cx-api", "Aws.Cdk.CxApiPackageId"); AssemblyGenerator generator = new AssemblyGenerator ( @@ -404,7 +405,7 @@ public void CreatesAssemblyInfo() Symbols ); - file.Received().WriteAllText(Path.Combine(OutputRoot, "Aws.Cdk.CxApi", "AssemblyInfo.cs"), + file.Received().WriteAllText(Path.Combine(OutputRoot, "Aws.Cdk.CxApiPackageId", "AssemblyInfo.cs"), Arg.Do( code => Assert.Equal( @"using Amazon.JSII.Runtime.Deputy; @@ -437,8 +438,8 @@ public void CreatesBasicTypeFile() ""license"": """", ""targets"": { ""dotnet"": { - ""namespace"": ""Aws.Cdk.CxApi"", - ""packageId"": ""Aws.Cdk.CxApi"" + ""namespace"": ""Aws.Cdk.CxApiNamespace"", + ""packageId"": ""Aws.Cdk.CxApiPackageId"" } }, ""version"": """", @@ -457,7 +458,7 @@ public void CreatesBasicTypeFile() }"; string jsonPath = GetJsonPath("aws-cdk-cx-api"); - string typeFilePath = GetTypeFilePath("Aws.Cdk.CxApi", "MissingContext"); + string typeFilePath = GetTypeFilePath("Aws.Cdk.CxApiPackageId", "Aws.Cdk.CxApiNamespace", "MissingContext"); IFile file = Substitute.For(); file.ReadAllText(jsonPath).Returns(json); @@ -466,9 +467,9 @@ public void CreatesBasicTypeFile() fileSystem.Directory.Returns(Substitute.For()); fileSystem.File.Returns(file); - Symbols.MapTypeToPackage("aws-cdk-cx-api", "Aws.Cdk.CxApi"); - Symbols.MapNamespace("jsii$aws_cdk_cx_api$", "Aws.Cdk.CxApi"); - Symbols.MapTypeName("jsii$aws_cdk_cx_api$.MissingContext", "MissingContext", JsonModel.Spec.TypeKind.Class); + Symbols.MapTypeToPackage("aws-cdk-cx-api", "Aws.Cdk.CxApiPackageId"); + Symbols.MapNamespace("jsii$aws_cdk_cx_api$", "Aws.Cdk.CxApiNamespace"); + Symbols.MapTypeName("jsii$aws_cdk_cx_api$.MissingContext", "MissingContext", TypeKind.Class); AssemblyGenerator generator = new AssemblyGenerator ( @@ -486,7 +487,7 @@ public void CreatesBasicTypeFile() string expected = @"using Amazon.JSII.Runtime.Deputy; -namespace Aws.Cdk.CxApi +namespace Aws.Cdk.CxApiNamespace { [JsiiClass(typeof(MissingContext), ""jsii$aws_cdk_cx_api$.MissingContext"", ""[]"")] public class MissingContext : DeputyBase diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/SymbolMapTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/SymbolMapTests.cs index bcffa1a2d4..c47707c405 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/SymbolMapTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/SymbolMapTests.cs @@ -49,7 +49,7 @@ public void LoadsEmptyAssembly() ISymbolMap symbolMap = GetSymbolMap(out Assembly assembly); string actual = symbolMap.GetName(assembly); - Assert.Equal("My.Namespace", actual, ignoreLineEndingDifferences: true); + Assert.Equal("My.PackageId", actual, ignoreLineEndingDifferences: true); } [Fact(DisplayName = Prefix + nameof(RenamesTypeOnNamespaceConflict))] diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyExtensions.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyExtensions.cs index 0716b2f358..a0e6d82482 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyExtensions.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyExtensions.cs @@ -7,28 +7,50 @@ namespace Amazon.JSII.Generator { public static class AssemblyExtensions { - public static string GetNativeName(this Assembly assembly, string packageName) + public static string GetNativePackageId(this Assembly assembly, string targetPackageName = null) { assembly = assembly ?? throw new ArgumentNullException(nameof(assembly)); - packageName = packageName ?? throw new ArgumentNullException(nameof(packageName)); - if (packageName == assembly.Name) - { - return assembly.GetNativeName(); - } + string packageId = assembly.GetNativeProperty + ( + assembly.Name, + targetPackageName ?? assembly.Name, + d => d.Targets?.DotNet?.PackageId + ); - if (assembly.Dependencies == null) + if (string.IsNullOrWhiteSpace(packageId)) { - throw new ArgumentException($"Assembly '{assembly.Name}' does not define namespace mappings for '{packageName}'", nameof(assembly)); + throw new ArgumentException + ( + $"Assembly {assembly.Name} does not include a package id mapping for {targetPackageName ?? assembly.Name}", + nameof(assembly) + ); } - var name = assembly.TryGetNativeName(packageName); - if (string.IsNullOrWhiteSpace(name)) + return packageId; + } + + public static string GetNativeNamespace(this Assembly assembly, string targetPackageName = null) + { + assembly = assembly ?? throw new ArgumentNullException(nameof(assembly)); + + string @namespace = assembly.GetNativeProperty + ( + assembly.Name, + targetPackageName ?? assembly.Name, + d => d.Targets?.DotNet?.Namespace + ); + + if (string.IsNullOrWhiteSpace(@namespace)) { - throw new ArgumentException($"Assembly '{assembly.Name}' does not define namespace mappings for '{packageName}'", nameof(assembly)); + throw new ArgumentException + ( + $"Assembly {assembly.Name} does not include a namespace mapping for {targetPackageName ?? assembly.Name}", + nameof(assembly) + ); } - return name; + return @namespace; } public static IEnumerable GetMsBuildProperties(this Assembly assembly) @@ -60,12 +82,6 @@ public static IEnumerable GetMsBuildProperties(this Assembly assembly) yield return new XElement("AssemblyOriginatorKey", assembly.Targets.DotNet.AssemblyOriginatorKey); } - if (assembly.Targets.DotNet.Tags != null) - { - // NuGet expects the list of tags to be space-delimited. - yield return new XElement("Tags", string.Join(" ", assembly.Targets.DotNet.Tags)); - } - if (assembly.Targets.DotNet.IconUrl != null) { yield return new XElement("IconUrl", assembly.Targets.DotNet.IconUrl); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyGenerator.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyGenerator.cs index ac2d1246d2..d6d70abfbe 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyGenerator.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/AssemblyGenerator.cs @@ -46,7 +46,7 @@ public void Generate(string jsiiFile, string tarballPath, ISymbolMap symbols = n LoadDependencies(assembly, Path.GetDirectoryName(jsiiFile)); - string packageOutputRoot = Path.Combine(_outputRoot, assembly.GetNativeName()); + string packageOutputRoot = Path.Combine(_outputRoot, assembly.GetNativePackageId()); if (_fileSystem.Directory.Exists(packageOutputRoot)) { _fileSystem.Directory.Delete(packageOutputRoot, true); @@ -157,7 +157,7 @@ void SaveProjectFile() project.Save(writer); } - string csProjPath = Path.Combine(packageOutputRoot, $"{assembly.GetNativeName()}.csproj"); + string csProjPath = Path.Combine(packageOutputRoot, $"{assembly.GetNativePackageId()}.csproj"); _fileSystem.File.WriteAllText(csProjPath, builder.ToString()); IEnumerable> GetDependencies() diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/DependencyRootExtensions.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/DependencyRootExtensions.cs index 8063707dc6..19149c549c 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/DependencyRootExtensions.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/DependencyRootExtensions.cs @@ -1,44 +1,32 @@ using Amazon.JSII.JsonModel.Spec; using System; using System.Collections.Generic; +using System.Linq; namespace Amazon.JSII.Generator { public static class DependencyRootExtensions { - public static string GetNativeName(this DependencyRoot root) + internal static string GetNativeProperty( + this DependencyRoot root, + string currentPackageName, + string targetPackageName, + Func selector + ) { root = root ?? throw new ArgumentNullException(nameof(root)); + selector = selector ?? throw new ArgumentNullException(nameof(selector)); + currentPackageName = currentPackageName ?? throw new ArgumentNullException(nameof(currentPackageName)); + targetPackageName = targetPackageName ?? throw new ArgumentNullException(nameof(targetPackageName)); - if (string.IsNullOrWhiteSpace(root.Targets?.DotNet?.Namespace)) + if (currentPackageName == targetPackageName) { - throw new ArgumentException($"Assembly does not contain a .NET namespace mapping", nameof(root)); + return selector(root); } - return root.Targets.DotNet.Namespace; - } - - internal static string TryGetNativeName(this DependencyRoot root, string packageName) - { - if (root.Dependencies == null) - { - return null; - } - if (root.Dependencies.ContainsKey(packageName)) - { - return root.Dependencies[packageName].GetNativeName(); - } - - foreach (PackageVersion dependency in root.Dependencies.Values) - { - string name = dependency.TryGetNativeName(packageName); - if (name != null) - { - return name; - } - } - - return null; + return (root.Dependencies ?? Enumerable.Empty>()) + .Select(kvp => GetNativeProperty(kvp.Value, kvp.Key, targetPackageName, selector)) + .FirstOrDefault(p => p != null); } } } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/SymbolMap.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/SymbolMap.cs index b328a98ed6..d6820f48e4 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/SymbolMap.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/SymbolMap.cs @@ -27,7 +27,7 @@ public void Add(Assembly assembly) return; } - _assemblyNames[assembly.Name] = assembly.GetNativeName(); + _assemblyNames[assembly.Name] = assembly.GetNativePackageId(); var types = assembly.Types?.Values ?? Enumerable.Empty(); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/TypeMetadata.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/TypeMetadata.cs index 91402c1059..3d3d91f359 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/TypeMetadata.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/TypeMetadata.cs @@ -16,7 +16,7 @@ public TypeMetadata(Type type, Assembly assembly) Package = type.Assembly; - Namespace = $"{assembly.GetNativeName(Package)}{type.Namespace.Substring(Package.Length)}"; + Namespace = $"{assembly.GetNativeNamespace(Package)}{type.Namespace.Substring(Package.Length)}"; } public virtual void ResolveTypeNameConflicts(ISet namespaceNames) diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/AssemblyTests.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/AssemblyTests.cs index 7f55c348ff..9486f7a018 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/AssemblyTests.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/AssemblyTests.cs @@ -39,7 +39,6 @@ public void ShouldSerializeAllMembers() packageId: "Dot.Net.PackageId", signAssembly: true, assemblyOriginatorKey: "key.snk", - tags: new [] { "tag1", "tag2" }, iconUrl: "http://www.example.com/icon.png" )), dependencies: new Dictionary(), @@ -95,10 +94,6 @@ public void ShouldSerializeAllMembers() ""packageId"": ""Dot.Net.PackageId"", ""signAssembly"": true, ""assemblyOriginatorKey"": ""key.snk"", - ""tags"": [ - ""tag1"", - ""tag2"" - ], ""iconUrl"": ""http://www.example.com/icon.png"" } } @@ -125,7 +120,6 @@ public void ShouldThrowOnMissingName() packageId: "Dot.Net.PackageId", signAssembly: true, assemblyOriginatorKey: "key.snk", - tags: new[] { "tag1", "tag2" }, iconUrl: "http://www.example.com/icon.png" )), dependencies: new Dictionary(), @@ -153,7 +147,6 @@ public void ShouldThrowOnMissingVersion() packageId: "Dot.Net.PackageId", signAssembly: true, assemblyOriginatorKey: "key.snk", - tags: new[] { "tag1", "tag2" }, iconUrl: "http://www.example.com/icon.png" )), types: new Dictionary(), @@ -181,7 +174,6 @@ public void ShouldNotSerializeMissingDependencies() packageId: "Dot.Net.PackageId", signAssembly: true, assemblyOriginatorKey: "key.snk", - tags: new[] { "tag1", "tag2" }, iconUrl: "http://www.example.com/icon.png" )), types: new Dictionary(), @@ -216,10 +208,6 @@ public void ShouldNotSerializeMissingDependencies() ""packageId"": ""Dot.Net.PackageId"", ""signAssembly"": true, ""assemblyOriginatorKey"": ""key.snk"", - ""tags"": [ - ""tag1"", - ""tag2"" - ], ""iconUrl"": ""http://www.example.com/icon.png"" } } @@ -246,7 +234,6 @@ public void ShouldNotSerializeMissingBundled() packageId: "Dot.Net.PackageId", signAssembly: true, assemblyOriginatorKey: "key.snk", - tags: new[] { "tag1", "tag2" }, iconUrl: "http://www.example.com/icon.png" )), types: new Dictionary(), @@ -281,10 +268,6 @@ public void ShouldNotSerializeMissingBundled() ""packageId"": ""Dot.Net.PackageId"", ""signAssembly"": true, ""assemblyOriginatorKey"": ""key.snk"", - ""tags"": [ - ""tag1"", - ""tag2"" - ], ""iconUrl"": ""http://www.example.com/icon.png"" } } @@ -311,7 +294,6 @@ public void ShouldNotSerializeMissingDocs() packageId: "Dot.Net.PackageId", signAssembly: true, assemblyOriginatorKey: "key.snk", - tags: new[] { "tag1", "tag2" }, iconUrl: "http://www.example.com/icon.png" )), types: new Dictionary(), @@ -346,10 +328,6 @@ public void ShouldNotSerializeMissingDocs() ""packageId"": ""Dot.Net.PackageId"", ""signAssembly"": true, ""assemblyOriginatorKey"": ""key.snk"", - ""tags"": [ - ""tag1"", - ""tag2"" - ], ""iconUrl"": ""http://www.example.com/icon.png"" } } @@ -449,10 +427,6 @@ public void ShouldDeserializeAllMembersWithDotNetTarget() ""packageId"": ""Dot.Net.PackageId"", ""signAssembly"": true, ""assemblyOriginatorKey"": ""key.snk"", - ""tags"": [ - ""tag1"", - ""tag2"" - ], ""iconUrl"": ""http://www.example.com/icon.png"" }, ""java"": { ""package"": ""com.amazonaws.cdk.Test"" } @@ -487,12 +461,6 @@ public void ShouldDeserializeAllMembersWithDotNetTarget() Assert.Equal("Dot.Net.PackageId", dotNetTarget.PackageId); Assert.True(dotNetTarget.SignAssembly); Assert.Equal("key.snk", dotNetTarget.AssemblyOriginatorKey); - Assert.Collection - ( - dotNetTarget.Tags, - tag => Assert.Equal("tag1", tag), - tag => Assert.Equal("tag2", tag) - ); Assert.Equal("http://www.example.com/icon.png", dotNetTarget.IconUrl); Assert.Equal("myVersion", actual.Version, ignoreLineEndingDifferences: true); diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/AssemblyTargets.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/AssemblyTargets.cs index 57e584b71d..a7c27f3753 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/AssemblyTargets.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/AssemblyTargets.cs @@ -25,7 +25,6 @@ public DotNetTarget string title = null, bool? signAssembly = null, string assemblyOriginatorKey = null, - string[] tags = null, string iconUrl = null ) { @@ -35,7 +34,6 @@ public DotNetTarget Title = title; SignAssembly = signAssembly; AssemblyOriginatorKey = assemblyOriginatorKey; - Tags = tags; IconUrl = iconUrl; } @@ -54,9 +52,6 @@ public DotNetTarget [JsonProperty("assemblyOriginatorKey", NullValueHandling = NullValueHandling.Ignore)] public string AssemblyOriginatorKey { get; } - [JsonProperty("tags", NullValueHandling = NullValueHandling.Ignore)] - public string[] Tags { get; } - [JsonProperty("iconUrl", NullValueHandling = NullValueHandling.Ignore)] public string IconUrl { get; } } diff --git a/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/Amazon.JSII.Runtime.IntegrationTests.csproj b/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/Amazon.JSII.Runtime.IntegrationTests.csproj index 7e008ab9c3..00b3f51d7f 100644 --- a/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/Amazon.JSII.Runtime.IntegrationTests.csproj +++ b/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/Amazon.JSII.Runtime.IntegrationTests.csproj @@ -7,7 +7,7 @@ - + diff --git a/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/ComplianceTests.cs b/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/ComplianceTests.cs index 4f88815e44..9bfddb6f1e 100644 --- a/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/ComplianceTests.cs +++ b/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests/ComplianceTests.cs @@ -1,8 +1,8 @@ using Amazon.JSII.Runtime.Deputy; using Amazon.JSII.Runtime.Services; -using Amazon.JSII.Tests.Calculator; -using Amazon.JSII.Tests.Calculator.composition; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace; +using Amazon.JSII.Tests.CalculatorNamespace.composition; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; @@ -189,9 +189,9 @@ public void UnionTypes() public void CreateObjectAndCtorOverloads() { // TODO: Generator should create a parameterless constructor. - new Calculator_(new CalculatorProps()); + new Calculator(new CalculatorProps()); - new Calculator_(new CalculatorProps + new Calculator(new CalculatorProps { MaximumValue = 10 }); @@ -214,7 +214,7 @@ public void GetSetPrimitiveProperties() public void CallMethods() { // TODO: Generator should create a parameterless constructor. - Calculator_ calc = new Calculator_(new CalculatorProps()); + Calculator calc = new Calculator(new CalculatorProps()); calc.Add(10); Assert.Equal((double)10, calc.Value); @@ -233,7 +233,7 @@ public void CallMethods() public void UnmarkshallIntoAbstractType() { // TODO: Generator should create a parameterless constructor. - Calculator_ calc = new Calculator_(new CalculatorProps()); + Calculator calc = new Calculator(new CalculatorProps()); calc.Add(120); Value_ value = calc.Curr; @@ -244,7 +244,7 @@ public void UnmarkshallIntoAbstractType() public void GetAndSetNotPrimitiveProperties() { // TODO: Generator should create a parameterless constructor. - Calculator_ calc = new Calculator_(new CalculatorProps()); + Calculator calc = new Calculator(new CalculatorProps()); calc.Add(3200000); calc.Neg(); @@ -256,7 +256,7 @@ public void GetAndSetNotPrimitiveProperties() public void GetAndSetEnumValues() { // TODO: Generator should create a parameterless constructor. - Calculator_ calc = new Calculator_(new CalculatorProps()); + Calculator calc = new Calculator(new CalculatorProps()); calc.Add(9); calc.Pow(3); @@ -281,7 +281,7 @@ public void UseEnumFromScopedModule() public void UndefinedAndNull() { // TODO: Generator should create a parameterless constructor. - Calculator_ calculator = new Calculator_(new CalculatorProps()); + Calculator calculator = new Calculator(new CalculatorProps()); Assert.Null(calculator.MaxValue); calculator.MaxValue = null; @@ -302,7 +302,7 @@ public void Arrays() public void Maps() { // TODO: Generator should create a parameterless constructor. - Calculator_ calc = new Calculator_(new CalculatorProps()); + Calculator calc = new Calculator(new CalculatorProps()); calc.Add(10); calc.Add(20); @@ -321,7 +321,7 @@ public void Maps() [Fact(DisplayName = Prefix + nameof(FluentApi))] public void FluentApi() { - Calculator_ calc = new Calculator_(new CalculatorProps + Calculator calc = new Calculator(new CalculatorProps { InitialValue = 20, MaximumValue = 30, @@ -333,7 +333,7 @@ public void FluentApi() [Fact(DisplayName = Prefix + nameof(Exceptions))] public void Exceptions() { - Calculator_ calc = new Calculator_(new CalculatorProps + Calculator calc = new Calculator(new CalculatorProps { InitialValue = 20, MaximumValue = 30, @@ -353,7 +353,7 @@ public void Exceptions() public void UnionProperties() { // TODO: Generator should create a parameterless constructor. - Calculator_ calc = new Calculator_(new CalculatorProps()); + Calculator calc = new Calculator(new CalculatorProps()); calc.UnionProperty = new Multiply(new Number(9), new Number(3)); Assert.IsType(calc.UnionProperty); @@ -367,7 +367,7 @@ public void UnionProperties() public void SubClassing() { // TODO: Generator should create a parameterless constructor. - Calculator_ calc = new Calculator_(new CalculatorProps()); + Calculator calc = new Calculator(new CalculatorProps()); calc.Curr = new AddTen(33); calc.Neg(); diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Amazon.JSII.Runtime.csproj b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Amazon.JSII.Runtime.csproj index 726c8a2cc0..dbc76c4b9b 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Amazon.JSII.Runtime.csproj +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/Amazon.JSII.Runtime.csproj @@ -13,7 +13,6 @@ - diff --git a/packages/jsii-kernel/test/test.kernel.ts b/packages/jsii-kernel/test/test.kernel.ts index 0fdde6fd72..f5b2ac36fd 100644 --- a/packages/jsii-kernel/test/test.kernel.ts +++ b/packages/jsii-kernel/test/test.kernel.ts @@ -226,8 +226,8 @@ defineTest('naming allows returns the module name for different languages', asyn maven: { groupId: 'software.amazon.jsii.tests', artifactId: 'calculator' } }, dotnet: { - namespace: 'Amazon.JSII.Tests.Calculator', - packageId: 'Amazon.JSII.Tests.Calculator', + namespace: 'Amazon.JSII.Tests.CalculatorNamespace', + packageId: 'Amazon.JSII.Tests.CalculatorPackageId', }, js: { npm: 'jsii-calc' } }); @@ -237,8 +237,8 @@ defineTest('naming allows returns the module name for different languages', asyn maven: { groupId: 'software.amazon.jsii.tests', artifactId: 'calculator-lib' } }, dotnet: { - namespace: 'Amazon.JSII.Tests.Calculator.Lib', - packageId: 'Amazon.JSII.Tests.Calculator.Lib' + namespace: 'Amazon.JSII.Tests.CalculatorNamespace.LibNamespace', + packageId: 'Amazon.JSII.Tests.CalculatorPackageId.LibPackageId' }, js: { npm: '@scope/jsii-calc-lib' } }); diff --git a/packages/jsii-pacmak/lib/targets/dotnet.ts b/packages/jsii-pacmak/lib/targets/dotnet.ts index 53b2550885..7789b94e56 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet.ts @@ -19,8 +19,8 @@ export default class Dotnet extends Target { await this.generateNuGetConfigForLocalDeps(sourceDir, outDir); const pkg = await fs.readJson(path.join(this.packageDir, 'package.json')); - const namespace: string = pkg.jsii.targets.dotnet.namespace; - const project: string = path.join(namespace, `${namespace}.csproj`); + const packageId: string = pkg.jsii.targets.dotnet.packageId; + const project: string = path.join(packageId, `${packageId}.csproj`); await shell( 'dotnet', @@ -28,7 +28,7 @@ export default class Dotnet extends Target { { cwd: sourceDir } ); - await this.copyFiles(path.join(sourceDir, namespace, 'bin', 'Release'), outDir); + await this.copyFiles(path.join(sourceDir, packageId, 'bin', 'Release'), outDir); await fs.remove(path.join(outDir, 'netstandard2.0')); } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/.jsii similarity index 84% rename from packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/.jsii rename to packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/.jsii index 8d8c26712e..b7c02873bc 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/.jsii +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/.jsii @@ -1,5 +1,5 @@ { - "fingerprint": "nY7bYOUnP/71hy4cDOOXssKcfB/Oz1tAhMPMw1QcZyI=", + "fingerprint": "3lcys0/Cd5ZbPR/CXccsL3Fdb66mNsVBs8jb+ySL0oU=", "author": { "name": "Amazon Web Services", "organization": true, @@ -12,8 +12,8 @@ "@scope/jsii-calc-base-of-base": { "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", - "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, "java": { "maven": { @@ -29,7 +29,7 @@ "version": "0.6.4" } }, - "description": "@scope/jsii-calc-base", + "description": "An example direct dependency for jsii-calc.", "homepage": "https://github.com/awslabs/jsii.git", "license": "Apache-2.0", "name": "@scope/jsii-calc-base", @@ -40,8 +40,8 @@ "schema": "jsii/1.0", "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base", - "packageId": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId" }, "java": { "maven": { diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/Amazon.JSII.Tests.Calculator.Base.csproj b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj similarity index 70% rename from packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/Amazon.JSII.Tests.Calculator.Base.csproj rename to packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj index be2e60e824..7fbcf0b4d3 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/Amazon.JSII.Tests.Calculator.Base.csproj +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj @@ -3,8 +3,8 @@ netstandard2.0 true 0.6.4 - Amazon.JSII.Tests.Calculator.Base - @scope/jsii-calc-base + Amazon.JSII.Tests.CalculatorPackageId.BasePackageId + An example direct dependency for jsii-calc. https://github.com/awslabs/jsii.git https://spdx.org/licenses/Apache-2.0.html Amazon Web Services @@ -15,6 +15,6 @@ - + \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/Base_.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/Base.cs similarity index 56% rename from packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/Base_.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/Base.cs index 16fed2e836..c38472e6b3 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/Base_.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/Base.cs @@ -1,20 +1,20 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator.Base +namespace Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace { /// A base class. - [JsiiClass(typeof(Base_), "@scope/jsii-calc-base.Base", "[]")] - public abstract class Base_ : DeputyBase + [JsiiClass(typeof(Base), "@scope/jsii-calc-base.Base", "[]")] + public abstract class Base : DeputyBase { - protected Base_(): base(new DeputyProps(new object[]{})) + protected Base(): base(new DeputyProps(new object[]{})) { } - protected Base_(ByRefValue reference): base(reference) + protected Base(ByRefValue reference): base(reference) { } - protected Base_(DeputyProps props): base(props) + protected Base(DeputyProps props): base(props) { } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/BaseProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BaseProps.cs similarity index 76% rename from packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/BaseProps.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BaseProps.cs index a12f87e754..ca632c90f6 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/BaseProps.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BaseProps.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.BaseOfBase; +using Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace; -namespace Amazon.JSII.Tests.Calculator.Base +namespace Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace { public class BaseProps : DeputyBase, IBaseProps { diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/BasePropsProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BasePropsProxy.cs similarity index 85% rename from packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/BasePropsProxy.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BasePropsProxy.cs index c33d4cfa75..5a291279e5 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/BasePropsProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/BasePropsProxy.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.BaseOfBase; +using Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace; -namespace Amazon.JSII.Tests.Calculator.Base +namespace Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace { [JsiiInterfaceProxy(typeof(IBaseProps), "@scope/jsii-calc-base.BaseProps")] internal class BasePropsProxy : DeputyBase, IBaseProps diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/IBaseProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/IBaseProps.cs similarity index 70% rename from packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/IBaseProps.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/IBaseProps.cs index 2c4f062285..d368d084c4 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/IBaseProps.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/IBaseProps.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.BaseOfBase; +using Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace; -namespace Amazon.JSII.Tests.Calculator.Base +namespace Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace { [JsiiInterface(typeof(IBaseProps), "@scope/jsii-calc-base.BaseProps")] public interface IBaseProps : IVeryBaseProps diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/AssemblyInfo.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/AssemblyInfo.cs similarity index 100% rename from packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/AssemblyInfo.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/AssemblyInfo.cs diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/scope-jsii-calc-base-0.6.4.tgz b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/scope-jsii-calc-base-0.6.4.tgz similarity index 100% rename from packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.Calculator.Base/scope-jsii-calc-base-0.6.4.tgz rename to packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/scope-jsii-calc-base-0.6.4.tgz diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/java/pom.xml b/packages/jsii-pacmak/test/expected.jsii-calc-base/java/pom.xml index 3bffc5e408..4769a7d33f 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/java/pom.xml +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/java/pom.xml @@ -2,7 +2,7 @@ 4.0.0 ${project.groupId}:${project.artifactId} - @scope/jsii-calc-base + An example direct dependency for jsii-calc. https://github.com/awslabs/jsii.git diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/.jsii similarity index 92% rename from packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/.jsii rename to packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/.jsii index e7151a1e23..0dcc1f95b7 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/.jsii +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/.jsii @@ -1,5 +1,5 @@ { - "fingerprint": "TG5iHDURFXP3eGuVFwCU45xgyr1bMUgsWPdXDH55o4Y=", + "fingerprint": "euaH0hTUT38hFuqtItWxu9uK4iO1iSCGEHecTSHwY5o=", "author": { "name": "Amazon Web Services", "organization": true, @@ -14,8 +14,8 @@ "@scope/jsii-calc-base-of-base": { "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", - "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, "java": { "maven": { @@ -33,8 +33,8 @@ }, "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base", - "packageId": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId" }, "java": { "maven": { @@ -50,7 +50,7 @@ "version": "0.6.4" } }, - "description": "@scope/jsii-calc-lib", + "description": "A simple calcuator library built on JSII.", "homepage": "https://github.com/awslabs/jsii.git", "license": "Apache-2.0", "name": "@scope/jsii-calc-lib", @@ -61,8 +61,8 @@ "schema": "jsii/1.0", "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Lib", - "packageId": "Amazon.JSII.Tests.Calculator.Lib" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.LibNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.LibPackageId" }, "java": { "maven": { diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Amazon.JSII.Tests.Calculator.Lib.csproj b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj similarity index 63% rename from packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Amazon.JSII.Tests.Calculator.Lib.csproj rename to packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj index b26b419134..dbc7b2681e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Amazon.JSII.Tests.Calculator.Lib.csproj +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj @@ -3,8 +3,8 @@ netstandard2.0 true 0.6.4 - Amazon.JSII.Tests.Calculator.Lib - @scope/jsii-calc-lib + Amazon.JSII.Tests.CalculatorPackageId.LibPackageId + A simple calcuator library built on JSII. https://github.com/awslabs/jsii.git https://spdx.org/licenses/Apache-2.0.html Amazon Web Services @@ -15,7 +15,7 @@ - - + + \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/EnumFromScopedModule.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/EnumFromScopedModule.cs similarity index 87% rename from packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/EnumFromScopedModule.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/EnumFromScopedModule.cs index 0b5699377b..2d3681175f 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/EnumFromScopedModule.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/EnumFromScopedModule.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator.Lib +namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// /// Check that enums from @scoped packages can be references. diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/IFriendlyProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IFriendlyProxy.cs similarity index 92% rename from packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/IFriendlyProxy.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IFriendlyProxy.cs index bd58c33405..95ac50beeb 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/IFriendlyProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IFriendlyProxy.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator.Lib +namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// /// Applies to classes that are considered friendly. These classes can be greeted with diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/IIFriendly.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IIFriendly.cs similarity index 89% rename from packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/IIFriendly.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IIFriendly.cs index 9d9be8fbc3..98b3e77d6e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/IIFriendly.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IIFriendly.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator.Lib +namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// /// Applies to classes that are considered friendly. These classes can be greeted with diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/IMyFirstStruct.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IMyFirstStruct.cs similarity index 93% rename from packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/IMyFirstStruct.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IMyFirstStruct.cs index a79d406730..9215d5181e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/IMyFirstStruct.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IMyFirstStruct.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator.Lib +namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// This is the first struct we have created in jsii [JsiiInterface(typeof(IMyFirstStruct), "@scope/jsii-calc-lib.MyFirstStruct")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/IStructWithOnlyOptionals.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IStructWithOnlyOptionals.cs similarity index 93% rename from packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/IStructWithOnlyOptionals.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IStructWithOnlyOptionals.cs index 9a8847b67d..a9f6753b6d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/IStructWithOnlyOptionals.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/IStructWithOnlyOptionals.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator.Lib +namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// This is a struct with only optional properties. [JsiiInterface(typeof(IStructWithOnlyOptionals), "@scope/jsii-calc-lib.StructWithOnlyOptionals")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/MyFirstStruct.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/MyFirstStruct.cs similarity index 93% rename from packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/MyFirstStruct.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/MyFirstStruct.cs index 05acb58cca..7aa2c82810 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/MyFirstStruct.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/MyFirstStruct.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator.Lib +namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// This is the first struct we have created in jsii public class MyFirstStruct : DeputyBase, IMyFirstStruct diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/MyFirstStructProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/MyFirstStructProxy.cs similarity index 95% rename from packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/MyFirstStructProxy.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/MyFirstStructProxy.cs index d77accff92..7891bdea0d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/MyFirstStructProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/MyFirstStructProxy.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator.Lib +namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// This is the first struct we have created in jsii [JsiiInterfaceProxy(typeof(IMyFirstStruct), "@scope/jsii-calc-lib.MyFirstStruct")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Number.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Number.cs similarity index 94% rename from packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Number.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Number.cs index 984aa288f7..7974c1fcec 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Number.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Number.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator.Lib +namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// Represents a concrete number. [JsiiClass(typeof(Number), "@scope/jsii-calc-lib.Number", "[{\"name\":\"value\",\"type\":{\"primitive\":\"number\"}}]")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Operation.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Operation.cs similarity index 91% rename from packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Operation.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Operation.cs index b1a6d17fd2..f1127303fe 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Operation.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Operation.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator.Lib +namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// Represents an operation on values. [JsiiClass(typeof(Operation), "@scope/jsii-calc-lib.Operation", "[]")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/StructWithOnlyOptionals.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/StructWithOnlyOptionals.cs similarity index 92% rename from packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/StructWithOnlyOptionals.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/StructWithOnlyOptionals.cs index ea58ecce4c..9dc1bdca83 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/StructWithOnlyOptionals.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/StructWithOnlyOptionals.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator.Lib +namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// This is a struct with only optional properties. public class StructWithOnlyOptionals : DeputyBase, IStructWithOnlyOptionals diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/StructWithOnlyOptionalsProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/StructWithOnlyOptionalsProxy.cs similarity index 95% rename from packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/StructWithOnlyOptionalsProxy.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/StructWithOnlyOptionalsProxy.cs index 31df3854fa..da65e4918b 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/StructWithOnlyOptionalsProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/StructWithOnlyOptionalsProxy.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator.Lib +namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// This is a struct with only optional properties. [JsiiInterfaceProxy(typeof(IStructWithOnlyOptionals), "@scope/jsii-calc-lib.StructWithOnlyOptionals")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Value_.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Value_.cs similarity index 85% rename from packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Value_.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Value_.cs index f6937cabdc..b6d5a90866 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/Value_.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon/JSII/Tests/CalculatorNamespace/LibNamespace/Value_.cs @@ -1,11 +1,11 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Base; +using Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace; -namespace Amazon.JSII.Tests.Calculator.Lib +namespace Amazon.JSII.Tests.CalculatorNamespace.LibNamespace { /// Abstract class which represents a numeric value. [JsiiClass(typeof(Value_), "@scope/jsii-calc-lib.Value", "[]")] - public abstract class Value_ : Base_ + public abstract class Value_ : Base { protected Value_(): base(new DeputyProps(new object[]{})) { diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/AssemblyInfo.cs b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/AssemblyInfo.cs similarity index 100% rename from packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/AssemblyInfo.cs rename to packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/AssemblyInfo.cs diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/scope-jsii-calc-lib-0.6.4.tgz b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/scope-jsii-calc-lib-0.6.4.tgz similarity index 100% rename from packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.Calculator.Lib/scope-jsii-calc-lib-0.6.4.tgz rename to packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/scope-jsii-calc-lib-0.6.4.tgz diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/java/pom.xml b/packages/jsii-pacmak/test/expected.jsii-calc-lib/java/pom.xml index a87797154e..a7fd090f6f 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/java/pom.xml +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/java/pom.xml @@ -2,7 +2,7 @@ 4.0.0 ${project.groupId}:${project.artifactId} - @scope/jsii-calc-lib + A simple calcuator library built on JSII. https://github.com/awslabs/jsii.git diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Amazon.JSII.Tests.Calculator.csproj b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Amazon.JSII.Tests.Calculator.csproj deleted file mode 100644 index 032bc6709f..0000000000 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Amazon.JSII.Tests.Calculator.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - netstandard2.0 - true - 0.6.4 - Amazon.JSII.Tests.Calculator - jsii-calc - https://github.com/awslabs/jsii.git - https://spdx.org/licenses/Apache-2.0.html - Amazon Web Services - en-US - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii similarity index 98% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/.jsii rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii index ea35343e15..26bbaf49c2 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/.jsii +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii @@ -1,5 +1,5 @@ { - "fingerprint": "4hr7d742QVoXg5SKsc71Byf1QABcdQ0HEixthntx9g4=", + "fingerprint": "TTYo91AyKTcjF5jv1DjNFwJ1qLxMdEUIY8f3WkFycBQ=", "author": { "name": "Amazon Web Services", "organization": true, @@ -40,8 +40,8 @@ "@scope/jsii-calc-base-of-base": { "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", - "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, "java": { "maven": { @@ -59,8 +59,8 @@ }, "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base", - "packageId": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId" }, "java": { "maven": { @@ -82,8 +82,8 @@ "@scope/jsii-calc-base-of-base": { "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase", - "packageId": "Amazon.JSII.Tests.Calculator.BaseOfBase" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" }, "java": { "maven": { @@ -101,8 +101,8 @@ }, "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Base", - "packageId": "Amazon.JSII.Tests.Calculator.Base" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId" }, "java": { "maven": { @@ -120,8 +120,8 @@ }, "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator.Lib", - "packageId": "Amazon.JSII.Tests.Calculator.Lib" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.LibNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.LibPackageId" }, "java": { "maven": { @@ -137,7 +137,7 @@ "version": "0.6.4" } }, - "description": "jsii-calc", + "description": "A simple calcuator built on JSII.", "homepage": "https://github.com/awslabs/jsii.git", "license": "Apache-2.0", "name": "jsii-calc", @@ -151,8 +151,8 @@ "schema": "jsii/1.0", "targets": { "dotnet": { - "namespace": "Amazon.JSII.Tests.Calculator", - "packageId": "Amazon.JSII.Tests.Calculator" + "namespace": "Amazon.JSII.Tests.CalculatorNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId" }, "java": { "maven": { diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon.JSII.Tests.CalculatorPackageId.csproj b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon.JSII.Tests.CalculatorPackageId.csproj new file mode 100644 index 0000000000..a0863d61c6 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon.JSII.Tests.CalculatorPackageId.csproj @@ -0,0 +1,24 @@ + + + netstandard2.0 + true + 0.6.4 + Amazon.JSII.Tests.CalculatorPackageId + A simple calcuator built on JSII. + https://github.com/awslabs/jsii.git + https://spdx.org/licenses/Apache-2.0.html + Amazon Web Services + en-US + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Add.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Add.cs similarity index 91% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Add.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Add.cs index 15575901f5..d148a7781c 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Add.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Add.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// The "+" binary operation. [JsiiClass(typeof(Add), "jsii-calc.Add", "[{\"name\":\"lhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},{\"name\":\"rhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/AllTypes.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs similarity index 98% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/AllTypes.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs index 5d943437fc..4506903b89 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/AllTypes.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs @@ -1,10 +1,10 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.composition; +using Amazon.JSII.Tests.CalculatorNamespace.composition; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// /// This class includes property for all types supported by jsii. The setters will validate diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/AllTypesEnum.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypesEnum.cs similarity index 87% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/AllTypesEnum.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypesEnum.cs index 9c1a6145bb..6fef8651d6 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/AllTypesEnum.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypesEnum.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiEnum(typeof(AllTypesEnum), "jsii-calc.AllTypesEnum")] public enum AllTypesEnum diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/AllowedMethodNames.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllowedMethodNames.cs similarity index 97% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/AllowedMethodNames.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllowedMethodNames.cs index a7b2cdadfa..a2e6ba97f4 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/AllowedMethodNames.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllowedMethodNames.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(AllowedMethodNames), "jsii-calc.AllowedMethodNames", "[]")] public class AllowedMethodNames : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/AsyncVirtualMethods.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AsyncVirtualMethods.cs similarity index 97% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/AsyncVirtualMethods.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AsyncVirtualMethods.cs index 76a35a912e..0bba08eafb 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/AsyncVirtualMethods.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AsyncVirtualMethods.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(AsyncVirtualMethods), "jsii-calc.AsyncVirtualMethods", "[]")] public class AsyncVirtualMethods : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/BinaryOperation.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BinaryOperation.cs similarity index 92% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/BinaryOperation.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BinaryOperation.cs index 07c8f51e47..b869964689 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/BinaryOperation.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BinaryOperation.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// Represents an operation with two operands. [JsiiClass(typeof(BinaryOperation), "jsii-calc.BinaryOperation", "[{\"name\":\"lhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},{\"name\":\"rhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Calculator_.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs similarity index 86% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Calculator_.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs index e257335db2..071b0845b7 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Calculator_.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs @@ -1,23 +1,23 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.composition; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.composition; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; using System.Collections.Generic; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// A calculator which maintains a current value and allows adding operations. - [JsiiClass(typeof(Calculator_), "jsii-calc.Calculator", "[{\"name\":\"props\",\"type\":{\"fqn\":\"jsii-calc.CalculatorProps\",\"optional\":true}}]")] - public class Calculator_ : CompositeOperation + [JsiiClass(typeof(Calculator), "jsii-calc.Calculator", "[{\"name\":\"props\",\"type\":{\"fqn\":\"jsii-calc.CalculatorProps\",\"optional\":true}}]")] + public class Calculator : CompositeOperation { - public Calculator_(ICalculatorProps props): base(new DeputyProps(new object[]{props})) + public Calculator(ICalculatorProps props): base(new DeputyProps(new object[]{props})) { } - protected Calculator_(ByRefValue reference): base(reference) + protected Calculator(ByRefValue reference): base(reference) { } - protected Calculator_(DeputyProps props): base(props) + protected Calculator(DeputyProps props): base(props) { } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/CalculatorProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorProps.cs similarity index 91% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/CalculatorProps.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorProps.cs index 368162a20f..73d47dfba9 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/CalculatorProps.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorProps.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// Properties for Calculator. public class CalculatorProps : DeputyBase, ICalculatorProps diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/CalculatorPropsProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorPropsProxy.cs similarity index 94% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/CalculatorPropsProxy.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorPropsProxy.cs index b9dc4da81c..3d8ba2c089 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/CalculatorPropsProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorPropsProxy.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// Properties for Calculator. [JsiiInterfaceProxy(typeof(ICalculatorProps), "jsii-calc.CalculatorProps")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/DerivedClassHasNoProperties/Base.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Base.cs similarity index 89% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/DerivedClassHasNoProperties/Base.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Base.cs index 24e6b451e5..5036342fc2 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/DerivedClassHasNoProperties/Base.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Base.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator.DerivedClassHasNoProperties +namespace Amazon.JSII.Tests.CalculatorNamespace.DerivedClassHasNoProperties { [JsiiClass(typeof(Base), "jsii-calc.DerivedClassHasNoProperties.Base", "[]")] public class Base : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/DerivedClassHasNoProperties/Derived.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Derived.cs similarity index 68% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/DerivedClassHasNoProperties/Derived.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Derived.cs index dab7f53240..fa68e32efa 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/DerivedClassHasNoProperties/Derived.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Derived.cs @@ -1,9 +1,9 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator.DerivedClassHasNoProperties +namespace Amazon.JSII.Tests.CalculatorNamespace.DerivedClassHasNoProperties { [JsiiClass(typeof(Derived), "jsii-calc.DerivedClassHasNoProperties.Derived", "[]")] - public class Derived : Base + public class Derived : Amazon.JSII.Tests.CalculatorNamespace.DerivedClassHasNoProperties.Base { public Derived(): base(new DeputyProps(new object[]{})) { diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/DerivedStruct.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStruct.cs similarity index 95% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/DerivedStruct.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStruct.cs index 2ddf0decab..7b276ccfb9 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/DerivedStruct.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStruct.cs @@ -1,9 +1,9 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; using System; using System.Collections.Generic; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// A struct which derives from another struct. public class DerivedStruct : DeputyBase, IDerivedStruct diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/DerivedStructProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStructProxy.cs similarity index 96% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/DerivedStructProxy.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStructProxy.cs index 545446b56d..6ec344a620 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/DerivedStructProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStructProxy.cs @@ -1,9 +1,9 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; using System; using System.Collections.Generic; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// A struct which derives from another struct. [JsiiInterfaceProxy(typeof(IDerivedStruct), "jsii-calc.DerivedStruct")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/DoubleTrouble.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoubleTrouble.cs similarity index 95% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/DoubleTrouble.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoubleTrouble.cs index f8b34dc192..e5a7182554 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/DoubleTrouble.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoubleTrouble.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(DoubleTrouble), "jsii-calc.DoubleTrouble", "[]")] public class DoubleTrouble : DeputyBase, IIFriendlyRandomGenerator diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/GiveMeStructs.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GiveMeStructs.cs similarity index 94% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/GiveMeStructs.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GiveMeStructs.cs index 49f91417ed..19b2049aab 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/GiveMeStructs.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GiveMeStructs.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(GiveMeStructs), "jsii-calc.GiveMeStructs", "[]")] public class GiveMeStructs : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ICalculatorProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ICalculatorProps.cs similarity index 92% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ICalculatorProps.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ICalculatorProps.cs index 87c07be874..04a2a6b005 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ICalculatorProps.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ICalculatorProps.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// Properties for Calculator. [JsiiInterface(typeof(ICalculatorProps), "jsii-calc.CalculatorProps")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IDerivedStruct.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDerivedStruct.cs similarity index 92% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IDerivedStruct.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDerivedStruct.cs index 40d732879e..dbfb05b354 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IDerivedStruct.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDerivedStruct.cs @@ -1,9 +1,9 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; using System; using System.Collections.Generic; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// A struct which derives from another struct. [JsiiInterface(typeof(IDerivedStruct), "jsii-calc.DerivedStruct")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IFriendlierProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlierProxy.cs similarity index 95% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IFriendlierProxy.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlierProxy.cs index 47ca4b427b..1cdb9c4ea3 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IFriendlierProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlierProxy.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// Even friendlier classes can implement this interface. [JsiiInterfaceProxy(typeof(IIFriendlier), "jsii-calc.IFriendlier")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IFriendlyRandomGeneratorProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlyRandomGeneratorProxy.cs similarity index 94% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IFriendlyRandomGeneratorProxy.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlyRandomGeneratorProxy.cs index 0b11d1a76e..bbeda0eae5 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IFriendlyRandomGeneratorProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlyRandomGeneratorProxy.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiInterfaceProxy(typeof(IIFriendlyRandomGenerator), "jsii-calc.IFriendlyRandomGenerator")] internal class IFriendlyRandomGeneratorProxy : DeputyBase, IIFriendlyRandomGenerator diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IIFriendlier.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlier.cs similarity index 84% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IIFriendlier.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlier.cs index 800314eb9d..1b07d1af59 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IIFriendlier.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlier.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// Even friendlier classes can implement this interface. [JsiiInterface(typeof(IIFriendlier), "jsii-calc.IFriendlier")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IIFriendlyRandomGenerator.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlyRandomGenerator.cs similarity index 68% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IIFriendlyRandomGenerator.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlyRandomGenerator.cs index 6ec21b366c..389968b74d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IIFriendlyRandomGenerator.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlyRandomGenerator.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiInterface(typeof(IIFriendlyRandomGenerator), "jsii-calc.IFriendlyRandomGenerator")] public interface IIFriendlyRandomGenerator : IIRandomNumberGenerator, IIFriendly diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IIInterfaceWithProperties.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithProperties.cs similarity index 91% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IIInterfaceWithProperties.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithProperties.cs index 0fa317f43c..cfdc3b488f 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IIInterfaceWithProperties.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithProperties.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiInterface(typeof(IIInterfaceWithProperties), "jsii-calc.IInterfaceWithProperties")] public interface IIInterfaceWithProperties diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IIInterfaceWithPropertiesExtension.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithPropertiesExtension.cs similarity index 88% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IIInterfaceWithPropertiesExtension.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithPropertiesExtension.cs index a2214ef9f9..26840a4247 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IIInterfaceWithPropertiesExtension.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithPropertiesExtension.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiInterface(typeof(IIInterfaceWithPropertiesExtension), "jsii-calc.IInterfaceWithPropertiesExtension")] public interface IIInterfaceWithPropertiesExtension : IIInterfaceWithProperties diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IIRandomNumberGenerator.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIRandomNumberGenerator.cs similarity index 90% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IIRandomNumberGenerator.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIRandomNumberGenerator.cs index c3712f16bf..3a0553c4f3 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IIRandomNumberGenerator.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIRandomNumberGenerator.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// Generates random numbers. [JsiiInterface(typeof(IIRandomNumberGenerator), "jsii-calc.IRandomNumberGenerator")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IImplictBaseOfBase.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IImplictBaseOfBase.cs similarity index 75% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IImplictBaseOfBase.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IImplictBaseOfBase.cs index 7093358827..23d330079e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IImplictBaseOfBase.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IImplictBaseOfBase.cs @@ -1,8 +1,8 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Base; +using Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace; using System; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiInterface(typeof(IImplictBaseOfBase), "jsii-calc.ImplictBaseOfBase")] public interface IImplictBaseOfBase : IBaseProps diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IInterfaceWithProperties.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithProperties.cs similarity index 90% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IInterfaceWithProperties.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithProperties.cs index 43bf6b6714..68ba03b8f6 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IInterfaceWithProperties.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithProperties.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { public class IInterfaceWithProperties : DeputyBase, IIInterfaceWithProperties { diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IInterfaceWithPropertiesExtension.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtension.cs similarity index 92% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IInterfaceWithPropertiesExtension.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtension.cs index f9b1bfe5f0..3a176e747b 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IInterfaceWithPropertiesExtension.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtension.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { public class IInterfaceWithPropertiesExtension : DeputyBase, IIInterfaceWithPropertiesExtension { diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IInterfaceWithPropertiesExtensionProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtensionProxy.cs similarity index 95% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IInterfaceWithPropertiesExtensionProxy.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtensionProxy.cs index e62f1f47ac..3be85b6c5f 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IInterfaceWithPropertiesExtensionProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtensionProxy.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiInterfaceProxy(typeof(IIInterfaceWithPropertiesExtension), "jsii-calc.IInterfaceWithPropertiesExtension")] internal class IInterfaceWithPropertiesExtensionProxy : DeputyBase, IIInterfaceWithPropertiesExtension diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IInterfaceWithPropertiesProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesProxy.cs similarity index 94% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IInterfaceWithPropertiesProxy.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesProxy.cs index ea579678e9..010dc62dcf 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IInterfaceWithPropertiesProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesProxy.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiInterfaceProxy(typeof(IIInterfaceWithProperties), "jsii-calc.IInterfaceWithProperties")] internal class IInterfaceWithPropertiesProxy : DeputyBase, IIInterfaceWithProperties diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IRandomNumberGeneratorProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IRandomNumberGeneratorProxy.cs similarity index 93% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IRandomNumberGeneratorProxy.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IRandomNumberGeneratorProxy.cs index 4ea60881e2..8bccac1c90 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IRandomNumberGeneratorProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IRandomNumberGeneratorProxy.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// Generates random numbers. [JsiiInterfaceProxy(typeof(IIRandomNumberGenerator), "jsii-calc.IRandomNumberGenerator")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IReturnsNumber.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IReturnsNumber.cs similarity index 89% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IReturnsNumber.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IReturnsNumber.cs index 34d3b39f20..bedb9be1cb 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IReturnsNumber.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IReturnsNumber.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiInterface(typeof(IReturnsNumber), "jsii-calc.ReturnsNumber")] public interface IReturnsNumber diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IUnionProperties.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IUnionProperties.cs similarity index 92% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IUnionProperties.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IUnionProperties.cs index 1cb5373618..d21f6dd84e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/IUnionProperties.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IUnionProperties.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiInterface(typeof(IUnionProperties), "jsii-calc.UnionProperties")] public interface IUnionProperties diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ImplictBaseOfBase.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBase.cs similarity index 83% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ImplictBaseOfBase.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBase.cs index 9f6b0b55c4..1b286f79a9 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ImplictBaseOfBase.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBase.cs @@ -1,8 +1,8 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.BaseOfBase; +using Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace; using System; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { public class ImplictBaseOfBase : DeputyBase, IImplictBaseOfBase { diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ImplictBaseOfBaseProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBaseProxy.cs similarity index 89% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ImplictBaseOfBaseProxy.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBaseProxy.cs index 9ea844328a..28bcc86414 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ImplictBaseOfBaseProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBaseProxy.cs @@ -1,8 +1,8 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.BaseOfBase; +using Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace; using System; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiInterfaceProxy(typeof(IImplictBaseOfBase), "jsii-calc.ImplictBaseOfBase")] internal class ImplictBaseOfBaseProxy : DeputyBase, IImplictBaseOfBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/JSObjectLiteralForInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralForInterface.cs similarity index 90% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/JSObjectLiteralForInterface.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralForInterface.cs index c873776231..19fa50e867 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/JSObjectLiteralForInterface.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralForInterface.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(JSObjectLiteralForInterface), "jsii-calc.JSObjectLiteralForInterface", "[]")] public class JSObjectLiteralForInterface : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/JSObjectLiteralToNative.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNative.cs similarity index 94% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/JSObjectLiteralToNative.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNative.cs index cb3921546e..0177e98a97 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/JSObjectLiteralToNative.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNative.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(JSObjectLiteralToNative), "jsii-calc.JSObjectLiteralToNative", "[]")] public class JSObjectLiteralToNative : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/JSObjectLiteralToNativeClass.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNativeClass.cs similarity index 95% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/JSObjectLiteralToNativeClass.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNativeClass.cs index c32ab3c7e9..c13d989370 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/JSObjectLiteralToNativeClass.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNativeClass.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(JSObjectLiteralToNativeClass), "jsii-calc.JSObjectLiteralToNativeClass", "[]")] public class JSObjectLiteralToNativeClass : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/JavaReservedWords.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JavaReservedWords.cs similarity index 99% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/JavaReservedWords.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JavaReservedWords.cs index 7c7fc82cdb..706840c982 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/JavaReservedWords.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JavaReservedWords.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(JavaReservedWords), "jsii-calc.JavaReservedWords", "[]")] public class JavaReservedWords : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Multiply.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Multiply.cs similarity index 94% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Multiply.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Multiply.cs index ece67dbacb..0317da1cf3 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Multiply.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Multiply.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// The "*" binary operation. [JsiiClass(typeof(Multiply), "jsii-calc.Multiply", "[{\"name\":\"lhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},{\"name\":\"rhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Negate.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Negate.cs similarity index 94% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Negate.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Negate.cs index 144d71e255..f6cbf0eb05 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Negate.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Negate.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// The negation operation ("-value") [JsiiClass(typeof(Negate), "jsii-calc.Negate", "[{\"name\":\"operand\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/NodeStandardLibrary.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NodeStandardLibrary.cs similarity index 97% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/NodeStandardLibrary.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NodeStandardLibrary.cs index af1c39e5f7..116335aa18 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/NodeStandardLibrary.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NodeStandardLibrary.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// Test fixture to verify that jsii modules can use the node standard library. [JsiiClass(typeof(NodeStandardLibrary), "jsii-calc.NodeStandardLibrary", "[]")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/NumberGenerator.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NumberGenerator.cs similarity index 96% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/NumberGenerator.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NumberGenerator.cs index 3d8f96c25d..3a437dbc5d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/NumberGenerator.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NumberGenerator.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// /// This allows us to test that a reference can be stored for objects that diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ObjectRefsInCollections.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ObjectRefsInCollections.cs similarity index 93% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ObjectRefsInCollections.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ObjectRefsInCollections.cs index b7a19ac532..13915c1450 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ObjectRefsInCollections.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ObjectRefsInCollections.cs @@ -1,8 +1,8 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; using System.Collections.Generic; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// Verify that object references can be passed inside collections. [JsiiClass(typeof(ObjectRefsInCollections), "jsii-calc.ObjectRefsInCollections", "[]")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/OverrideReturnsObject.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OverrideReturnsObject.cs similarity index 94% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/OverrideReturnsObject.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OverrideReturnsObject.cs index aacfe784a0..152f329b6d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/OverrideReturnsObject.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OverrideReturnsObject.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(OverrideReturnsObject), "jsii-calc.OverrideReturnsObject", "[]")] public class OverrideReturnsObject : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Polymorphism.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Polymorphism.cs similarity index 87% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Polymorphism.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Polymorphism.cs index 4ce25ce1bc..565b785432 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Polymorphism.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Polymorphism.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(Polymorphism), "jsii-calc.Polymorphism", "[]")] public class Polymorphism : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Power.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Power.cs similarity index 89% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Power.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Power.cs index 394f909b10..9a44543ad3 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Power.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Power.cs @@ -1,8 +1,8 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.composition; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.composition; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// The power operation. [JsiiClass(typeof(Power), "jsii-calc.Power", "[{\"name\":\"base\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},{\"name\":\"pow\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ReferenceEnumFromScopedPackage.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReferenceEnumFromScopedPackage.cs similarity index 93% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ReferenceEnumFromScopedPackage.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReferenceEnumFromScopedPackage.cs index 3cf2adbc4b..febe8c3ec9 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ReferenceEnumFromScopedPackage.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReferenceEnumFromScopedPackage.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// See awslabs/jsii#138 [JsiiClass(typeof(ReferenceEnumFromScopedPackage), "jsii-calc.ReferenceEnumFromScopedPackage", "[]")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ReturnsNumberProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReturnsNumberProxy.cs similarity index 93% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ReturnsNumberProxy.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReturnsNumberProxy.cs index 9efcdd6965..1abd7f0a89 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/ReturnsNumberProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReturnsNumberProxy.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiInterfaceProxy(typeof(IReturnsNumber), "jsii-calc.ReturnsNumber")] internal class ReturnsNumberProxy : DeputyBase, IReturnsNumber diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/RuntimeTypeChecking.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/RuntimeTypeChecking.cs similarity index 95% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/RuntimeTypeChecking.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/RuntimeTypeChecking.cs index 24f65215e7..c3da746ef9 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/RuntimeTypeChecking.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/RuntimeTypeChecking.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; using System; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(RuntimeTypeChecking), "jsii-calc.RuntimeTypeChecking", "[]")] public class RuntimeTypeChecking : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Statics.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Statics.cs similarity index 98% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Statics.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Statics.cs index 1ba665fd35..afc463be9d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Statics.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Statics.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; using System.Collections.Generic; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(Statics), "jsii-calc.Statics", "[{\"name\":\"value\",\"type\":{\"primitive\":\"string\"}}]")] public class Statics : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/StringEnum.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StringEnum.cs similarity index 84% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/StringEnum.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StringEnum.cs index 076820f21a..00184f5025 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/StringEnum.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StringEnum.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiEnum(typeof(StringEnum), "jsii-calc.StringEnum")] public enum StringEnum diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Sum.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Sum.cs similarity index 87% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Sum.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Sum.cs index 4fd9da8f99..20c488dfe3 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Sum.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Sum.cs @@ -1,8 +1,8 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.composition; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.composition; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// An operation that sums multiple values. [JsiiClass(typeof(Sum), "jsii-calc.Sum", "[]")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/SyncVirtualMethods.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SyncVirtualMethods.cs similarity index 98% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/SyncVirtualMethods.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SyncVirtualMethods.cs index f20bee8430..288769629c 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/SyncVirtualMethods.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SyncVirtualMethods.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(SyncVirtualMethods), "jsii-calc.SyncVirtualMethods", "[]")] public class SyncVirtualMethods : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Thrower.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Thrower.cs similarity index 92% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Thrower.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Thrower.cs index 75dfd2e725..7f5961d7ac 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/Thrower.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Thrower.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(Thrower), "jsii-calc.Thrower", "[]")] public class Thrower : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UnaryOperation.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnaryOperation.cs similarity index 88% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UnaryOperation.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnaryOperation.cs index 9825fc649b..61200c8938 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UnaryOperation.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnaryOperation.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// An operation on a single operand. [JsiiClass(typeof(UnaryOperation), "jsii-calc.UnaryOperation", "[{\"name\":\"operand\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UnionProperties.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs similarity index 91% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UnionProperties.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs index b94576af4b..f542587f82 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UnionProperties.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { public class UnionProperties : DeputyBase, IUnionProperties { diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UnionPropertiesProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionPropertiesProxy.cs similarity index 94% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UnionPropertiesProxy.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionPropertiesProxy.cs index 6aecc5d06b..0d3f41f129 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UnionPropertiesProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionPropertiesProxy.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiInterfaceProxy(typeof(IUnionProperties), "jsii-calc.UnionProperties")] internal class UnionPropertiesProxy : DeputyBase, IUnionProperties diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UseBundledDependency.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseBundledDependency.cs similarity index 93% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UseBundledDependency.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseBundledDependency.cs index b16f053dc9..7470df65fe 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UseBundledDependency.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseBundledDependency.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(UseBundledDependency), "jsii-calc.UseBundledDependency", "[]")] public class UseBundledDependency : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UseCalcBase.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseCalcBase.cs similarity index 74% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UseCalcBase.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseCalcBase.cs index d15020528e..a93601c43d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UseCalcBase.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseCalcBase.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Base; +using Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { /// Depend on a type from jsii-calc-base as a test for awslabs/jsii#128 [JsiiClass(typeof(UseCalcBase), "jsii-calc.UseCalcBase", "[]")] @@ -20,9 +20,9 @@ protected UseCalcBase(DeputyProps props): base(props) } [JsiiMethod("hello", "{\"fqn\":\"@scope/jsii-calc-base.Base\"}", "[]")] - public virtual Base_ Hello() + public virtual Base Hello() { - return InvokeInstanceMethod(new object[]{}); + return InvokeInstanceMethod(new object[]{}); } } } \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UsesInterfaceWithProperties.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UsesInterfaceWithProperties.cs similarity index 97% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UsesInterfaceWithProperties.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UsesInterfaceWithProperties.cs index 32ed9916e0..6eaf053d1d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/UsesInterfaceWithProperties.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UsesInterfaceWithProperties.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(UsesInterfaceWithProperties), "jsii-calc.UsesInterfaceWithProperties", "[{\"name\":\"obj\",\"type\":{\"fqn\":\"jsii-calc.IInterfaceWithProperties\"}}]")] public class UsesInterfaceWithProperties : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/VariadicMethod.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VariadicMethod.cs similarity index 95% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/VariadicMethod.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VariadicMethod.cs index cfab17985c..c2491df697 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/VariadicMethod.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VariadicMethod.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(VariadicMethod), "jsii-calc.VariadicMethod", "[{\"name\":\"prefix\",\"type\":{\"primitive\":\"number\"}}]")] public class VariadicMethod : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/VirtualMethodPlayground.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VirtualMethodPlayground.cs similarity index 97% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/VirtualMethodPlayground.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VirtualMethodPlayground.cs index 10b32f5296..e8955d3726 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/VirtualMethodPlayground.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VirtualMethodPlayground.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator +namespace Amazon.JSII.Tests.CalculatorNamespace { [JsiiClass(typeof(VirtualMethodPlayground), "jsii-calc.VirtualMethodPlayground", "[]")] public class VirtualMethodPlayground : DeputyBase diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/composition/CompositeOperation.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation.cs similarity index 95% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/composition/CompositeOperation.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation.cs index 07b3070acd..604d6e2db2 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/composition/CompositeOperation.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation.cs @@ -1,7 +1,7 @@ using Amazon.JSII.Runtime.Deputy; -using Amazon.JSII.Tests.Calculator.Lib; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; -namespace Amazon.JSII.Tests.Calculator.composition +namespace Amazon.JSII.Tests.CalculatorNamespace.composition { /// Abstract operation composed from an expression of other operations. [JsiiClass(typeof(CompositeOperation), "jsii-calc.composition.CompositeOperation", "[]")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/composition/CompositionStringStyle.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositionStringStyle.cs similarity index 86% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/composition/CompositionStringStyle.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositionStringStyle.cs index 41df36d709..919810e480 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/composition/CompositionStringStyle.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositionStringStyle.cs @@ -1,6 +1,6 @@ using Amazon.JSII.Runtime.Deputy; -namespace Amazon.JSII.Tests.Calculator.composition +namespace Amazon.JSII.Tests.CalculatorNamespace.composition { /// Style of .toString() output for CompositeOperation. [JsiiEnum(typeof(CompositionStringStyle), "jsii-calc.composition.CompositionStringStyle")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/AssemblyInfo.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/AssemblyInfo.cs similarity index 100% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/AssemblyInfo.cs rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/AssemblyInfo.cs diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/jsii-calc-0.6.4.tgz b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/jsii-calc-0.6.4.tgz similarity index 100% rename from packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.Calculator/jsii-calc-0.6.4.tgz rename to packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/jsii-calc-0.6.4.tgz diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/pom.xml b/packages/jsii-pacmak/test/expected.jsii-calc/java/pom.xml index 9cc6ac1db8..9d3305b37b 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/java/pom.xml +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/pom.xml @@ -2,7 +2,7 @@ 4.0.0 ${project.groupId}:${project.artifactId} - jsii-calc + A simple calcuator built on JSII. https://github.com/awslabs/jsii.git diff --git a/packages/jsii-ruby-runtime/package.json b/packages/jsii-ruby-runtime/package.json deleted file mode 100644 index 854f9c1360..0000000000 --- a/packages/jsii-ruby-runtime/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "jsii-ruby-runtime", - "version": "0.6.4", - "description": "Ruby client for jsii runtime", - "main": "lib/index.js", - "types": "lib/index.d.ts", - "private": true, - "scripts": { - "gen": "/bin/bash generate.sh", - "deps": "cd project && bundle install", - "lint": "cd project && rubocop", - "build": "npm run gen && npm run deps && npm run lint && gem build project/*.gemspec", - "test": "cd project && ruby test/suite.rb", - "package": "package-ruby" - }, - "devDependencies": { - "@types/node": "^9.6.18", - "jsii-build-tools": "^0.6.4", - "jsii-calc": "^0.6.4", - "jsii-pacmak": "^0.6.4", - "jsii-runtime": "^0.6.4", - "typescript": "^3.0.1" - }, - "author": { - "name": "Amazon Web Services", - "url": "https://aws.amazon.com", - "email": "aws-jsii@amazon.com" - }, - "license": "Apache-2.0", - "repository": { - "type": "git", - "url": "https://github.com/awslabs/jsii.git" - }, - "homepage": "https://github.com/awslabs/jsii" -} From 4ca58e5593c1450d2a97237a6e0f8ea401060c23 Mon Sep 17 00:00:00 2001 From: Matthew Pirocchi Date: Mon, 13 Aug 2018 14:26:14 -0700 Subject: [PATCH 4/7] Restore accidentally deleted file. --- packages/jsii-ruby-runtime/package.json | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 packages/jsii-ruby-runtime/package.json diff --git a/packages/jsii-ruby-runtime/package.json b/packages/jsii-ruby-runtime/package.json new file mode 100644 index 0000000000..854f9c1360 --- /dev/null +++ b/packages/jsii-ruby-runtime/package.json @@ -0,0 +1,35 @@ +{ + "name": "jsii-ruby-runtime", + "version": "0.6.4", + "description": "Ruby client for jsii runtime", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "private": true, + "scripts": { + "gen": "/bin/bash generate.sh", + "deps": "cd project && bundle install", + "lint": "cd project && rubocop", + "build": "npm run gen && npm run deps && npm run lint && gem build project/*.gemspec", + "test": "cd project && ruby test/suite.rb", + "package": "package-ruby" + }, + "devDependencies": { + "@types/node": "^9.6.18", + "jsii-build-tools": "^0.6.4", + "jsii-calc": "^0.6.4", + "jsii-pacmak": "^0.6.4", + "jsii-runtime": "^0.6.4", + "typescript": "^3.0.1" + }, + "author": { + "name": "Amazon Web Services", + "url": "https://aws.amazon.com", + "email": "aws-jsii@amazon.com" + }, + "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "https://github.com/awslabs/jsii.git" + }, + "homepage": "https://github.com/awslabs/jsii" +} From e4a06114ea4c19a7f2ba13955615607d5b880bab Mon Sep 17 00:00:00 2001 From: Matthew Pirocchi Date: Mon, 13 Aug 2018 14:40:09 -0700 Subject: [PATCH 5/7] Update README for dotnet target spec changes. --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2bbf406670..f780273db9 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,8 @@ Edit your `package.json`: } }, "dotnet": { - "namespace": "Acme.Hello" + "namespace": "Acme.Hello", + "packageId": "Acme.Hello" }, "sphinx": { } } @@ -136,7 +137,8 @@ You should also see a `.jsii` file in the root: "schema": "jsii/1.0", "targets": { "dotnet": { - "namespace": "Acme.Hello" + "namespace": "Acme.Hello", + "packageId": "Acme.Hello" }, "java": { "maven": { @@ -265,7 +267,15 @@ The following targets are currently supported: ```json { "dotnet": { - "namespace": "Acme.Hello" + /* required */ + "namespace": "Acme.Hello", + "packageId": "Acme.Hello", + + /* optional */ + "title": "ACME Hello", + "iconUrl": "path/to/icon.svg", + "signAssembly": true, + "assemblyOriginatorKey": "key.snk" } } ``` From aae26fdd50f314ffea0ada18128fb4b3d329e246 Mon Sep 17 00:00:00 2001 From: Matthew Pirocchi Date: Tue, 14 Aug 2018 10:56:52 -0700 Subject: [PATCH 6/7] Update README based on PR feedback. --- README.md | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f780273db9..a162aad8c3 100644 --- a/README.md +++ b/README.md @@ -86,8 +86,8 @@ Edit your `package.json`: } }, "dotnet": { - "namespace": "Acme.Hello", - "packageId": "Acme.Hello" + "namespace": "Acme.HelloNamespace", + "packageId": "Acme.HelloPackage" }, "sphinx": { } } @@ -137,8 +137,8 @@ You should also see a `.jsii` file in the root: "schema": "jsii/1.0", "targets": { "dotnet": { - "namespace": "Acme.Hello", - "packageId": "Acme.Hello" + "namespace": "Acme.HelloNamespace", + "packageId": "Acme.HelloPackage" }, "java": { "maven": { @@ -264,18 +264,26 @@ The following targets are currently supported: * `dotnet` - packages the module as a .NET/NuGet package. Requires the following config: -```json +```js { "dotnet": { - /* required */ - "namespace": "Acme.Hello", - "packageId": "Acme.Hello", + /* Required. */ + "namespace": "Acme.HelloNamespace", + + /* Required. */ + "packageId": "Acme.HelloPackage", - /* optional */ + /* Optional. Default: Value of packageId. */ "title": "ACME Hello", + + /* Optional. Default: null (no icon). */ "iconUrl": "path/to/icon.svg", + + /* Optional. Used in conjunction with assemblyOriginatorKey. Default: false. */ "signAssembly": true, - "assemblyOriginatorKey": "key.snk" + + /* Optional. Used in conjunction with signAssembly. Default: null. */ + "assemblyOriginatorKey": "path/to/key.snk" } } ``` From 6d2f1d16913b3ce0c06f0ce01991bd038c3dca66 Mon Sep 17 00:00:00 2001 From: Matthew Pirocchi Date: Wed, 15 Aug 2018 11:14:03 -0700 Subject: [PATCH 7/7] Update test expectations. --- .../.jsii | 2 +- .../.jsii | 2 +- .../.jsii | 2830 +++++++++++++++++ ...azon.JSII.Tests.CalculatorPackageId.csproj | 24 + .../JSII/Tests/CalculatorNamespace/Add.cs | 36 + .../Tests/CalculatorNamespace/AllTypes.cs | 166 + .../Tests/CalculatorNamespace/AllTypesEnum.cs | 15 + .../CalculatorNamespace/AllowedMethodNames.cs | 46 + .../AsyncVirtualMethods.cs | 63 + .../CalculatorNamespace/BinaryOperation.cs | 43 + .../Tests/CalculatorNamespace/Calculator.cs | 104 + .../CalculatorNamespace/CalculatorProps.cs | 22 + .../CalculatorPropsProxy.cs | 27 + .../DerivedClassHasNoProperties/Base.cs | 27 + .../DerivedClassHasNoProperties/Derived.cs | 20 + .../CalculatorNamespace/DerivedStruct.cs | 71 + .../CalculatorNamespace/DerivedStructProxy.cs | 76 + .../CalculatorNamespace/DoubleTrouble.cs | 34 + .../CalculatorNamespace/GiveMeStructs.cs | 48 + .../CalculatorNamespace/ICalculatorProps.cs | 23 + .../CalculatorNamespace/IDerivedStruct.cs | 49 + .../CalculatorNamespace/IFriendlierProxy.cs | 35 + .../IFriendlyRandomGeneratorProxy.cs | 27 + .../Tests/CalculatorNamespace/IIFriendlier.cs | 18 + .../IIFriendlyRandomGenerator.cs | 10 + .../IIInterfaceWithProperties.cs | 21 + .../IIInterfaceWithPropertiesExtension.cs | 15 + .../IIRandomNumberGenerator.cs | 14 + .../CalculatorNamespace/IImplictBaseOfBase.cs | 17 + .../IInterfaceWithProperties.cs | 20 + .../IInterfaceWithPropertiesExtension.cs | 27 + .../IInterfaceWithPropertiesExtensionProxy.cs | 32 + .../IInterfaceWithPropertiesProxy.cs | 25 + .../IRandomNumberGeneratorProxy.cs | 21 + .../CalculatorNamespace/IReturnsNumber.cs | 17 + .../CalculatorNamespace/IUnionProperties.cs | 21 + .../CalculatorNamespace/ImplictBaseOfBase.cs | 30 + .../ImplictBaseOfBaseProxy.cs | 35 + .../JSObjectLiteralForInterface.cs | 33 + .../JSObjectLiteralToNative.cs | 26 + .../JSObjectLiteralToNativeClass.cs | 34 + .../CalculatorNamespace/JavaReservedWords.cs | 339 ++ .../Tests/CalculatorNamespace/Multiply.cs | 57 + .../JSII/Tests/CalculatorNamespace/Negate.cs | 57 + .../NodeStandardLibrary.cs | 52 + .../CalculatorNamespace/NumberGenerator.cs | 43 + .../ObjectRefsInCollections.cs | 37 + .../OverrideReturnsObject.cs | 26 + .../Tests/CalculatorNamespace/Polymorphism.cs | 27 + .../JSII/Tests/CalculatorNamespace/Power.cs | 47 + .../ReferenceEnumFromScopedPackage.cs | 41 + .../CalculatorNamespace/ReturnsNumberProxy.cs | 24 + .../RuntimeTypeChecking.cs | 28 + .../JSII/Tests/CalculatorNamespace/Statics.cs | 90 + .../Tests/CalculatorNamespace/StringEnum.cs | 15 + .../JSII/Tests/CalculatorNamespace/Sum.cs | 41 + .../CalculatorNamespace/SyncVirtualMethods.cs | 121 + .../JSII/Tests/CalculatorNamespace/Thrower.cs | 26 + .../CalculatorNamespace/UnaryOperation.cs | 28 + .../CalculatorNamespace/UnionProperties.cs | 20 + .../UnionPropertiesProxy.cs | 25 + .../UseBundledDependency.cs | 26 + .../Tests/CalculatorNamespace/UseCalcBase.cs | 28 + .../UsesInterfaceWithProperties.cs | 44 + .../CalculatorNamespace/VariadicMethod.cs | 28 + .../VirtualMethodPlayground.cs | 50 + .../CompositionStringStyle.cs | 14 + .../composition/CompositeOperation_.cs | 71 + .../AssemblyInfo.cs | 3 + .../jsii-calc-0.6.4.tgz | 2 + packages/jsii-runtime/package-lock.json | 28 +- 71 files changed, 5635 insertions(+), 9 deletions(-) create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon.JSII.Tests.CalculatorPackageId.csproj create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Add.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypesEnum.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllowedMethodNames.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AsyncVirtualMethods.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BinaryOperation.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorProps.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorPropsProxy.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Base.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Derived.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStruct.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStructProxy.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoubleTrouble.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GiveMeStructs.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ICalculatorProps.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDerivedStruct.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlierProxy.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlyRandomGeneratorProxy.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlier.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlyRandomGenerator.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithProperties.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithPropertiesExtension.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIRandomNumberGenerator.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IImplictBaseOfBase.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithProperties.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtension.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtensionProxy.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesProxy.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IRandomNumberGeneratorProxy.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IReturnsNumber.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IUnionProperties.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBase.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBaseProxy.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralForInterface.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNative.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNativeClass.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JavaReservedWords.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Multiply.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Negate.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NodeStandardLibrary.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NumberGenerator.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ObjectRefsInCollections.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OverrideReturnsObject.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Polymorphism.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Power.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReferenceEnumFromScopedPackage.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReturnsNumberProxy.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/RuntimeTypeChecking.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Statics.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StringEnum.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Sum.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SyncVirtualMethods.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Thrower.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnaryOperation.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionPropertiesProxy.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseBundledDependency.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseCalcBase.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UsesInterfaceWithProperties.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VariadicMethod.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VirtualMethodPlayground.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation/CompositionStringStyle.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation_.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/AssemblyInfo.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/jsii-calc-0.6.4.tgz diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/.jsii index 355efd6ba9..3209725ad2 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/.jsii +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/.jsii @@ -102,5 +102,5 @@ } }, "version": "0.6.4", - "fingerprint": "b+UZfT/No0vxqTQ1n3lIsyw7olqARDbeGj853lNFoE8=" + "fingerprint": "3lcys0/Cd5ZbPR/CXccsL3Fdb66mNsVBs8jb+ySL0oU=" } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/.jsii index f38527b494..94d0c8912e 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/.jsii +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/.jsii @@ -318,5 +318,5 @@ } }, "version": "0.6.4", - "fingerprint": "MHdlbqyf1RV6moIHslfpKnl7yjQoYVvvZLfxFXWihrU=" + "fingerprint": "jA30G5c81DZXD/7DMYLvdlY8XwEevVQAMAwkUBmPE64=" } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii new file mode 100644 index 0000000000..f57bded816 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii @@ -0,0 +1,2830 @@ +{ + "author": { + "name": "Amazon Web Services", + "organization": true, + "roles": [ + "author" + ], + "url": "https://aws.amazon.com" + }, + "bundled": { + "jsii-calc-bundled": "^0.6.4" + }, + "contributors": [ + { + "name": "Elad Ben-Israel", + "roles": [ + "maintainer" + ], + "url": "https://github.com/eladb" + }, + { + "name": "Rico Huijbers", + "roles": [ + "maintainer" + ], + "url": "https://github.com/rix0rrr" + }, + { + "name": "Romain Marcadier-Muller", + "roles": [ + "maintainer" + ], + "url": "https://github.com/RomainMuller" + } + ], + "dependencies": { + "@scope/jsii-calc-base": { + "dependencies": { + "@scope/jsii-calc-base-of-base": { + "targets": { + "dotnet": { + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" + }, + "java": { + "maven": { + "artifactId": "calculator-base-of-base", + "groupId": "software.amazon.jsii.tests" + }, + "package": "software.amazon.jsii.tests.calculator.baseofbase" + }, + "js": { + "npm": "@scope/jsii-calc-base-of-base" + } + }, + "version": "0.6.4" + } + }, + "targets": { + "dotnet": { + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId" + }, + "java": { + "maven": { + "artifactId": "calculator-base", + "groupId": "software.amazon.jsii.tests" + }, + "package": "software.amazon.jsii.tests.calculator.base" + }, + "js": { + "npm": "@scope/jsii-calc-base" + } + }, + "version": "0.6.4" + }, + "@scope/jsii-calc-lib": { + "dependencies": { + "@scope/jsii-calc-base": { + "dependencies": { + "@scope/jsii-calc-base-of-base": { + "targets": { + "dotnet": { + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId" + }, + "java": { + "maven": { + "artifactId": "calculator-base-of-base", + "groupId": "software.amazon.jsii.tests" + }, + "package": "software.amazon.jsii.tests.calculator.baseofbase" + }, + "js": { + "npm": "@scope/jsii-calc-base-of-base" + } + }, + "version": "0.6.4" + } + }, + "targets": { + "dotnet": { + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId" + }, + "java": { + "maven": { + "artifactId": "calculator-base", + "groupId": "software.amazon.jsii.tests" + }, + "package": "software.amazon.jsii.tests.calculator.base" + }, + "js": { + "npm": "@scope/jsii-calc-base" + } + }, + "version": "0.6.4" + } + }, + "targets": { + "dotnet": { + "namespace": "Amazon.JSII.Tests.CalculatorNamespace.LibNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId.LibPackageId" + }, + "java": { + "maven": { + "artifactId": "calculator-lib", + "groupId": "software.amazon.jsii.tests" + }, + "package": "software.amazon.jsii.tests.calculator.lib" + }, + "js": { + "npm": "@scope/jsii-calc-lib" + } + }, + "version": "0.6.4" + } + }, + "description": "A simple calcuator built on JSII.", + "homepage": "https://github.com/awslabs/jsii.git", + "license": "Apache-2.0", + "name": "jsii-calc", + "readme": { + "markdown": "## JSII Calculator\n\nThis library is used to demonstrate and test the features of JSII\n" + }, + "repository": { + "type": "git", + "url": "https://github.com/awslabs/jsii.git" + }, + "schema": "jsii/1.0", + "targets": { + "dotnet": { + "namespace": "Amazon.JSII.Tests.CalculatorNamespace", + "packageId": "Amazon.JSII.Tests.CalculatorPackageId" + }, + "java": { + "maven": { + "artifactId": "calculator", + "groupId": "software.amazon.jsii.tests" + }, + "package": "software.amazon.jsii.tests.calculator" + }, + "js": { + "npm": "jsii-calc" + } + }, + "types": { + "jsii-calc.Add": { + "assembly": "jsii-calc", + "base": { + "fqn": "jsii-calc.BinaryOperation" + }, + "docs": { + "comment": "The \"+\" binary operation." + }, + "fqn": "jsii-calc.Add", + "initializer": { + "docs": { + "comment": "Creates a BinaryOperation" + }, + "initializer": true, + "parameters": [ + { + "docs": { + "comment": "Left-hand side operand" + }, + "name": "lhs", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + }, + { + "docs": { + "comment": "Right-hand side operand" + }, + "name": "rhs", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + } + ] + }, + "kind": "class", + "methods": [ + { + "docs": { + "comment": "String representation of the value." + }, + "name": "toString", + "returns": { + "primitive": "string" + } + } + ], + "name": "Add", + "namespace": "jsii-calc", + "properties": [ + { + "docs": { + "comment": "The value." + }, + "immutable": true, + "name": "value", + "type": { + "primitive": "number" + } + } + ] + }, + "jsii-calc.AllTypes": { + "assembly": "jsii-calc", + "docs": { + "comment": "This class includes property for all types supported by jsii. The setters will validate\nthat the value set is of the expected type and throw otherwise." + }, + "fqn": "jsii-calc.AllTypes", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "name": "enumMethod", + "parameters": [ + { + "name": "value", + "type": { + "fqn": "jsii-calc.StringEnum" + } + } + ], + "returns": { + "fqn": "jsii-calc.StringEnum" + } + } + ], + "name": "AllTypes", + "namespace": "jsii-calc", + "properties": [ + { + "immutable": true, + "name": "enumPropertyValue", + "type": { + "primitive": "number" + } + }, + { + "name": "anyArrayProperty", + "type": { + "collection": { + "elementtype": { + "primitive": "any" + }, + "kind": "array" + } + } + }, + { + "name": "anyMapProperty", + "type": { + "collection": { + "elementtype": { + "primitive": "any" + }, + "kind": "map" + } + } + }, + { + "name": "anyProperty", + "type": { + "primitive": "any" + } + }, + { + "name": "arrayProperty", + "type": { + "collection": { + "elementtype": { + "primitive": "string" + }, + "kind": "array" + } + } + }, + { + "name": "booleanProperty", + "type": { + "primitive": "boolean" + } + }, + { + "name": "dateProperty", + "type": { + "primitive": "date" + } + }, + { + "name": "enumProperty", + "type": { + "fqn": "jsii-calc.AllTypesEnum" + } + }, + { + "name": "jsonProperty", + "type": { + "primitive": "json" + } + }, + { + "name": "mapProperty", + "type": { + "collection": { + "elementtype": { + "primitive": "number" + }, + "kind": "map" + } + } + }, + { + "name": "numberProperty", + "type": { + "primitive": "number" + } + }, + { + "name": "stringProperty", + "type": { + "primitive": "string" + } + }, + { + "name": "unionArrayProperty", + "type": { + "collection": { + "elementtype": { + "union": { + "types": [ + { + "primitive": "number" + }, + { + "fqn": "jsii-calc.composition.CompositeOperation" + } + ] + } + }, + "kind": "array" + } + } + }, + { + "name": "unionMapProperty", + "type": { + "collection": { + "elementtype": { + "union": { + "types": [ + { + "primitive": "string" + }, + { + "primitive": "number" + } + ] + } + }, + "kind": "map" + } + } + }, + { + "name": "unionProperty", + "type": { + "union": { + "types": [ + { + "primitive": "string" + }, + { + "primitive": "number" + }, + { + "fqn": "jsii-calc.Multiply" + } + ] + } + } + }, + { + "name": "unknownArrayProperty", + "type": { + "collection": { + "elementtype": { + "primitive": "any" + }, + "kind": "array" + } + } + }, + { + "name": "unknownMapProperty", + "type": { + "collection": { + "elementtype": { + "primitive": "any" + }, + "kind": "map" + } + } + }, + { + "name": "unknownProperty", + "type": { + "primitive": "any" + } + }, + { + "name": "optionalEnumValue", + "type": { + "fqn": "jsii-calc.StringEnum", + "optional": true + } + } + ] + }, + "jsii-calc.AllTypesEnum": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.AllTypesEnum", + "kind": "enum", + "members": [ + { + "name": "MyEnumValue" + }, + { + "name": "YourEnumValue" + }, + { + "name": "ThisIsGreat" + } + ], + "name": "AllTypesEnum", + "namespace": "jsii-calc" + }, + "jsii-calc.AllowedMethodNames": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.AllowedMethodNames", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "name": "getBar", + "parameters": [ + { + "name": "_p1", + "type": { + "primitive": "string" + } + }, + { + "name": "_p2", + "type": { + "primitive": "number" + } + } + ] + }, + { + "docs": { + "comment": "getXxx() is not allowed (see negatives), but getXxx(a, ...) is okay." + }, + "name": "getFoo", + "parameters": [ + { + "name": "withParam", + "type": { + "primitive": "string" + } + } + ], + "returns": { + "primitive": "string" + } + }, + { + "name": "setBar", + "parameters": [ + { + "name": "_x", + "type": { + "primitive": "string" + } + }, + { + "name": "_y", + "type": { + "primitive": "number" + } + }, + { + "name": "_z", + "type": { + "primitive": "boolean" + } + } + ] + }, + { + "docs": { + "comment": "setFoo(x) is not allowed (see negatives), but setXxx(a, b, ...) is okay." + }, + "name": "setFoo", + "parameters": [ + { + "name": "_x", + "type": { + "primitive": "string" + } + }, + { + "name": "_y", + "type": { + "primitive": "number" + } + } + ] + } + ], + "name": "AllowedMethodNames", + "namespace": "jsii-calc" + }, + "jsii-calc.AsyncVirtualMethods": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.AsyncVirtualMethods", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "name": "callMe", + "returns": { + "primitive": "number", + "promise": true + } + }, + { + "docs": { + "comment": "Just calls \"overrideMeToo\"" + }, + "name": "callMe2", + "returns": { + "primitive": "number", + "promise": true + } + }, + { + "docs": { + "comment": "This method calls the \"callMe\" async method indirectly, which will then\ninvoke a virtual method. This is a \"double promise\" situation, which\nmeans that callbacks are not going to be available immediate, but only\nafter an \"immediates\" cycle." + }, + "name": "callMeDoublePromise", + "returns": { + "primitive": "number", + "promise": true + } + }, + { + "name": "dontOverrideMe", + "returns": { + "primitive": "number" + } + }, + { + "name": "overrideMe", + "parameters": [ + { + "name": "mult", + "type": { + "primitive": "number" + } + } + ], + "returns": { + "primitive": "number", + "promise": true + } + }, + { + "name": "overrideMeToo", + "returns": { + "primitive": "number", + "promise": true + } + } + ], + "name": "AsyncVirtualMethods", + "namespace": "jsii-calc" + }, + "jsii-calc.BinaryOperation": { + "abstract": true, + "assembly": "jsii-calc", + "base": { + "fqn": "@scope/jsii-calc-lib.Operation" + }, + "docs": { + "comment": "Represents an operation with two operands." + }, + "fqn": "jsii-calc.BinaryOperation", + "initializer": { + "docs": { + "comment": "Creates a BinaryOperation" + }, + "initializer": true, + "parameters": [ + { + "docs": { + "comment": "Left-hand side operand" + }, + "name": "lhs", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + }, + { + "docs": { + "comment": "Right-hand side operand" + }, + "name": "rhs", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + } + ] + }, + "interfaces": [ + { + "fqn": "@scope/jsii-calc-lib.IFriendly" + } + ], + "kind": "class", + "methods": [ + { + "docs": { + "comment": "Say hello!" + }, + "name": "hello", + "returns": { + "primitive": "string" + } + } + ], + "name": "BinaryOperation", + "namespace": "jsii-calc", + "properties": [ + { + "docs": { + "comment": "Left-hand side operand" + }, + "immutable": true, + "name": "lhs", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + }, + { + "docs": { + "comment": "Right-hand side operand" + }, + "immutable": true, + "name": "rhs", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + } + ] + }, + "jsii-calc.Calculator": { + "assembly": "jsii-calc", + "base": { + "fqn": "jsii-calc.composition.CompositeOperation" + }, + "docs": { + "comment": "A calculator which maintains a current value and allows adding operations." + }, + "fqn": "jsii-calc.Calculator", + "initializer": { + "docs": { + "comment": "Creates a Calculator object." + }, + "initializer": true, + "parameters": [ + { + "docs": { + "comment": "Initialization properties." + }, + "name": "props", + "type": { + "fqn": "jsii-calc.CalculatorProps", + "optional": true + } + } + ] + }, + "kind": "class", + "methods": [ + { + "docs": { + "comment": "Adds a number to the current value." + }, + "name": "add", + "parameters": [ + { + "name": "value", + "type": { + "primitive": "number" + } + } + ] + }, + { + "docs": { + "comment": "Multiplies the current value by a number." + }, + "name": "mul", + "parameters": [ + { + "name": "value", + "type": { + "primitive": "number" + } + } + ] + }, + { + "docs": { + "comment": "Negates the current value." + }, + "name": "neg" + }, + { + "docs": { + "comment": "Raises the current value by a power." + }, + "name": "pow", + "parameters": [ + { + "name": "value", + "type": { + "primitive": "number" + } + } + ] + }, + { + "docs": { + "comment": "Returns teh value of the union property (if defined)." + }, + "name": "readUnionValue", + "returns": { + "primitive": "number" + } + } + ], + "name": "Calculator", + "namespace": "jsii-calc", + "properties": [ + { + "docs": { + "comment": "Returns the expression." + }, + "immutable": true, + "name": "expression", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + }, + { + "docs": { + "comment": "A log of all operations." + }, + "immutable": true, + "name": "operationsLog", + "type": { + "collection": { + "elementtype": { + "fqn": "@scope/jsii-calc-lib.Value" + }, + "kind": "array" + } + } + }, + { + "docs": { + "comment": "A map of per operation name of all operations performed." + }, + "immutable": true, + "name": "operationsMap", + "type": { + "collection": { + "elementtype": { + "collection": { + "elementtype": { + "fqn": "@scope/jsii-calc-lib.Value" + }, + "kind": "array" + } + }, + "kind": "map" + } + } + }, + { + "docs": { + "comment": "The current value." + }, + "name": "curr", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + }, + { + "docs": { + "comment": "The maximum value allows in this calculator." + }, + "name": "maxValue", + "type": { + "optional": true, + "primitive": "number" + } + }, + { + "docs": { + "comment": "Example of a property that accepts a union of types." + }, + "name": "unionProperty", + "type": { + "optional": true, + "union": { + "types": [ + { + "fqn": "jsii-calc.Add" + }, + { + "fqn": "jsii-calc.Multiply" + }, + { + "fqn": "jsii-calc.Power" + } + ] + } + } + } + ] + }, + "jsii-calc.CalculatorProps": { + "assembly": "jsii-calc", + "datatype": true, + "docs": { + "comment": "Properties for Calculator." + }, + "fqn": "jsii-calc.CalculatorProps", + "kind": "interface", + "name": "CalculatorProps", + "namespace": "jsii-calc", + "properties": [ + { + "name": "initialValue", + "type": { + "optional": true, + "primitive": "number" + } + }, + { + "name": "maximumValue", + "type": { + "optional": true, + "primitive": "number" + } + } + ] + }, + "jsii-calc.DerivedClassHasNoProperties.Base": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.DerivedClassHasNoProperties.Base", + "initializer": { + "initializer": true + }, + "kind": "class", + "name": "Base", + "namespace": "jsii-calc.DerivedClassHasNoProperties", + "properties": [ + { + "name": "prop", + "type": { + "primitive": "string" + } + } + ] + }, + "jsii-calc.DerivedClassHasNoProperties.Derived": { + "assembly": "jsii-calc", + "base": { + "fqn": "jsii-calc.DerivedClassHasNoProperties.Base" + }, + "fqn": "jsii-calc.DerivedClassHasNoProperties.Derived", + "initializer": { + "initializer": true + }, + "kind": "class", + "name": "Derived", + "namespace": "jsii-calc.DerivedClassHasNoProperties" + }, + "jsii-calc.DerivedStruct": { + "assembly": "jsii-calc", + "datatype": true, + "docs": { + "comment": "A struct which derives from another struct." + }, + "fqn": "jsii-calc.DerivedStruct", + "interfaces": [ + { + "fqn": "@scope/jsii-calc-lib.MyFirstStruct" + } + ], + "kind": "interface", + "name": "DerivedStruct", + "namespace": "jsii-calc", + "properties": [ + { + "name": "anotherRequired", + "type": { + "primitive": "date" + } + }, + { + "name": "bool", + "type": { + "primitive": "boolean" + } + }, + { + "docs": { + "comment": "An example of a non primitive property." + }, + "name": "nonPrimitive", + "type": { + "fqn": "jsii-calc.DoubleTrouble" + } + }, + { + "docs": { + "comment": "This is optional." + }, + "name": "anotherOptional", + "type": { + "collection": { + "elementtype": { + "fqn": "@scope/jsii-calc-lib.Value" + }, + "kind": "map" + }, + "optional": true + } + }, + { + "name": "optionalArray", + "type": { + "collection": { + "elementtype": { + "primitive": "string" + }, + "kind": "array" + }, + "optional": true + } + } + ] + }, + "jsii-calc.DoubleTrouble": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.DoubleTrouble", + "initializer": { + "initializer": true + }, + "interfaces": [ + { + "fqn": "jsii-calc.IFriendlyRandomGenerator" + } + ], + "kind": "class", + "methods": [ + { + "docs": { + "comment": "Say hello!" + }, + "name": "hello", + "returns": { + "primitive": "string" + } + }, + { + "docs": { + "comment": "Returns another random number." + }, + "name": "next", + "returns": { + "primitive": "number" + } + } + ], + "name": "DoubleTrouble", + "namespace": "jsii-calc" + }, + "jsii-calc.GiveMeStructs": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.GiveMeStructs", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "docs": { + "comment": "Accepts a struct of type DerivedStruct and returns a struct of type FirstStruct." + }, + "name": "derivedToFirst", + "parameters": [ + { + "name": "derived", + "type": { + "fqn": "jsii-calc.DerivedStruct" + } + } + ], + "returns": { + "fqn": "@scope/jsii-calc-lib.MyFirstStruct" + } + }, + { + "docs": { + "comment": "Returns the boolean from a DerivedStruct struct." + }, + "name": "readDerivedNonPrimitive", + "parameters": [ + { + "name": "derived", + "type": { + "fqn": "jsii-calc.DerivedStruct" + } + } + ], + "returns": { + "fqn": "jsii-calc.DoubleTrouble" + } + }, + { + "docs": { + "comment": "Returns the \"anumber\" from a MyFirstStruct struct;" + }, + "name": "readFirstNumber", + "parameters": [ + { + "name": "first", + "type": { + "fqn": "@scope/jsii-calc-lib.MyFirstStruct" + } + } + ], + "returns": { + "primitive": "number" + } + } + ], + "name": "GiveMeStructs", + "namespace": "jsii-calc", + "properties": [ + { + "immutable": true, + "name": "structLiteral", + "type": { + "fqn": "@scope/jsii-calc-lib.StructWithOnlyOptionals" + } + } + ] + }, + "jsii-calc.IFriendlier": { + "assembly": "jsii-calc", + "docs": { + "comment": "Even friendlier classes can implement this interface." + }, + "fqn": "jsii-calc.IFriendlier", + "interfaces": [ + { + "fqn": "@scope/jsii-calc-lib.IFriendly" + } + ], + "kind": "interface", + "methods": [ + { + "docs": { + "comment": "Say farewell." + }, + "name": "farewell", + "returns": { + "primitive": "string" + } + }, + { + "docs": { + "comment": "Say goodbye.", + "return": "A goodbye blessing." + }, + "name": "goodbye", + "returns": { + "primitive": "string" + } + } + ], + "name": "IFriendlier", + "namespace": "jsii-calc" + }, + "jsii-calc.IFriendlyRandomGenerator": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.IFriendlyRandomGenerator", + "interfaces": [ + { + "fqn": "jsii-calc.IRandomNumberGenerator" + }, + { + "fqn": "@scope/jsii-calc-lib.IFriendly" + } + ], + "kind": "interface", + "name": "IFriendlyRandomGenerator", + "namespace": "jsii-calc" + }, + "jsii-calc.IInterfaceWithProperties": { + "assembly": "jsii-calc", + "datatype": true, + "fqn": "jsii-calc.IInterfaceWithProperties", + "kind": "interface", + "name": "IInterfaceWithProperties", + "namespace": "jsii-calc", + "properties": [ + { + "immutable": true, + "name": "readOnlyString", + "type": { + "primitive": "string" + } + }, + { + "name": "readWriteString", + "type": { + "primitive": "string" + } + } + ] + }, + "jsii-calc.IInterfaceWithPropertiesExtension": { + "assembly": "jsii-calc", + "datatype": true, + "fqn": "jsii-calc.IInterfaceWithPropertiesExtension", + "interfaces": [ + { + "fqn": "jsii-calc.IInterfaceWithProperties" + } + ], + "kind": "interface", + "name": "IInterfaceWithPropertiesExtension", + "namespace": "jsii-calc", + "properties": [ + { + "name": "foo", + "type": { + "primitive": "number" + } + } + ] + }, + "jsii-calc.IRandomNumberGenerator": { + "assembly": "jsii-calc", + "docs": { + "comment": "Generates random numbers." + }, + "fqn": "jsii-calc.IRandomNumberGenerator", + "kind": "interface", + "methods": [ + { + "docs": { + "comment": "Returns another random number.", + "return": "A random number." + }, + "name": "next", + "returns": { + "primitive": "number" + } + } + ], + "name": "IRandomNumberGenerator", + "namespace": "jsii-calc" + }, + "jsii-calc.ImplictBaseOfBase": { + "assembly": "jsii-calc", + "datatype": true, + "fqn": "jsii-calc.ImplictBaseOfBase", + "interfaces": [ + { + "fqn": "@scope/jsii-calc-base.BaseProps" + } + ], + "kind": "interface", + "name": "ImplictBaseOfBase", + "namespace": "jsii-calc", + "properties": [ + { + "name": "goo", + "type": { + "primitive": "date" + } + } + ] + }, + "jsii-calc.JSObjectLiteralForInterface": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.JSObjectLiteralForInterface", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "name": "giveMeFriendly", + "returns": { + "fqn": "@scope/jsii-calc-lib.IFriendly" + } + }, + { + "name": "giveMeFriendlyGenerator", + "returns": { + "fqn": "jsii-calc.IFriendlyRandomGenerator" + } + } + ], + "name": "JSObjectLiteralForInterface", + "namespace": "jsii-calc" + }, + "jsii-calc.JSObjectLiteralToNative": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.JSObjectLiteralToNative", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "name": "returnLiteral", + "returns": { + "fqn": "jsii-calc.JSObjectLiteralToNativeClass" + } + } + ], + "name": "JSObjectLiteralToNative", + "namespace": "jsii-calc" + }, + "jsii-calc.JSObjectLiteralToNativeClass": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.JSObjectLiteralToNativeClass", + "initializer": { + "initializer": true + }, + "kind": "class", + "name": "JSObjectLiteralToNativeClass", + "namespace": "jsii-calc", + "properties": [ + { + "name": "propA", + "type": { + "primitive": "string" + } + }, + { + "name": "propB", + "type": { + "primitive": "number" + } + } + ] + }, + "jsii-calc.JavaReservedWords": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.JavaReservedWords", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "name": "abstract" + }, + { + "name": "assert" + }, + { + "name": "boolean" + }, + { + "name": "break" + }, + { + "name": "byte" + }, + { + "name": "case" + }, + { + "name": "catch" + }, + { + "name": "char" + }, + { + "name": "class" + }, + { + "name": "const" + }, + { + "name": "continue" + }, + { + "name": "default" + }, + { + "name": "do" + }, + { + "name": "double" + }, + { + "name": "else" + }, + { + "name": "enum" + }, + { + "name": "extends" + }, + { + "name": "false" + }, + { + "name": "final" + }, + { + "name": "finally" + }, + { + "name": "float" + }, + { + "name": "for" + }, + { + "name": "goto" + }, + { + "name": "if" + }, + { + "name": "implements" + }, + { + "name": "import" + }, + { + "name": "instanceof" + }, + { + "name": "int" + }, + { + "name": "interface" + }, + { + "name": "long" + }, + { + "name": "native" + }, + { + "name": "new" + }, + { + "name": "null" + }, + { + "name": "package" + }, + { + "name": "private" + }, + { + "name": "protected" + }, + { + "name": "public" + }, + { + "name": "return" + }, + { + "name": "short" + }, + { + "name": "static" + }, + { + "name": "strictfp" + }, + { + "name": "super" + }, + { + "name": "switch" + }, + { + "name": "synchronized" + }, + { + "name": "this" + }, + { + "name": "throw" + }, + { + "name": "throws" + }, + { + "name": "transient" + }, + { + "name": "true" + }, + { + "name": "try" + }, + { + "name": "void" + }, + { + "name": "volatile" + } + ], + "name": "JavaReservedWords", + "namespace": "jsii-calc", + "properties": [ + { + "name": "while", + "type": { + "primitive": "string" + } + } + ] + }, + "jsii-calc.Multiply": { + "assembly": "jsii-calc", + "base": { + "fqn": "jsii-calc.BinaryOperation" + }, + "docs": { + "comment": "The \"*\" binary operation." + }, + "fqn": "jsii-calc.Multiply", + "initializer": { + "docs": { + "comment": "Creates a BinaryOperation" + }, + "initializer": true, + "parameters": [ + { + "docs": { + "comment": "Left-hand side operand" + }, + "name": "lhs", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + }, + { + "docs": { + "comment": "Right-hand side operand" + }, + "name": "rhs", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + } + ] + }, + "interfaces": [ + { + "fqn": "jsii-calc.IFriendlier" + }, + { + "fqn": "jsii-calc.IRandomNumberGenerator" + } + ], + "kind": "class", + "methods": [ + { + "docs": { + "comment": "Say farewell." + }, + "name": "farewell", + "returns": { + "primitive": "string" + } + }, + { + "docs": { + "comment": "Say goodbye." + }, + "name": "goodbye", + "returns": { + "primitive": "string" + } + }, + { + "docs": { + "comment": "Returns another random number." + }, + "name": "next", + "returns": { + "primitive": "number" + } + }, + { + "docs": { + "comment": "String representation of the value." + }, + "name": "toString", + "returns": { + "primitive": "string" + } + } + ], + "name": "Multiply", + "namespace": "jsii-calc", + "properties": [ + { + "docs": { + "comment": "The value." + }, + "immutable": true, + "name": "value", + "type": { + "primitive": "number" + } + } + ] + }, + "jsii-calc.Negate": { + "assembly": "jsii-calc", + "base": { + "fqn": "jsii-calc.UnaryOperation" + }, + "docs": { + "comment": "The negation operation (\"-value\")" + }, + "fqn": "jsii-calc.Negate", + "initializer": { + "initializer": true, + "parameters": [ + { + "name": "operand", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + } + ] + }, + "interfaces": [ + { + "fqn": "jsii-calc.IFriendlier" + } + ], + "kind": "class", + "methods": [ + { + "docs": { + "comment": "Say farewell." + }, + "name": "farewell", + "returns": { + "primitive": "string" + } + }, + { + "docs": { + "comment": "Say goodbye." + }, + "name": "goodbye", + "returns": { + "primitive": "string" + } + }, + { + "docs": { + "comment": "Say hello!" + }, + "name": "hello", + "returns": { + "primitive": "string" + } + }, + { + "docs": { + "comment": "String representation of the value." + }, + "name": "toString", + "returns": { + "primitive": "string" + } + } + ], + "name": "Negate", + "namespace": "jsii-calc", + "properties": [ + { + "docs": { + "comment": "The value." + }, + "immutable": true, + "name": "value", + "type": { + "primitive": "number" + } + } + ] + }, + "jsii-calc.NodeStandardLibrary": { + "assembly": "jsii-calc", + "docs": { + "comment": "Test fixture to verify that jsii modules can use the node standard library." + }, + "fqn": "jsii-calc.NodeStandardLibrary", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "docs": { + "comment": "Uses node.js \"crypto\" module to calculate sha256 of a string.", + "return": "\"6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50\"" + }, + "name": "cryptoSha256", + "returns": { + "primitive": "string" + } + }, + { + "docs": { + "comment": "Reads a local resource file (resource.txt) asynchronously.", + "return": "\"Hello, resource!\"" + }, + "name": "fsReadFile", + "returns": { + "primitive": "string", + "promise": true + } + }, + { + "docs": { + "comment": "Sync version of fsReadFile.", + "return": "\"Hello, resource! SYNC!\"" + }, + "name": "fsReadFileSync", + "returns": { + "primitive": "string" + } + } + ], + "name": "NodeStandardLibrary", + "namespace": "jsii-calc", + "properties": [ + { + "docs": { + "comment": "Returns the current os.platform() from the \"os\" node module." + }, + "immutable": true, + "name": "osPlatform", + "type": { + "primitive": "string" + } + } + ] + }, + "jsii-calc.NumberGenerator": { + "assembly": "jsii-calc", + "docs": { + "comment": "This allows us to test that a reference can be stored for objects that\nimplement interfaces." + }, + "fqn": "jsii-calc.NumberGenerator", + "initializer": { + "initializer": true, + "parameters": [ + { + "name": "generator", + "type": { + "fqn": "jsii-calc.IRandomNumberGenerator" + } + } + ] + }, + "kind": "class", + "methods": [ + { + "name": "isSameGenerator", + "parameters": [ + { + "name": "gen", + "type": { + "fqn": "jsii-calc.IRandomNumberGenerator" + } + } + ], + "returns": { + "primitive": "boolean" + } + }, + { + "name": "nextTimes100", + "returns": { + "primitive": "number" + } + } + ], + "name": "NumberGenerator", + "namespace": "jsii-calc", + "properties": [ + { + "name": "generator", + "type": { + "fqn": "jsii-calc.IRandomNumberGenerator" + } + } + ] + }, + "jsii-calc.ObjectRefsInCollections": { + "assembly": "jsii-calc", + "docs": { + "comment": "Verify that object references can be passed inside collections." + }, + "fqn": "jsii-calc.ObjectRefsInCollections", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "docs": { + "comment": "Returns the sum of all values" + }, + "name": "sumFromArray", + "parameters": [ + { + "name": "values", + "type": { + "collection": { + "elementtype": { + "fqn": "@scope/jsii-calc-lib.Value" + }, + "kind": "array" + } + } + } + ], + "returns": { + "primitive": "number" + } + }, + { + "docs": { + "comment": "Returns the sum of all values in a map" + }, + "name": "sumFromMap", + "parameters": [ + { + "name": "values", + "type": { + "collection": { + "elementtype": { + "fqn": "@scope/jsii-calc-lib.Value" + }, + "kind": "map" + } + } + } + ], + "returns": { + "primitive": "number" + } + } + ], + "name": "ObjectRefsInCollections", + "namespace": "jsii-calc" + }, + "jsii-calc.OverrideReturnsObject": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.OverrideReturnsObject", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "name": "test", + "parameters": [ + { + "name": "obj", + "type": { + "fqn": "jsii-calc.ReturnsNumber" + } + } + ], + "returns": { + "primitive": "number" + } + } + ], + "name": "OverrideReturnsObject", + "namespace": "jsii-calc" + }, + "jsii-calc.Polymorphism": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.Polymorphism", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "name": "sayHello", + "parameters": [ + { + "name": "friendly", + "type": { + "fqn": "@scope/jsii-calc-lib.IFriendly" + } + } + ], + "returns": { + "primitive": "string" + } + } + ], + "name": "Polymorphism", + "namespace": "jsii-calc" + }, + "jsii-calc.Power": { + "assembly": "jsii-calc", + "base": { + "fqn": "jsii-calc.composition.CompositeOperation" + }, + "docs": { + "comment": "The power operation." + }, + "fqn": "jsii-calc.Power", + "initializer": { + "docs": { + "comment": "Creates a Power operation." + }, + "initializer": true, + "parameters": [ + { + "docs": { + "comment": "The base of the power" + }, + "name": "base", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + }, + { + "docs": { + "comment": "The number of times to multiply" + }, + "name": "pow", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + } + ] + }, + "kind": "class", + "name": "Power", + "namespace": "jsii-calc", + "properties": [ + { + "docs": { + "comment": "The base of the power" + }, + "immutable": true, + "name": "base", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + }, + { + "docs": { + "comment": "The expression that this operation consists of.\nMust be implemented by derived classes." + }, + "immutable": true, + "name": "expression", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + }, + { + "docs": { + "comment": "The number of times to multiply" + }, + "immutable": true, + "name": "pow", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + } + ] + }, + "jsii-calc.ReferenceEnumFromScopedPackage": { + "assembly": "jsii-calc", + "docs": { + "comment": "See awslabs/jsii#138" + }, + "fqn": "jsii-calc.ReferenceEnumFromScopedPackage", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "name": "loadFoo", + "returns": { + "fqn": "@scope/jsii-calc-lib.EnumFromScopedModule", + "optional": true + } + }, + { + "name": "saveFoo", + "parameters": [ + { + "name": "value", + "type": { + "fqn": "@scope/jsii-calc-lib.EnumFromScopedModule" + } + } + ] + } + ], + "name": "ReferenceEnumFromScopedPackage", + "namespace": "jsii-calc", + "properties": [ + { + "name": "foo", + "type": { + "fqn": "@scope/jsii-calc-lib.EnumFromScopedModule", + "optional": true + } + } + ] + }, + "jsii-calc.ReturnsNumber": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.ReturnsNumber", + "kind": "interface", + "methods": [ + { + "name": "obtainNumber", + "returns": { + "primitive": "number" + } + } + ], + "name": "ReturnsNumber", + "namespace": "jsii-calc", + "properties": [ + { + "immutable": true, + "name": "numberProp", + "type": { + "primitive": "number" + } + } + ] + }, + "jsii-calc.RuntimeTypeChecking": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.RuntimeTypeChecking", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "docs": { + "comment": "Used to verify verification of number of method arguments." + }, + "name": "methodWithOptionalArguments", + "parameters": [ + { + "name": "arg1", + "type": { + "primitive": "number" + } + }, + { + "name": "arg2", + "type": { + "primitive": "string" + } + }, + { + "name": "arg3", + "type": { + "optional": true, + "primitive": "date" + } + } + ] + } + ], + "name": "RuntimeTypeChecking", + "namespace": "jsii-calc" + }, + "jsii-calc.Statics": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.Statics", + "initializer": { + "initializer": true, + "parameters": [ + { + "name": "value", + "type": { + "primitive": "string" + } + } + ] + }, + "kind": "class", + "methods": [ + { + "docs": { + "comment": "Jsdocs for static method" + }, + "name": "staticMethod", + "parameters": [ + { + "docs": { + "comment": "The name of the person to say hello to" + }, + "name": "name", + "type": { + "primitive": "string" + } + } + ], + "returns": { + "primitive": "string" + }, + "static": true + }, + { + "name": "justMethod", + "returns": { + "primitive": "string" + } + } + ], + "name": "Statics", + "namespace": "jsii-calc", + "properties": [ + { + "const": true, + "docs": { + "comment": "Constants may also use all-caps." + }, + "immutable": true, + "name": "BAR", + "static": true, + "type": { + "primitive": "number" + } + }, + { + "const": true, + "immutable": true, + "name": "ConstObj", + "static": true, + "type": { + "fqn": "jsii-calc.DoubleTrouble" + } + }, + { + "const": true, + "docs": { + "comment": "Jsdocs for static property." + }, + "immutable": true, + "name": "Foo", + "static": true, + "type": { + "primitive": "string" + } + }, + { + "const": true, + "docs": { + "comment": "Constants can also use camelCase." + }, + "immutable": true, + "name": "zooBar", + "static": true, + "type": { + "collection": { + "elementtype": { + "primitive": "string" + }, + "kind": "map" + } + } + }, + { + "docs": { + "comment": "Jsdocs for static getter.\nJsdocs for static setter." + }, + "name": "instance", + "static": true, + "type": { + "fqn": "jsii-calc.Statics" + } + }, + { + "name": "nonConstStatic", + "static": true, + "type": { + "primitive": "number" + } + }, + { + "immutable": true, + "name": "value", + "type": { + "primitive": "string" + } + } + ] + }, + "jsii-calc.StringEnum": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.StringEnum", + "kind": "enum", + "members": [ + { + "name": "A" + }, + { + "name": "B" + }, + { + "name": "C" + } + ], + "name": "StringEnum", + "namespace": "jsii-calc" + }, + "jsii-calc.Sum": { + "assembly": "jsii-calc", + "base": { + "fqn": "jsii-calc.composition.CompositeOperation" + }, + "docs": { + "comment": "An operation that sums multiple values." + }, + "fqn": "jsii-calc.Sum", + "initializer": { + "initializer": true + }, + "kind": "class", + "name": "Sum", + "namespace": "jsii-calc", + "properties": [ + { + "docs": { + "comment": "The expression that this operation consists of.\nMust be implemented by derived classes." + }, + "immutable": true, + "name": "expression", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + }, + { + "docs": { + "comment": "The parts to sum." + }, + "name": "parts", + "type": { + "collection": { + "elementtype": { + "fqn": "@scope/jsii-calc-lib.Value" + }, + "kind": "array" + } + } + } + ] + }, + "jsii-calc.SyncVirtualMethods": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.SyncVirtualMethods", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "name": "callerIsAsync", + "returns": { + "primitive": "number", + "promise": true + } + }, + { + "name": "callerIsMethod", + "returns": { + "primitive": "number" + } + }, + { + "name": "modifyOtherProperty", + "parameters": [ + { + "name": "value", + "type": { + "primitive": "string" + } + } + ] + }, + { + "name": "modifyValueOfTheProperty", + "parameters": [ + { + "name": "value", + "type": { + "primitive": "string" + } + } + ] + }, + { + "name": "readA", + "returns": { + "primitive": "number" + } + }, + { + "name": "retrieveOtherProperty", + "returns": { + "primitive": "string" + } + }, + { + "name": "retrieveReadOnlyProperty", + "returns": { + "primitive": "string" + } + }, + { + "name": "retrieveValueOfTheProperty", + "returns": { + "primitive": "string" + } + }, + { + "name": "virtualMethod", + "parameters": [ + { + "name": "n", + "type": { + "primitive": "number" + } + } + ], + "returns": { + "primitive": "number" + } + }, + { + "name": "writeA", + "parameters": [ + { + "name": "value", + "type": { + "primitive": "number" + } + } + ] + } + ], + "name": "SyncVirtualMethods", + "namespace": "jsii-calc", + "properties": [ + { + "immutable": true, + "name": "readonlyProperty", + "type": { + "primitive": "string" + } + }, + { + "name": "a", + "type": { + "primitive": "number" + } + }, + { + "name": "callerIsProperty", + "type": { + "primitive": "number" + } + }, + { + "name": "otherProperty", + "type": { + "primitive": "string" + } + }, + { + "name": "theProperty", + "type": { + "primitive": "string" + } + }, + { + "name": "valueOfOtherProperty", + "type": { + "primitive": "string" + } + } + ] + }, + "jsii-calc.Thrower": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.Thrower", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "name": "throwError" + } + ], + "name": "Thrower", + "namespace": "jsii-calc" + }, + "jsii-calc.UnaryOperation": { + "abstract": true, + "assembly": "jsii-calc", + "base": { + "fqn": "@scope/jsii-calc-lib.Operation" + }, + "docs": { + "comment": "An operation on a single operand." + }, + "fqn": "jsii-calc.UnaryOperation", + "initializer": { + "initializer": true, + "parameters": [ + { + "name": "operand", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + } + ] + }, + "kind": "class", + "name": "UnaryOperation", + "namespace": "jsii-calc", + "properties": [ + { + "immutable": true, + "name": "operand", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + } + ] + }, + "jsii-calc.UnionProperties": { + "assembly": "jsii-calc", + "datatype": true, + "fqn": "jsii-calc.UnionProperties", + "kind": "interface", + "name": "UnionProperties", + "namespace": "jsii-calc", + "properties": [ + { + "immutable": true, + "name": "bar", + "type": { + "union": { + "types": [ + { + "primitive": "string" + }, + { + "primitive": "number" + }, + { + "fqn": "jsii-calc.AllTypes" + } + ] + } + } + }, + { + "name": "foo", + "type": { + "optional": true, + "union": { + "types": [ + { + "primitive": "string" + }, + { + "primitive": "number" + } + ] + } + } + } + ] + }, + "jsii-calc.UseBundledDependency": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.UseBundledDependency", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "name": "value", + "returns": { + "primitive": "any" + } + } + ], + "name": "UseBundledDependency", + "namespace": "jsii-calc" + }, + "jsii-calc.UseCalcBase": { + "assembly": "jsii-calc", + "docs": { + "comment": "Depend on a type from jsii-calc-base as a test for awslabs/jsii#128" + }, + "fqn": "jsii-calc.UseCalcBase", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "name": "hello", + "returns": { + "fqn": "@scope/jsii-calc-base.Base" + } + } + ], + "name": "UseCalcBase", + "namespace": "jsii-calc" + }, + "jsii-calc.UsesInterfaceWithProperties": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.UsesInterfaceWithProperties", + "initializer": { + "initializer": true, + "parameters": [ + { + "name": "obj", + "type": { + "fqn": "jsii-calc.IInterfaceWithProperties" + } + } + ] + }, + "kind": "class", + "methods": [ + { + "name": "justRead", + "returns": { + "primitive": "string" + } + }, + { + "name": "readStringAndNumber", + "parameters": [ + { + "name": "ext", + "type": { + "fqn": "jsii-calc.IInterfaceWithPropertiesExtension" + } + } + ], + "returns": { + "primitive": "string" + } + }, + { + "name": "writeAndRead", + "parameters": [ + { + "name": "value", + "type": { + "primitive": "string" + } + } + ], + "returns": { + "primitive": "string" + } + } + ], + "name": "UsesInterfaceWithProperties", + "namespace": "jsii-calc", + "properties": [ + { + "immutable": true, + "name": "obj", + "type": { + "fqn": "jsii-calc.IInterfaceWithProperties" + } + } + ] + }, + "jsii-calc.VariadicMethod": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.VariadicMethod", + "initializer": { + "initializer": true, + "parameters": [ + { + "docs": { + "comment": "a prefix that will be use for all values returned by ``#asArray``." + }, + "name": "prefix", + "type": { + "primitive": "number" + }, + "variadic": true + } + ], + "variadic": true + }, + "kind": "class", + "methods": [ + { + "name": "asArray", + "parameters": [ + { + "docs": { + "comment": "the first element of the array to be returned (after the ``prefix`` provided at construction time)." + }, + "name": "first", + "type": { + "primitive": "number" + } + }, + { + "docs": { + "comment": "other elements to be included in the array." + }, + "name": "others", + "type": { + "primitive": "number" + }, + "variadic": true + } + ], + "returns": { + "collection": { + "elementtype": { + "primitive": "number" + }, + "kind": "array" + } + }, + "variadic": true + } + ], + "name": "VariadicMethod", + "namespace": "jsii-calc" + }, + "jsii-calc.VirtualMethodPlayground": { + "assembly": "jsii-calc", + "fqn": "jsii-calc.VirtualMethodPlayground", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "name": "overrideMeAsync", + "parameters": [ + { + "name": "index", + "type": { + "primitive": "number" + } + } + ], + "returns": { + "primitive": "number", + "promise": true + } + }, + { + "name": "overrideMeSync", + "parameters": [ + { + "name": "index", + "type": { + "primitive": "number" + } + } + ], + "returns": { + "primitive": "number" + } + }, + { + "name": "parallelSumAsync", + "parameters": [ + { + "name": "count", + "type": { + "primitive": "number" + } + } + ], + "returns": { + "primitive": "number", + "promise": true + } + }, + { + "name": "serialSumAsync", + "parameters": [ + { + "name": "count", + "type": { + "primitive": "number" + } + } + ], + "returns": { + "primitive": "number", + "promise": true + } + }, + { + "name": "sumSync", + "parameters": [ + { + "name": "count", + "type": { + "primitive": "number" + } + } + ], + "returns": { + "primitive": "number" + } + } + ], + "name": "VirtualMethodPlayground", + "namespace": "jsii-calc" + }, + "jsii-calc.composition.CompositeOperation": { + "abstract": true, + "assembly": "jsii-calc", + "base": { + "fqn": "@scope/jsii-calc-lib.Operation" + }, + "docs": { + "comment": "Abstract operation composed from an expression of other operations." + }, + "fqn": "jsii-calc.composition.CompositeOperation", + "initializer": { + "initializer": true + }, + "kind": "class", + "methods": [ + { + "docs": { + "comment": "String representation of the value." + }, + "name": "toString", + "returns": { + "primitive": "string" + } + } + ], + "name": "CompositeOperation", + "namespace": "jsii-calc.composition", + "properties": [ + { + "abstract": true, + "docs": { + "comment": "The expression that this operation consists of.\nMust be implemented by derived classes." + }, + "immutable": true, + "name": "expression", + "type": { + "fqn": "@scope/jsii-calc-lib.Value" + } + }, + { + "docs": { + "comment": "The value." + }, + "immutable": true, + "name": "value", + "type": { + "primitive": "number" + } + }, + { + "docs": { + "comment": "A set of postfixes to include in a decorated .toString()." + }, + "name": "decorationPostfixes", + "type": { + "collection": { + "elementtype": { + "primitive": "string" + }, + "kind": "array" + } + } + }, + { + "docs": { + "comment": "A set of prefixes to include in a decorated .toString()." + }, + "name": "decorationPrefixes", + "type": { + "collection": { + "elementtype": { + "primitive": "string" + }, + "kind": "array" + } + } + }, + { + "docs": { + "comment": "The .toString() style." + }, + "name": "stringStyle", + "type": { + "fqn": "jsii-calc.composition.CompositeOperation.CompositionStringStyle" + } + } + ], + "subtypes": [ + "jsii-calc.composition.CompositeOperation.CompositionStringStyle" + ] + }, + "jsii-calc.composition.CompositeOperation.CompositionStringStyle": { + "assembly": "jsii-calc", + "docs": { + "comment": "Style of .toString() output for CompositeOperation." + }, + "fqn": "jsii-calc.composition.CompositeOperation.CompositionStringStyle", + "kind": "enum", + "members": [ + { + "name": "Normal" + }, + { + "name": "Decorated" + } + ], + "name": "CompositionStringStyle", + "namespace": "jsii-calc.composition.CompositeOperation", + "parenttype": "jsii-calc.composition.CompositeOperation" + } + }, + "version": "0.6.4", + "fingerprint": "gKUNI8uBG+ge5Ccbk0ay+JZ+j4C/4hPATR3jvtVm0Po=" +} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon.JSII.Tests.CalculatorPackageId.csproj b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon.JSII.Tests.CalculatorPackageId.csproj new file mode 100644 index 0000000000..a0863d61c6 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon.JSII.Tests.CalculatorPackageId.csproj @@ -0,0 +1,24 @@ + + + netstandard2.0 + true + 0.6.4 + Amazon.JSII.Tests.CalculatorPackageId + A simple calcuator built on JSII. + https://github.com/awslabs/jsii.git + https://spdx.org/licenses/Apache-2.0.html + Amazon Web Services + en-US + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Add.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Add.cs new file mode 100644 index 0000000000..d148a7781c --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Add.cs @@ -0,0 +1,36 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// The "+" binary operation. + [JsiiClass(typeof(Add), "jsii-calc.Add", "[{\"name\":\"lhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},{\"name\":\"rhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] + public class Add : BinaryOperation + { + public Add(Value_ lhs, Value_ rhs): base(new DeputyProps(new object[]{lhs, rhs})) + { + } + + protected Add(ByRefValue reference): base(reference) + { + } + + protected Add(DeputyProps props): base(props) + { + } + + /// The value. + [JsiiProperty("value", "{\"primitive\":\"number\"}")] + public override double Value + { + get => GetInstanceProperty(); + } + + /// String representation of the value. + [JsiiMethod("toString", "{\"primitive\":\"string\"}", "[]")] + public override string ToString() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs new file mode 100644 index 0000000000..46e7cbbac0 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypes.cs @@ -0,0 +1,166 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.composition; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// + /// This class includes property for all types supported by jsii. The setters will validate + /// that the value set is of the expected type and throw otherwise. + /// + [JsiiClass(typeof(AllTypes), "jsii-calc.AllTypes", "[]")] + public class AllTypes : DeputyBase + { + public AllTypes(): base(new DeputyProps(new object[]{})) + { + } + + protected AllTypes(ByRefValue reference): base(reference) + { + } + + protected AllTypes(DeputyProps props): base(props) + { + } + + [JsiiProperty("enumPropertyValue", "{\"primitive\":\"number\"}")] + public virtual double EnumPropertyValue + { + get => GetInstanceProperty(); + } + + [JsiiProperty("anyArrayProperty", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"any\"}}}")] + public virtual object[] AnyArrayProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("anyMapProperty", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"primitive\":\"any\"}}}")] + public virtual IDictionary AnyMapProperty + { + get => GetInstanceProperty>(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("anyProperty", "{\"primitive\":\"any\"}")] + public virtual object AnyProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("arrayProperty", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}")] + public virtual string[] ArrayProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("booleanProperty", "{\"primitive\":\"boolean\"}")] + public virtual bool BooleanProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("dateProperty", "{\"primitive\":\"date\"}")] + public virtual DateTime DateProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("enumProperty", "{\"fqn\":\"jsii-calc.AllTypesEnum\"}")] + public virtual AllTypesEnum EnumProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("jsonProperty", "{\"primitive\":\"json\"}")] + public virtual JObject JsonProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("mapProperty", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"primitive\":\"number\"}}}")] + public virtual IDictionary MapProperty + { + get => GetInstanceProperty>(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("numberProperty", "{\"primitive\":\"number\"}")] + public virtual double NumberProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("stringProperty", "{\"primitive\":\"string\"}")] + public virtual string StringProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("unionArrayProperty", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"union\":{\"types\":[{\"primitive\":\"number\"},{\"fqn\":\"jsii-calc.composition.CompositeOperation\"}]}}}}")] + public virtual object[] UnionArrayProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("unionMapProperty", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"}]}}}}")] + public virtual IDictionary UnionMapProperty + { + get => GetInstanceProperty>(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("unionProperty", "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"},{\"fqn\":\"jsii-calc.Multiply\"}]}}")] + public virtual object UnionProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("unknownArrayProperty", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"any\"}}}")] + public virtual object[] UnknownArrayProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("unknownMapProperty", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"primitive\":\"any\"}}}")] + public virtual IDictionary UnknownMapProperty + { + get => GetInstanceProperty>(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("unknownProperty", "{\"primitive\":\"any\"}")] + public virtual object UnknownProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("optionalEnumValue", "{\"fqn\":\"jsii-calc.StringEnum\",\"optional\":true}")] + public virtual StringEnum OptionalEnumValue + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiMethod("enumMethod", "{\"fqn\":\"jsii-calc.StringEnum\"}", "[{\"name\":\"value\",\"type\":{\"fqn\":\"jsii-calc.StringEnum\"}}]")] + public virtual StringEnum EnumMethod(StringEnum value) + { + return InvokeInstanceMethod(new object[]{value}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypesEnum.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypesEnum.cs new file mode 100644 index 0000000000..6fef8651d6 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllTypesEnum.cs @@ -0,0 +1,15 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiEnum(typeof(AllTypesEnum), "jsii-calc.AllTypesEnum")] + public enum AllTypesEnum + { + [JsiiEnumMember("MyEnumValue")] + MyEnumValue, + [JsiiEnumMember("YourEnumValue")] + YourEnumValue, + [JsiiEnumMember("ThisIsGreat")] + ThisIsGreat + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllowedMethodNames.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllowedMethodNames.cs new file mode 100644 index 0000000000..793eda8c44 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AllowedMethodNames.cs @@ -0,0 +1,46 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(AllowedMethodNames), "jsii-calc.AllowedMethodNames", "[]")] + public class AllowedMethodNames : DeputyBase + { + public AllowedMethodNames(): base(new DeputyProps(new object[]{})) + { + } + + protected AllowedMethodNames(ByRefValue reference): base(reference) + { + } + + protected AllowedMethodNames(DeputyProps props): base(props) + { + } + + [JsiiMethod("getBar", null, "[{\"name\":\"_p1\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"_p2\",\"type\":{\"primitive\":\"number\"}}]")] + public virtual void GetBar(string _p1, double _p2) + { + InvokeInstanceVoidMethod(new object[]{_p1, _p2}); + } + + /// getXxx() is not allowed (see negatives), but getXxx(a, ...) is okay. + [JsiiMethod("getFoo", "{\"primitive\":\"string\"}", "[{\"name\":\"withParam\",\"type\":{\"primitive\":\"string\"}}]")] + public virtual string GetFoo(string withParam) + { + return InvokeInstanceMethod(new object[]{withParam}); + } + + [JsiiMethod("setBar", null, "[{\"name\":\"_x\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"_y\",\"type\":{\"primitive\":\"number\"}},{\"name\":\"_z\",\"type\":{\"primitive\":\"boolean\"}}]")] + public virtual void SetBar(string _x, double _y, bool _z) + { + InvokeInstanceVoidMethod(new object[]{_x, _y, _z}); + } + + /// setFoo(x) is not allowed (see negatives), but setXxx(a, b, ...) is okay. + [JsiiMethod("setFoo", null, "[{\"name\":\"_x\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"_y\",\"type\":{\"primitive\":\"number\"}}]")] + public virtual void SetFoo(string _x, double _y) + { + InvokeInstanceVoidMethod(new object[]{_x, _y}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AsyncVirtualMethods.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AsyncVirtualMethods.cs new file mode 100644 index 0000000000..61b80a7ea6 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/AsyncVirtualMethods.cs @@ -0,0 +1,63 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(AsyncVirtualMethods), "jsii-calc.AsyncVirtualMethods", "[]")] + public class AsyncVirtualMethods : DeputyBase + { + public AsyncVirtualMethods(): base(new DeputyProps(new object[]{})) + { + } + + protected AsyncVirtualMethods(ByRefValue reference): base(reference) + { + } + + protected AsyncVirtualMethods(DeputyProps props): base(props) + { + } + + [JsiiMethod("callMe", "{\"primitive\":\"number\",\"promise\":true}", "[]")] + public virtual double CallMe() + { + return InvokeInstanceMethod(new object[]{}); + } + + /// Just calls "overrideMeToo" + [JsiiMethod("callMe2", "{\"primitive\":\"number\",\"promise\":true}", "[]")] + public virtual double CallMe2() + { + return InvokeInstanceMethod(new object[]{}); + } + + /// + /// This method calls the "callMe" async method indirectly, which will then + /// invoke a virtual method. This is a "double promise" situation, which + /// means that callbacks are not going to be available immediate, but only + /// after an "immediates" cycle. + /// + [JsiiMethod("callMeDoublePromise", "{\"primitive\":\"number\",\"promise\":true}", "[]")] + public virtual double CallMeDoublePromise() + { + return InvokeInstanceMethod(new object[]{}); + } + + [JsiiMethod("dontOverrideMe", "{\"primitive\":\"number\"}", "[]")] + public virtual double DontOverrideMe() + { + return InvokeInstanceMethod(new object[]{}); + } + + [JsiiMethod("overrideMe", "{\"primitive\":\"number\",\"promise\":true}", "[{\"name\":\"mult\",\"type\":{\"primitive\":\"number\"}}]")] + public virtual double OverrideMe(double mult) + { + return InvokeInstanceMethod(new object[]{mult}); + } + + [JsiiMethod("overrideMeToo", "{\"primitive\":\"number\",\"promise\":true}", "[]")] + public virtual double OverrideMeToo() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BinaryOperation.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BinaryOperation.cs new file mode 100644 index 0000000000..b869964689 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/BinaryOperation.cs @@ -0,0 +1,43 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// Represents an operation with two operands. + [JsiiClass(typeof(BinaryOperation), "jsii-calc.BinaryOperation", "[{\"name\":\"lhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},{\"name\":\"rhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] + public abstract class BinaryOperation : Operation, IIFriendly + { + protected BinaryOperation(Value_ lhs, Value_ rhs): base(new DeputyProps(new object[]{lhs, rhs})) + { + } + + protected BinaryOperation(ByRefValue reference): base(reference) + { + } + + protected BinaryOperation(DeputyProps props): base(props) + { + } + + /// Left-hand side operand + [JsiiProperty("lhs", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + public virtual Value_ Lhs + { + get => GetInstanceProperty(); + } + + /// Right-hand side operand + [JsiiProperty("rhs", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + public virtual Value_ Rhs + { + get => GetInstanceProperty(); + } + + /// Say hello! + [JsiiMethod("hello", "{\"primitive\":\"string\"}", "[]")] + public virtual string Hello() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs new file mode 100644 index 0000000000..1169383381 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Calculator.cs @@ -0,0 +1,104 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.composition; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; +using System.Collections.Generic; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// A calculator which maintains a current value and allows adding operations. + [JsiiClass(typeof(Calculator), "jsii-calc.Calculator", "[{\"name\":\"props\",\"type\":{\"fqn\":\"jsii-calc.CalculatorProps\",\"optional\":true}}]")] + public class Calculator : CompositeOperation_ + { + public Calculator(ICalculatorProps props): base(new DeputyProps(new object[]{props})) + { + } + + protected Calculator(ByRefValue reference): base(reference) + { + } + + protected Calculator(DeputyProps props): base(props) + { + } + + /// Returns the expression. + [JsiiProperty("expression", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + public override Value_ Expression + { + get => GetInstanceProperty(); + } + + /// A log of all operations. + [JsiiProperty("operationsLog", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}")] + public virtual Value_[] OperationsLog + { + get => GetInstanceProperty(); + } + + /// A map of per operation name of all operations performed. + [JsiiProperty("operationsMap", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}}}")] + public virtual IDictionary OperationsMap + { + get => GetInstanceProperty>(); + } + + /// The current value. + [JsiiProperty("curr", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + public virtual Value_ Curr + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + /// The maximum value allows in this calculator. + [JsiiProperty("maxValue", "{\"primitive\":\"number\",\"optional\":true}")] + public virtual double? MaxValue + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + /// Example of a property that accepts a union of types. + [JsiiProperty("unionProperty", "{\"union\":{\"types\":[{\"fqn\":\"jsii-calc.Add\"},{\"fqn\":\"jsii-calc.Multiply\"},{\"fqn\":\"jsii-calc.Power\"}]},\"optional\":true}")] + public virtual object UnionProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + /// Adds a number to the current value. + [JsiiMethod("add", null, "[{\"name\":\"value\",\"type\":{\"primitive\":\"number\"}}]")] + public virtual void Add(double value) + { + InvokeInstanceVoidMethod(new object[]{value}); + } + + /// Multiplies the current value by a number. + [JsiiMethod("mul", null, "[{\"name\":\"value\",\"type\":{\"primitive\":\"number\"}}]")] + public virtual void Mul(double value) + { + InvokeInstanceVoidMethod(new object[]{value}); + } + + /// Negates the current value. + [JsiiMethod("neg", null, "[]")] + public virtual void Neg() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + /// Raises the current value by a power. + [JsiiMethod("pow", null, "[{\"name\":\"value\",\"type\":{\"primitive\":\"number\"}}]")] + public virtual void Pow(double value) + { + InvokeInstanceVoidMethod(new object[]{value}); + } + + /// Returns teh value of the union property (if defined). + [JsiiMethod("readUnionValue", "{\"primitive\":\"number\"}", "[]")] + public virtual double ReadUnionValue() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorProps.cs new file mode 100644 index 0000000000..73d47dfba9 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorProps.cs @@ -0,0 +1,22 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// Properties for Calculator. + public class CalculatorProps : DeputyBase, ICalculatorProps + { + [JsiiProperty("initialValue", "{\"primitive\":\"number\",\"optional\":true}", true)] + public double? InitialValue + { + get; + set; + } + + [JsiiProperty("maximumValue", "{\"primitive\":\"number\",\"optional\":true}", true)] + public double? MaximumValue + { + get; + set; + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorPropsProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorPropsProxy.cs new file mode 100644 index 0000000000..3d8ba2c089 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/CalculatorPropsProxy.cs @@ -0,0 +1,27 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// Properties for Calculator. + [JsiiInterfaceProxy(typeof(ICalculatorProps), "jsii-calc.CalculatorProps")] + internal class CalculatorPropsProxy : DeputyBase, ICalculatorProps + { + private CalculatorPropsProxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty("initialValue", "{\"primitive\":\"number\",\"optional\":true}")] + public virtual double? InitialValue + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("maximumValue", "{\"primitive\":\"number\",\"optional\":true}")] + public virtual double? MaximumValue + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Base.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Base.cs new file mode 100644 index 0000000000..5036342fc2 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Base.cs @@ -0,0 +1,27 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace.DerivedClassHasNoProperties +{ + [JsiiClass(typeof(Base), "jsii-calc.DerivedClassHasNoProperties.Base", "[]")] + public class Base : DeputyBase + { + public Base(): base(new DeputyProps(new object[]{})) + { + } + + protected Base(ByRefValue reference): base(reference) + { + } + + protected Base(DeputyProps props): base(props) + { + } + + [JsiiProperty("prop", "{\"primitive\":\"string\"}")] + public virtual string Prop + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Derived.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Derived.cs new file mode 100644 index 0000000000..fa68e32efa --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedClassHasNoProperties/Derived.cs @@ -0,0 +1,20 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace.DerivedClassHasNoProperties +{ + [JsiiClass(typeof(Derived), "jsii-calc.DerivedClassHasNoProperties.Derived", "[]")] + public class Derived : Amazon.JSII.Tests.CalculatorNamespace.DerivedClassHasNoProperties.Base + { + public Derived(): base(new DeputyProps(new object[]{})) + { + } + + protected Derived(ByRefValue reference): base(reference) + { + } + + protected Derived(DeputyProps props): base(props) + { + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStruct.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStruct.cs new file mode 100644 index 0000000000..5a999f1a32 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStruct.cs @@ -0,0 +1,71 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; +using System; +using System.Collections.Generic; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// A struct which derives from another struct. + public class DerivedStruct : DeputyBase, IDerivedStruct + { + [JsiiProperty("anotherRequired", "{\"primitive\":\"date\"}", true)] + public DateTime AnotherRequired + { + get; + set; + } + + [JsiiProperty("bool", "{\"primitive\":\"boolean\"}", true)] + public bool Bool + { + get; + set; + } + + /// An example of a non primitive property. + [JsiiProperty("nonPrimitive", "{\"fqn\":\"jsii-calc.DoubleTrouble\"}", true)] + public DoubleTrouble NonPrimitive + { + get; + set; + } + + /// This is optional. + [JsiiProperty("anotherOptional", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},\"optional\":true}", true)] + public IDictionary AnotherOptional + { + get; + set; + } + + [JsiiProperty("optionalArray", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}},\"optional\":true}", true)] + public string[] OptionalArray + { + get; + set; + } + + /// An awesome number value + [JsiiProperty("anumber", "{\"primitive\":\"number\"}", true)] + public double Anumber + { + get; + set; + } + + /// A string value + [JsiiProperty("astring", "{\"primitive\":\"string\"}", true)] + public string Astring + { + get; + set; + } + + [JsiiProperty("firstOptional", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}},\"optional\":true}", true)] + public string[] FirstOptional + { + get; + set; + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStructProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStructProxy.cs new file mode 100644 index 0000000000..372ea6267f --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DerivedStructProxy.cs @@ -0,0 +1,76 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; +using System; +using System.Collections.Generic; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// A struct which derives from another struct. + [JsiiInterfaceProxy(typeof(IDerivedStruct), "jsii-calc.DerivedStruct")] + internal class DerivedStructProxy : DeputyBase, IDerivedStruct + { + private DerivedStructProxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty("anotherRequired", "{\"primitive\":\"date\"}")] + public virtual DateTime AnotherRequired + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("bool", "{\"primitive\":\"boolean\"}")] + public virtual bool Bool + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + /// An example of a non primitive property. + [JsiiProperty("nonPrimitive", "{\"fqn\":\"jsii-calc.DoubleTrouble\"}")] + public virtual DoubleTrouble NonPrimitive + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + /// This is optional. + [JsiiProperty("anotherOptional", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},\"optional\":true}")] + public virtual IDictionary AnotherOptional + { + get => GetInstanceProperty>(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("optionalArray", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}},\"optional\":true}")] + public virtual string[] OptionalArray + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + /// An awesome number value + [JsiiProperty("anumber", "{\"primitive\":\"number\"}")] + public virtual double Anumber + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + /// A string value + [JsiiProperty("astring", "{\"primitive\":\"string\"}")] + public virtual string Astring + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("firstOptional", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}},\"optional\":true}")] + public virtual string[] FirstOptional + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoubleTrouble.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoubleTrouble.cs new file mode 100644 index 0000000000..b1215d2026 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DoubleTrouble.cs @@ -0,0 +1,34 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(DoubleTrouble), "jsii-calc.DoubleTrouble", "[]")] + public class DoubleTrouble : DeputyBase, IIFriendlyRandomGenerator + { + public DoubleTrouble(): base(new DeputyProps(new object[]{})) + { + } + + protected DoubleTrouble(ByRefValue reference): base(reference) + { + } + + protected DoubleTrouble(DeputyProps props): base(props) + { + } + + /// Say hello! + [JsiiMethod("hello", "{\"primitive\":\"string\"}", "[]")] + public virtual string Hello() + { + return InvokeInstanceMethod(new object[]{}); + } + + /// Returns another random number. + [JsiiMethod("next", "{\"primitive\":\"number\"}", "[]")] + public virtual double Next() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GiveMeStructs.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GiveMeStructs.cs new file mode 100644 index 0000000000..0a5c95cf5a --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/GiveMeStructs.cs @@ -0,0 +1,48 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(GiveMeStructs), "jsii-calc.GiveMeStructs", "[]")] + public class GiveMeStructs : DeputyBase + { + public GiveMeStructs(): base(new DeputyProps(new object[]{})) + { + } + + protected GiveMeStructs(ByRefValue reference): base(reference) + { + } + + protected GiveMeStructs(DeputyProps props): base(props) + { + } + + [JsiiProperty("structLiteral", "{\"fqn\":\"@scope/jsii-calc-lib.StructWithOnlyOptionals\"}")] + public virtual IStructWithOnlyOptionals StructLiteral + { + get => GetInstanceProperty(); + } + + /// Accepts a struct of type DerivedStruct and returns a struct of type FirstStruct. + [JsiiMethod("derivedToFirst", "{\"fqn\":\"@scope/jsii-calc-lib.MyFirstStruct\"}", "[{\"name\":\"derived\",\"type\":{\"fqn\":\"jsii-calc.DerivedStruct\"}}]")] + public virtual IMyFirstStruct DerivedToFirst(IDerivedStruct derived) + { + return InvokeInstanceMethod(new object[]{derived}); + } + + /// Returns the boolean from a DerivedStruct struct. + [JsiiMethod("readDerivedNonPrimitive", "{\"fqn\":\"jsii-calc.DoubleTrouble\"}", "[{\"name\":\"derived\",\"type\":{\"fqn\":\"jsii-calc.DerivedStruct\"}}]")] + public virtual DoubleTrouble ReadDerivedNonPrimitive(IDerivedStruct derived) + { + return InvokeInstanceMethod(new object[]{derived}); + } + + /// Returns the "anumber" from a MyFirstStruct struct; + [JsiiMethod("readFirstNumber", "{\"primitive\":\"number\"}", "[{\"name\":\"first\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.MyFirstStruct\"}}]")] + public virtual double ReadFirstNumber(IMyFirstStruct first) + { + return InvokeInstanceMethod(new object[]{first}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ICalculatorProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ICalculatorProps.cs new file mode 100644 index 0000000000..04a2a6b005 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ICalculatorProps.cs @@ -0,0 +1,23 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// Properties for Calculator. + [JsiiInterface(typeof(ICalculatorProps), "jsii-calc.CalculatorProps")] + public interface ICalculatorProps + { + [JsiiProperty("initialValue", "{\"primitive\":\"number\",\"optional\":true}")] + double? InitialValue + { + get; + set; + } + + [JsiiProperty("maximumValue", "{\"primitive\":\"number\",\"optional\":true}")] + double? MaximumValue + { + get; + set; + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDerivedStruct.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDerivedStruct.cs new file mode 100644 index 0000000000..58a290f26b --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IDerivedStruct.cs @@ -0,0 +1,49 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; +using System; +using System.Collections.Generic; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// A struct which derives from another struct. + [JsiiInterface(typeof(IDerivedStruct), "jsii-calc.DerivedStruct")] + public interface IDerivedStruct : IMyFirstStruct + { + [JsiiProperty("anotherRequired", "{\"primitive\":\"date\"}")] + DateTime AnotherRequired + { + get; + set; + } + + [JsiiProperty("bool", "{\"primitive\":\"boolean\"}")] + bool Bool + { + get; + set; + } + + /// An example of a non primitive property. + [JsiiProperty("nonPrimitive", "{\"fqn\":\"jsii-calc.DoubleTrouble\"}")] + DoubleTrouble NonPrimitive + { + get; + set; + } + + /// This is optional. + [JsiiProperty("anotherOptional", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},\"optional\":true}")] + IDictionary AnotherOptional + { + get; + set; + } + + [JsiiProperty("optionalArray", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}},\"optional\":true}")] + string[] OptionalArray + { + get; + set; + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlierProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlierProxy.cs new file mode 100644 index 0000000000..6ad94be5e6 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlierProxy.cs @@ -0,0 +1,35 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// Even friendlier classes can implement this interface. + [JsiiInterfaceProxy(typeof(IIFriendlier), "jsii-calc.IFriendlier")] + internal class IFriendlierProxy : DeputyBase, IIFriendlier + { + private IFriendlierProxy(ByRefValue reference): base(reference) + { + } + + /// Say farewell. + [JsiiMethod("farewell", "{\"primitive\":\"string\"}", "[]")] + public virtual string Farewell() + { + return InvokeInstanceMethod(new object[]{}); + } + + /// Say goodbye. + /// A goodbye blessing. + [JsiiMethod("goodbye", "{\"primitive\":\"string\"}", "[]")] + public virtual string Goodbye() + { + return InvokeInstanceMethod(new object[]{}); + } + + /// Say hello! + [JsiiMethod("hello", "{\"primitive\":\"string\"}", "[]")] + public virtual string Hello() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlyRandomGeneratorProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlyRandomGeneratorProxy.cs new file mode 100644 index 0000000000..bbeda0eae5 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IFriendlyRandomGeneratorProxy.cs @@ -0,0 +1,27 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiInterfaceProxy(typeof(IIFriendlyRandomGenerator), "jsii-calc.IFriendlyRandomGenerator")] + internal class IFriendlyRandomGeneratorProxy : DeputyBase, IIFriendlyRandomGenerator + { + private IFriendlyRandomGeneratorProxy(ByRefValue reference): base(reference) + { + } + + /// Returns another random number. + /// A random number. + [JsiiMethod("next", "{\"primitive\":\"number\"}", "[]")] + public virtual double Next() + { + return InvokeInstanceMethod(new object[]{}); + } + + /// Say hello! + [JsiiMethod("hello", "{\"primitive\":\"string\"}", "[]")] + public virtual string Hello() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlier.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlier.cs new file mode 100644 index 0000000000..c44fe3d253 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlier.cs @@ -0,0 +1,18 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// Even friendlier classes can implement this interface. + [JsiiInterface(typeof(IIFriendlier), "jsii-calc.IFriendlier")] + public interface IIFriendlier : IIFriendly + { + /// Say farewell. + [JsiiMethod("farewell", "{\"primitive\":\"string\"}", "[]")] + string Farewell(); + /// Say goodbye. + /// A goodbye blessing. + [JsiiMethod("goodbye", "{\"primitive\":\"string\"}", "[]")] + string Goodbye(); + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlyRandomGenerator.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlyRandomGenerator.cs new file mode 100644 index 0000000000..389968b74d --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIFriendlyRandomGenerator.cs @@ -0,0 +1,10 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiInterface(typeof(IIFriendlyRandomGenerator), "jsii-calc.IFriendlyRandomGenerator")] + public interface IIFriendlyRandomGenerator : IIRandomNumberGenerator, IIFriendly + { + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithProperties.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithProperties.cs new file mode 100644 index 0000000000..cfdc3b488f --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithProperties.cs @@ -0,0 +1,21 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiInterface(typeof(IIInterfaceWithProperties), "jsii-calc.IInterfaceWithProperties")] + public interface IIInterfaceWithProperties + { + [JsiiProperty("readOnlyString", "{\"primitive\":\"string\"}")] + string ReadOnlyString + { + get; + } + + [JsiiProperty("readWriteString", "{\"primitive\":\"string\"}")] + string ReadWriteString + { + get; + set; + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithPropertiesExtension.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithPropertiesExtension.cs new file mode 100644 index 0000000000..26840a4247 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIInterfaceWithPropertiesExtension.cs @@ -0,0 +1,15 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiInterface(typeof(IIInterfaceWithPropertiesExtension), "jsii-calc.IInterfaceWithPropertiesExtension")] + public interface IIInterfaceWithPropertiesExtension : IIInterfaceWithProperties + { + [JsiiProperty("foo", "{\"primitive\":\"number\"}")] + double Foo + { + get; + set; + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIRandomNumberGenerator.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIRandomNumberGenerator.cs new file mode 100644 index 0000000000..3a0553c4f3 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IIRandomNumberGenerator.cs @@ -0,0 +1,14 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// Generates random numbers. + [JsiiInterface(typeof(IIRandomNumberGenerator), "jsii-calc.IRandomNumberGenerator")] + public interface IIRandomNumberGenerator + { + /// Returns another random number. + /// A random number. + [JsiiMethod("next", "{\"primitive\":\"number\"}", "[]")] + double Next(); + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IImplictBaseOfBase.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IImplictBaseOfBase.cs new file mode 100644 index 0000000000..23d330079e --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IImplictBaseOfBase.cs @@ -0,0 +1,17 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace; +using System; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiInterface(typeof(IImplictBaseOfBase), "jsii-calc.ImplictBaseOfBase")] + public interface IImplictBaseOfBase : IBaseProps + { + [JsiiProperty("goo", "{\"primitive\":\"date\"}")] + DateTime Goo + { + get; + set; + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithProperties.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithProperties.cs new file mode 100644 index 0000000000..68ba03b8f6 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithProperties.cs @@ -0,0 +1,20 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + public class IInterfaceWithProperties : DeputyBase, IIInterfaceWithProperties + { + [JsiiProperty("readOnlyString", "{\"primitive\":\"string\"}", true)] + public string ReadOnlyString + { + get; + } + + [JsiiProperty("readWriteString", "{\"primitive\":\"string\"}", true)] + public string ReadWriteString + { + get; + set; + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtension.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtension.cs new file mode 100644 index 0000000000..3a176e747b --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtension.cs @@ -0,0 +1,27 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + public class IInterfaceWithPropertiesExtension : DeputyBase, IIInterfaceWithPropertiesExtension + { + [JsiiProperty("foo", "{\"primitive\":\"number\"}", true)] + public double Foo + { + get; + set; + } + + [JsiiProperty("readOnlyString", "{\"primitive\":\"string\"}", true)] + public string ReadOnlyString + { + get; + } + + [JsiiProperty("readWriteString", "{\"primitive\":\"string\"}", true)] + public string ReadWriteString + { + get; + set; + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtensionProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtensionProxy.cs new file mode 100644 index 0000000000..3be85b6c5f --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesExtensionProxy.cs @@ -0,0 +1,32 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiInterfaceProxy(typeof(IIInterfaceWithPropertiesExtension), "jsii-calc.IInterfaceWithPropertiesExtension")] + internal class IInterfaceWithPropertiesExtensionProxy : DeputyBase, IIInterfaceWithPropertiesExtension + { + private IInterfaceWithPropertiesExtensionProxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty("foo", "{\"primitive\":\"number\"}")] + public virtual double Foo + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("readOnlyString", "{\"primitive\":\"string\"}")] + public virtual string ReadOnlyString + { + get => GetInstanceProperty(); + } + + [JsiiProperty("readWriteString", "{\"primitive\":\"string\"}")] + public virtual string ReadWriteString + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesProxy.cs new file mode 100644 index 0000000000..010dc62dcf --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IInterfaceWithPropertiesProxy.cs @@ -0,0 +1,25 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiInterfaceProxy(typeof(IIInterfaceWithProperties), "jsii-calc.IInterfaceWithProperties")] + internal class IInterfaceWithPropertiesProxy : DeputyBase, IIInterfaceWithProperties + { + private IInterfaceWithPropertiesProxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty("readOnlyString", "{\"primitive\":\"string\"}")] + public virtual string ReadOnlyString + { + get => GetInstanceProperty(); + } + + [JsiiProperty("readWriteString", "{\"primitive\":\"string\"}")] + public virtual string ReadWriteString + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IRandomNumberGeneratorProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IRandomNumberGeneratorProxy.cs new file mode 100644 index 0000000000..8bccac1c90 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IRandomNumberGeneratorProxy.cs @@ -0,0 +1,21 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// Generates random numbers. + [JsiiInterfaceProxy(typeof(IIRandomNumberGenerator), "jsii-calc.IRandomNumberGenerator")] + internal class IRandomNumberGeneratorProxy : DeputyBase, IIRandomNumberGenerator + { + private IRandomNumberGeneratorProxy(ByRefValue reference): base(reference) + { + } + + /// Returns another random number. + /// A random number. + [JsiiMethod("next", "{\"primitive\":\"number\"}", "[]")] + public virtual double Next() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IReturnsNumber.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IReturnsNumber.cs new file mode 100644 index 0000000000..bedb9be1cb --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IReturnsNumber.cs @@ -0,0 +1,17 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiInterface(typeof(IReturnsNumber), "jsii-calc.ReturnsNumber")] + public interface IReturnsNumber + { + [JsiiProperty("numberProp", "{\"primitive\":\"number\"}")] + double NumberProp + { + get; + } + + [JsiiMethod("obtainNumber", "{\"primitive\":\"number\"}", "[]")] + double ObtainNumber(); + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IUnionProperties.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IUnionProperties.cs new file mode 100644 index 0000000000..6b06b10a95 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IUnionProperties.cs @@ -0,0 +1,21 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiInterface(typeof(IUnionProperties), "jsii-calc.UnionProperties")] + public interface IUnionProperties + { + [JsiiProperty("bar", "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"},{\"fqn\":\"jsii-calc.AllTypes\"}]}}")] + object Bar + { + get; + } + + [JsiiProperty("foo", "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"}]},\"optional\":true}")] + object Foo + { + get; + set; + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBase.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBase.cs new file mode 100644 index 0000000000..1b286f79a9 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBase.cs @@ -0,0 +1,30 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace; +using System; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + public class ImplictBaseOfBase : DeputyBase, IImplictBaseOfBase + { + [JsiiProperty("goo", "{\"primitive\":\"date\"}", true)] + public DateTime Goo + { + get; + set; + } + + [JsiiProperty("bar", "{\"primitive\":\"string\"}", true)] + public string Bar + { + get; + set; + } + + [JsiiProperty("foo", "{\"fqn\":\"@scope/jsii-calc-base-of-base.Very\"}", true)] + public Very Foo + { + get; + set; + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBaseProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBaseProxy.cs new file mode 100644 index 0000000000..28bcc86414 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ImplictBaseOfBaseProxy.cs @@ -0,0 +1,35 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace; +using System; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiInterfaceProxy(typeof(IImplictBaseOfBase), "jsii-calc.ImplictBaseOfBase")] + internal class ImplictBaseOfBaseProxy : DeputyBase, IImplictBaseOfBase + { + private ImplictBaseOfBaseProxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty("goo", "{\"primitive\":\"date\"}")] + public virtual DateTime Goo + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("bar", "{\"primitive\":\"string\"}")] + public virtual string Bar + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("foo", "{\"fqn\":\"@scope/jsii-calc-base-of-base.Very\"}")] + public virtual Very Foo + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralForInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralForInterface.cs new file mode 100644 index 0000000000..19fa50e867 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralForInterface.cs @@ -0,0 +1,33 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(JSObjectLiteralForInterface), "jsii-calc.JSObjectLiteralForInterface", "[]")] + public class JSObjectLiteralForInterface : DeputyBase + { + public JSObjectLiteralForInterface(): base(new DeputyProps(new object[]{})) + { + } + + protected JSObjectLiteralForInterface(ByRefValue reference): base(reference) + { + } + + protected JSObjectLiteralForInterface(DeputyProps props): base(props) + { + } + + [JsiiMethod("giveMeFriendly", "{\"fqn\":\"@scope/jsii-calc-lib.IFriendly\"}", "[]")] + public virtual IIFriendly GiveMeFriendly() + { + return InvokeInstanceMethod(new object[]{}); + } + + [JsiiMethod("giveMeFriendlyGenerator", "{\"fqn\":\"jsii-calc.IFriendlyRandomGenerator\"}", "[]")] + public virtual IIFriendlyRandomGenerator GiveMeFriendlyGenerator() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNative.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNative.cs new file mode 100644 index 0000000000..0177e98a97 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNative.cs @@ -0,0 +1,26 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(JSObjectLiteralToNative), "jsii-calc.JSObjectLiteralToNative", "[]")] + public class JSObjectLiteralToNative : DeputyBase + { + public JSObjectLiteralToNative(): base(new DeputyProps(new object[]{})) + { + } + + protected JSObjectLiteralToNative(ByRefValue reference): base(reference) + { + } + + protected JSObjectLiteralToNative(DeputyProps props): base(props) + { + } + + [JsiiMethod("returnLiteral", "{\"fqn\":\"jsii-calc.JSObjectLiteralToNativeClass\"}", "[]")] + public virtual JSObjectLiteralToNativeClass ReturnLiteral() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNativeClass.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNativeClass.cs new file mode 100644 index 0000000000..c13d989370 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JSObjectLiteralToNativeClass.cs @@ -0,0 +1,34 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(JSObjectLiteralToNativeClass), "jsii-calc.JSObjectLiteralToNativeClass", "[]")] + public class JSObjectLiteralToNativeClass : DeputyBase + { + public JSObjectLiteralToNativeClass(): base(new DeputyProps(new object[]{})) + { + } + + protected JSObjectLiteralToNativeClass(ByRefValue reference): base(reference) + { + } + + protected JSObjectLiteralToNativeClass(DeputyProps props): base(props) + { + } + + [JsiiProperty("propA", "{\"primitive\":\"string\"}")] + public virtual string PropA + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("propB", "{\"primitive\":\"number\"}")] + public virtual double PropB + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JavaReservedWords.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JavaReservedWords.cs new file mode 100644 index 0000000000..329b1be7e9 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/JavaReservedWords.cs @@ -0,0 +1,339 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(JavaReservedWords), "jsii-calc.JavaReservedWords", "[]")] + public class JavaReservedWords : DeputyBase + { + public JavaReservedWords(): base(new DeputyProps(new object[]{})) + { + } + + protected JavaReservedWords(ByRefValue reference): base(reference) + { + } + + protected JavaReservedWords(DeputyProps props): base(props) + { + } + + [JsiiProperty("while", "{\"primitive\":\"string\"}")] + public virtual string While + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiMethod("abstract", null, "[]")] + public virtual void Abstract() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("assert", null, "[]")] + public virtual void Assert() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("boolean", null, "[]")] + public virtual void Boolean() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("break", null, "[]")] + public virtual void Break() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("byte", null, "[]")] + public virtual void Byte() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("case", null, "[]")] + public virtual void Case() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("catch", null, "[]")] + public virtual void Catch() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("char", null, "[]")] + public virtual void Char() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("class", null, "[]")] + public virtual void Class() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("const", null, "[]")] + public virtual void Const() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("continue", null, "[]")] + public virtual void Continue() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("default", null, "[]")] + public virtual void Default() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("do", null, "[]")] + public virtual void Do() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("double", null, "[]")] + public virtual void Double() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("else", null, "[]")] + public virtual void Else() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("enum", null, "[]")] + public virtual void Enum() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("extends", null, "[]")] + public virtual void Extends() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("false", null, "[]")] + public virtual void False() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("final", null, "[]")] + public virtual void Final() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("finally", null, "[]")] + public virtual void Finally() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("float", null, "[]")] + public virtual void Float() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("for", null, "[]")] + public virtual void For() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("goto", null, "[]")] + public virtual void Goto() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("if", null, "[]")] + public virtual void If() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("implements", null, "[]")] + public virtual void Implements() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("import", null, "[]")] + public virtual void Import() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("instanceof", null, "[]")] + public virtual void Instanceof() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("int", null, "[]")] + public virtual void Int() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("interface", null, "[]")] + public virtual void Interface() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("long", null, "[]")] + public virtual void Long() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("native", null, "[]")] + public virtual void Native() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("new", null, "[]")] + public virtual void New() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("null", null, "[]")] + public virtual void Null() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("package", null, "[]")] + public virtual void Package() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("private", null, "[]")] + public virtual void Private() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("protected", null, "[]")] + public virtual void Protected() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("public", null, "[]")] + public virtual void Public() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("return", null, "[]")] + public virtual void Return() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("short", null, "[]")] + public virtual void Short() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("static", null, "[]")] + public virtual void Static() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("strictfp", null, "[]")] + public virtual void Strictfp() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("super", null, "[]")] + public virtual void Super() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("switch", null, "[]")] + public virtual void Switch() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("synchronized", null, "[]")] + public virtual void Synchronized() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("this", null, "[]")] + public virtual void This() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("throw", null, "[]")] + public virtual void Throw() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("throws", null, "[]")] + public virtual void Throws() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("transient", null, "[]")] + public virtual void Transient() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("true", null, "[]")] + public virtual void True() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("try", null, "[]")] + public virtual void Try() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("void", null, "[]")] + public virtual void Void() + { + InvokeInstanceVoidMethod(new object[]{}); + } + + [JsiiMethod("volatile", null, "[]")] + public virtual void Volatile() + { + InvokeInstanceVoidMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Multiply.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Multiply.cs new file mode 100644 index 0000000000..316dfe4586 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Multiply.cs @@ -0,0 +1,57 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// The "*" binary operation. + [JsiiClass(typeof(Multiply), "jsii-calc.Multiply", "[{\"name\":\"lhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},{\"name\":\"rhs\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] + public class Multiply : BinaryOperation, IIFriendlier, IIRandomNumberGenerator + { + public Multiply(Value_ lhs, Value_ rhs): base(new DeputyProps(new object[]{lhs, rhs})) + { + } + + protected Multiply(ByRefValue reference): base(reference) + { + } + + protected Multiply(DeputyProps props): base(props) + { + } + + /// The value. + [JsiiProperty("value", "{\"primitive\":\"number\"}")] + public override double Value + { + get => GetInstanceProperty(); + } + + /// Say farewell. + [JsiiMethod("farewell", "{\"primitive\":\"string\"}", "[]")] + public virtual string Farewell() + { + return InvokeInstanceMethod(new object[]{}); + } + + /// Say goodbye. + [JsiiMethod("goodbye", "{\"primitive\":\"string\"}", "[]")] + public virtual string Goodbye() + { + return InvokeInstanceMethod(new object[]{}); + } + + /// Returns another random number. + [JsiiMethod("next", "{\"primitive\":\"number\"}", "[]")] + public virtual double Next() + { + return InvokeInstanceMethod(new object[]{}); + } + + /// String representation of the value. + [JsiiMethod("toString", "{\"primitive\":\"string\"}", "[]")] + public override string ToString() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Negate.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Negate.cs new file mode 100644 index 0000000000..a85ecfa9fd --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Negate.cs @@ -0,0 +1,57 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// The negation operation ("-value") + [JsiiClass(typeof(Negate), "jsii-calc.Negate", "[{\"name\":\"operand\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] + public class Negate : UnaryOperation, IIFriendlier + { + public Negate(Value_ operand): base(new DeputyProps(new object[]{operand})) + { + } + + protected Negate(ByRefValue reference): base(reference) + { + } + + protected Negate(DeputyProps props): base(props) + { + } + + /// The value. + [JsiiProperty("value", "{\"primitive\":\"number\"}")] + public override double Value + { + get => GetInstanceProperty(); + } + + /// Say farewell. + [JsiiMethod("farewell", "{\"primitive\":\"string\"}", "[]")] + public virtual string Farewell() + { + return InvokeInstanceMethod(new object[]{}); + } + + /// Say goodbye. + [JsiiMethod("goodbye", "{\"primitive\":\"string\"}", "[]")] + public virtual string Goodbye() + { + return InvokeInstanceMethod(new object[]{}); + } + + /// Say hello! + [JsiiMethod("hello", "{\"primitive\":\"string\"}", "[]")] + public virtual string Hello() + { + return InvokeInstanceMethod(new object[]{}); + } + + /// String representation of the value. + [JsiiMethod("toString", "{\"primitive\":\"string\"}", "[]")] + public override string ToString() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NodeStandardLibrary.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NodeStandardLibrary.cs new file mode 100644 index 0000000000..bcbc57d591 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NodeStandardLibrary.cs @@ -0,0 +1,52 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// Test fixture to verify that jsii modules can use the node standard library. + [JsiiClass(typeof(NodeStandardLibrary), "jsii-calc.NodeStandardLibrary", "[]")] + public class NodeStandardLibrary : DeputyBase + { + public NodeStandardLibrary(): base(new DeputyProps(new object[]{})) + { + } + + protected NodeStandardLibrary(ByRefValue reference): base(reference) + { + } + + protected NodeStandardLibrary(DeputyProps props): base(props) + { + } + + /// Returns the current os.platform() from the "os" node module. + [JsiiProperty("osPlatform", "{\"primitive\":\"string\"}")] + public virtual string OsPlatform + { + get => GetInstanceProperty(); + } + + /// Uses node.js "crypto" module to calculate sha256 of a string. + /// "6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50" + [JsiiMethod("cryptoSha256", "{\"primitive\":\"string\"}", "[]")] + public virtual string CryptoSha256() + { + return InvokeInstanceMethod(new object[]{}); + } + + /// Reads a local resource file (resource.txt) asynchronously. + /// "Hello, resource!" + [JsiiMethod("fsReadFile", "{\"primitive\":\"string\",\"promise\":true}", "[]")] + public virtual string FsReadFile() + { + return InvokeInstanceMethod(new object[]{}); + } + + /// Sync version of fsReadFile. + /// "Hello, resource! SYNC!" + [JsiiMethod("fsReadFileSync", "{\"primitive\":\"string\"}", "[]")] + public virtual string FsReadFileSync() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NumberGenerator.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NumberGenerator.cs new file mode 100644 index 0000000000..9889b5fdaa --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/NumberGenerator.cs @@ -0,0 +1,43 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// + /// This allows us to test that a reference can be stored for objects that + /// implement interfaces. + /// + [JsiiClass(typeof(NumberGenerator), "jsii-calc.NumberGenerator", "[{\"name\":\"generator\",\"type\":{\"fqn\":\"jsii-calc.IRandomNumberGenerator\"}}]")] + public class NumberGenerator : DeputyBase + { + public NumberGenerator(IIRandomNumberGenerator generator): base(new DeputyProps(new object[]{generator})) + { + } + + protected NumberGenerator(ByRefValue reference): base(reference) + { + } + + protected NumberGenerator(DeputyProps props): base(props) + { + } + + [JsiiProperty("generator", "{\"fqn\":\"jsii-calc.IRandomNumberGenerator\"}")] + public virtual IIRandomNumberGenerator Generator + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiMethod("isSameGenerator", "{\"primitive\":\"boolean\"}", "[{\"name\":\"gen\",\"type\":{\"fqn\":\"jsii-calc.IRandomNumberGenerator\"}}]")] + public virtual bool IsSameGenerator(IIRandomNumberGenerator gen) + { + return InvokeInstanceMethod(new object[]{gen}); + } + + [JsiiMethod("nextTimes100", "{\"primitive\":\"number\"}", "[]")] + public virtual double NextTimes100() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ObjectRefsInCollections.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ObjectRefsInCollections.cs new file mode 100644 index 0000000000..13915c1450 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ObjectRefsInCollections.cs @@ -0,0 +1,37 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; +using System.Collections.Generic; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// Verify that object references can be passed inside collections. + [JsiiClass(typeof(ObjectRefsInCollections), "jsii-calc.ObjectRefsInCollections", "[]")] + public class ObjectRefsInCollections : DeputyBase + { + public ObjectRefsInCollections(): base(new DeputyProps(new object[]{})) + { + } + + protected ObjectRefsInCollections(ByRefValue reference): base(reference) + { + } + + protected ObjectRefsInCollections(DeputyProps props): base(props) + { + } + + /// Returns the sum of all values + [JsiiMethod("sumFromArray", "{\"primitive\":\"number\"}", "[{\"name\":\"values\",\"type\":{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}}]")] + public virtual double SumFromArray(Value_[] values) + { + return InvokeInstanceMethod(new object[]{values}); + } + + /// Returns the sum of all values in a map + [JsiiMethod("sumFromMap", "{\"primitive\":\"number\"}", "[{\"name\":\"values\",\"type\":{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}}]")] + public virtual double SumFromMap(IDictionary values) + { + return InvokeInstanceMethod(new object[]{values}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OverrideReturnsObject.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OverrideReturnsObject.cs new file mode 100644 index 0000000000..152f329b6d --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/OverrideReturnsObject.cs @@ -0,0 +1,26 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(OverrideReturnsObject), "jsii-calc.OverrideReturnsObject", "[]")] + public class OverrideReturnsObject : DeputyBase + { + public OverrideReturnsObject(): base(new DeputyProps(new object[]{})) + { + } + + protected OverrideReturnsObject(ByRefValue reference): base(reference) + { + } + + protected OverrideReturnsObject(DeputyProps props): base(props) + { + } + + [JsiiMethod("test", "{\"primitive\":\"number\"}", "[{\"name\":\"obj\",\"type\":{\"fqn\":\"jsii-calc.ReturnsNumber\"}}]")] + public virtual double Test(IReturnsNumber obj) + { + return InvokeInstanceMethod(new object[]{obj}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Polymorphism.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Polymorphism.cs new file mode 100644 index 0000000000..565b785432 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Polymorphism.cs @@ -0,0 +1,27 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(Polymorphism), "jsii-calc.Polymorphism", "[]")] + public class Polymorphism : DeputyBase + { + public Polymorphism(): base(new DeputyProps(new object[]{})) + { + } + + protected Polymorphism(ByRefValue reference): base(reference) + { + } + + protected Polymorphism(DeputyProps props): base(props) + { + } + + [JsiiMethod("sayHello", "{\"primitive\":\"string\"}", "[{\"name\":\"friendly\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.IFriendly\"}}]")] + public virtual string SayHello(IIFriendly friendly) + { + return InvokeInstanceMethod(new object[]{friendly}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Power.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Power.cs new file mode 100644 index 0000000000..422b614bdd --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Power.cs @@ -0,0 +1,47 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.composition; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// The power operation. + [JsiiClass(typeof(Power), "jsii-calc.Power", "[{\"name\":\"base\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}},{\"name\":\"pow\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] + public class Power : CompositeOperation_ + { + public Power(Value_ @base, Value_ pow): base(new DeputyProps(new object[]{@base, pow})) + { + } + + protected Power(ByRefValue reference): base(reference) + { + } + + protected Power(DeputyProps props): base(props) + { + } + + /// The base of the power + [JsiiProperty("base", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + public virtual Value_ Base + { + get => GetInstanceProperty(); + } + + /// + /// The expression that this operation consists of. + /// Must be implemented by derived classes. + /// + [JsiiProperty("expression", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + public override Value_ Expression + { + get => GetInstanceProperty(); + } + + /// The number of times to multiply + [JsiiProperty("pow", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + public virtual Value_ Pow + { + get => GetInstanceProperty(); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReferenceEnumFromScopedPackage.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReferenceEnumFromScopedPackage.cs new file mode 100644 index 0000000000..febe8c3ec9 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReferenceEnumFromScopedPackage.cs @@ -0,0 +1,41 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// See awslabs/jsii#138 + [JsiiClass(typeof(ReferenceEnumFromScopedPackage), "jsii-calc.ReferenceEnumFromScopedPackage", "[]")] + public class ReferenceEnumFromScopedPackage : DeputyBase + { + public ReferenceEnumFromScopedPackage(): base(new DeputyProps(new object[]{})) + { + } + + protected ReferenceEnumFromScopedPackage(ByRefValue reference): base(reference) + { + } + + protected ReferenceEnumFromScopedPackage(DeputyProps props): base(props) + { + } + + [JsiiProperty("foo", "{\"fqn\":\"@scope/jsii-calc-lib.EnumFromScopedModule\",\"optional\":true}")] + public virtual EnumFromScopedModule Foo + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiMethod("loadFoo", "{\"fqn\":\"@scope/jsii-calc-lib.EnumFromScopedModule\",\"optional\":true}", "[]")] + public virtual EnumFromScopedModule LoadFoo() + { + return InvokeInstanceMethod(new object[]{}); + } + + [JsiiMethod("saveFoo", null, "[{\"name\":\"value\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.EnumFromScopedModule\"}}]")] + public virtual void SaveFoo(EnumFromScopedModule value) + { + InvokeInstanceVoidMethod(new object[]{value}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReturnsNumberProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReturnsNumberProxy.cs new file mode 100644 index 0000000000..1abd7f0a89 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReturnsNumberProxy.cs @@ -0,0 +1,24 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiInterfaceProxy(typeof(IReturnsNumber), "jsii-calc.ReturnsNumber")] + internal class ReturnsNumberProxy : DeputyBase, IReturnsNumber + { + private ReturnsNumberProxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty("numberProp", "{\"primitive\":\"number\"}")] + public virtual double NumberProp + { + get => GetInstanceProperty(); + } + + [JsiiMethod("obtainNumber", "{\"primitive\":\"number\"}", "[]")] + public virtual double ObtainNumber() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/RuntimeTypeChecking.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/RuntimeTypeChecking.cs new file mode 100644 index 0000000000..c3da746ef9 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/RuntimeTypeChecking.cs @@ -0,0 +1,28 @@ +using Amazon.JSII.Runtime.Deputy; +using System; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(RuntimeTypeChecking), "jsii-calc.RuntimeTypeChecking", "[]")] + public class RuntimeTypeChecking : DeputyBase + { + public RuntimeTypeChecking(): base(new DeputyProps(new object[]{})) + { + } + + protected RuntimeTypeChecking(ByRefValue reference): base(reference) + { + } + + protected RuntimeTypeChecking(DeputyProps props): base(props) + { + } + + /// Used to verify verification of number of method arguments. + [JsiiMethod("methodWithOptionalArguments", null, "[{\"name\":\"arg1\",\"type\":{\"primitive\":\"number\"}},{\"name\":\"arg2\",\"type\":{\"primitive\":\"string\"}},{\"name\":\"arg3\",\"type\":{\"primitive\":\"date\",\"optional\":true}}]")] + public virtual void MethodWithOptionalArguments(double arg1, string arg2, DateTime? arg3) + { + InvokeInstanceVoidMethod(new object[]{arg1, arg2, arg3}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Statics.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Statics.cs new file mode 100644 index 0000000000..b6231d91c8 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Statics.cs @@ -0,0 +1,90 @@ +using Amazon.JSII.Runtime.Deputy; +using System.Collections.Generic; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(Statics), "jsii-calc.Statics", "[{\"name\":\"value\",\"type\":{\"primitive\":\"string\"}}]")] + public class Statics : DeputyBase + { + public Statics(string value): base(new DeputyProps(new object[]{value})) + { + } + + protected Statics(ByRefValue reference): base(reference) + { + } + + protected Statics(DeputyProps props): base(props) + { + } + + /// Constants may also use all-caps. + [JsiiProperty("BAR", "{\"primitive\":\"number\"}")] + public static double BAR + { + get; + } + + = GetStaticProperty(typeof(Statics)); + [JsiiProperty("ConstObj", "{\"fqn\":\"jsii-calc.DoubleTrouble\"}")] + public static DoubleTrouble ConstObj + { + get; + } + + = GetStaticProperty(typeof(Statics)); + /// Jsdocs for static property. + [JsiiProperty("Foo", "{\"primitive\":\"string\"}")] + public static string Foo + { + get; + } + + = GetStaticProperty(typeof(Statics)); + /// Constants can also use camelCase. + [JsiiProperty("zooBar", "{\"collection\":{\"kind\":\"map\",\"elementtype\":{\"primitive\":\"string\"}}}")] + public static IDictionary ZooBar + { + get; + } + + = GetStaticProperty>(typeof(Statics)); + /// + /// Jsdocs for static getter. + /// Jsdocs for static setter. + /// + [JsiiProperty("instance", "{\"fqn\":\"jsii-calc.Statics\"}")] + public static Statics Instance + { + get => GetStaticProperty(typeof(Statics)); + set => SetStaticProperty(typeof(Statics), value); + } + + [JsiiProperty("nonConstStatic", "{\"primitive\":\"number\"}")] + public static double NonConstStatic + { + get => GetStaticProperty(typeof(Statics)); + set => SetStaticProperty(typeof(Statics), value); + } + + [JsiiProperty("value", "{\"primitive\":\"string\"}")] + public virtual string Value + { + get => GetInstanceProperty(); + } + + /// Jsdocs for static method + /// The name of the person to say hello to + [JsiiMethod("staticMethod", "{\"primitive\":\"string\"}", "[{\"name\":\"name\",\"type\":{\"primitive\":\"string\"}}]")] + public static string StaticMethod(string name) + { + return InvokeStaticMethod(typeof(Statics), new object[]{name}); + } + + [JsiiMethod("justMethod", "{\"primitive\":\"string\"}", "[]")] + public virtual string JustMethod() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StringEnum.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StringEnum.cs new file mode 100644 index 0000000000..00184f5025 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/StringEnum.cs @@ -0,0 +1,15 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiEnum(typeof(StringEnum), "jsii-calc.StringEnum")] + public enum StringEnum + { + [JsiiEnumMember("A")] + A, + [JsiiEnumMember("B")] + B, + [JsiiEnumMember("C")] + C + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Sum.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Sum.cs new file mode 100644 index 0000000000..b694819829 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Sum.cs @@ -0,0 +1,41 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.composition; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// An operation that sums multiple values. + [JsiiClass(typeof(Sum), "jsii-calc.Sum", "[]")] + public class Sum : CompositeOperation_ + { + public Sum(): base(new DeputyProps(new object[]{})) + { + } + + protected Sum(ByRefValue reference): base(reference) + { + } + + protected Sum(DeputyProps props): base(props) + { + } + + /// + /// The expression that this operation consists of. + /// Must be implemented by derived classes. + /// + [JsiiProperty("expression", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + public override Value_ Expression + { + get => GetInstanceProperty(); + } + + /// The parts to sum. + [JsiiProperty("parts", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}}")] + public virtual Value_[] Parts + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SyncVirtualMethods.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SyncVirtualMethods.cs new file mode 100644 index 0000000000..fb39b30885 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/SyncVirtualMethods.cs @@ -0,0 +1,121 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(SyncVirtualMethods), "jsii-calc.SyncVirtualMethods", "[]")] + public class SyncVirtualMethods : DeputyBase + { + public SyncVirtualMethods(): base(new DeputyProps(new object[]{})) + { + } + + protected SyncVirtualMethods(ByRefValue reference): base(reference) + { + } + + protected SyncVirtualMethods(DeputyProps props): base(props) + { + } + + [JsiiProperty("readonlyProperty", "{\"primitive\":\"string\"}")] + public virtual string ReadonlyProperty + { + get => GetInstanceProperty(); + } + + [JsiiProperty("a", "{\"primitive\":\"number\"}")] + public virtual double A + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("callerIsProperty", "{\"primitive\":\"number\"}")] + public virtual double CallerIsProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("otherProperty", "{\"primitive\":\"string\"}")] + public virtual string OtherProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("theProperty", "{\"primitive\":\"string\"}")] + public virtual string TheProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiProperty("valueOfOtherProperty", "{\"primitive\":\"string\"}")] + public virtual string ValueOfOtherProperty + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + [JsiiMethod("callerIsAsync", "{\"primitive\":\"number\",\"promise\":true}", "[]")] + public virtual double CallerIsAsync() + { + return InvokeInstanceMethod(new object[]{}); + } + + [JsiiMethod("callerIsMethod", "{\"primitive\":\"number\"}", "[]")] + public virtual double CallerIsMethod() + { + return InvokeInstanceMethod(new object[]{}); + } + + [JsiiMethod("modifyOtherProperty", null, "[{\"name\":\"value\",\"type\":{\"primitive\":\"string\"}}]")] + public virtual void ModifyOtherProperty(string value) + { + InvokeInstanceVoidMethod(new object[]{value}); + } + + [JsiiMethod("modifyValueOfTheProperty", null, "[{\"name\":\"value\",\"type\":{\"primitive\":\"string\"}}]")] + public virtual void ModifyValueOfTheProperty(string value) + { + InvokeInstanceVoidMethod(new object[]{value}); + } + + [JsiiMethod("readA", "{\"primitive\":\"number\"}", "[]")] + public virtual double ReadA() + { + return InvokeInstanceMethod(new object[]{}); + } + + [JsiiMethod("retrieveOtherProperty", "{\"primitive\":\"string\"}", "[]")] + public virtual string RetrieveOtherProperty() + { + return InvokeInstanceMethod(new object[]{}); + } + + [JsiiMethod("retrieveReadOnlyProperty", "{\"primitive\":\"string\"}", "[]")] + public virtual string RetrieveReadOnlyProperty() + { + return InvokeInstanceMethod(new object[]{}); + } + + [JsiiMethod("retrieveValueOfTheProperty", "{\"primitive\":\"string\"}", "[]")] + public virtual string RetrieveValueOfTheProperty() + { + return InvokeInstanceMethod(new object[]{}); + } + + [JsiiMethod("virtualMethod", "{\"primitive\":\"number\"}", "[{\"name\":\"n\",\"type\":{\"primitive\":\"number\"}}]")] + public virtual double VirtualMethod(double n) + { + return InvokeInstanceMethod(new object[]{n}); + } + + [JsiiMethod("writeA", null, "[{\"name\":\"value\",\"type\":{\"primitive\":\"number\"}}]")] + public virtual void WriteA(double value) + { + InvokeInstanceVoidMethod(new object[]{value}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Thrower.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Thrower.cs new file mode 100644 index 0000000000..7f5961d7ac --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/Thrower.cs @@ -0,0 +1,26 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(Thrower), "jsii-calc.Thrower", "[]")] + public class Thrower : DeputyBase + { + public Thrower(): base(new DeputyProps(new object[]{})) + { + } + + protected Thrower(ByRefValue reference): base(reference) + { + } + + protected Thrower(DeputyProps props): base(props) + { + } + + [JsiiMethod("throwError", null, "[]")] + public virtual void ThrowError() + { + InvokeInstanceVoidMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnaryOperation.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnaryOperation.cs new file mode 100644 index 0000000000..61200c8938 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnaryOperation.cs @@ -0,0 +1,28 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// An operation on a single operand. + [JsiiClass(typeof(UnaryOperation), "jsii-calc.UnaryOperation", "[{\"name\":\"operand\",\"type\":{\"fqn\":\"@scope/jsii-calc-lib.Value\"}}]")] + public abstract class UnaryOperation : Operation + { + protected UnaryOperation(Value_ operand): base(new DeputyProps(new object[]{operand})) + { + } + + protected UnaryOperation(ByRefValue reference): base(reference) + { + } + + protected UnaryOperation(DeputyProps props): base(props) + { + } + + [JsiiProperty("operand", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + public virtual Value_ Operand + { + get => GetInstanceProperty(); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs new file mode 100644 index 0000000000..6c830255af --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionProperties.cs @@ -0,0 +1,20 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + public class UnionProperties : DeputyBase, IUnionProperties + { + [JsiiProperty("bar", "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"},{\"fqn\":\"jsii-calc.AllTypes\"}]}}", true)] + public object Bar + { + get; + } + + [JsiiProperty("foo", "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"}]},\"optional\":true}", true)] + public object Foo + { + get; + set; + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionPropertiesProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionPropertiesProxy.cs new file mode 100644 index 0000000000..1266146265 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UnionPropertiesProxy.cs @@ -0,0 +1,25 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiInterfaceProxy(typeof(IUnionProperties), "jsii-calc.UnionProperties")] + internal class UnionPropertiesProxy : DeputyBase, IUnionProperties + { + private UnionPropertiesProxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty("bar", "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"},{\"fqn\":\"jsii-calc.AllTypes\"}]}}")] + public virtual object Bar + { + get => GetInstanceProperty(); + } + + [JsiiProperty("foo", "{\"union\":{\"types\":[{\"primitive\":\"string\"},{\"primitive\":\"number\"}]},\"optional\":true}")] + public virtual object Foo + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseBundledDependency.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseBundledDependency.cs new file mode 100644 index 0000000000..7470df65fe --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseBundledDependency.cs @@ -0,0 +1,26 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(UseBundledDependency), "jsii-calc.UseBundledDependency", "[]")] + public class UseBundledDependency : DeputyBase + { + public UseBundledDependency(): base(new DeputyProps(new object[]{})) + { + } + + protected UseBundledDependency(ByRefValue reference): base(reference) + { + } + + protected UseBundledDependency(DeputyProps props): base(props) + { + } + + [JsiiMethod("value", "{\"primitive\":\"any\"}", "[]")] + public virtual object Value() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseCalcBase.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseCalcBase.cs new file mode 100644 index 0000000000..a93601c43d --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UseCalcBase.cs @@ -0,0 +1,28 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// Depend on a type from jsii-calc-base as a test for awslabs/jsii#128 + [JsiiClass(typeof(UseCalcBase), "jsii-calc.UseCalcBase", "[]")] + public class UseCalcBase : DeputyBase + { + public UseCalcBase(): base(new DeputyProps(new object[]{})) + { + } + + protected UseCalcBase(ByRefValue reference): base(reference) + { + } + + protected UseCalcBase(DeputyProps props): base(props) + { + } + + [JsiiMethod("hello", "{\"fqn\":\"@scope/jsii-calc-base.Base\"}", "[]")] + public virtual Base Hello() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UsesInterfaceWithProperties.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UsesInterfaceWithProperties.cs new file mode 100644 index 0000000000..36b537a76c --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/UsesInterfaceWithProperties.cs @@ -0,0 +1,44 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(UsesInterfaceWithProperties), "jsii-calc.UsesInterfaceWithProperties", "[{\"name\":\"obj\",\"type\":{\"fqn\":\"jsii-calc.IInterfaceWithProperties\"}}]")] + public class UsesInterfaceWithProperties : DeputyBase + { + public UsesInterfaceWithProperties(IIInterfaceWithProperties obj): base(new DeputyProps(new object[]{obj})) + { + } + + protected UsesInterfaceWithProperties(ByRefValue reference): base(reference) + { + } + + protected UsesInterfaceWithProperties(DeputyProps props): base(props) + { + } + + [JsiiProperty("obj", "{\"fqn\":\"jsii-calc.IInterfaceWithProperties\"}")] + public virtual IIInterfaceWithProperties Obj + { + get => GetInstanceProperty(); + } + + [JsiiMethod("justRead", "{\"primitive\":\"string\"}", "[]")] + public virtual string JustRead() + { + return InvokeInstanceMethod(new object[]{}); + } + + [JsiiMethod("readStringAndNumber", "{\"primitive\":\"string\"}", "[{\"name\":\"ext\",\"type\":{\"fqn\":\"jsii-calc.IInterfaceWithPropertiesExtension\"}}]")] + public virtual string ReadStringAndNumber(IIInterfaceWithPropertiesExtension ext) + { + return InvokeInstanceMethod(new object[]{ext}); + } + + [JsiiMethod("writeAndRead", "{\"primitive\":\"string\"}", "[{\"name\":\"value\",\"type\":{\"primitive\":\"string\"}}]")] + public virtual string WriteAndRead(string value) + { + return InvokeInstanceMethod(new object[]{value}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VariadicMethod.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VariadicMethod.cs new file mode 100644 index 0000000000..c2491df697 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VariadicMethod.cs @@ -0,0 +1,28 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(VariadicMethod), "jsii-calc.VariadicMethod", "[{\"name\":\"prefix\",\"type\":{\"primitive\":\"number\"}}]")] + public class VariadicMethod : DeputyBase + { + public VariadicMethod(double prefix): base(new DeputyProps(new object[]{prefix})) + { + } + + protected VariadicMethod(ByRefValue reference): base(reference) + { + } + + protected VariadicMethod(DeputyProps props): base(props) + { + } + + /// the first element of the array to be returned (after the ``prefix`` provided at construction time). + /// other elements to be included in the array. + [JsiiMethod("asArray", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"number\"}}}", "[{\"name\":\"first\",\"type\":{\"primitive\":\"number\"}},{\"name\":\"others\",\"type\":{\"primitive\":\"number\"}}]")] + public virtual double[] AsArray(double first, double others) + { + return InvokeInstanceMethod(new object[]{first, others}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VirtualMethodPlayground.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VirtualMethodPlayground.cs new file mode 100644 index 0000000000..82a3001c27 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/VirtualMethodPlayground.cs @@ -0,0 +1,50 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + [JsiiClass(typeof(VirtualMethodPlayground), "jsii-calc.VirtualMethodPlayground", "[]")] + public class VirtualMethodPlayground : DeputyBase + { + public VirtualMethodPlayground(): base(new DeputyProps(new object[]{})) + { + } + + protected VirtualMethodPlayground(ByRefValue reference): base(reference) + { + } + + protected VirtualMethodPlayground(DeputyProps props): base(props) + { + } + + [JsiiMethod("overrideMeAsync", "{\"primitive\":\"number\",\"promise\":true}", "[{\"name\":\"index\",\"type\":{\"primitive\":\"number\"}}]")] + public virtual double OverrideMeAsync(double index) + { + return InvokeInstanceMethod(new object[]{index}); + } + + [JsiiMethod("overrideMeSync", "{\"primitive\":\"number\"}", "[{\"name\":\"index\",\"type\":{\"primitive\":\"number\"}}]")] + public virtual double OverrideMeSync(double index) + { + return InvokeInstanceMethod(new object[]{index}); + } + + [JsiiMethod("parallelSumAsync", "{\"primitive\":\"number\",\"promise\":true}", "[{\"name\":\"count\",\"type\":{\"primitive\":\"number\"}}]")] + public virtual double ParallelSumAsync(double count) + { + return InvokeInstanceMethod(new object[]{count}); + } + + [JsiiMethod("serialSumAsync", "{\"primitive\":\"number\",\"promise\":true}", "[{\"name\":\"count\",\"type\":{\"primitive\":\"number\"}}]")] + public virtual double SerialSumAsync(double count) + { + return InvokeInstanceMethod(new object[]{count}); + } + + [JsiiMethod("sumSync", "{\"primitive\":\"number\"}", "[{\"name\":\"count\",\"type\":{\"primitive\":\"number\"}}]")] + public virtual double SumSync(double count) + { + return InvokeInstanceMethod(new object[]{count}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation/CompositionStringStyle.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation/CompositionStringStyle.cs new file mode 100644 index 0000000000..b20e6ab251 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation/CompositionStringStyle.cs @@ -0,0 +1,14 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace.composition.CompositeOperation +{ + /// Style of .toString() output for CompositeOperation. + [JsiiEnum(typeof(CompositionStringStyle), "jsii-calc.composition.CompositeOperation.CompositionStringStyle")] + public enum CompositionStringStyle + { + [JsiiEnumMember("Normal")] + Normal, + [JsiiEnumMember("Decorated")] + Decorated + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation_.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation_.cs new file mode 100644 index 0000000000..6bc3281d6a --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/composition/CompositeOperation_.cs @@ -0,0 +1,71 @@ +using Amazon.JSII.Runtime.Deputy; +using Amazon.JSII.Tests.CalculatorNamespace.composition.CompositeOperation; +using Amazon.JSII.Tests.CalculatorNamespace.LibNamespace; + +namespace Amazon.JSII.Tests.CalculatorNamespace.composition +{ + /// Abstract operation composed from an expression of other operations. + [JsiiClass(typeof(CompositeOperation_), "jsii-calc.composition.CompositeOperation", "[]")] + public abstract class CompositeOperation_ : Operation + { + protected CompositeOperation_(): base(new DeputyProps(new object[]{})) + { + } + + protected CompositeOperation_(ByRefValue reference): base(reference) + { + } + + protected CompositeOperation_(DeputyProps props): base(props) + { + } + + /// + /// The expression that this operation consists of. + /// Must be implemented by derived classes. + /// + [JsiiProperty("expression", "{\"fqn\":\"@scope/jsii-calc-lib.Value\"}")] + public virtual Value_ Expression + { + get => GetInstanceProperty(); + } + + /// The value. + [JsiiProperty("value", "{\"primitive\":\"number\"}")] + public override double Value + { + get => GetInstanceProperty(); + } + + /// A set of postfixes to include in a decorated .toString(). + [JsiiProperty("decorationPostfixes", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}")] + public virtual string[] DecorationPostfixes + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + /// A set of prefixes to include in a decorated .toString(). + [JsiiProperty("decorationPrefixes", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"string\"}}}")] + public virtual string[] DecorationPrefixes + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + /// The .toString() style. + [JsiiProperty("stringStyle", "{\"fqn\":\"jsii-calc.composition.CompositeOperation.CompositionStringStyle\"}")] + public virtual CompositionStringStyle StringStyle + { + get => GetInstanceProperty(); + set => SetInstanceProperty(value); + } + + /// String representation of the value. + [JsiiMethod("toString", "{\"primitive\":\"string\"}", "[]")] + public override string ToString() + { + return InvokeInstanceMethod(new object[]{}); + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/AssemblyInfo.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/AssemblyInfo.cs new file mode 100644 index 0000000000..05ba9d531a --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using Amazon.JSII.Runtime.Deputy; + +[assembly: JsiiAssembly("jsii-calc", "0.6.4", "jsii-calc-0.6.4.tgz")] \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/jsii-calc-0.6.4.tgz b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/jsii-calc-0.6.4.tgz new file mode 100644 index 0000000000..eef7587bf2 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/jsii-calc-0.6.4.tgz @@ -0,0 +1,2 @@ +Placeholder for the expected module tarball +The diff-test.sh harness will replace it with the real expected tarball diff --git a/packages/jsii-runtime/package-lock.json b/packages/jsii-runtime/package-lock.json index e2c829d2d4..72bc4420ae 100644 --- a/packages/jsii-runtime/package-lock.json +++ b/packages/jsii-runtime/package-lock.json @@ -1976,11 +1976,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1993,15 +1995,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2104,7 +2109,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2114,6 +2120,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2126,17 +2133,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -2153,6 +2163,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -2225,7 +2236,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -2235,6 +2247,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2340,6 +2353,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",