Skip to content

Commit 0a3055d

Browse files
dulmandakhfacebook-github-bot
authored andcommitted
gradle to set project-wide properties (#19845)
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
1 parent 5017b86 commit 0a3055d

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

local-cli/templates/HelloWorld/android/app/build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ def enableSeparateBuildPerCPUArchitecture = false
9494
def enableProguardInReleaseBuilds = false
9595

9696
android {
97-
compileSdkVersion 26
98-
buildToolsVersion "26.0.3"
97+
compileSdkVersion rootProject.ext.compileSdkVersion
98+
buildToolsVersion rootProject.ext.buildToolsVersion
9999

100100
defaultConfig {
101101
applicationId "com.helloworld"
102-
minSdkVersion 16
103-
targetSdkVersion 22
102+
minSdkVersion rootProject.ext.minSdkVersion
103+
targetSdkVersion rootProject.ext.targetSdkVersion
104104
versionCode 1
105105
versionName "1.0"
106106
ndk {
@@ -138,7 +138,7 @@ android {
138138

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

local-cli/templates/HelloWorld/android/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,11 @@ allprojects {
3030
}
3131
}
3232
}
33+
34+
ext {
35+
buildToolsVersion = "26.0.3"
36+
minSdkVersion = 16
37+
compileSdkVersion = 26
38+
targetSdkVersion = 26
39+
supportLibVersion = "26.1.0"
40+
}

0 commit comments

Comments
 (0)