mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
gradle: make tests DSL groovy-friendly
This commit is contained in:
parent
a4b2199142
commit
725aac089b
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
package org.teavm.gradle;
|
||||
|
||||
import groovy.lang.Closure;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
|
@ -120,4 +121,9 @@ class TeaVMBaseExtensionImpl implements TeaVMBaseExtension {
|
|||
public void tests(Action<TeaVMTests> config) {
|
||||
config.execute(tests);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tests(Closure<Void> config) {
|
||||
config.rehydrate(getTests(), config.getOwner(), config.getThisObject()).call();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
package org.teavm.gradle;
|
||||
|
||||
import groovy.lang.Closure;
|
||||
import org.gradle.api.Action;
|
||||
import org.gradle.api.model.ObjectFactory;
|
||||
import org.teavm.gradle.api.TeaVMJSTests;
|
||||
|
@ -40,6 +41,11 @@ class TeaVMTestsImpl implements TeaVMTests {
|
|||
config.execute(js);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void js(Closure<Void> config) {
|
||||
config.rehydrate(getJs(), config.getOwner(), config.getThisObject()).call();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TeaVMWasmTests getWasm() {
|
||||
return wasm;
|
||||
|
@ -50,6 +56,11 @@ class TeaVMTestsImpl implements TeaVMTests {
|
|||
config.execute(wasm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wasm(Closure<Void> config) {
|
||||
config.rehydrate(getWasm(), config.getOwner(), config.getThisObject()).call();
|
||||
}
|
||||
|
||||
void configure(TeaVMBaseExtensionImpl extension) {
|
||||
js.configure(extension);
|
||||
wasm.configure(extension);
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
*/
|
||||
package org.teavm.gradle.api;
|
||||
|
||||
import groovy.lang.Closure;
|
||||
import groovy.lang.DelegatesTo;
|
||||
import org.gradle.api.Action;
|
||||
import org.gradle.api.provider.Provider;
|
||||
|
||||
|
@ -26,4 +28,6 @@ public interface TeaVMBaseExtension {
|
|||
TeaVMTests getTests();
|
||||
|
||||
void tests(Action<TeaVMTests> config);
|
||||
|
||||
void tests(@DelegatesTo(TeaVMTests.class) Closure<Void> config);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
*/
|
||||
package org.teavm.gradle.api;
|
||||
|
||||
import groovy.lang.Closure;
|
||||
import groovy.lang.DelegatesTo;
|
||||
import org.gradle.api.Action;
|
||||
|
||||
public interface TeaVMTests {
|
||||
|
@ -22,7 +24,11 @@ public interface TeaVMTests {
|
|||
|
||||
void js(Action<TeaVMJSTests> config);
|
||||
|
||||
void js(@DelegatesTo(TeaVMJSTests.class) Closure<Void> config);
|
||||
|
||||
TeaVMWasmTests getWasm();
|
||||
|
||||
void wasm(Action<TeaVMWasmTests> config);
|
||||
|
||||
void wasm(@DelegatesTo(TeaVMWasmTests.class) Closure<Void> config);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user