Skip to content

Commit

Permalink
gradle to set project-wide properties (#19845)
Browse files Browse the repository at this point in the history
Summary:
Change HelloWorld app template to use project-wide properties. See https://developer.android.com/studio/build/gradle-tips#configure-project-wide-properties.

RN community and third-party native module developers adopted this, so it'll make RN package development and usage easy.

CI is green https://circleci.com/gh/dulmandakh/react-native/507
Closes #19845

Differential Revision: D8675341

Pulled By: hramos

fbshipit-source-id: 4ed06cd7ef7ae70f153d7f335ef8a9d1371f6ce0
  • Loading branch information
dulmandakh authored and facebook-github-bot committed Jun 28, 2018
1 parent 5017b86 commit 0a3055d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 5 additions & 5 deletions local-cli/templates/HelloWorld/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false

android {
compileSdkVersion 26
buildToolsVersion "26.0.3"
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
applicationId "com.helloworld"
minSdkVersion 16
targetSdkVersion 22
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
ndk {
Expand Down Expand Up @@ -138,7 +138,7 @@ android {

dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:26.1.0"
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
compile "com.facebook.react:react-native:+" // From node_modules
}

Expand Down
8 changes: 8 additions & 0 deletions local-cli/templates/HelloWorld/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ allprojects {
}
}
}

ext {
buildToolsVersion = "26.0.3"
minSdkVersion = 16
compileSdkVersion = 26
targetSdkVersion = 26
supportLibVersion = "26.1.0"
}

0 comments on commit 0a3055d

Please sign in to comment.