New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build dependencies #491

Merged
merged 4 commits into from Mar 14, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+50 −30
Diff settings

Always

Just for now

Copy path View file
@@ -6,7 +6,7 @@ jdk:
android:
components:
- tools
- build-tools-24.0.2
- build-tools-25.0.2
- android-23
- platform-tools
- extra-android-support
Copy path View file
@@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.android.tools.build:gradle:2.3.0'
}
}

Copy path View file
@@ -1,2 +1,20 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

This comment has been minimized.

@jasta

jasta Mar 11, 2017

Contributor

Hmm, what's this all about? This could affect our Travis builds in theory.

This comment has been minimized.

@friederbluemle

friederbluemle Mar 14, 2017

Author Contributor

The reason is that with the default setting of 1GB and a more recent version of the Android build tool chain and Gradle, dex will run out of process since it requires a larger heap. Adding this setting allows dex to run in the same process, speeding up the build. This is now also the default setting if you create a new project using the latest version of Android Studio.

During the build, you would encounter this warning if the heap was not explicity set to at least 1.5G:

Running dex as a separate process.

To run dex in process, the Gradle daemon needs a larger heap.
It currently has 1024 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to at least 1536 MB.
To do this set org.gradle.jvmargs=-Xmx1536M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environment.html

This comment has been minimized.

@jasta

jasta Mar 14, 2017

Contributor

Ack'd, sounds good.


# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

VERSION_NAME=1.4.3-SNAPSHOT
GROUP=com.facebook.stetho
Copy path View file
BIN +884 Bytes (100%) gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
@@ -1,6 +1,6 @@
#Sun Jul 31 17:42:38 SGT 2016
#Tue Mar 14 19:35:32 AEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip
Copy path View file
22 gradlew
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
@@ -154,11 +154,19 @@ if $cygwin ; then
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save ( ) {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
Copy path View file
@@ -49,7 +49,6 @@ goto fail
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
@@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
Copy path View file
@@ -5,15 +5,15 @@ def isReleaseBuild() {
return VERSION_NAME.contains("SNAPSHOT") == false
}

def getRepositoryUrl() {
def getMavenRepositoryUrl() {

This comment has been minimized.

@jasta

jasta Mar 11, 2017

Contributor

What's this change about? Seems unrelated (though not necessarily wrong, I'd prefer to see it in a separate PR for bookkeeping sake).

This comment has been minimized.

@friederbluemle

friederbluemle Mar 14, 2017

Author Contributor

This change is necessary with a more recent version of Gradle and/or the Android Gradle plugin. It seems like there is a naming clash with the property repositoryUrl the auto-generated getter method.

Without this change the build will fail with this error message:

FAILURE: Build failed with an exception.

* Where:
Script '[path]/release.gradle' line: 9

* What went wrong:
A problem occurred configuring project ':stetho'.
> Could not get unknown property 'repositoryUrl' for project ':stetho' of type org.gradle.api.Project.

This comment has been minimized.

@jasta

jasta Mar 14, 2017

Contributor

Ack'd, I wonder if Google added the support upstream that we had to manually hack in. I am a little worried that ./gradlew uploadArchives may have been broken by this change as well but wasn't invoked during your tests. I guess we'll just have to take that pain when it comes to release time...

This comment has been minimized.

@vaiden

vaiden May 14, 2017

This error started with gradle 3.4 and originates from hasProperty() returning true in cases where the property is indeed missing, but still has an overrding getter.
The simpler fix is to change

def getRepositoryUrl() {
    return hasProperty('repositoryUrl') ? property('repositoryUrl') : 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
}

Into:

def getRepositoryUrl() {
    return findProperty('repositoryUrl') != null ? property('repositoryUrl') : 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
}

findProperty() ignores overloaded getters.

More info here: http://www.devsbedevin.com/the-pains-of-building-android-react-native-from-source/

This comment has been minimized.

@friederbluemle

friederbluemle May 16, 2017

Author Contributor

@vaiden That makes sense. Thanks for the explanation!! 👍

return hasProperty('repositoryUrl') ? property('repositoryUrl') : "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
}

def getRepositoryUsername() {
def getMavenRepositoryUsername() {
return hasProperty('repositoryUsername') ? property('repositoryUsername') : ""
}

def getRepositoryPassword() {
def getMavenRepositoryPassword() {
return hasProperty('repositoryPassword') ? property('repositoryPassword') : ""
}

@@ -116,10 +116,10 @@ afterEvaluate { project ->
MavenDeployment deployment -> signing.signPom(deployment)
}

repository(url: getRepositoryUrl()) {
repository(url: getMavenRepositoryUrl()) {
authentication(
userName: getRepositoryUsername(),
password: getRepositoryPassword())
userName: getMavenRepositoryUsername(),
password: getMavenRepositoryPassword())

}

Copy path View file
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion "24.0.2"
buildToolsVersion "25.0.2"

defaultConfig {
minSdkVersion 9
Copy path View file
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion "24.0.2"
buildToolsVersion "25.0.2"

defaultConfig {
minSdkVersion 9
Copy path View file
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion "24.0.2"
buildToolsVersion "25.0.2"

defaultConfig {
minSdkVersion 9
Copy path View file
@@ -7,7 +7,7 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "24.0.2"
buildToolsVersion "25.0.2"

defaultConfig {
applicationId "com.facebook.stetho.sample"
Copy path View file
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion "24.0.2"
buildToolsVersion "25.0.2"

defaultConfig {
minSdkVersion 11
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion "24.0.2"
buildToolsVersion "25.0.2"

defaultConfig {
minSdkVersion 9
Copy path View file
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion "24.0.2"
buildToolsVersion "25.0.2"

defaultConfig {
minSdkVersion 9
ProTip! Use n and p to navigate between commits in a pull request.