Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit new package-related properties in generated C# project file. #169

Merged
merged 11 commits into from
Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ Edit your `package.json`:
}
},
"dotnet": {
"namespace": "Acme.Hello"
"namespace": "Acme.HelloNamespace",
"packageId": "Acme.HelloPackage"
},
"sphinx": { }
}
Expand Down Expand Up @@ -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.HelloNamespace",
"packageId": "Acme.HelloPackage"
},
"java": {
"maven": {
Expand Down Expand Up @@ -262,10 +264,26 @@ The following targets are currently supported:

* `dotnet` - packages the module as a .NET/NuGet package. Requires the following config:

```json
```js
{
"dotnet": {
"namespace": "Acme.Hello"
/* Required. */
"namespace": "Acme.HelloNamespace",

/* Required. */
"packageId": "Acme.HelloPackage",

/* Optional. Default: Value of packageId. */
"title": "ACME Hello",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have this? Isn't this the same as description? If it's not provided, what is the default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not--title is a short human-readable name, while description is more detailed. If a NuGet package has no title, it defaults to the package's packageId. Updated comments to reflect this.

✔️


/* Optional. Default: null (no icon). */
"iconUrl": "path/to/icon.svg",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comments with defaults to all fields

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️


/* Optional. Used in conjunction with assemblyOriginatorKey. Default: false. */
"signAssembly": true,

/* Optional. Used in conjunction with signAssembly. Default: null. */
"assemblyOriginatorKey": "path/to/key.snk"
}
}
```
Expand Down
4 changes: 3 additions & 1 deletion packages/jsii-calc-base-of-base/package.json
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -15,7 +16,8 @@
}
},
"dotnet": {
"namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase"
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace",
"packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId"
},
"sphinx": {}
}
Expand Down
5 changes: 3 additions & 2 deletions packages/jsii-calc-base-of-base/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,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",
Expand All @@ -18,7 +18,8 @@
"schema": "jsii/1.0",
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase"
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace",
"packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId"
},
"java": {
"maven": {
Expand Down
4 changes: 3 additions & 1 deletion packages/jsii-calc-base/package.json
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -15,7 +16,8 @@
}
},
"dotnet": {
"namespace": "Amazon.JSII.Tests.Calculator.Base"
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace",
"packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId"
},
"sphinx": {}
}
Expand Down
8 changes: 5 additions & 3 deletions packages/jsii-calc-base/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"@scope/jsii-calc-base-of-base": {
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase"
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace",
"packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId"
},
"java": {
"maven": {
Expand All @@ -27,7 +28,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",
Expand All @@ -38,7 +39,8 @@
"schema": "jsii/1.0",
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.Calculator.Base"
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace",
"packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId"
},
"java": {
"maven": {
Expand Down
4 changes: 3 additions & 1 deletion packages/jsii-calc-lib/package.json
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -15,7 +16,8 @@
}
},
"dotnet": {
"namespace": "Amazon.JSII.Tests.Calculator.Lib"
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.LibNamespace",
"packageId": "Amazon.JSII.Tests.CalculatorPackageId.LibPackageId"
},
"sphinx": {}
}
Expand Down
11 changes: 7 additions & 4 deletions packages/jsii-calc-lib/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"@scope/jsii-calc-base-of-base": {
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase"
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace",
"packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId"
},
"java": {
"maven": {
Expand All @@ -31,7 +32,8 @@
},
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.Calculator.Base"
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace",
"packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId"
},
"java": {
"maven": {
Expand All @@ -47,7 +49,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",
Expand All @@ -58,7 +60,8 @@
"schema": "jsii/1.0",
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.Calculator.Lib"
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.LibNamespace",
"packageId": "Amazon.JSII.Tests.CalculatorPackageId.LibPackageId"
},
"java": {
"maven": {
Expand Down
4 changes: 3 additions & 1 deletion packages/jsii-calc/package.json
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -15,7 +16,8 @@
}
},
"dotnet": {
"namespace": "Amazon.JSII.Tests.Calculator"
"namespace": "Amazon.JSII.Tests.CalculatorNamespace",
"packageId": "Amazon.JSII.Tests.CalculatorPackageId"
},
"sphinx": {}
}
Expand Down
20 changes: 13 additions & 7 deletions packages/jsii-calc/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"@scope/jsii-calc-base-of-base": {
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase"
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace",
"packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId"
},
"java": {
"maven": {
Expand All @@ -57,7 +58,8 @@
},
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.Calculator.Base"
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace",
"packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId"
},
"java": {
"maven": {
Expand All @@ -79,7 +81,8 @@
"@scope/jsii-calc-base-of-base": {
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.Calculator.BaseOfBase"
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseOfBaseNamespace",
"packageId": "Amazon.JSII.Tests.CalculatorPackageId.BaseOfBasePackageId"
},
"java": {
"maven": {
Expand All @@ -97,7 +100,8 @@
},
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.Calculator.Base"
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace",
"packageId": "Amazon.JSII.Tests.CalculatorPackageId.BasePackageId"
},
"java": {
"maven": {
Expand All @@ -115,7 +119,8 @@
},
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.Calculator.Lib"
"namespace": "Amazon.JSII.Tests.CalculatorNamespace.LibNamespace",
"packageId": "Amazon.JSII.Tests.CalculatorPackageId.LibPackageId"
},
"java": {
"maven": {
Expand All @@ -131,7 +136,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",
Expand All @@ -145,7 +150,8 @@
"schema": "jsii/1.0",
"targets": {
"dotnet": {
"namespace": "Amazon.JSII.Tests.Calculator"
"namespace": "Amazon.JSII.Tests.CalculatorNamespace",
"packageId": "Amazon.JSII.Tests.CalculatorPackageId"
},
"java": {
"maven": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static void HandleParseError(IEnumerable<Error> errors)

static void Generate(Options options)
{
AssemblyGenerator generator = new AssemblyGenerator(options.OutputDirectory, "", "");
AssemblyGenerator generator = new AssemblyGenerator(options.OutputDirectory);

generator.Generate(options.JsiiFile, options.Tarball);
}
Expand Down
Loading