Skip to content

Commit 4bb5bed

Browse files
Migrate microbenchmark build files to kts
1 parent 167e16a commit 4bb5bed

13 files changed

Lines changed: 227 additions & 189 deletions

File tree

MicrobenchmarkSample/app/build.gradle

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
plugins {
2+
id("com.android.application")
3+
id("kotlin-android")
4+
}
5+
6+
android {
7+
namespace = "com.example.app"
8+
compileSdk = 33
9+
10+
defaultConfig {
11+
applicationId = "com.example.app"
12+
minSdk = 21
13+
targetSdk = 33
14+
versionCode = 1
15+
versionName = "1.0"
16+
17+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18+
}
19+
20+
buildTypes {
21+
getByName("release") {
22+
isMinifyEnabled = true
23+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
24+
}
25+
}
26+
compileOptions {
27+
sourceCompatibility = JavaVersion.VERSION_11
28+
targetCompatibility = JavaVersion.VERSION_11
29+
}
30+
kotlinOptions {
31+
jvmTarget = "11"
32+
}
33+
}
34+
35+
dependencies {
36+
implementation(project(":benchmarkable"))
37+
38+
implementation(libs.appcompat)
39+
implementation(libs.core)
40+
implementation(libs.material)
41+
42+
androidTestImplementation(libs.espresso)
43+
androidTestImplementation(libs.test.ext)
44+
45+
testImplementation(libs.junit)
46+
}

MicrobenchmarkSample/app/proguard-rules.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Add project specific ProGuard rules here.
22
# You can control the set of applied configuration files using the
3-
# proguardFiles setting in build.gradle.
3+
# proguardFiles setting in build.gradle.kts.
44
#
55
# For more details, see
66
# http://developer.android.com/guide/developing/tools/proguard.html

MicrobenchmarkSample/benchmarkable/build.gradle

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
plugins {
2+
id("com.android.library")
3+
id("kotlin-android")
4+
}
5+
6+
android {
7+
compileSdk = 33
8+
namespace = "com.example.benchmark.ui"
9+
10+
defaultConfig {
11+
minSdk = 21
12+
targetSdk = 33
13+
}
14+
15+
kotlinOptions {
16+
jvmTarget = "11"
17+
}
18+
}
19+
20+
dependencies {
21+
22+
implementation(libs.appcompat)
23+
implementation(libs.cardview)
24+
implementation(libs.constraintlayout)
25+
implementation(libs.kotlin.stdlib)
26+
implementation(libs.recyclerview)
27+
28+
androidTestImplementation(libs.espresso)
29+
androidTestImplementation(libs.test.ext)
30+
androidTestImplementation(libs.test.runner)
31+
32+
testImplementation(libs.junit)
33+
}

MicrobenchmarkSample/benchmarkable/proguard-rules.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Add project specific ProGuard rules here.
22
# You can control the set of applied configuration files using the
3-
# proguardFiles setting in build.gradle.
3+
# proguardFiles setting in build.gradle.kts.
44
#
55
# For more details, see
66
# http://developer.android.com/guide/developing/tools/proguard.html

MicrobenchmarkSample/build.gradle

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
plugins {
4+
alias(libs.plugins.application) apply false
5+
alias(libs.plugins.benchmark) apply false
6+
alias(libs.plugins.library) apply false
7+
alias(libs.plugins.test) apply false
8+
alias(libs.plugins.kotlin) apply false
9+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[versions]
2+
agp = "7.3.1"
3+
appcompat = "1.5.1"
4+
benchmark = "1.1.0"
5+
cardView = "1.0.0"
6+
constraintLayout = "2.1.4"
7+
core = "1.9.0"
8+
kotlin = "1.7.10"
9+
material = "1.6.1"
10+
recyclerView = "1.2.1"
11+
12+
androidxTest = "1.4.0"
13+
espressoCore = "3.4.0"
14+
jUnit = "4.13.2"
15+
testExt = "1.1.3"
16+
17+
[libraries]
18+
19+
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
20+
benchmark = { group = "androidx.benchmark", name = "benchmark-junit4", version.ref = "benchmark" }
21+
benchmark-junit = { group = "androidx.benchmark", name = "benchmark-macro-junit4", version.ref = "benchmark" }
22+
cardview = { group = "androidx.cardview", name = "cardview", version.ref = "cardView" }
23+
constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintLayout" }
24+
core = { group = "androidx.core", name = "core-ktx", version.ref = "core" }
25+
espresso = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
26+
junit = { group = "junit", name = "junit", version.ref = "jUnit" }
27+
kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" }
28+
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
29+
recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version.ref = "recyclerView" }
30+
test-ext = { group = "androidx.test.ext", name = "junit", version.ref = "testExt" }
31+
test-rules = { group = "androidx.test", name = "rules", version.ref = "androidxTest" }
32+
test-runner = { group = "androidx.test", name = "runner", version.ref = "androidxTest" }
33+
34+
[plugins]
35+
36+
application = { id = "com.android.application", version.ref = "agp" }
37+
benchmark = { id = "androidx.benchmark", version.ref = "benchmark" }
38+
library = { id = "com.android.library", version.ref = "agp" }
39+
test = { id = "com.android.test", version.ref = "agp" }
40+
kotlin = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }

MicrobenchmarkSample/microbenchmark/build.gradle

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)