Only disable gradle daemon on CI, and install recommended npm version

This commit is contained in:
Pedro Pombeiro 2018-11-21 08:02:53 +01:00
parent 1d0c00d4bc
commit 8d2818017c
No known key found for this signature in database
GPG Key ID: A65DEB11E4BBC647
4 changed files with 13 additions and 9 deletions

View File

@ -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=

View File

@ -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

View File

@ -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()}'"
}

View File

@ -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() {