From 8d2818017cb5587f5c84e250c2b1655739bf412b Mon Sep 17 00:00:00 2001 From: Pedro Pombeiro Date: Wed, 21 Nov 2018 08:02:53 +0100 Subject: [PATCH] Only disable gradle daemon on CI, and install recommended npm version --- Makefile | 2 +- android/gradle.properties | 5 +---- ci/android.groovy | 3 ++- scripts/lib/setup/installers.sh | 12 +++++++++--- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index d8a826aa5d..950add737c 100644 --- a/Makefile +++ b/Makefile @@ -138,7 +138,7 @@ watch-desktop: ##@watch Start development for Desktop run-android: ##@run Run Android build react-native run-android --appIdSuffix debug -run-desktop: ##@run Run Android build +run-desktop: ##@run Run Desktop build react-native run-desktop SIMULATOR= diff --git a/android/gradle.properties b/android/gradle.properties index 3cf751ad69..6fada24744 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -25,10 +25,7 @@ STATUS_RELEASE_STORE_PASSWORD=password STATUS_RELEASE_KEY_ALIAS=status STATUS_RELEASE_KEY_PASSWORD=password -# Workaround for issue https://github.com/facebook/react-native/issues/16906 +# Workaround for issue https://github.com/facebook/react-native/issues/16906 (TODO: fixed in 0.57.3, remove once we upgrade react-native) android.enableAapt2=false -# Disable Gradle Daemon https://stackoverflow.com/questions/38710327/jenkins-builds-fail-using-the-gradle-daemon -org.gradle.daemon=false - org.gradle.jvmargs=-Xmx4608M \ No newline at end of file diff --git a/ci/android.groovy b/ci/android.groovy index 9a4cc6cae4..430152e4e6 100644 --- a/ci/android.groovy +++ b/ci/android.groovy @@ -2,7 +2,8 @@ common = load 'ci/common.groovy' def compile(type = 'nightly') { common.buildNumber() - def gradleOpt = "-PbuildUrl='${currentBuild.absoluteUrl}' " + // Disable Gradle Daemon https://stackoverflow.com/questions/38710327/jenkins-builds-fail-using-the-gradle-daemon + def gradleOpt = "-PbuildUrl='${currentBuild.absoluteUrl}' -Dorg.gradle.daemon=false " if (type == 'release') { gradleOpt += "-PreleaseVersion='${common.version()}'" } diff --git a/scripts/lib/setup/installers.sh b/scripts/lib/setup/installers.sh index cec5a07bd8..1df735a2d5 100755 --- a/scripts/lib/setup/installers.sh +++ b/scripts/lib/setup/installers.sh @@ -216,13 +216,14 @@ function install_node_via_nvm() { cd "$(repo_path)" if [ ! -e "$nvmrc" ]; then - cecho "@b@blue[[+ Installing Node 9 (Node 10 is not supported by Realm)]]" + cecho "@b@blue[[+ Installing Node 8 (Node 10 is not supported by Realm and Node 9 doesn't support npm 5.5.1)]]" - nvm install 9 - nvm alias status-im 9 + nvm install 8.9.4 + nvm alias status-im 8.9.4 echo status-im > "$nvmrc" nvm use status-im + npm install -g npm@5.5.1 # Explicitly downgrade to v5.5.1 of npm, since Status Desktop builds require it (npm install hangs with version higher than 5.5.1). We could maintain two versions of npm (5.5.1 for Desktop and a more recent on for mobile) but that can be confusing and lead to inconsistent environments else local version_alias=$(cat "$nvmrc") nvm use $version_alias @@ -230,6 +231,11 @@ function install_node_via_nvm() { local version=$(node -v) cecho "+ Node already installed ($version_alias $version via NVM)... skipping." fi + + local npm_version=$(npm -v) + if [[ $npm_version != "5.5.1" ]]; then + cecho "@b@red[[+ npm version $npm_version is installed. npm version 5.5.1 is recommended.]]" + fi } function install_node_via_package_manager() {