Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ yarn setup
2. Build the project:

```shell
yarn build <free|paid> <p|prod|d|dev> [fdroid]
yarn build <free|paid> <p|prod|d|dev> [fdroid] <apk/bundle>
```

**Note**: Add the fdroid flag only if you want to build the F-Droid-compatible version of Acode.
Expand Down
18 changes: 15 additions & 3 deletions utils/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

# Default values
app="paid"
mode="d"
fdroidFlag=""
buildType="apk" # New default: apk or aar
webpackmode="development"
cordovamode=""

Expand All @@ -19,6 +19,9 @@ for arg in "$@"; do
"fdroid")
fdroidFlag="fdroid"
;;
"apk"|"bundle")
buildType="$arg"
;;
*)
echo "Warning: Unknown argument '$arg' ignored"
;;
Expand Down Expand Up @@ -52,12 +55,21 @@ webpackmode="production"
cordovamode="--release"
fi

# Set build target based on buildType
if [ "$buildType" = "aar" ]; then
echo "Building AAR library file..."
else
echo "Building APK file..."
fi

RED=''
NC=''

script1="node ./utils/config.js $mode $app"
script2="webpack --progress --mode $webpackmode "
# script3="node ./utils/loadStyles.js"
script4="cordova build android $cordovamode"
script4="cordova build android $cordovamode -- --packageType=$buildType"

eval "
echo \"${RED}$script1${NC}\";
$script1;
Expand All @@ -67,4 +79,4 @@ $script2&&
# $script3;
echo \"${RED}$script4${NC}\";
$script4;
"
"