summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 26 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..7f4f548
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,26 @@
+.PHONY: all clean compileStubs
+
+all: dist/kotlin-proxy-compiler-stubs.jar
+
+clean:
+ rm -f dist/kotlin-proxy-compiler-stubs.jar
+ rm -rf stubs/classes_min/*
+
+stubs/classes_min/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.class: tools/gen_class.py jars/scan.txt jars/defs.txt jars/fallback.txt
+ python3 tools/gen_class.py \
+ --scan-jars jars/scan.txt \
+ --def-jars jars/defs.txt \
+ --fallback-jars jars/fallback.txt \
+ --seed-only --no-closure \
+ --seed 'org/jetbrains/kotlin/cli/jvm/K2JVMCompiler,org/jetbrains/kotlin/cli/jvm/K2JVMCompiler$Companion,org/jetbrains/kotlin/cli/jvm/K2JVMCompilerKt' \
+ --out stubs/classes_min
+
+DEFS = $(shell grep -v '^[[:space:]]*#' jars/defs.txt | tr '\n' ':')
+
+compileStubs: stubs/classes_min/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.class jars/defs.txt stubs/src/kotlin/proxy/*.java
+ javac -nowarn -proc:none -d stubs/classes_min \
+ -cp "$(DEFS)" \
+ stubs/src/kotlin/proxy/*.java
+
+dist/kotlin-proxy-compiler-stubs.jar: compileStubs
+ jar cf $@ -C stubs/classes_min .