Skip to content

Commit 176e8c7

Browse files
Merge branch 'android-source+L'
2 parents 00b54d1 + 720b0a1 commit 176e8c7

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

app/build.gradle

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ android {
66

77
defaultConfig {
88
applicationId "com.google.android.testdpc"
9-
minSdkVersion 'MNC'
10-
targetSdkVersion 'MNC'
9+
minSdkVersion 21
10+
targetSdkVersion 21
1111
versionCode 1
1212
versionName "1.0"
1313
}
@@ -21,6 +21,23 @@ android {
2121
sourceCompatibility JavaVersion.VERSION_1_7
2222
targetCompatibility JavaVersion.VERSION_1_7
2323
}
24+
25+
/* TODO: remove once release version of M sdk is released */
26+
def minVersion = defaultConfig.getMinSdkVersion().getApiString()
27+
def targetVersion = defaultConfig.getTargetSdkVersion().getApiString()
28+
applicationVariants.all { variant ->
29+
variant.outputs.each { output ->
30+
output.processManifest.doLast {
31+
def manifestOutFile = output.processManifest.manifestOutputFile
32+
def newFileContents = manifestOutFile.getText('UTF-8').
33+
replace('android:minSdkVersion="MNC"',
34+
'android:minSdkVersion="' + minVersion + '"')
35+
newFileContents = newFileContents.replace('android:targetSdkVersion="MNC"',
36+
'android:targetSdkVersion="' + targetVersion + '"')
37+
manifestOutFile.write(newFileContents, 'UTF-8')
38+
}
39+
}
40+
}
2441
}
2542

2643
dependencies {

0 commit comments

Comments
 (0)