diff --git a/packages/jsii-dotnet-analyzers/src/Amazon.JSII.Analyzers/Amazon.JSII.Analyzers.csproj b/packages/jsii-dotnet-analyzers/src/Amazon.JSII.Analyzers/Amazon.JSII.Analyzers.csproj index e51c3eb96a..ab11cb58dc 100644 --- a/packages/jsii-dotnet-analyzers/src/Amazon.JSII.Analyzers/Amazon.JSII.Analyzers.csproj +++ b/packages/jsii-dotnet-analyzers/src/Amazon.JSII.Analyzers/Amazon.JSII.Analyzers.csproj @@ -1,4 +1,4 @@ - + @@ -10,9 +10,7 @@ - - - + diff --git a/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests.sln b/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests.sln index 775f7320b7..f6a54bb6e3 100644 --- a/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests.sln +++ b/packages/jsii-dotnet-runtime-test/test/Amazon.JSII.Runtime.IntegrationTests.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Amazon.JSII.Runtime.IntegrationTests", "Amazon.JSII.Runtime.IntegrationTests\Amazon.JSII.Runtime.IntegrationTests.csproj", "{CE3CAFBD-25F8-422D-925A-8F9CCEA1F548}" diff --git a/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts b/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts index 86afe6ab34..e9c96281b5 100644 --- a/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts +++ b/packages/jsii-pacmak/lib/targets/dotnet/filegenerator.ts @@ -2,8 +2,9 @@ import { CodeMaker } from 'codemaker'; import { Assembly } from 'jsii-spec'; import path = require('path'); import xmlbuilder = require('xmlbuilder'); -import logging = require('../../logging'); import { DotNetNameUtils } from './nameutils'; +import logging = require('../../logging'); +import { nextMajorVersion } from '../../util'; // Represents a dependency in the dependency tree. export class DotNetDependency { @@ -95,13 +96,14 @@ export class FileGenerator { const embeddedResource = itemGroup1.ele('EmbeddedResource'); embeddedResource.att('Include', this.tarballFileName); + // Strip " (build abcdef)" from the jsii version + const jsiiVersion = assembly.jsiiVersion.replace(/ .*$/, ''); + const jsiiVersionNextMajor = nextMajorVersion(jsiiVersion); + const itemGroup2 = rootNode.ele('ItemGroup'); const packageReference = itemGroup2.ele('PackageReference'); packageReference.att('Include', 'Amazon.JSII.Runtime'); - - // Strip " (build abcdef)" from the jsii version - const jsiiVersionSimple = assembly.jsiiVersion.replace(/ .*$/, ''); - packageReference.att('Version', jsiiVersionSimple); + packageReference.att('Version', `[${jsiiVersion},${jsiiVersionNextMajor})`); dependencies.forEach((value: DotNetDependency) => { const dependencyReference = itemGroup2.ele('PackageReference'); diff --git a/packages/jsii-pacmak/lib/util.ts b/packages/jsii-pacmak/lib/util.ts index 199d62de73..81dca2fde4 100644 --- a/packages/jsii-pacmak/lib/util.ts +++ b/packages/jsii-pacmak/lib/util.ts @@ -3,6 +3,7 @@ import fs = require('fs-extra'); import spec = require('jsii-spec'); import os = require('os'); import path = require('path'); +import semver = require('semver'); import logging = require('./logging'); export interface ShellOptions extends SpawnOptions { @@ -120,4 +121,26 @@ export class Scratch { await fs.remove(this.directory); } } -} \ No newline at end of file +} + +/** + * Determines the next major version from a given current version. This honors + * the specificities of pre-1.0.0 releases, too. + * + * @param version the current version from which to bump. + * + * @returns the next Major Version string. + */ +export function nextMajorVersion(version: string): string { + const v = semver.parse(version); + if (!v) { + throw new Error(`Invalid semantic version identifier: ${version}`); + } + if (v.major !== 0) { + return v.inc('major').version; + } + if (v.minor !== 0) { + return v.inc('minor').version; + } + return v.inc('patch').version; +} diff --git a/packages/jsii-pacmak/test/diff-test.sh b/packages/jsii-pacmak/test/diff-test.sh index 8889c113d3..f0ffa86761 100755 --- a/packages/jsii-pacmak/test/diff-test.sh +++ b/packages/jsii-pacmak/test/diff-test.sh @@ -72,6 +72,7 @@ function assert-generator() { done } +assert-generator jsii-calc-base-of-base assert-generator jsii-calc-base assert-generator jsii-calc-lib assert-generator jsii-calc diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/.jsii new file mode 100644 index 0000000000..68af9dcfe1 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/.jsii @@ -0,0 +1,115 @@ +{ + "author": { + "name": "Amazon Web Services", + "organization": true, + "roles": [ + "author" + ], + "url": "https://aws.amazon.com" + }, + "description": "An example transitive dependency for jsii-calc.", + "homepage": "https://github.com/aws/jsii", + "jsiiVersion": "0.20.0", + "license": "Apache-2.0", + "name": "@scope/jsii-calc-base-of-base", + "repository": { + "directory": "packages/jsii-calc-base-of-base", + "type": "git", + "url": "https://github.com/aws/jsii.git" + }, + "schema": "jsii/0.10.0", + "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" + }, + "python": { + "distName": "scope.jsii-calc-base-of-base", + "module": "scope.jsii_calc_base_of_base" + } + }, + "types": { + "@scope/jsii-calc-base-of-base.IVeryBaseInterface": { + "assembly": "@scope/jsii-calc-base-of-base", + "fqn": "@scope/jsii-calc-base-of-base.IVeryBaseInterface", + "kind": "interface", + "locationInModule": { + "filename": "lib/index.ts", + "line": 1 + }, + "methods": [ + { + "abstract": true, + "locationInModule": { + "filename": "lib/index.ts", + "line": 2 + }, + "name": "foo" + } + ], + "name": "IVeryBaseInterface" + }, + "@scope/jsii-calc-base-of-base.Very": { + "assembly": "@scope/jsii-calc-base-of-base", + "fqn": "@scope/jsii-calc-base-of-base.Very", + "initializer": {}, + "kind": "class", + "locationInModule": { + "filename": "lib/index.ts", + "line": 9 + }, + "methods": [ + { + "locationInModule": { + "filename": "lib/index.ts", + "line": 10 + }, + "name": "hey", + "returns": { + "type": { + "primitive": "number" + } + } + } + ], + "name": "Very" + }, + "@scope/jsii-calc-base-of-base.VeryBaseProps": { + "assembly": "@scope/jsii-calc-base-of-base", + "datatype": true, + "fqn": "@scope/jsii-calc-base-of-base.VeryBaseProps", + "kind": "interface", + "locationInModule": { + "filename": "lib/index.ts", + "line": 5 + }, + "name": "VeryBaseProps", + "properties": [ + { + "abstract": true, + "immutable": true, + "locationInModule": { + "filename": "lib/index.ts", + "line": 6 + }, + "name": "foo", + "type": { + "fqn": "@scope/jsii-calc-base-of-base.Very" + } + } + ] + } + }, + "version": "0.20.0", + "fingerprint": "4yJsyi5ch/E1bHSJMcEEBX/WvJK/zroW/a+Ta8Tc6lk=" +} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId.csproj b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId.csproj new file mode 100644 index 0000000000..d1c369568c --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId.csproj @@ -0,0 +1,30 @@ + + + + An example transitive dependency for jsii-calc. + Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId + Apache-2.0 + 0.20.0 + + Amazon Web Services + Amazon Web Services + en-US + https://github.com/aws/jsii + https://github.com/aws/jsii.git + git + + true + true + true + true + snupkg + netcoreapp3.0 + + + + + + + + + diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/IVeryBaseInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/IVeryBaseInterface.cs new file mode 100644 index 0000000000..3a4b4dace1 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/IVeryBaseInterface.cs @@ -0,0 +1,11 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace +{ + [JsiiInterface(nativeType: typeof(IVeryBaseInterface), fullyQualifiedName: "@scope/jsii-calc-base-of-base.IVeryBaseInterface")] + public interface IVeryBaseInterface + { + [JsiiMethod(name: "foo")] + void Foo(); + } +} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/IVeryBaseInterfaceProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/IVeryBaseInterfaceProxy.cs new file mode 100644 index 0000000000..af20ecc140 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/IVeryBaseInterfaceProxy.cs @@ -0,0 +1,18 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace +{ + [JsiiTypeProxy(nativeType: typeof(IVeryBaseInterface), fullyQualifiedName: "@scope/jsii-calc-base-of-base.IVeryBaseInterface")] + internal sealed class IVeryBaseInterfaceProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.IVeryBaseInterface + { + private IVeryBaseInterfaceProxy(ByRefValue reference): base(reference) + { + } + + [JsiiMethod(name: "foo")] + public void Foo() + { + InvokeInstanceVoidMethod(new System.Type[]{}, new object[]{}); + } + } +} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/IVeryBaseProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/IVeryBaseProps.cs new file mode 100644 index 0000000000..d0af7ce17b --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/IVeryBaseProps.cs @@ -0,0 +1,14 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace +{ + [JsiiInterface(nativeType: typeof(IVeryBaseProps), fullyQualifiedName: "@scope/jsii-calc-base-of-base.VeryBaseProps")] + public interface IVeryBaseProps + { + [JsiiProperty(name: "foo", typeJson: "{\"fqn\":\"@scope/jsii-calc-base-of-base.Very\"}")] + Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.Very Foo + { + get; + } + } +} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/Internal/DependencyResolution/Anchor.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/Internal/DependencyResolution/Anchor.cs new file mode 100644 index 0000000000..608cd2651c --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/Internal/DependencyResolution/Anchor.cs @@ -0,0 +1,9 @@ +namespace Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.Internal.DependencyResolution +{ + public class Anchor + { + public Anchor() + { + } + } +} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/Very.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/Very.cs new file mode 100644 index 0000000000..a20931304f --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/Very.cs @@ -0,0 +1,26 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace +{ + [JsiiClass(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.Very), fullyQualifiedName: "@scope/jsii-calc-base-of-base.Very")] + public class Very : DeputyBase + { + public Very(): base(new DeputyProps(new object[]{})) + { + } + + protected Very(ByRefValue reference): base(reference) + { + } + + protected Very(DeputyProps props): base(props) + { + } + + [JsiiMethod(name: "hey", returnsJson: "{\"type\":{\"primitive\":\"number\"}}")] + public virtual double Hey() + { + return InvokeInstanceMethod(new System.Type[]{}, new object[]{}); + } + } +} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/VeryBaseProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/VeryBaseProps.cs new file mode 100644 index 0000000000..e3129f5e31 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/VeryBaseProps.cs @@ -0,0 +1,15 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace +{ + [JsiiByValue(fqn: "@scope/jsii-calc-base-of-base.VeryBaseProps")] + public class VeryBaseProps : Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.IVeryBaseProps + { + [JsiiProperty(name: "foo", typeJson: "{\"fqn\":\"@scope/jsii-calc-base-of-base.Very\"}", isOverride: true)] + public Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.Very Foo + { + get; + set; + } + } +} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/VeryBasePropsProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/VeryBasePropsProxy.cs new file mode 100644 index 0000000000..cf0420f2c6 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseOfBaseNamespace/VeryBasePropsProxy.cs @@ -0,0 +1,18 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace +{ + [JsiiTypeProxy(nativeType: typeof(IVeryBaseProps), fullyQualifiedName: "@scope/jsii-calc-base-of-base.VeryBaseProps")] + internal sealed class VeryBasePropsProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.IVeryBaseProps + { + private VeryBasePropsProxy(ByRefValue reference): base(reference) + { + } + + [JsiiProperty(name: "foo", typeJson: "{\"fqn\":\"@scope/jsii-calc-base-of-base.Very\"}")] + public Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace.Very Foo + { + get => GetInstanceProperty(); + } + } +} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/AssemblyInfo.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/AssemblyInfo.cs new file mode 100644 index 0000000000..ec6843f8cf --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using Amazon.JSII.Runtime.Deputy; + +[assembly: JsiiAssembly("@scope/jsii-calc-base-of-base", "0.20.0", "scope-jsii-calc-base-of-base-0.20.0.tgz")] diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/scope-jsii-calc-base-of-base-0.20.0.tgz b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/scope-jsii-calc-base-of-base-0.20.0.tgz new file mode 100644 index 0000000000..eef7587bf2 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId/scope-jsii-calc-base-of-base-0.20.0.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-pacmak/test/expected.jsii-calc-base-of-base/java/pom.xml b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/java/pom.xml new file mode 100644 index 0000000000..ec2567eb3c --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/java/pom.xml @@ -0,0 +1,110 @@ + + + 4.0.0 + ${project.groupId}:${project.artifactId} + An example transitive dependency for jsii-calc. + https://github.com/aws/jsii + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + An OSI-approved license + + + + + Amazon Web Services + + author + + https://aws.amazon.com + + + + scm:git:https://github.com/aws/jsii.git + https://github.com/aws/jsii.git + + software.amazon.jsii.tests + calculator-base-of-base + 0.20.0 + jar + + UTF-8 + + + + software.amazon.jsii + jsii-runtime + 0.20.0 + + + javax.annotation + javax.annotation-api + [1.3.2,) + provided + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + true + + true + true + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.0.1 + + + attach-javadocs + + jar + + + + + false + protected + + **/$Module.java + + -J-XX:+TieredCompilation + -J-XX:TieredStopAtLevel=1 + + + + + diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/java/src/main/java/software/amazon/jsii/tests/calculator/baseofbase/$Module.java b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/java/src/main/java/software/amazon/jsii/tests/calculator/baseofbase/$Module.java new file mode 100644 index 0000000000..257b53928e --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/java/src/main/java/software/amazon/jsii/tests/calculator/baseofbase/$Module.java @@ -0,0 +1,19 @@ +package software.amazon.jsii.tests.calculator.baseofbase; + +import software.amazon.jsii.JsiiModule; + +public final class $Module extends JsiiModule { + public $Module() { + super("@scope/jsii-calc-base-of-base", "0.20.0", $Module.class, "jsii-calc-base-of-base@0.20.0.jsii.tgz"); + } + + @Override + protected Class resolveClass(final String fqn) throws ClassNotFoundException { + switch (fqn) { + case "@scope/jsii-calc-base-of-base.IVeryBaseInterface": return software.amazon.jsii.tests.calculator.baseofbase.IVeryBaseInterface.class; + case "@scope/jsii-calc-base-of-base.Very": return software.amazon.jsii.tests.calculator.baseofbase.Very.class; + case "@scope/jsii-calc-base-of-base.VeryBaseProps": return software.amazon.jsii.tests.calculator.baseofbase.VeryBaseProps.class; + default: throw new ClassNotFoundException("Unknown JSII type: " + fqn); + } + } +} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/java/src/main/java/software/amazon/jsii/tests/calculator/baseofbase/IVeryBaseInterface.java b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/java/src/main/java/software/amazon/jsii/tests/calculator/baseofbase/IVeryBaseInterface.java new file mode 100644 index 0000000000..98e97fe6f6 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/java/src/main/java/software/amazon/jsii/tests/calculator/baseofbase/IVeryBaseInterface.java @@ -0,0 +1,23 @@ +package software.amazon.jsii.tests.calculator.baseofbase; + +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.baseofbase.$Module.class, fqn = "@scope/jsii-calc-base-of-base.IVeryBaseInterface") +@software.amazon.jsii.Jsii.Proxy(IVeryBaseInterface.Jsii$Proxy.class) +public interface IVeryBaseInterface extends software.amazon.jsii.JsiiSerializable { + + void foo(); + + /** + * A proxy class which represents a concrete javascript instance of this type. + */ + final static class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements software.amazon.jsii.tests.calculator.baseofbase.IVeryBaseInterface { + protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + } + + @Override + public void foo() { + this.jsiiCall("foo", Void.class); + } + } +} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/java/src/main/java/software/amazon/jsii/tests/calculator/baseofbase/Very.java b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/java/src/main/java/software/amazon/jsii/tests/calculator/baseofbase/Very.java new file mode 100644 index 0000000000..de4f4d934b --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/java/src/main/java/software/amazon/jsii/tests/calculator/baseofbase/Very.java @@ -0,0 +1,23 @@ +package software.amazon.jsii.tests.calculator.baseofbase; + +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.baseofbase.$Module.class, fqn = "@scope/jsii-calc-base-of-base.Very") +public class Very extends software.amazon.jsii.JsiiObject { + + protected Very(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + } + + protected Very(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { + super(initializationMode); + } + + public Very() { + super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); + software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this); + } + + public java.lang.Number hey() { + return this.jsiiCall("hey", java.lang.Number.class); + } +} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/java/src/main/java/software/amazon/jsii/tests/calculator/baseofbase/VeryBaseProps.java b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/java/src/main/java/software/amazon/jsii/tests/calculator/baseofbase/VeryBaseProps.java new file mode 100644 index 0000000000..3fba84a282 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/java/src/main/java/software/amazon/jsii/tests/calculator/baseofbase/VeryBaseProps.java @@ -0,0 +1,103 @@ +package software.amazon.jsii.tests.calculator.baseofbase; + +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.baseofbase.$Module.class, fqn = "@scope/jsii-calc-base-of-base.VeryBaseProps") +@software.amazon.jsii.Jsii.Proxy(VeryBaseProps.Jsii$Proxy.class) +public interface VeryBaseProps extends software.amazon.jsii.JsiiSerializable { + + software.amazon.jsii.tests.calculator.baseofbase.Very getFoo(); + + /** + * @return a {@link Builder} of {@link VeryBaseProps} + */ + static Builder builder() { + return new Builder(); + } + /** + * A builder for {@link VeryBaseProps} + */ + public static final class Builder { + private software.amazon.jsii.tests.calculator.baseofbase.Very foo; + + /** + * Sets the value of Foo + * @param foo the value to be set. This parameter is required. + * @return {@code this} + */ + public Builder foo(software.amazon.jsii.tests.calculator.baseofbase.Very foo) { + this.foo = foo; + return this; + } + + /** + * Builds the configured instance. + * @return a new instance of {@link VeryBaseProps} + * @throws NullPointerException if any required attribute was not provided + */ + public VeryBaseProps build() { + return new Jsii$Proxy(foo); + } + } + + /** + * An implementation for {@link VeryBaseProps} + */ + final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements VeryBaseProps { + private final software.amazon.jsii.tests.calculator.baseofbase.Very foo; + + /** + * Constructor that initializes the object based on values retrieved from the JsiiObject. + * @param objRef Reference to the JSII managed object. + */ + protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { + super(objRef); + this.foo = this.jsiiGet("foo", software.amazon.jsii.tests.calculator.baseofbase.Very.class); + } + + /** + * Constructor that initializes the object based on literal property values passed by the {@link Builder}. + */ + private Jsii$Proxy(final software.amazon.jsii.tests.calculator.baseofbase.Very foo) { + super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); + this.foo = java.util.Objects.requireNonNull(foo, "foo is required"); + } + + @Override + public software.amazon.jsii.tests.calculator.baseofbase.Very getFoo() { + return this.foo; + } + + @Override + public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() { + final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE; + final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); + + data.set("foo", om.valueToTree(this.getFoo())); + + final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); + struct.set("fqn", om.valueToTree("@scope/jsii-calc-base-of-base.VeryBaseProps")); + struct.set("data", data); + + final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); + obj.set("$jsii.struct", struct); + + return obj; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + VeryBaseProps.Jsii$Proxy that = (VeryBaseProps.Jsii$Proxy) o; + + return this.foo.equals(that.foo); + } + + @Override + public int hashCode() { + int result = this.foo.hashCode(); + return result; + } + } +} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/java/src/main/resources/software/amazon/jsii/tests/calculator/baseofbase/jsii-calc-base-of-base@0.20.0.jsii.tgz b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/java/src/main/resources/software/amazon/jsii/tests/calculator/baseofbase/jsii-calc-base-of-base@0.20.0.jsii.tgz new file mode 100644 index 0000000000..eef7587bf2 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/java/src/main/resources/software/amazon/jsii/tests/calculator/baseofbase/jsii-calc-base-of-base@0.20.0.jsii.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-pacmak/test/expected.jsii-calc-base-of-base/js/jsii-calc-base-of-base@0.20.0.jsii.tgz b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/js/jsii-calc-base-of-base@0.20.0.jsii.tgz new file mode 100644 index 0000000000..eef7587bf2 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/js/jsii-calc-base-of-base@0.20.0.jsii.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-pacmak/test/expected.jsii-calc-base-of-base/python/MANIFEST.in b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/MANIFEST.in new file mode 100644 index 0000000000..bec201fc83 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/MANIFEST.in @@ -0,0 +1 @@ +include pyproject.toml diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/README.md b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/README.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/README.md @@ -0,0 +1 @@ + diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/pyproject.toml b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/pyproject.toml new file mode 100644 index 0000000000..34ba8ead4b --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools >= 38.6.0", "wheel >= 0.31.0"] +build-backend = "setuptools.build_meta" diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/setup.py b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/setup.py new file mode 100644 index 0000000000..c1f9623809 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/setup.py @@ -0,0 +1,42 @@ +import json +import setuptools + +kwargs = json.loads(""" +{ + "name": "scope.jsii-calc-base-of-base", + "version": "0.20.0", + "description": "An example transitive dependency for jsii-calc.", + "url": "https://github.com/aws/jsii", + "long_description_content_type": "text/markdown", + "author": "Amazon Web Services", + "project_urls": { + "Source": "https://github.com/aws/jsii.git" + }, + "package_dir": { + "": "src" + }, + "packages": [ + "scope.jsii_calc_base_of_base", + "scope.jsii_calc_base_of_base._jsii" + ], + "package_data": { + "scope.jsii_calc_base_of_base._jsii": [ + "jsii-calc-base-of-base@0.20.0.jsii.tgz" + ], + "scope.jsii_calc_base_of_base": [ + "py.typed" + ] + }, + "python_requires": ">=3.6", + "install_requires": [ + "jsii~=0.20.0", + "publication>=0.0.3" + ] +} +""") + +with open('README.md') as fp: + kwargs['long_description'] = fp.read() + + +setuptools.setup(**kwargs) diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/__init__.py new file mode 100644 index 0000000000..1c92548af9 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/__init__.py @@ -0,0 +1,65 @@ +import abc +import datetime +import enum +import typing + +import jsii +import jsii.compat +import publication + +from jsii.python import classproperty +__jsii_assembly__ = jsii.JSIIAssembly.load("@scope/jsii-calc-base-of-base", "0.20.0", __name__, "jsii-calc-base-of-base@0.20.0.jsii.tgz") +@jsii.interface(jsii_type="@scope/jsii-calc-base-of-base.IVeryBaseInterface") +class IVeryBaseInterface(jsii.compat.Protocol): + @staticmethod + def __jsii_proxy_class__(): + return _IVeryBaseInterfaceProxy + + @jsii.member(jsii_name="foo") + def foo(self) -> None: + ... + + +class _IVeryBaseInterfaceProxy(): + __jsii_type__ = "@scope/jsii-calc-base-of-base.IVeryBaseInterface" + @jsii.member(jsii_name="foo") + def foo(self) -> None: + return jsii.invoke(self, "foo", []) + + +class Very(metaclass=jsii.JSIIMeta, jsii_type="@scope/jsii-calc-base-of-base.Very"): + def __init__(self) -> None: + jsii.create(Very, self, []) + + @jsii.member(jsii_name="hey") + def hey(self) -> jsii.Number: + return jsii.invoke(self, "hey", []) + + +@jsii.data_type(jsii_type="@scope/jsii-calc-base-of-base.VeryBaseProps", jsii_struct_bases=[], name_mapping={'foo': 'foo'}) +class VeryBaseProps(): + def __init__(self, *, foo: "Very"): + """ + :param foo: - + """ + self._values = { + 'foo': foo, + } + + @property + def foo(self) -> "Very": + return self._values.get('foo') + + def __eq__(self, rhs) -> bool: + return isinstance(rhs, self.__class__) and rhs._values == self._values + + def __ne__(self, rhs) -> bool: + return not (rhs == self) + + def __repr__(self) -> str: + return 'VeryBaseProps(%s)' % ', '.join(k + '=' + repr(v) for k, v in self._values.items()) + + +__all__ = ["IVeryBaseInterface", "Very", "VeryBaseProps", "__jsii_assembly__"] + +publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/_jsii/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/_jsii/__init__.py new file mode 100644 index 0000000000..86dd1c7833 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/_jsii/__init__.py @@ -0,0 +1,13 @@ +import abc +import datetime +import enum +import typing + +import jsii +import jsii.compat +import publication + +from jsii.python import classproperty +__all__ = [] + +publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/_jsii/jsii-calc-base-of-base@0.20.0.jsii.tgz b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/_jsii/jsii-calc-base-of-base@0.20.0.jsii.tgz new file mode 100644 index 0000000000..eef7587bf2 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/_jsii/jsii-calc-base-of-base@0.20.0.jsii.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-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/py.typed b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/py.typed new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base-of-base/python/src/scope/jsii_calc_base_of_base/py.typed @@ -0,0 +1 @@ + diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj index ed58bd419c..2a3f39c513 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj +++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId.csproj @@ -24,7 +24,7 @@ - + diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj index 31eadf8fee..687e0b5f03 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj +++ b/packages/jsii-pacmak/test/expected.jsii-calc-lib/dotnet/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId/Amazon.JSII.Tests.CalculatorPackageId.LibPackageId.csproj @@ -24,7 +24,7 @@ - + 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 index ad4383b78d..f4449664a8 100644 --- 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 @@ -25,7 +25,7 @@ - +