-
Notifications
You must be signed in to change notification settings - Fork 65
Build with Gradle
Until there is a stable version of JWebAssembly we recommended the snapshot version. Declare the repository and classpath of the plugin first.
buildscript {
repositories {
maven { url uri('https://jitpack.io') }
}
dependencies {
classpath 'com.github.i-net-software:jwebassembly-gradle:master-SNAPSHOT'
}
}
And apply the plugin to load it.
apply plugin: 'de.inetsoftware.jwebassembly'
This implicit apply the Java plugin. We want compile Java sources first and the compile it to the WebAssembly files.
Add the library dependencies. Here also the snapshot version of the JWebAssembly API is recommended currently. You can also add other Java libraries that you need. If there calls into libraries then the needed Java code will be compiled.
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
compile 'com.github.i-net-software:jwebassembly-api:master-SNAPSHOT'
}
Like in Java you can optional define a custom file name for the output:
archivesBaseName = 'HelloWorld'
Like in Java you can optional define the source files that want compile if you does not use the defaults. Resources are not supported yet.
sourceSets {
main {
java {
srcDir 'src/main/java'
}
}
}
The wasm files will be build from the wasm
task.