Skip to content

Commit

Permalink
Emit new package-related properties in generated C# project file. (#169)
Browse files Browse the repository at this point in the history
Emit new package-related properties in generated C# project file.
  • Loading branch information
mpiroc authored Aug 15, 2018
1 parent 755c26d commit fd424ee
Show file tree
Hide file tree
Showing 138 changed files with 1,661 additions and 576 deletions.
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",

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

/* 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
7 changes: 4 additions & 3 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 Expand Up @@ -68,5 +69,5 @@
}
},
"version": "0.6.4",
"fingerprint": "I/HF4zJK5eV4ZLmNLDEzShkHVsxngX3K/y2SEYjXsxU="
"fingerprint": "2YF/qObQgbuJSs52vT9/Z7sgEO0mc2zP0jCuFWGUM4w="
}
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
10 changes: 6 additions & 4 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 Expand Up @@ -100,5 +102,5 @@
}
},
"version": "0.6.4",
"fingerprint": "b+UZfT/No0vxqTQ1n3lIsyw7olqARDbeGj853lNFoE8="
"fingerprint": "3lcys0/Cd5ZbPR/CXccsL3Fdb66mNsVBs8jb+ySL0oU="
}
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
13 changes: 8 additions & 5 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 Expand Up @@ -315,5 +318,5 @@
}
},
"version": "0.6.4",
"fingerprint": "MHdlbqyf1RV6moIHslfpKnl7yjQoYVvvZLfxFXWihrU="
"fingerprint": "jA30G5c81DZXD/7DMYLvdlY8XwEevVQAMAwkUBmPE64="
}
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
22 changes: 14 additions & 8 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 Expand Up @@ -2820,5 +2826,5 @@
}
},
"version": "0.6.4",
"fingerprint": "V1fwQARJzmO/FTBQutFnq1v95it317kCGVv350RLqYo="
"fingerprint": "gKUNI8uBG+ge5Ccbk0ay+JZ+j4C/4hPATR3jvtVm0Po="
}
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

0 comments on commit fd424ee

Please sign in to comment.