-
Notifications
You must be signed in to change notification settings - Fork 43
/
mk-release-pkg.sh
executable file
·30 lines (25 loc) · 1.18 KB
/
mk-release-pkg.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
#!/bin/bash
pluginVersion=`grep "ext.PLUGIN_VERSION = \".*\"" app/build.gradle | sed "s/.*ext.PLUGIN_VERSION = \"//" | sed "s/\"//"`
targetAtakVersion="${1}"
if [ "${targetAtakVersion}" != "" ]
then
currentAtakVersion=`grep "ext.ATAK_VERSION = \".*\"" app/build.gradle | sed "s/.*ext.ATAK_VERSION = \"//" | sed "s/\"//"`
sed -i "s/ext.ATAK_VERSION = \".*\"/ext.ATAK_VERSION = \"${targetAtakVersion}\"/" app/build.gradle
fi
repoDirName=`pwd | sed s#.*/##`
pushd ..
if [ "${targetAtakVersion}" != "" ]
then
targetFilename=/mnt/shared/release-pkgs/atak-forwarder-${pluginVersion}-atak-${targetAtakVersion}.zip
else
targetFilename=/mnt/shared/release-pkgs/atak-forwarder-${pluginVersion}.zip
fi
zip -qr ${targetFilename} "${repoDirName}" --exclude "*/build/*" "${repoDirName}/images/*" "${repoDirName}/local.properties" "${repoDirName}/.idea/*"
popd
if [ "${targetAtakVersion}" != "" ]
then
sed -i "s/ext.ATAK_VERSION = \"${targetAtakVersion}\"/ext.ATAK_VERSION = \"${currentAtakVersion}\"/" app/build.gradle
echo "wrote: /mnt/shared/release-pkgs/atak-forwarder-${pluginVersion}-atak-${targetAtakVersion}.zip"
else
echo "wrote: /mnt/shared/release-pkgs/atak-forwarder-${pluginVersion}.zip"
fi