Skip to content

Commit 3a29ef3

Browse files
committed
refactor: versions
1 parent f321f08 commit 3a29ef3

4 files changed

Lines changed: 57 additions & 39 deletions

File tree

MicrobenchmarkSample/app/build.gradle

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ plugins {
55

66
android {
77
namespace 'com.example.app'
8-
compileSdk 32
8+
compileSdk rootProject.compileSdkVersion
99

1010
defaultConfig {
1111
applicationId "com.example.app"
12-
minSdk 21
13-
targetSdk 32
12+
minSdk rootProject.minSdkVersion
13+
targetSdk rootProject.targetSdkVersion
1414
versionCode 1
1515
versionName "1.0"
1616

@@ -35,10 +35,10 @@ android {
3535
dependencies {
3636
implementation project(':benchmarkable')
3737

38-
implementation 'androidx.core:core-ktx:1.7.0'
39-
implementation 'androidx.appcompat:appcompat:1.4.1'
40-
implementation 'com.google.android.material:material:1.5.0'
41-
testImplementation 'junit:junit:4.13.2'
42-
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
43-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
38+
implementation "androidx.core:core-ktx:$coreVersion"
39+
implementation "androidx.appcompat:appcompat:$appcompatVersion"
40+
implementation "com.google.android.material:material:$materialVersion"
41+
testImplementation "junit:junit:$jUnitVersion"
42+
androidTestImplementation "androidx.test.ext:junit:$testExtVersion"
43+
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoCoreVersion"
4444
}

MicrobenchmarkSample/benchmarkable/build.gradle

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33

44
android {
5-
compileSdkVersion 31
5+
compileSdk rootProject.compileSdkVersion
66
namespace 'com.example.benchmark.ui'
77

88
defaultConfig {
9-
minSdkVersion 14
10-
targetSdkVersion 31
9+
minSdk rootProject.minSdkVersion
10+
targetSdk rootProject.targetSdkVersion
1111
}
1212

1313
kotlinOptions {
@@ -18,14 +18,14 @@ android {
1818
dependencies {
1919
implementation fileTree(dir: 'libs', include: ['*.jar'])
2020

21-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
22-
implementation 'androidx.appcompat:appcompat:1.4.1'
23-
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
24-
implementation 'androidx.cardview:cardview:1.0.0'
25-
implementation 'androidx.recyclerview:recyclerview:1.2.1'
21+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
22+
implementation "androidx.appcompat:appcompat:$appcompatVersion"
23+
implementation "androidx.constraintlayout:constraintlayout:$constraintLayoutVersion"
24+
implementation "androidx.cardview:cardview:$cardViewVersion"
25+
implementation "androidx.recyclerview:recyclerview:$recyclerViewVersion"
2626

27-
testImplementation 'junit:junit:4.13.2'
28-
androidTestImplementation 'androidx.test:runner:1.4.0'
29-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
30-
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
27+
testImplementation "junit:junit:$jUnitVersion"
28+
androidTestImplementation "androidx.test:runner:$androidxTestVersion"
29+
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoCoreVersion"
30+
androidTestImplementation "androidx.test.ext:junit:$testExtVersion"
3131
}

MicrobenchmarkSample/build.gradle

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.6.10'
5-
ext.benchmark_version = "1.1.0-beta01"
4+
ext {
5+
agpVersion = '7.1.2'
6+
targetSdkVersion = 31
7+
minSdkVersion = 21
8+
compileSdkVersion = 31
9+
10+
benchmarkVersion = "1.1.0-beta06"
11+
kotlinVersion = '1.6.20'
12+
coreVersion = '1.7.0'
13+
appcompatVersion = '1.4.1'
14+
materialVersion = '1.5.0'
15+
constraintLayoutVersion = '2.1.3'
16+
cardViewVersion = '1.0.0'
17+
recyclerViewVersion = '1.2.1'
18+
19+
jUnitVersion = '4.13.2'
20+
androidxTestVersion = '1.4.0'
21+
testExtVersion = '1.1.3'
22+
espressoCoreVersion = '3.4.0'
23+
}
624

725
repositories {
826
google()
@@ -12,10 +30,10 @@ buildscript {
1230
// [START root_classpath]
1331
dependencies {
1432
// [START_EXCLUDE]
15-
classpath 'com.android.tools.build:gradle:7.1.2'
16-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
33+
classpath "com.android.tools.build:gradle:$agpVersion"
34+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
1735
// [END_EXCLUDE]
18-
classpath "androidx.benchmark:benchmark-gradle-plugin:$benchmark_version"
36+
classpath "androidx.benchmark:benchmark-gradle-plugin:$benchmarkVersion"
1937
}
2038
// [END root_classpath]
2139
}

MicrobenchmarkSample/microbenchmark/build.gradle

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ apply plugin: 'androidx.benchmark'
55
// [END benchmark_apply_plugin]
66

77
android {
8-
compileSdkVersion 31
8+
compileSdk rootProject.compileSdkVersion
99

1010
defaultConfig {
11-
minSdkVersion 14
12-
targetSdkVersion 31
11+
minSdk rootProject.minSdkVersion
12+
targetSdk rootProject.targetSdkVersion
1313

1414
// Set this argument to capture profiling information, instead of measuring performance.
1515
// Can be one of:
@@ -40,23 +40,23 @@ android {
4040

4141
// [START benchmark_dependency]
4242
dependencies {
43-
androidTestImplementation "androidx.benchmark:benchmark-junit4:$benchmark_version"
43+
androidTestImplementation "androidx.benchmark:benchmark-junit4:$benchmarkVersion"
4444
androidTestImplementation project(':benchmarkable')
4545
// [START_EXCLUDE]
4646
implementation fileTree(dir: 'libs', include: ['*.jar'])
4747

48-
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
49-
androidTestImplementation 'junit:junit:4.13.2'
48+
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
49+
androidTestImplementation "junit:junit:$jUnitVersion"
5050

51-
androidTestImplementation 'androidx.test:runner:1.4.0'
52-
androidTestImplementation 'androidx.test:rules:1.4.0'
53-
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
51+
androidTestImplementation "androidx.test:runner:$androidxTestVersion"
52+
androidTestImplementation "androidx.test:rules:$androidxTestVersion"
53+
androidTestImplementation "androidx.test.ext:junit:$testExtVersion"
5454

5555
// duplicate the dependencies of ui module here, to ensure we have the same versions
56-
androidTestImplementation 'androidx.appcompat:appcompat:1.4.1'
57-
androidTestImplementation 'androidx.constraintlayout:constraintlayout:2.1.3'
58-
androidTestImplementation 'androidx.cardview:cardview:1.0.0'
59-
androidTestImplementation 'androidx.recyclerview:recyclerview:1.2.1'
56+
androidTestImplementation "androidx.appcompat:appcompat:$appcompatVersion"
57+
androidTestImplementation "androidx.constraintlayout:constraintlayout:$constraintLayoutVersion"
58+
androidTestImplementation "androidx.cardview:cardview:$cardViewVersion"
59+
androidTestImplementation "androidx.recyclerview:recyclerview:$recyclerViewVersion"
6060
// [END_EXCLUDE]
6161
}
6262
// [END benchmark_dependency]

0 commit comments

Comments
 (0)