Skip to content

Commit cea9a7e

Browse files
authored
Merge branch 'develop' into share-community-qr-17993
2 parents 97dac76 + 2c96c38 commit cea9a7e

20 files changed

+33
-37
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ build-fdroid: ##@build Build release for F-Droid
214214

215215
build-android: export BUILD_ENV ?= prod
216216
build-android: export BUILD_TYPE ?= nightly
217-
build-android: export BUILD_NUMBER ?= $(TMP_BUILD_NUMBER)
217+
build-android: export ORG_GRADLE_PROJECT_versionCode ?= $(TMP_BUILD_NUMBER)
218218
build-android: export ANDROID_ABI_SPLIT ?= false
219219
build-android: export ANDROID_ABI_INCLUDE ?= armeabi-v7a;arm64-v8a;x86
220220
build-android: ##@build Build unsigned Android APK

ci/Jenkinsfile.android

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].5'
2+
library '[email protected].7'
33

44
/* Options section can't access functions in objects. */
55
def isPRBuild = utils.isPRBuild()

ci/Jenkinsfile.combined

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].5'
2+
library '[email protected].7'
33

44
pipeline {
55
agent { label 'linux' }

ci/Jenkinsfile.e2e-nightly

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].5'
2+
library '[email protected].7'
33

44
pipeline {
55
agent { label 'linux' }

ci/Jenkinsfile.ios

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].5'
2+
library '[email protected].7'
33

44
/* Options section can't access functions in objects. */
55
def isPRBuild = utils.isPRBuild()

ci/Jenkinsfile.tests

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].5'
2+
library '[email protected].7'
33

44
/* Options section can't access functions in objects. */
55
def isPRBuild = utils.isPRBuild()

ci/tests/Jenkinsfile.e2e-nightly

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].5'
2+
library '[email protected].7'
33

44
pipeline {
55

ci/tests/Jenkinsfile.e2e-prs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].5'
2+
library '[email protected].7'
33

44
pipeline {
55

ci/tests/Jenkinsfile.e2e-upgrade

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].5'
2+
library '[email protected].7'
33

44
pipeline {
55

ci/tools/Jenkinsfile.fastlane-clean

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].5'
2+
library '[email protected].7'
33

44
pipeline {
55
agent { label 'macos' }

ci/tools/Jenkinsfile.nix-cache

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].5'
2+
library '[email protected].7'
33

