Replace gradle node plugin and switch to V8 canary.

This commit is contained in:
Volker Berlin 2020-06-07 12:00:40 +02:00
parent 42c68257b6
commit b6238124c7
4 changed files with 12 additions and 27 deletions

View File

@ -1,5 +1,4 @@
plugins {
id "com.github.node-gradle.node" version "2.2.3"
id 'com.github.kt3k.coveralls' version '2.8.2' // Coverage
id "com.jfrog.bintray" version "1.8.4"
}
@ -83,27 +82,6 @@ artifacts {
archives javadocJar
}
node {
version = '14.0.0'
// version = '+'
download = true
}
task nodeVersion(type: NodeTask) {
test.dependsOn it
options = ['-v']
script = file("$buildDir/tmp/scriptDoesNotExists.js")
script.parentFile.mkdirs()
script.text = ''
doLast {
if( node.download ) {
def nodeDir = nodeSetup.getNodeDir() // dir is only valid if downloaded
println nodeDir
test.systemProperty 'node.dir', nodeDir
}
}
}
test {
systemProperty "file.encoding", "UTF-8"
testLogging {

View File

@ -125,8 +125,8 @@ public class BinaryModuleWriter extends ModuleWriter implements InstructionOpcod
writeSection( SectionType.Function, functions.values() );
writeTableSection();
writeMemorySection();
writeEventSection();
writeSection( SectionType.Global, globals.values() );
writeEventSection(); // TODO event section before global section
writeSection( SectionType.Export, exports );
writeStartSection();
writeElementSection();

View File

@ -44,7 +44,7 @@ public enum ScriptEngine {
public static ScriptEngine[] testEngines() {
ScriptEngine[] val = { //
SpiderMonkey, //
//TODO NodeJS, //
NodeJS, //
//TODO NodeWat, //
SpiderMonkeyWat,//
//TODO Wat2Wasm, //

View File

@ -57,6 +57,8 @@ public class WasmRule extends TemporaryFolder {
private static final SpiderMonkey spiderMonkey = new SpiderMonkey();
private static final Node node = new Node();
private static final Wat2Wasm wat2Wasm = new Wat2Wasm();
private static boolean npmWabtNightly;
@ -619,10 +621,12 @@ public class WasmRule extends TemporaryFolder {
* The executable of the node command.
*
* @return the node executable
* @throws IOException
* if any I/O error occur
*/
@Nonnull
private static String nodeExecuable() {
String command = System.getProperty( "node.dir" );
private static String nodeExecuable() throws IOException {
String command = node.getNodeDir();
if( command == null ) {
command = "node";
} else {
@ -641,14 +645,17 @@ public class WasmRule extends TemporaryFolder {
* @param script
* the path to the script that should be executed
* @return the value from the script
* @throws IOException
* if any I/O error occur
*/
private static ProcessBuilder nodeJsCommand( File script ) {
private static ProcessBuilder nodeJsCommand( File script ) throws IOException {
String command = nodeExecuable();
// details see with command: node --v8-options
ProcessBuilder processBuilder = new ProcessBuilder( command, //
"--experimental-wasm-mv", // multi value
"--experimental-wasm-eh", // exception handling
"--experimental-wasm-anyref", //
"--experimental-wasm-gc", //
"--experimental-wasm-bigint", //
"--experimental-wasm-bulk-memory", // bulk memory for WABT version 1.0.13, https://github.com/WebAssembly/wabt/issues/1311
script.getName() );