forked from balr0g/NetherOres
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·66 lines (51 loc) · 1.45 KB
/
build.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
if [[ -z "${MCP}" ]]; then
echo "Please set \$MCP to your MCP working dir."
exit
fi
if [[ -z "${PROJBASE}" ]]; then
echo "Assuming project basedir is here."
PROJBASE=`pwd`
fi
BUILDSRC=$MCP/src
CLEANSRC=$MCP/src-dev
SPRITEFOLDER=NetherOresSprites
MODNAME=NetherOres
MODVERSION=1.2.0
ZIPPATH=`which zip`
SRCBASE=$PROJBASE/source
CLIENTSRC=$SRCBASE/client
SERVERSRC=$SRCBASE/server
COMMONSRC=$SRCBASE/common
RELEASEBASE=$PROJBASE/release
RELEASECLIENT=$RELEASEBASE/clienttemp
RELEASESERVER=$RELEASEBASE/servertemp
echo "This assumes you have a clean (with Forge) copy of the decompiled code in src-dev. press ctrl-c now if you don't."
echo "Press any key to continue."
read
mkdir -p $RELEASECLIENT
mkdir -p $RELEASESERVER
if [[ -z "${DEBUG}" ]]; then
rm -rf $BUILDSRC
fi
cp -a $CLEANSRC $BUILDSRC
cp -a $COMMONSRC $BUILDSRC/minecraft/
cp -a $COMMONSRC $BUILDSRC/minecraft_server
cp -a $CLIENTSRC $BUILDSRC/minecraft/
cp -a $SERVERSRC $BUILDSRC/minecraft_server/
pushd $MCP
./recompile.sh
./reobfuscate.sh
rm -rf $RELEASEBASE/*.zip
rm -rf $RELEASECLIENT/*
rm -rf $RELEASESERVER/*
cp -a $MCP/reobf/minecraft/* $RELEASECLIENT/
cp -a $MCP/reobf/minecraft_server/* $RELEASESERVER/
cp -a $PROJBASE/sprites $RELEASECLIENT/$SPRITEFOLDER
rm -rf $RELEASECLIENT/net
rm -rf $RELEASESERVER/net
cd $RELEASECLIENT
$ZIPPATH -r -q $RELEASEBASE/"$MODNAME"_Client_"$MODVERSION".zip *
cd $RELEASESERVER
$ZIPPATH -r -q $RELEASEBASE/"$MODNAME"_Server_"$MODVERSION".zip *
popd