-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for generating a .NET (C#) project. I choose `namespace` rather than `package` since it seemed more appropriate when generating source code. I went with `dotnet` since it matches the jsii naming, but `csharp` may make more sense for configuration options / cli parameters. I don't believe there are any plans to generate F# code in jsii, but if there were, I'd lean towards using `csharp` naming.
- Loading branch information
Showing
10 changed files
with
799 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,35 @@ original module. This code depends on the following maven package (should be def | |
|
||
The output directory will also include a tarball `[email protected]` that must be bundled in your project. | ||
|
||
### C# Output | ||
|
||
To produce a C# module from your source, use the `csharp` option: | ||
|
||
```ts | ||
await srcmak('srcdir', { | ||
csharp: { | ||
outdir: '/path/to/project/root', | ||
namespace: 'HelloWorld' | ||
} | ||
}); | ||
``` | ||
|
||
Or the `--csharp-*` switches in the CLI: | ||
|
||
```bash | ||
$ jsii-srcmak /src/dir --csharp-outdir=dir --csharp-namespace=HelloWorld | ||
``` | ||
|
||
* The `outdir`/`--csharp-outdir` option points to the root directory of your C# project. | ||
* The `package`/`--csharp-namespace` option is the C# root namespace. | ||
|
||
The output directory will include a C# project that corresponds to the | ||
original module. This code depends on the following NuGet package (It is already defined as a dependency in the generated project): | ||
|
||
- [jsii](https://www.nuget.org/packages/Amazon.JSII.Runtime/) | ||
|
||
The output directory will also include a tarball `[email protected]` that must be bundled in your project (It is already included as an embedded resource in the generated project). | ||
|
||
### Entrypoint | ||
|
||
The `entrypoint` option can be used to customize the name of the typescript entrypoint (default is `index.ts`). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.