Skip to content

Commit 841c6f3

Browse files
Update build.sh
1 parent fd4b2c6 commit 841c6f3

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

utils/scripts/build.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/bash
2-
32
# Default values
43
app="paid"
54
mode="d"
65
fdroidFlag=""
6+
buildType="apk" # New default: apk or aar
77
webpackmode="development"
88
cordovamode=""
99

@@ -19,6 +19,9 @@ for arg in "$@"; do
1919
"fdroid")
2020
fdroidFlag="fdroid"
2121
;;
22+
"apk"|"aar")
23+
buildType="$arg"
24+
;;
2225
*)
2326
echo "Warning: Unknown argument '$arg' ignored"
2427
;;
@@ -52,12 +55,21 @@ webpackmode="production"
5255
cordovamode="--release"
5356
fi
5457

58+
# Set build target based on buildType
59+
if [ "$buildType" = "aar" ]; then
60+
echo "Building AAR library file..."
61+
else
62+
echo "Building APK file..."
63+
fi
64+
5565
RED=''
5666
NC=''
67+
5768
script1="node ./utils/config.js $mode $app"
5869
script2="webpack --progress --mode $webpackmode "
5970
# script3="node ./utils/loadStyles.js"
60-
script4="cordova build android $cordovamode"
71+
script4="cordova build android $cordovamode --packageType=$buildType"
72+
6173
eval "
6274
echo \"${RED}$script1${NC}\";
6375
$script1;
@@ -67,4 +79,4 @@ $script2&&
6779
# $script3;
6880
echo \"${RED}$script4${NC}\";
6981
$script4;
70-
"
82+
"

0 commit comments

Comments
 (0)