-
Notifications
You must be signed in to change notification settings - Fork 10
feat: Java support #2
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
Changes from 4 commits
eeb3aca
341be49
82687d9
225a06c
46a7697
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,12 @@ export interface Options { | |
| * @default - python is not generated | ||
| */ | ||
| python?: PythonOutputOptions; | ||
|
|
||
| /** | ||
| * Produce java code. | ||
| * @default - java is not generated | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a note here that says that the code will be produced under |
||
| */ | ||
| java?: JavaOutputOptions; | ||
| } | ||
|
|
||
| export interface JsiiOutputOptions { | ||
|
|
@@ -43,3 +49,15 @@ export interface PythonOutputOptions { | |
| */ | ||
| moduleName: string; | ||
| } | ||
|
|
||
| export interface JavaOutputOptions { | ||
| /** | ||
| * Base root directory. | ||
| */ | ||
| outdir: string; | ||
|
|
||
| /** | ||
| * The name of the java package to generate | ||
| */ | ||
| package: string; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,5 +33,12 @@ export async function srcmak(srcdir: string, options: Options = { }) { | |
| const target = path.join(options.python.outdir, reldir); | ||
| await fs.move(source, target, { overwrite: true }); | ||
| } | ||
|
|
||
| if (options.java) { | ||
| const reldir = options.java.package.replace(/\./g, '/'); | ||
| const source = path.resolve(path.join(workdir, 'dist/java/src/main/java', reldir)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is it |
||
| const target = path.join(options.java.outdir, 'src/main' , reldir); | ||
| await fs.move(source, target, { overwrite: true }); | ||
| } | ||
| }); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also worth mentioning that the output will include a tarball resource that must be bundled in the project (maybe provide an example snippet from a
pom.xml?)