mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
print also *.js file if only *.wat was compiled
This commit is contained in:
parent
6b309dac9f
commit
e6be6a66ec
@ -196,17 +196,23 @@ public class WasmRule extends TemporaryFolder {
|
|||||||
protected void after() {
|
protected void after() {
|
||||||
if( failed ) {
|
if( failed ) {
|
||||||
for( File wasmFile : compiledFiles.values() ) {
|
for( File wasmFile : compiledFiles.values() ) {
|
||||||
|
File jsFile;
|
||||||
if( wasmFile.getName().endsWith( ".wasm" ) ) {
|
if( wasmFile.getName().endsWith( ".wasm" ) ) {
|
||||||
File jsFile = new File( wasmFile.toString() + ".js" );
|
jsFile = new File( wasmFile.toString() + ".js" );
|
||||||
if( jsFile.isFile() ) {
|
} else if( wasmFile.getName().endsWith( ".wat" ) ) {
|
||||||
try {
|
String name = wasmFile.toString();
|
||||||
System.out.println( new String( Files.readAllBytes( jsFile.toPath() ), StandardCharsets.UTF_8 ) );
|
jsFile = new File( name.substring( 0, name.length() - 4 ) + ".wasm.js" );
|
||||||
System.out.println();
|
} else {
|
||||||
} catch( IOException e ) {
|
continue;
|
||||||
e.printStackTrace();
|
}
|
||||||
}
|
if( jsFile.isFile() ) {
|
||||||
break;
|
try {
|
||||||
|
System.out.println( new String( Files.readAllBytes( jsFile.toPath() ), StandardCharsets.UTF_8 ) );
|
||||||
|
System.out.println();
|
||||||
|
} catch( IOException e ) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
System.out.println( textCompiled );
|
System.out.println( textCompiled );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user