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

Documentation on the Gradle Task is outdated/incomplete #42

Open
manticore-projects opened this issue May 28, 2022 · 6 comments
Open

Documentation on the Gradle Task is outdated/incomplete #42

manticore-projects opened this issue May 28, 2022 · 6 comments
Labels

Comments

@manticore-projects
Copy link

Greetings.

Thank you for providing this project, I have an high interest in it.
Although I have had a hard time to even follow the most basic Getting Started instructions. The information seems to be outdated. Below is the Gradle 7.4 configuration, which seems to work:

plugins {
    id 'java'

    // Web Assembly Compiler
    id "de.inetsoftware.jwebassembly" version "0.4"
}

repositories {
    mavenCentral()
    maven { url = uri('https://jitpack.io') }
}

dependencies {
    // Web Assembly Compiler
    implementation 'com.github.i-net-software:JWebAssembly:v0.4'
    implementation 'com.github.i-net-software:jwebassembly-api:master-SNAPSHOT'
}

Putting this into build gradle I have been able to import the Export annotation and to annotate my Java Method.

import de.inetsoftware.jwebassembly.api.annotation.Export;

  @Export
  public static String format(String sqlStr, String... options) throws Exception {
  ...
  }
@manticore-projects
Copy link
Author

Also, you mention Java-8 as a requirement. However, this seems to be misleading as it yields into a java.lang.UnsupportedClassVersionError:

are@archlinux ~/d/s/J/JSQLFormatter (main) [1]> JAVA_HOME=/usr/lib/jvm/java-8-openjdk gradle --no-build-cache wasm

FAILURE: Build failed with an exception.

* What went wrong:
java.lang.UnsupportedClassVersionError: de/inetsoftware/jwebassembly/gradle/WasmPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
> de/inetsoftware/jwebassembly/gradle/WasmPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 355ms
<-------------> 0% WAITING

@Horcrux7 Horcrux7 added the bug label May 28, 2022
@Horcrux7
Copy link
Member

Horcrux7 commented May 28, 2022

This is strange. I will check this out. Shouldn't be. Must have been an error when deploying the Gradle plugin.

@pepperoni42069
Copy link

buildscript {
repositories {
maven { url uri('https://jitpack.io') }
maven { url 'https://repo.spongepowered.org/maven' }
}
dependencies {
classpath 'com.github.i-net-software:jwebassembly-gradle:master-SNAPSHOT'
}
}

apply plugin: 'de.inetsoftware.jwebassembly'

group 'org.pepperoni'
version '1.0'

repositories {
maven { url 'https://jitpack.io' }
maven { url 'https://repo.spongepowered.org/maven' }
mavenCentral()
}
dependencies {
// https://mvnrepository.com/artifact/de.inetsoftware/jwebassembly-api
implementation 'com.github.i-net-software:jwebassembly-api:master-SNAPSHOT'
// https://mvnrepository.com/artifact/com.google.code.findbugs/jsr305
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2'

}

sourceSets {
main.java.srcDirs += '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' )

}

@pepperoni42069
Copy link

Working build.gradle, java 8, also so this

@Ordiel
Copy link

Ordiel commented May 30, 2022

@Eskerepvp you have a typo on the "this" link above. (it has an extra 'l' at the end).

The corrected link is:
https://github.com/Eskerepvp/JWebAssembly-HelloWorld

Thanks for sharing that I was actually looking for it, I guess it was a good Idea for me to start tinkering with JWebAssembly today since I have been postponing that for a while now, and you just provided that yesterday hahaha.

I was noticing that apparently the project is lacking maintainers, based on the Question you opened. Would you mind sharing any info you have found to get started? I would also like contributing to this.

Greetings

@pepperoni42069
Copy link

1 : Oops also thats outdated...

2: I haven't actually looked at the source code of JWebAssembly itself, only the API. But I have found some issues, the biggest one being that Kotlin doesn't work :(

I made a web framework for JWebAssembly-API if you would like to check it out!

Contributing would be nice, fixing my spaghetti code, and adding some of the features in the todo list would be greatly appreciated.

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

No branches or pull requests

4 participants