Skip to content

Commit b635fe8

Browse files
authored
Merge branch 'Acode-Foundation:main' into main
2 parents 1adb8a1 + a38f019 commit b635fe8

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ yarn setup
6060
2. Build the project:
6161

6262
```shell
63-
yarn build <free|paid> <p|prod|d|dev> [fdroid]
63+
yarn build <free|paid> <p|prod|d|dev> [fdroid] <apk/bundle>
6464
```
6565

6666
**Note**: Add the fdroid flag only if you want to build the F-Droid-compatible version of Acode.

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"|"bundle")
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)