forked from dan200/ComputerCraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·46 lines (38 loc) · 1.23 KB
/
deploy.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
43
44
45
46
#!/bin/sh
echo "Building with gradle..."
rm -rf build/libs
rm -rf build/resources
rm -rf build/classes
chmod -R +rw src/main/resources
chmod +x gradlew
./gradlew build
echo "Deleting old deployment..."
rm -rf deploy
mkdir deploy
echo "Making new deployment..."
INPUTJAR=`ls -1 build/libs | grep -v sources`
OUTPUTJAR=`ls -1 build/libs | grep -v sources | sed s/\-//g`
FRIENDLYNAME=`ls -1 build/libs | grep -v sources | sed s/\-/\ /g | sed s/\.jar//g`
cp build/libs/$INPUTJAR deploy/$OUTPUTJAR
echo "Creating API..."
mkdir -p deploy/api/src/dan200/computercraft
cp -r build/sources/main/java/dan200/computercraft/api deploy/api/src/dan200/computercraft/api
echo "Creating API Javadocs..."
mkdir -p deploy/api/doc
cd src/main/java/dan200/computercraft/api
find . -type f -name "*.java" | xargs javadoc -d ../../../../../../deploy/api/doc -windowtitle "$FRIENDLYNAME"
cd ../../../../../..
echo "Adding API and Javadocs to deployment..."
cd deploy
zip -r $OUTPUTJAR api/doc > /dev/null
zip -r $OUTPUTJAR api/src/dan200/computercraft > /dev/null
cd ..
rm -rf deploy/api
echo "Adding LuaJ to deployment..."
mkdir deploy/luaj
cd deploy/luaj
jar xf ../../libs/luaj-jse-2.0.3.jar
zip -r ../$OUTPUTJAR org > /dev/null
cd ../..
rm -rf deploy/luaj
echo "Done."