Skip to content

Commit

Permalink
Modernize Android build system, bump dependencies
Browse files Browse the repository at this point in the history
Summary:
- Build against Android SDK 26
- Upgrade to Gradle 4
- Upgrade to Android Plugin 3.0, adjust dependency management accordingly
- Upgrade Maven deployment plugin

Reviewed By: emilsjolander

Differential Revision: D6272007

fbshipit-source-id: b198b4c8e1a94e2ee031ad26193fdfdf5b52adf1
  • Loading branch information
passy authored and facebook-github-bot committed Nov 8, 2017
1 parent d8fee24 commit 40861c6
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
1 change: 1 addition & 0 deletions .buckconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
gtest_dep = //lib/gtest:gtest
[android]
target = android-25
build_tools_version = 26.0.2
[ndk]
ndk_version = 15.2.4203891
compiler = clang
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ android {
}

dependencies {
compile project(':yoga')
api project(':yoga')
}

task sourcesJar(type: Jar) {
Expand Down
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
buildscript {
repositories {
jcenter()
maven { url 'https://maven.google.com/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -23,8 +24,8 @@ allprojects {
ext {
minSdkVersion = 14
targetSdkVersion = 25
compileSdkVersion = 25
buildToolsVersion = '25.0.2'
compileSdkVersion = 26
buildToolsVersion = '26.0.2'
sourceCompatibilityVersion = JavaVersion.VERSION_1_7
targetCompatibilityVersion = JavaVersion.VERSION_1_7
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2-bin.zip
8 changes: 4 additions & 4 deletions java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ android {
}

dependencies {
compile 'com.google.code.findbugs:jsr305:3.0.1'
compile 'com.facebook.soloader:soloader:0.2.0'
provided project(':yoga:proguard-annotations')
testCompile 'junit:junit:4.12'
compileOnly 'com.google.code.findbugs:jsr305:3.0.1'
compileOnly project(':yoga:proguard-annotations')
implementation 'com.facebook.soloader:soloader:0.2.0'
testImplementation 'junit:junit:4.12'
}

task sourcesJar(type: Jar) {
Expand Down
6 changes: 3 additions & 3 deletions lib/fb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ android {
}

dependencies {
compile 'com.facebook.soloader:soloader:0.2.0'
compile 'com.google.code.findbugs:jsr305:3.0.1'
compile project(':yoga:proguard-annotations')
implementation 'com.facebook.soloader:soloader:0.2.0'
compileOnly 'com.google.code.findbugs:jsr305:3.0.1'
compileOnly project(':yoga:proguard-annotations')
}
}
2 changes: 1 addition & 1 deletion scripts/android-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ function installAndroidSDK {
echo > "$ANDROID_HOME/licenses/android-sdk-license"
echo -n d56f5187479451eabf01fb78af6dfcb131a6481e >> "$ANDROID_HOME/licenses/android-sdk-license"

installsdk 'build-tools;23.0.2' 'build-tools;25.0.2' 'build-tools;25.0.1' 'platform-tools' 'platforms;android-23' 'platforms;android-25' 'extras;android;m2repository'
installsdk 'build-tools;26.0.2' 'platform-tools' 'platforms;android-23' 'platforms;android-25' 'extras;android;m2repository'
}

0 comments on commit 40861c6

Please sign in to comment.