build: split up into multiple projects, use kotlin DLS
All checks were successful
tagged-release / Tagged Release (push) Successful in 5m23s
All checks were successful
tagged-release / Tagged Release (push) Successful in 5m23s
This commit is contained in:
68
lib/build.gradle.kts
Normal file
68
lib/build.gradle.kts
Normal file
@@ -0,0 +1,68 @@
|
||||
import com.github.gradle.node.npm.task.NpmTask;
|
||||
|
||||
plugins {
|
||||
id("common");
|
||||
id("com.github.node-gradle.node") version "5.0.0";
|
||||
}
|
||||
|
||||
tasks.compileJava {
|
||||
enabled = false;
|
||||
}
|
||||
tasks.classes {
|
||||
enabled = false;
|
||||
}
|
||||
|
||||
node {
|
||||
version = "20.0.0";
|
||||
npmVersion = "8.0.0";
|
||||
download = true;
|
||||
}
|
||||
|
||||
tasks.register<NpmTask>("compileStdlib") {
|
||||
dependsOn("npmInstall");
|
||||
|
||||
inputs.files("rollup.config.js");
|
||||
inputs.dir("src/stdlib");
|
||||
outputs.files("build/js/stdlib.js");
|
||||
|
||||
args.set(listOf("run", "build-env"));
|
||||
}
|
||||
tasks.register<NpmTask>("compileTranspiler") {
|
||||
dependsOn("npmInstall");
|
||||
|
||||
inputs.files("rollup.config.js");
|
||||
inputs.dir("src/transpiler");
|
||||
outputs.files("build/js/transpiler.js");
|
||||
// nom nom tasty ram
|
||||
environment.put("NODE_OPTIONS", "--max-old-space-size=4096");
|
||||
|
||||
args.set(listOf("run", "build-ts"));
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
manifest {
|
||||
attributes(
|
||||
"Main-Class" to properties["main_class"].toString(),
|
||||
"Build-Author" to "TopchetoEU",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
tasks.processResources {
|
||||
dependsOn("compileStdlib");
|
||||
dependsOn("compileTranspiler");
|
||||
|
||||
from("build/js") {
|
||||
into("lib");
|
||||
}
|
||||
from("src/lib") {
|
||||
into("lib");
|
||||
}
|
||||
|
||||
filesMatching("metadata.json", {
|
||||
expand(
|
||||
"version" to properties["project_version"].toString(),
|
||||
"name" to properties["project_name"].toString(),
|
||||
);
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user