Skip to content

Commit 5c31f7f

Browse files
Release script
1 parent 1511728 commit 5c31f7f

1 file changed

Lines changed: 70 additions & 0 deletions

File tree

releaseAPKDecompiler.sh

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/bin/sh
2+
3+
DOE="`dirname \"$0\"`"
4+
5+
function help
6+
{
7+
echo "releaseAPKDecompiler -- Release a new version of Android Decompiler"
8+
echo ""
9+
echo "usage: releaseAPKDecompiler.sh [options]"
10+
echo ""
11+
echo "options:"
12+
echo " -v,--version <version> The version of this release"
13+
echo " -d,--dir <path> The path were release file will be put"
14+
echo " -h,--help Prints this help message"
15+
}
16+
17+
#Init values
18+
version=
19+
outputDir=
20+
temp=
21+
22+
# Check all of the possible options
23+
while [[ "$1" == -* ]]; do
24+
case $1 in
25+
-v | --version ) shift
26+
version=$1
27+
;;
28+
-d | --dir ) shift
29+
outputDir=$1
30+
;;
31+
-h | --help ) help
32+
exit
33+
;;
34+
esac
35+
shift
36+
done
37+
38+
# Check a the minimum set of parameters is present. If not show help...
39+
if [ -z $outputDir ] || [ -z $version ]
40+
then
41+
help
42+
exit
43+
fi
44+
45+
echo "Releasing version $version to directory $outputDir"
46+
echo ""
47+
48+
# Cleanup the output directories
49+
echo "Cleaning up the output directory"
50+
rm -Rf $DOE/output
51+
rm -Rf $DOE/output-res
52+
mkdir -p $outputDir
53+
54+
# Copy all the files
55+
echo "Preparing release..."
56+
temp="$outputDir/AndroidDecompiler"
57+
mkdir -p $temp
58+
cp -r $DOE/* $temp/
59+
echo "Removing all unncessary files"
60+
rm $temp/releaseAPKDecompiler.sh
61+
rm $temp/README.md
62+
63+
echo "Zipping all files together"
64+
pushd $temp
65+
zip -r $outputDir/AndroidDecompiler-$version.zip ./*
66+
tar -cvf $outputDir/AndroidDecompiler-$version.tar.gz ./*
67+
popd
68+
rm -Rf $temp
69+
70+
exit;

0 commit comments

Comments
 (0)