44
pipeline {
55
agent { label params.AGENT_LABEL }
@@ -82,7 +82,7 @@ pipeline {
8282
env.NIXPKGS_SYSTEM_OVERRIDE = nixSysOverride(os, arch, 'android')
8383
/* Build/fetch deps required to build android release. */
8484
nix.build(
85-
attr: 'targets.mobile.android.release.buildInputs',
85+
attr: 'targets.mobile.android.build.buildInputs',
8686
sandbox: false,
8787
pure: false,
8888
link: false

ci/tools/Jenkinsfile.playstore-meta

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].5'
2+
library '[email protected].7'
33

44
pipeline {
55
agent { label 'linux' }

ci/tools/Jenkinsfile.xcode-clean

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].5'
2+
library '[email protected].7'
33

44
pipeline {
55
agent {

nix/DETAILS.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ We will use the `make jsbundle` target as an example of a derivation you can bui
6161
3. [`build.sh`](/nix/scripts/build.sh) calls `nix-build --attr targets.mobile.jsbundle` with extra arguments
6262
4. `nix-build` builds the derivation from [`nix/mobile/jsbundle/default.nix`](/nix/mobile/jsbundle/default.nix)
6363

64-
The same can be done for other targets like `targets.mobile.android.release`.
64+
The same can be done for other targets like `targets.mobile.android.build`.
6565
Except in that case extra arguments are required which is why the [`scripts/release-android.sh`](/scripts/release-android.sh) is used in the `make release-android` target.
6666

6767
If you run `make release-android` you'll see the `nix-build` command used:
@@ -71,14 +71,14 @@ nix-build \
7171
--fallback \
7272
--no-out-link \
7373
--show-trace \
74-
--attr targets.mobile.android.release \
74+
--attr targets.mobile.android.build \
7575
--argstr secrets-file '/tmp/tmp-status-mobile-559a3a441/tmp.xAnrPuNtAP' \
7676
--option extra-sandbox-paths '/home/joe/.gradle/status-im.keystore /tmp/tmp-status-mobile-559a3a441/tmp.xAnrPuNtAP' \
7777
default.nix
7878
```
7979
Some of those are required which is why just calling:
8080
```
81-
nix-build --attr targets.mobile.android.release
81+
nix-build --attr targets.mobile.android.build
8282
```
8383
Would fail.
8484

nix/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export STATUS_GO_IPFS_GATEWAY_URL="https://ipfs.status.im/"
2828
```
2929
You can see the defaults in code:
3030
- [`nix/status-go/default.nix`](./status-go/default.nix)
31-
- [`nix/mobile/android/release.nix`](./mobile/android/release.nix)
31+
- [`nix/mobile/android/release.nix`](./mobile/android/build.nix)
3232

3333
## Shell
3434

nix/deps/gradle/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This directory contains the tools and the data that allows Nix to manage Gradle
66

77
Simply calling `generate.sh` should result in a `deps.json` file which is used in the derivation that provides Gradle dependencies when building the Android app.
88

9-
You can see in [`nix/mobile/android/release.nix`](../../mobile/android/release.nix) that it's used via the `-Dmaven.repo.local='${deps.gradle}'` Gradle flag.
9+
You can see in [`nix/mobile/android/release.nix`](../../mobile/android/build.nix) that it's used via the `-Dmaven.repo.local='${deps.gradle}'` Gradle flag.
1010

1111
# Files
1212

nix/mobile/android/release.nix nix/mobile/android/build.nix

+10-12
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
# Path to the file containing secret environment variables
88
secretsFile ? "",
99
# Build type (influences which .env file gets used for feature flags)
10-
# TODO: pr or relase for default?
1110
buildType ? lib.getEnvWithDefault "BUILD_TYPE" "release",
1211
# Used for versionCode
13-
buildNumber ? lib.getEnvWithDefault "BUILD_NUMBER" 9999,
12+
versionCode ? lib.getEnvWithDefault "ORG_GRADLE_PROJECT_versionCode" 9999,
1413
# Included in APK Manifest for easier identification.
15-
# TODO: or GIT_COMMIT from Jenkins?
16-
commitHash ? lib.getEnvWithDefault "COMMIT_HASH" "unknown",
17-
# Gradle options passed for Android builds
18-
androidGradleOpts ? lib.getEnvWithDefault "ANDROID_GRADLE_OPTS" null,
14+
commitHash ? lib.getEnvWithDefault "ORG_GRADLE_PROJECT_commitHash" "unknown",
15+
# Disabled for debug builds to avoid 'maximum call stack exceeded' errors.
16+
# https://github.com/status-im/status-mobile/issues/18493
17+
hermesEnabled ? lib.getEnvWithDefault "ORG_GRADLE_PROJECT_hermesEnabled" "true",
18+
buildUrl ? lib.getEnvWithDefault "ORG_GRADLE_PROJECT_buildUrl" null,
1919
statusGoSrcOverride ? lib.getEnvWithDefault "STATUS_GO_SRC_OVERRIDE" null,
2020
# If APKs should be split based on architectures
2121
androidAbiSplit ? lib.getEnvWithDefault "ANDROID_ABI_SPLIT" "false",
@@ -83,7 +83,10 @@ in stdenv.mkDerivation rec {
8383
ANDROID_ABI_INCLUDE = androidAbiInclude;
8484
# Disabled for debug builds to avoid 'maximum call stack exceeded' errors.
8585
# https://github.com/status-im/status-mobile/issues/18493
86-
ORG_GRADLE_PROJECT_hermesEnabled = true;
86+
ORG_GRADLE_PROJECT_versionCode = versionCode;
87+
ORG_GRADLE_PROJECT_commitHash = commitHash;
88+
ORG_GRADLE_PROJECT_buildUrl = buildUrl;
89+
ORG_GRADLE_PROJECT_hermesEnabled = hermesEnabled;
8790

8891
# Fix for ERR_OSSL_EVP_UNSUPPORTED error.
8992
NODE_OPTIONS = "--openssl-legacy-provider";
@@ -118,8 +121,6 @@ in stdenv.mkDerivation rec {
118121
119122
# Symlink React Native entrypoint.
120123
cp -Lr ${builtJsBundle} ./result
121-
pwd
122-
find -L result
123124
124125
# Copy android/ directory
125126
mkdir -p ./android/build
@@ -146,16 +147,13 @@ in stdenv.mkDerivation rec {
146147
"LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${makeLibraryPath [ pkgs.zlib ]}";
147148
gradleCommand = ''
148149
${pkgs.gradle}/bin/gradle \
149-
${toString androidGradleOpts} \
150150
--console=plain \
151151
--offline \
152152
--no-daemon \
153153
--no-scan \
154154
--no-watch-fs \
155155
--no-build-cache \
156156
-Dmaven.repo.local='${deps.gradle}' \
157-
-PversionCode=${toString buildNumber} \
158-
-PcommitHash=${commitHash} \
159157
assemble${gradleBuildType}
160158
'';
161159
in

nix/mobile/android/default.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
, jsbundle, status-go, androidPkgs, androidShell }:
33

44
rec {
5-
release = callPackage ./release.nix {
5+
build = callPackage ./build.nix {
66
inherit jsbundle status-go;
77
};
88

@@ -15,7 +15,7 @@ rec {
1515
];
1616

1717
inputsFrom = [
18-
(release {})
18+
(build {})
1919
androidShell
2020
];
2121

nix/scripts/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if [[ -z "${TARGET}" ]]; then
4545
fi
4646

4747
# Hack fix for missing Android SDK for aarch64 on Darwin. See systemOverride in `nix/pkgs.nix`.
48-
if [[ "${TARGET}" =~ ^(targets.status-go.mobile.android|targets.mobile.android.release)$ ]]; then
48+
if [[ "${TARGET}" =~ ^(targets.status-go.mobile.android|targets.mobile.android.build)$ ]]; then
4949
os=$(uname -s | tr '[:upper:]' '[:lower:]')
5050
export NIXPKGS_SYSTEM_OVERRIDE="x86_64-${os}"
5151
fi

scripts/build-android.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ function append_env_export() {
2121
VAR_VALUE=$(must_get_env "${VAR_NAME}")
2222
echo "export ${VAR_NAME}=\"${VAR_VALUE}\";" >> "${SECRETS_FILE_PATH}"
2323
}
24-
25-
export COMMIT_HASH="$(git rev-parse --verify HEAD)"
2624
nixOpts=()
2725

2826
# We create if now so the trap knows its location
@@ -73,4 +71,4 @@ else
7371
fi
7472

7573

76-
"${GIT_ROOT}/nix/scripts/build.sh" targets.mobile.android.release "${nixOpts[@]}"
74+
"${GIT_ROOT}/nix/scripts/build.sh" targets.mobile.android.build "${nixOpts[@]}"

0 commit comments

Comments
 (0)