2025-01-10 02:05:17 +00:00
|
|
|
import com.github.gradle.node.npm.task.NpmTask;
|
|
|
|
|
|
|
|
plugins {
|
2025-01-24 03:57:15 +00:00
|
|
|
id("common-java");
|
2025-01-10 02:05:17 +00:00
|
|
|
id("com.github.node-gradle.node") version "5.0.0";
|
|
|
|
}
|
|
|
|
|
2025-01-24 03:57:15 +00:00
|
|
|
dependencies {
|
|
|
|
implementation(project(":common"));
|
|
|
|
implementation(project(":compilation"));
|
|
|
|
implementation(project(":runtime"));
|
2025-01-10 02:05:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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"));
|
|
|
|
}
|
2025-01-24 03:57:15 +00:00
|
|
|
tasks.register<NpmTask>("compileBabel") {
|
|
|
|
dependsOn("npmInstall");
|
|
|
|
|
|
|
|
inputs.files("rollup.config.js");
|
|
|
|
inputs.dir("src/transpiler");
|
|
|
|
outputs.files("build/js/babel.js");
|
|
|
|
// nom nom tasty ram
|
|
|
|
environment.put("NODE_OPTIONS", "--max-old-space-size=4096");
|
|
|
|
|
|
|
|
args.set(listOf("run", "build-babel"));
|
|
|
|
}
|
|
|
|
tasks.register<NpmTask>("compileTypescript") {
|
2025-01-10 02:05:17 +00:00
|
|
|
dependsOn("npmInstall");
|
|
|
|
|
|
|
|
inputs.files("rollup.config.js");
|
|
|
|
inputs.dir("src/transpiler");
|
2025-01-24 03:57:15 +00:00
|
|
|
outputs.files("build/js/typescript.js");
|
2025-01-10 02:05:17 +00:00
|
|
|
// nom nom tasty ram
|
|
|
|
environment.put("NODE_OPTIONS", "--max-old-space-size=4096");
|
|
|
|
|
2025-01-24 03:57:15 +00:00
|
|
|
args.set(listOf("run", "build-typescript"));
|
|
|
|
}
|
|
|
|
tasks.register<NpmTask>("compileCoffee") {
|
|
|
|
dependsOn("npmInstall");
|
|
|
|
|
|
|
|
inputs.files("rollup.config.js");
|
|
|
|
inputs.dir("src/transpiler");
|
|
|
|
outputs.files("build/js/coffee.js");
|
|
|
|
// nom nom tasty ram
|
|
|
|
environment.put("NODE_OPTIONS", "--max-old-space-size=4096");
|
|
|
|
|
|
|
|
args.set(listOf("run", "build-coffee"));
|
2025-01-10 02:05:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.jar {
|
|
|
|
manifest {
|
|
|
|
attributes(
|
|
|
|
"Main-Class" to properties["main_class"].toString(),
|
|
|
|
"Build-Author" to "TopchetoEU",
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.processResources {
|
|
|
|
dependsOn("compileStdlib");
|
2025-01-24 03:57:15 +00:00
|
|
|
dependsOn("compileTypescript");
|
|
|
|
dependsOn("compileBabel");
|
|
|
|
dependsOn("compileCoffee");
|
2025-01-10 02:05:17 +00:00
|
|
|
|
|
|
|
from("build/js") {
|
|
|
|
into("lib");
|
|
|
|
}
|
|
|
|
from("src/lib") {
|
|
|
|
into("lib");
|
|
|
|
}
|
|
|
|
}
|