Skip to content

Commit

Permalink
chore: Standardise build.gradle.kts
Browse files Browse the repository at this point in the history
Resolves: 10696
  • Loading branch information
ThomasIent committed Dec 11, 2024
1 parent a272fc7 commit 367a591
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 48 deletions.
41 changes: 21 additions & 20 deletions components/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ android {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildFeatures {
compose = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}

buildTypes {
release {
isMinifyEnabled = false
Expand Down Expand Up @@ -80,24 +91,13 @@ android {
isIncludeAndroidResources = true
}
}

buildFeatures {
compose = true
}
}

dependencies {
val composeBom = platform(libs.androidx.compose.bom)
androidTestImplementation(composeBom)
implementation(composeBom)

androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.androidx.compose.ui.junit4)
androidTestImplementation(libs.androidx.compose.ui.testmanifest)
androidTestImplementation(libs.androidx.test.espresso.core)

androidTestUtil(libs.androidx.test.orchestrator)

implementation(libs.androidx.activity.compose)
implementation(libs.appcompat)
implementation(libs.material)
Expand All @@ -107,17 +107,18 @@ dependencies {
implementation(libs.androidx.compose.ui.tooling)
implementation(libs.androidx.constraintlayout)
implementation(libs.core.ktx)

implementation(project(":theme"))

listOf(
libs.arch.core,
libs.hilt.android.testing,
libs.junit,
libs.mockito.kotlin
).forEach { testDependency ->
testImplementation(testDependency)
}
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.androidx.compose.ui.junit4)
androidTestImplementation(libs.androidx.compose.ui.testmanifest)
androidTestImplementation(libs.androidx.test.espresso.core)
androidTestUtil(libs.androidx.test.orchestrator)

testImplementation(libs.arch.core)
testImplementation(libs.hilt.android.testing)
testImplementation(libs.junit)
testImplementation(libs.mockito.kotlin)
}

mavenPublishingConfig {
Expand Down
23 changes: 13 additions & 10 deletions pages/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ android {
buildFeatures {
compose = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}

buildTypes {
release {
Expand Down Expand Up @@ -66,6 +73,7 @@ android {
xmlReport = true
}

@Suppress("UnstableApiUsage")
testOptions {
execution = "ANDROIDX_TEST_ORCHESTRATOR"
animationsDisabled = true
Expand Down Expand Up @@ -102,17 +110,12 @@ dependencies {
androidTestImplementation(libs.androidx.compose.ui.junit4)
androidTestImplementation(libs.androidx.compose.ui.testmanifest)
androidTestImplementation(libs.androidx.test.espresso.core)

listOf(
libs.arch.core,
libs.hilt.android.testing,
libs.junit,
libs.mockito.kotlin
).forEach { testDependency ->
testImplementation(testDependency)
}

androidTestUtil(libs.androidx.test.orchestrator)

testImplementation(libs.arch.core)
testImplementation(libs.hilt.android.testing)
testImplementation(libs.junit)
testImplementation(libs.mockito.kotlin)
}

mavenPublishingConfig {
Expand Down
29 changes: 11 additions & 18 deletions theme/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ android {
buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = (
rootProject.extra["composeKotlinCompilerVersion"] as String
)
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}

buildTypes {
Expand Down Expand Up @@ -70,6 +71,7 @@ android {
xmlReport = true
}

@Suppress("UnstableApiUsage")
testOptions {
execution = "ANDROIDX_TEST_ORCHESTRATOR"
animationsDisabled = true
Expand All @@ -88,10 +90,6 @@ android {
isIncludeAndroidResources = true
}
}

buildFeatures {
compose = true
}
}

dependencies {
Expand All @@ -112,17 +110,12 @@ dependencies {
androidTestImplementation(libs.androidx.compose.ui.junit4)
androidTestImplementation(libs.androidx.compose.ui.testmanifest)
androidTestImplementation(libs.androidx.test.espresso.core)

androidTestUtil(libs.androidx.test.orchestrator)

listOf(
libs.arch.core,
libs.hilt.android.testing,
libs.junit.jupiter,
libs.mockito.kotlin
).forEach { testDependency ->
testImplementation(testDependency)
}
testImplementation(libs.arch.core)
testImplementation(libs.hilt.android.testing)
testImplementation(libs.junit.jupiter)
testImplementation(libs.mockito.kotlin)
testImplementation(platform(libs.junit.bom))
}

Expand Down

0 comments on commit 367a591

Please sign in to comment.