mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
wasm gc: support source map in gradle plugin
This commit is contained in:
parent
d68018d2d3
commit
94c50dd1bc
|
@ -54,6 +54,7 @@ teavm {
|
||||||
wasmGC {
|
wasmGC {
|
||||||
addedToWebApp = true
|
addedToWebApp = true
|
||||||
mainClass = "org.teavm.samples.benchmark.teavm.BenchmarkStarter"
|
mainClass = "org.teavm.samples.benchmark.teavm.BenchmarkStarter"
|
||||||
|
sourceMap = true
|
||||||
}
|
}
|
||||||
wasm {
|
wasm {
|
||||||
addedToWebApp = true
|
addedToWebApp = true
|
||||||
|
|
|
@ -407,6 +407,7 @@ public class TeaVMTool {
|
||||||
target.setDebugInfoLevel(debugInformationGenerated ? WasmDebugInfoLevel.FULL : wasmDebugInfoLevel);
|
target.setDebugInfoLevel(debugInformationGenerated ? WasmDebugInfoLevel.FULL : wasmDebugInfoLevel);
|
||||||
target.setDebugInfoLocation(wasmDebugInfoLocation);
|
target.setDebugInfoLocation(wasmDebugInfoLocation);
|
||||||
if (sourceMapsFileGenerated) {
|
if (sourceMapsFileGenerated) {
|
||||||
|
wasmSourceMapWriter = new SourceMapBuilder();
|
||||||
target.setSourceMapBuilder(wasmSourceMapWriter);
|
target.setSourceMapBuilder(wasmSourceMapWriter);
|
||||||
target.setSourceMapLocation(getResolvedTargetFileName() + ".map");
|
target.setSourceMapLocation(getResolvedTargetFileName() + ".map");
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,6 +119,7 @@ class TeaVMExtensionImpl extends TeaVMBaseExtensionImpl implements TeaVMExtensio
|
||||||
.map(v -> WasmDebugInfoLocation.valueOf(v.toUpperCase())).orElse(WasmDebugInfoLocation.EXTERNAL));
|
.map(v -> WasmDebugInfoLocation.valueOf(v.toUpperCase())).orElse(WasmDebugInfoLocation.EXTERNAL));
|
||||||
wasmGC.getDebugInfoLevel().convention(property("wasm-gc.debugInformation.level")
|
wasmGC.getDebugInfoLevel().convention(property("wasm-gc.debugInformation.level")
|
||||||
.map(v -> WasmDebugInfoLevel.valueOf(v.toUpperCase())).orElse(WasmDebugInfoLevel.DEOBFUSCATION));
|
.map(v -> WasmDebugInfoLevel.valueOf(v.toUpperCase())).orElse(WasmDebugInfoLevel.DEOBFUSCATION));
|
||||||
|
wasmGC.getSourceMap().convention(property("wasm-gc.sourceMap").map(Boolean::parseBoolean).orElse(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupWasiDefaults() {
|
private void setupWasiDefaults() {
|
||||||
|
|
|
@ -225,6 +225,7 @@ public class TeaVMPlugin implements Plugin<Project> {
|
||||||
task.getTargetFileName().convention(wasmGC.getTargetFileName());
|
task.getTargetFileName().convention(wasmGC.getTargetFileName());
|
||||||
task.getObfuscated().convention(wasmGC.getObfuscated());
|
task.getObfuscated().convention(wasmGC.getObfuscated());
|
||||||
task.getStrict().convention(wasmGC.getStrict());
|
task.getStrict().convention(wasmGC.getStrict());
|
||||||
|
task.getSourceMap().convention(wasmGC.getSourceMap());
|
||||||
});
|
});
|
||||||
project.getTasks().create(WASM_GC_COPY_RUNTIME_TASK_NAME, CopyWasmGCRuntimeTask.class, task -> {
|
project.getTasks().create(WASM_GC_COPY_RUNTIME_TASK_NAME, CopyWasmGCRuntimeTask.class, task -> {
|
||||||
task.setGroup(TASK_GROUP);
|
task.setGroup(TASK_GROUP);
|
||||||
|
|
|
@ -31,4 +31,6 @@ public interface TeaVMWasmGCConfiguration extends TeaVMCommonConfiguration, TeaV
|
||||||
Property<WasmDebugInfoLocation> getDebugInfoLocation();
|
Property<WasmDebugInfoLocation> getDebugInfoLocation();
|
||||||
|
|
||||||
Property<WasmDebugInfoLevel> getDebugInfoLevel();
|
Property<WasmDebugInfoLevel> getDebugInfoLevel();
|
||||||
|
|
||||||
|
Property<Boolean> getSourceMap();
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ public abstract class GenerateWasmGCTask extends TeaVMTask {
|
||||||
getDebugInfo().convention(true);
|
getDebugInfo().convention(true);
|
||||||
getDebugInfoLevel().convention(WasmDebugInfoLevel.DEOBFUSCATION);
|
getDebugInfoLevel().convention(WasmDebugInfoLevel.DEOBFUSCATION);
|
||||||
getDebugInfoLocation().convention(WasmDebugInfoLocation.EXTERNAL);
|
getDebugInfoLocation().convention(WasmDebugInfoLocation.EXTERNAL);
|
||||||
|
getSourceMap().convention(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Input
|
@Input
|
||||||
|
@ -46,11 +47,15 @@ public abstract class GenerateWasmGCTask extends TeaVMTask {
|
||||||
@Input
|
@Input
|
||||||
public abstract Property<WasmDebugInfoLocation> getDebugInfoLocation();
|
public abstract Property<WasmDebugInfoLocation> getDebugInfoLocation();
|
||||||
|
|
||||||
|
@Input
|
||||||
|
public abstract Property<Boolean> getSourceMap();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setupBuilder(BuildStrategy builder) {
|
protected void setupBuilder(BuildStrategy builder) {
|
||||||
builder.setStrict(getStrict().get());
|
builder.setStrict(getStrict().get());
|
||||||
builder.setObfuscated(getObfuscated().get());
|
builder.setObfuscated(getObfuscated().get());
|
||||||
builder.setDebugInformationGenerated(getDebugInfo().get());
|
builder.setDebugInformationGenerated(getDebugInfo().get());
|
||||||
|
builder.setSourceMapsFileGenerated(getSourceMap().get());
|
||||||
switch (getDebugInfoLevel().get()) {
|
switch (getDebugInfoLevel().get()) {
|
||||||
case FULL:
|
case FULL:
|
||||||
builder.setWasmDebugInfoLevel(org.teavm.backend.wasm.WasmDebugInfoLevel.FULL);
|
builder.setWasmDebugInfoLevel(org.teavm.backend.wasm.WasmDebugInfoLevel.FULL);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user