mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 15:37:52 +01:00
install wabt@nightly globally to improve speed of tests
This commit is contained in:
parent
ee5b3ce326
commit
c4ed671b99
@ -59,6 +59,8 @@ public class WasmRule extends TemporaryFolder {
|
|||||||
|
|
||||||
private static final Wat2Wasm wat2Wasm = new Wat2Wasm();
|
private static final Wat2Wasm wat2Wasm = new Wat2Wasm();
|
||||||
|
|
||||||
|
private static boolean npmWabtNightly;
|
||||||
|
|
||||||
private final Class<?>[] classes;
|
private final Class<?>[] classes;
|
||||||
|
|
||||||
private final JWebAssembly compiler;
|
private final JWebAssembly compiler;
|
||||||
@ -257,15 +259,17 @@ public class WasmRule extends TemporaryFolder {
|
|||||||
if( nodeWatScript == null ) {
|
if( nodeWatScript == null ) {
|
||||||
nodeWatScript = createScript( "WatTest.js", "{test.wat}", watFile.getName() );
|
nodeWatScript = createScript( "WatTest.js", "{test.wat}", watFile.getName() );
|
||||||
|
|
||||||
//create dummy files to prevent error messages
|
if( !npmWabtNightly ) {
|
||||||
FileOutputStream jsonPackage = new FileOutputStream( new File( getRoot(), "package.json" ) );
|
npmWabtNightly = true;
|
||||||
jsonPackage.write( "{\"name\":\"test\", \"description\": \"description\", \"license\": \"Apache-2.0\", \"repository\": {}}".getBytes() );
|
ProcessBuilder processBuilder = new ProcessBuilder( "npm", "install", "-g", "wabt@nightly" );
|
||||||
jsonPackage.close();
|
if( IS_WINDOWS ) {
|
||||||
jsonPackage = new FileOutputStream( new File( getRoot(), "package-lock.json" ) );
|
processBuilder.command().add( 0, "cmd" );
|
||||||
jsonPackage.write( "{\"lockfileVersion\": 1}".getBytes() );
|
processBuilder.command().add( 1, "/C" );
|
||||||
jsonPackage.close();
|
}
|
||||||
|
execute( processBuilder );
|
||||||
|
}
|
||||||
|
|
||||||
ProcessBuilder processBuilder = new ProcessBuilder( "npm", "install", "wabt@nightly" );
|
ProcessBuilder processBuilder = new ProcessBuilder( "npm", "link", "wabt" );
|
||||||
if( IS_WINDOWS ) {
|
if( IS_WINDOWS ) {
|
||||||
processBuilder.command().add( 0, "cmd" );
|
processBuilder.command().add( 0, "cmd" );
|
||||||
processBuilder.command().add( 1, "/C" );
|
processBuilder.command().add( 1, "/C" );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user