Skip to content

Commit e5bc421

Browse files
committed
update the gradle config from master
1 parent efcb803 commit e5bc421

File tree

1 file changed

+50
-4
lines changed

1 file changed

+50
-4
lines changed

android/app/build.gradle

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ import com.android.build.OutputFile
3333
* // bundleInPaidRelease: true,
3434
* // bundleInBeta: true,
3535
*
36+
* // whether to disable dev mode in custom build variants (by default only disabled in release)
37+
* // for example: to disable dev mode in the staging build type (if configured)
38+
* devDisabledInStaging: true,
39+
* // The configuration property can be in the following formats
40+
* // 'devDisabledIn${productFlavor}${buildType}'
41+
* // 'devDisabledIn${buildType}'
42+
*
3643
* // the root of your project, i.e. where "package.json" lives
3744
* root: "../../",
3845
*
@@ -58,7 +65,7 @@ import com.android.build.OutputFile
5865
* inputExcludes: ["android/**", "ios/**"],
5966
*
6067
* // override which node gets called and with what additional arguments
61-
* nodeExecutableAndArgs: ["node"]
68+
* nodeExecutableAndArgs: ["node"],
6269
*
6370
* // supply additional arguments to the packager
6471
* extraPackagerArgs: []
@@ -80,7 +87,7 @@ apply from: "../../node_modules/react-native/react.gradle"
8087
* Upload all the APKs to the Play Store and people will download
8188
* the correct one based on the CPU architecture of their device.
8289
*/
83-
def enableSeparateBuildPerCPUArchitecture = false
90+
def enableSeparateBuildPerCPUArchitecture = true
8491

8592
/**
8693
* Run Proguard to shrink the Java bytecode in release builds.
@@ -94,9 +101,9 @@ android {
94101
defaultConfig {
95102
applicationId "com.allaboutolaf"
96103
minSdkVersion 16
97-
targetSdkVersion 25
104+
targetSdkVersion 23
98105
versionCode 1
99-
versionName "2.2.5-rc.3"
106+
versionName "1.0.0"
100107
ndk {
101108
abiFilters "armeabi-v7a", "x86"
102109
}
@@ -107,6 +114,10 @@ android {
107114
gmaps_key: System.getenv("GMAPS_KEY") ?: "",
108115
]
109116
}
117+
signingConfigs {
118+
// the signingConfig is configured below
119+
release
120+
}
110121
splits {
111122
abi {
112123
reset()
@@ -119,6 +130,7 @@ android {
119130
release {
120131
minifyEnabled enableProguardInReleaseBuilds
121132
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
133+
signingConfig signingConfigs.release
122134
}
123135
}
124136
// applicationVariants are e.g. debug, release
@@ -142,6 +154,40 @@ android {
142154
}
143155
}
144156

157+
// borrowed from https://gist.github.com/gabrielemariotti/6856974
158+
def propFile = new File('android/app//signing.properties')
159+
if (propFile.canRead()) {
160+
def Properties props = new Properties()
161+
props.load(new FileInputStream(propFile))
162+
if (props != null
163+
&& props.containsKey('STORE_FILE')
164+
&& props.containsKey('STORE_PASSWORD')
165+
&& props.containsKey('KEY_ALIAS')
166+
&& props.containsKey('KEY_PASSWORD')
167+
) {
168+
logger.info 'android/app/signing.properties is fully functional.'
169+
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
170+
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
171+
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
172+
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
173+
} else {
174+
println 'android/app/signing.properties found, but some entries are missing.'
175+
if (props == null) {
176+
logger.warn '`props` was null'
177+
} else {
178+
logger.warn "has STORE_FILE: ${props.containsKey('STORE_FILE')}"
179+
logger.warn "has STORE_PASSWORD: ${props.containsKey('STORE_PASSWORD')}"
180+
logger.warn "has KEY_ALIAS: ${props.containsKey('KEY_ALIAS')}"
181+
logger.warn "has KEY_PASSWORD: ${props.containsKey('KEY_PASSWORD')}"
182+
}
183+
android.buildTypes.release.signingConfig = null
184+
}
185+
} else {
186+
logger.warn 'android/app/signing.properties not found.'
187+
logger.warn "cwd: ${new File(".").absolutePath}"
188+
android.buildTypes.release.signingConfig = null
189+
}
190+
145191
dependencies {
146192
// please keep this list sorted
147193
compile project(':bugsnag-react-native')

0 commit comments

Comments
 (0)