Skip to content
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

no output #63

Open
john5634 opened this issue Jul 18, 2023 · 1 comment
Open

no output #63

john5634 opened this issue Jul 18, 2023 · 1 comment

Comments

@john5634
Copy link

Hi! Again very excited to see this work.

I run a build and no wasm is generated? How do I get it to make the wasm? and where does it go?

I have the following build script:
`buildscript {
repositories {
maven { url uri('https://jitpack.io') }
}
dependencies {
classpath 'com.github.i-net-software:jwebassembly-gradle:master-SNAPSHOT'
}
}
apply plugin: 'de.inetsoftware.jwebassembly'
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.i-net-software:jwebassembly-api:master-SNAPSHOT'
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
}
}

wasm {
//Get more debug information if there are problems.
//logging.level = LogLevel.DEBUG
//logging.levelInternal = LogLevel.DEBUG

//Change the output format to the text format *.wat.
//This can be helpful to understand the problems if you see the generated code as text format.
//format = 'text'

//The used JWebAssembly compiler version. The default is the latest release '+'.
//You can set any valid Gradle version string or a full dependency string.
//The snapshot version is recommended until a stable release.
//compilerVersion = 0.2
compilerVersion = 'com.github.i-net-software:jwebassembly:master-SNAPSHOT'

//Write method and parameter names into the output *.wasm file.
//The file will be approximate 10% larger. And it generate a source map.
//With a source map you can see in the debugger of the browser your source code if available.
debugNames = true

//Set an absolute or relative path between the final wasm file location and the source files location.
///This is needed for debugging in the browser. It work only if debugNames = true.
//sourceMapBase = '../../src/main/java/'
sourceMapBase = '/src/main/java/'

//set the destination dir
//destinationDir = file( 'targetDir' )

//ignore all referenced native methods without declared replacement in a library and replace them with a stub that throws an exception at runtime
//ignoreNative = true

}`

And java:
`import de.inetsoftware.jwebassembly.api.annotation.Export;
import de.inetsoftware.jwebassembly.web.dom.Document;
import de.inetsoftware.jwebassembly.web.dom.HTMLElement;
import de.inetsoftware.jwebassembly.web.dom.Text;
import de.inetsoftware.jwebassembly.web.dom.Window;

public class HelloWorld {

@Export
public static void main() {
    Document document = Window.document();
    HTMLElement div = document.createElement("div");
    Text text = document.createTextNode("Hello World, this text come from WebAssembly.");
    div.appendChild( text );
    document.body().appendChild( div );
}

}`

@Horcrux7
Copy link
Member

Was the java sources compiles to *.class files?
Please post the log output of your Gradle script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants