-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-and-run-example.sh
42 lines (34 loc) · 1.25 KB
/
build-and-run-example.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
echo 'Cleaning generated code...'
rm -rf src/generated/java target tools/tmp
mkdir -p target/
mkdir -p tools/temp
echo 'Compiling the DSL model and generating classes..'
java -jar tools/dsl-clc.jar \
-compiler=tools/dsl-compiler.exe \
-dsl=dsl \
-settings=manual-json,no-jackson \
-dependencies:java_client=tools/dependencies/java_client \
-java_client=target/model.jar \
-namespace=com.dslplatform.example \
-temp=tools/temp
echo 'Moving generated sources...'
rm -rf tools/temp/java_client/compile-java_client
mv -f tools/temp/java_client/ src/generated/java/
echo 'Formatting sources...'
java -jar tools/dcf.jar src/generated/java
echo 'Compiling the main program...'
javac src/main/java/com/dslplatform/example/Main.java \
-classpath ./lib/*:./target/model.jar \
-d target/
echo 'Generating Manifest...'
mkdir -p target/META-INF/
echo 'Main-Class: com.dslplatform.example.Main' > target/META-INF/MANIFEST.MF
echo 'Packagin the Main program jar...'
jar -cfm target/dsl-platform-json-example.jar target/META-INF/MANIFEST.MF \
-C target/ com
echo
echo '###############################'
echo '##Running the example program##'
echo '###############################'
java -cp lib/*:target/* com.dslplatform.example.Main