For the sake of example, we will use a very simple library: sprintf-js.
For more information on how this Maven project works, check the jsweet-candy-quickstart, which implements a very similar structure.
How to build
> bower install
Install with Maven:
> mvn install
This command performs the following Maven phases:
compile: compile with Java the Java APIs sources found in
generate-sources: create the
.d.tsTypeScript definitions bundle and puts it as a resource in
package: create the jar with the compiled Java APIs, and all the resources (including the TypeScript definitions, the
candy-metadata.jsonfile filtered to set the targeted transpiler version)
install: install the Maven artifact in your local Maven repository
How to adapt/modify
For details on how to define an API (definitions) with JSweet, please refer to the Language Specifications. Note that if you have the TypeScript definition file of your library, you can use the help of the online API translator tool to translate it to Java.
If you want, consider contributing to the JSweet Candies Open Source organization on Github.
Apache 2 Open Source license.