diff --git a/packages/jsii-calc/package.json b/packages/jsii-calc/package.json index d435bfdef7..7198cb954b 100644 --- a/packages/jsii-calc/package.json +++ b/packages/jsii-calc/package.json @@ -25,6 +25,13 @@ }, "sphinx": {} }, + "metadata": { + "jsii:boolean": true, + "jsii:number": 1337, + "jsii:object": { + "string": "yes!" + } + }, "versionFormat": "short" }, "scripts": { @@ -84,4 +91,4 @@ "type": "git", "url": "https://github.com/awslabs/jsii.git" } -} \ No newline at end of file +} diff --git a/packages/jsii-calc/test/assembly.jsii b/packages/jsii-calc/test/assembly.jsii index 3922b1f55e..7d7acac404 100644 --- a/packages/jsii-calc/test/assembly.jsii +++ b/packages/jsii-calc/test/assembly.jsii @@ -185,6 +185,13 @@ "homepage": "https://github.com/awslabs/jsii.git", "jsiiVersion": "0.11.0", "license": "Apache-2.0", + "metadata": { + "jsii:boolean": true, + "jsii:number": 1337, + "jsii:object": { + "string": "yes!" + } + }, "name": "jsii-calc", "readme": { "markdown": "# jsii Calculator\n\nThis library is used to demonstrate and test the features of JSII\n\n## Sphinx\n\nThis file will be incorporated into the sphinx documentation.\n\nIf this file starts with an \"H1\" line (in our case `# jsii Calculator`), this\nheading will be used as the Sphinx topic name. Otherwise, the name of the module\n(`jsii-calc`) will be used instead.\n\n\n\n\n" @@ -6803,5 +6810,5 @@ } }, "version": "0.11.0", - "fingerprint": "bKi31JLqJ4B9MMHdwaDdxTQlL4VG06izio0DqYMQnt4=" + "fingerprint": "i8GdLx7YlhttP5/pB0dKItig1wFkp/DwDdUtbYsIdfc=" } diff --git a/packages/jsii-dotnet-generator/build.sh b/packages/jsii-dotnet-generator/build.sh index 3f742ad066..6da18654bb 100644 --- a/packages/jsii-dotnet-generator/build.sh +++ b/packages/jsii-dotnet-generator/build.sh @@ -3,12 +3,7 @@ set -euo pipefail npm run gen -# TODO: Auto-rev NuGet package versions on each local build. -# Because we we don't rev the versions, dotnet will pick -# up an old build from the cache if it exists. So we -# explicitly clear the cache as a temporary workaround. -dotnet nuget locals all --clear -dotnet build -c Release ./src/Amazon.JSII.Generator.sln +dotnet build --force -c Release ./src/Amazon.JSII.Generator.sln dotnet publish -c Release src/Amazon.JSII.Generator.CLI/ mkdir -p cli diff --git a/packages/jsii-dotnet-jsonmodel/build.sh b/packages/jsii-dotnet-jsonmodel/build.sh index a4e65f8f3a..4e8b5b105b 100644 --- a/packages/jsii-dotnet-jsonmodel/build.sh +++ b/packages/jsii-dotnet-jsonmodel/build.sh @@ -3,11 +3,6 @@ set -euo pipefail npm run gen -# TODO: Auto-rev NuGet package versions on each local build. -# Because we we don't rev the versions, dotnet will pick -# up an old build from the cache if it exists. So we -# explicitly clear the cache as a temporary workaround. -dotnet nuget locals all --clear -dotnet build -c Release ./src/Amazon.JSII.JsonModel.sln +dotnet build --force -c Release ./src/Amazon.JSII.JsonModel.sln cp -f ./bin/Release/NuGet/*.nupkg . diff --git a/packages/jsii-dotnet-runtime-test/build.sh b/packages/jsii-dotnet-runtime-test/build.sh index c6e9d4868b..7320f0e7cb 100644 --- a/packages/jsii-dotnet-runtime-test/build.sh +++ b/packages/jsii-dotnet-runtime-test/build.sh @@ -1,9 +1,4 @@ #!/bin/bash set -euo pipefail -# TODO: Auto-rev NuGet package versions on each local build. -# Because we we don't rev the versions, dotnet will pick -# up an old build from the cache if it exists. So we -# explicitly clear the cache as a temporary workaround. -dotnet nuget locals all --clear -dotnet build -c Release ./test/Amazon.JSII.Runtime.IntegrationTests +dotnet build --force -c Release ./test/Amazon.JSII.Runtime.IntegrationTests diff --git a/packages/jsii-dotnet-runtime/build.sh b/packages/jsii-dotnet-runtime/build.sh index 9bab9ae901..4e873f1104 100644 --- a/packages/jsii-dotnet-runtime/build.sh +++ b/packages/jsii-dotnet-runtime/build.sh @@ -6,15 +6,9 @@ bundle_dir="src/Amazon.JSII.Runtime/jsii-runtime" mkdir -p ${bundle_dir} rsync -av node_modules/jsii-runtime/webpack/ ${bundle_dir} -# TODO: Auto-rev NuGet package versions on each local build. -# Because we we don't rev the versions, dotnet will pick -# up an old build from the cache if it exists. So we -# explicitly clear the cache as a temporary workaround. -dotnet nuget locals all --clear - # Build just Runtime and it's dependencies instead of the # solution to avoid integration tests from trying to be # built before the calc packages are generated. -dotnet build -c Release ./src/Amazon.JSII.Runtime +dotnet build --force -c Release ./src/Amazon.JSII.Runtime cp -f ./bin/Release/NuGet/*.nupkg . 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 index 3922b1f55e..7d7acac404 100644 --- 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 @@ -185,6 +185,13 @@ "homepage": "https://github.com/awslabs/jsii.git", "jsiiVersion": "0.11.0", "license": "Apache-2.0", + "metadata": { + "jsii:boolean": true, + "jsii:number": 1337, + "jsii:object": { + "string": "yes!" + } + }, "name": "jsii-calc", "readme": { "markdown": "# jsii Calculator\n\nThis library is used to demonstrate and test the features of JSII\n\n## Sphinx\n\nThis file will be incorporated into the sphinx documentation.\n\nIf this file starts with an \"H1\" line (in our case `# jsii Calculator`), this\nheading will be used as the Sphinx topic name. Otherwise, the name of the module\n(`jsii-calc`) will be used instead.\n\n\n\n\n" @@ -6803,5 +6810,5 @@ } }, "version": "0.11.0", - "fingerprint": "bKi31JLqJ4B9MMHdwaDdxTQlL4VG06izio0DqYMQnt4=" + "fingerprint": "i8GdLx7YlhttP5/pB0dKItig1wFkp/DwDdUtbYsIdfc=" } diff --git a/packages/jsii-spec/lib/spec.ts b/packages/jsii-spec/lib/spec.ts index f754332eda..bc87ecbcae 100644 --- a/packages/jsii-spec/lib/spec.ts +++ b/packages/jsii-spec/lib/spec.ts @@ -96,6 +96,15 @@ export interface Assembly extends Documentable { */ targets?: AssemblyTargets; + /** + * Arbitrary key-value pairs of metadata, which the maintainer chose to + * document with the assembly. These entries do not carry normative + * semantics and their interpretation is up to the assembly maintainer. + * + * @default none + */ + metadata?: { [key: string]: any }; + /** * Direct dependencies on other assemblies (with semver), the key is the JSII * assembly name. diff --git a/packages/jsii/lib/assembler.ts b/packages/jsii/lib/assembler.ts index bcd0fa4de5..cdd68e57d3 100644 --- a/packages/jsii/lib/assembler.ts +++ b/packages/jsii/lib/assembler.ts @@ -114,6 +114,7 @@ export class Assembler implements Emitter { bundled: this.projectInfo.bundleDependencies, types: this._types, targets: this.projectInfo.targets, + metadata: this.projectInfo.metadata, readme, jsiiVersion, fingerprint: '', @@ -1627,4 +1628,4 @@ const PROHIBITED_MEMBER_NAMES = ['equals', 'hashcode']; */ function isProhibitedMemberName(name: string) { return PROHIBITED_MEMBER_NAMES.includes(name.toLowerCase()); -} \ No newline at end of file +} diff --git a/packages/jsii/lib/project-info.ts b/packages/jsii/lib/project-info.ts index 3e73a535a8..0e3c2e5a45 100644 --- a/packages/jsii/lib/project-info.ts +++ b/packages/jsii/lib/project-info.ts @@ -32,6 +32,7 @@ export interface ProjectInfo { readonly transitiveDependencies: ReadonlyArray; readonly bundleDependencies?: { readonly [name: string]: string }; readonly targets: spec.AssemblyTargets; + readonly metadata?: { [key: string]: any }; readonly jsiiVersionFormat: 'short' | 'full'; readonly description?: string; readonly homepage?: string; @@ -123,6 +124,7 @@ export async function loadProjectInfo(projectRoot: string, { fixPeerDependencies ..._required(pkg.jsii, 'The "package.json" file must specify the "jsii" attribute').targets, js: { npm: pkg.name } }, + metadata: pkg.jsii && pkg.jsii.metadata, jsiiVersionFormat: _validateVersionFormat(pkg.jsii.versionFormat || 'full'), description: pkg.description,