Skip to content

Commit 4d00ad6

Browse files
authored
Merge release version 0.0.3
Release MegaProxy 0.0.3 and fix clean-runner APK builds.
2 parents 068c0f0 + 7792c20 commit 4d00ad6

3 files changed

Lines changed: 48 additions & 22 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ Pushing a version tag runs the GitHub release workflow, builds and verifies ever
230230
the artifacts to a GitHub Release. The tag must match `versionName` exactly:
231231

232232
```shell
233-
git tag v0.0.1
234-
git push origin v0.0.1
233+
git tag v0.0.3
234+
git push origin v0.0.3
235235
```
236236

237237
## Contributing

‎app/build.gradle.kts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ android {
2727
applicationId = "net.megaproxy487"
2828
minSdk = 26
2929
targetSdk = 35
30-
versionCode = 1
31-
versionName = "0.0.1"
30+
versionCode = 3
31+
versionName = "0.0.3"
3232
buildConfigField("String", "GIT_COMMIT_HASH", "\"$gitCommitHash\"")
3333
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
3434
}

‎scripts/build-release-apks.sh‎

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,6 @@ echo "Running native tests"
9191
go test ./...
9292
)
9393

94-
echo "Running Android unit tests"
95-
(
96-
cd "$project_dir"
97-
./gradlew testReleaseUnitTest
98-
)
99-
10094
# gomobile architecture names and their corresponding Android ABI names.
10195
targets=(
10296
"arm64:arm64-v8a"
@@ -105,27 +99,59 @@ targets=(
10599
"386:x86"
106100
)
107101

102+
# A clean checkout has no app/libs/megaproxy.aar. Gradle resolves local AAR
103+
# dependencies while configuring Android unit tests, so build the first ABI
104+
# before invoking Gradle and reuse it for the first release APK below.
105+
first_target="${targets[0]}"
106+
first_go_arch="${first_target%%:*}"
107+
first_android_abi="${first_target##*:}"
108+
echo "Building initial native AAR for $first_android_abi"
109+
(
110+
cd "$project_dir/native"
111+
gomobile bind \
112+
-target="android/$first_go_arch" \
113+
-androidapi 26 \
114+
-trimpath \
115+
-ldflags="-s -w -buildid=" \
116+
-o ../app/libs/megaproxy.aar \
117+
./mobile
118+
)
119+
120+
echo "Running Android unit tests"
121+
(
122+
cd "$project_dir"
123+
./gradlew testReleaseUnitTest
124+
)
125+
108126
for target in "${targets[@]}"; do
109127
go_arch="${target%%:*}"
110128
android_abi="${target##*:}"
111129
output_apk="$MEGAPROXY_RELEASE_DIR/mega-proxy-v${version_name}-${android_abi}.apk"
112130

113-
echo "Building optimized native AAR for $android_abi"
114-
(
115-
cd "$project_dir/native"
116-
gomobile bind \
117-
-target="android/$go_arch" \
118-
-androidapi 26 \
119-
-trimpath \
120-
-ldflags="-s -w -buildid=" \
121-
-o ../app/libs/megaproxy.aar \
122-
./mobile
123-
)
131+
if [[ "$android_abi" == "$first_android_abi" ]]; then
132+
echo "Reusing initial native AAR for $android_abi"
133+
else
134+
echo "Building optimized native AAR for $android_abi"
135+
(
136+
cd "$project_dir/native"
137+
gomobile bind \
138+
-target="android/$go_arch" \
139+
-androidapi 26 \
140+
-trimpath \
141+
-ldflags="-s -w -buildid=" \
142+
-o ../app/libs/megaproxy.aar \
143+
./mobile
144+
)
145+
fi
124146

125147
echo "Building and signing $android_abi APK"
126148
(
127149
cd "$project_dir"
128-
./gradlew clean assembleRelease
150+
# Keep clean and assemble in separate Gradle invocations. When both are
151+
# requested in one task graph, Gradle does not guarantee that clean has
152+
# finished before every generated-resource task starts.
153+
./gradlew clean
154+
./gradlew assembleRelease
129155
)
130156
built_apk="$project_dir/app/build/outputs/apk/release/app-release.apk"
131157
if [[ ! -f "$built_apk" ]]; then

0 commit comments

Comments
 (0)