Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce overall build complexity #108

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 30 additions & 33 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
alias(libs.plugins.at.android.application.compose)
alias(libs.plugins.at.android.application.flavors)
alias(libs.plugins.at.android.hilt)
alias(libs.plugins.roborazzi)
}

android {
Expand Down Expand Up @@ -69,56 +70,52 @@ android {
}

dependencies {
implementation(projects.feature.contactme)
implementation(projects.feature.home)
implementation(projects.feature.login)
implementation(projects.feature.teacherschedule)
implementation(projects.feature.home)
implementation(projects.feature.contactme)

implementation(projects.core.designsystem)
implementation(projects.core.common)
implementation(projects.core.data)
implementation(projects.core.model)
implementation(projects.core.datastore)
implementation(projects.core.designsystem)
implementation(projects.core.model)

androidTestImplementation(projects.core.designsystem)
androidTestImplementation(projects.core.datastoreTest)
androidTestImplementation(projects.core.testing)

androidTestImplementation(libs.androidx.navigation.testing)
androidTestImplementation(libs.accompanist.testharness)

testImplementation(projects.core.datastoreTest)
testImplementation(projects.core.testing)

testImplementation(libs.androidx.navigation.testing)
testImplementation(libs.accompanist.testharness)

debugImplementation(projects.uiTestHiltManifest)

debugImplementation(libs.androidx.compose.ui.testManifest)

kspTest(libs.hilt.compiler)

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.activity.compose)

implementation(libs.androidx.core.ktx)
// Splashscreen
implementation(libs.androidx.core.splashscreen)
// Write trace events to the system trace buffer.
implementation(libs.androidx.tracing.ktx)
// LifeCycle
implementation(libs.androidx.lifecycle.livedata.ktx)
implementation(libs.androidx.lifecycle.runtimeCompose)

// WindowSizeClass
implementation(libs.androidx.compose.material3.windowSizeClass)
// Navigation
implementation(libs.androidx.hilt.navigation.compose)
implementation(libs.androidx.navigation.compose)

// Coroutines
implementation(libs.kotlinx.coroutines.android)

// Splashscreen
implementation(libs.androidx.core.splashscreen)

// Timber
implementation(libs.timber)

debugImplementation(projects.uiTestHiltManifest)
// LeakCanary
debugImplementation(libs.leakcanary)
debugImplementation(libs.androidx.compose.ui.testManifest)

kspTest(libs.hilt.compiler)

testImplementation(projects.core.datastoreTest)
testImplementation(projects.core.testing)
testImplementation(libs.accompanist.testharness)
testImplementation(libs.hilt.android.testing)

testDemoImplementation(libs.robolectric)
testDemoImplementation(libs.roborazzi)

androidTestImplementation(projects.core.datastoreTest)
androidTestImplementation(projects.core.testing)
androidTestImplementation(libs.accompanist.testharness)
androidTestImplementation(libs.androidx.navigation.testing)
androidTestImplementation(libs.hilt.android.testing)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ class AndroidApplicationComposeConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
pluginManager.apply("com.android.application")
// Screenshot Tests
pluginManager.apply("io.github.takahirom.roborazzi")

val extension = extensions.getByType<ApplicationExtension>()
configureAndroidCompose(extension)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.kotlin

class AndroidFeatureConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
Expand All @@ -24,28 +23,11 @@ class AndroidFeatureConventionPlugin : Plugin<Project> {
}

dependencies {
add("implementation", project(":core:network"))
add("implementation", project(":core:common"))
add("implementation", project(":core:designsystem"))
add("implementation", project(":core:data"))
add("implementation", project(":core:model"))
add("implementation", project(":core:domain"))

add("testImplementation", kotlin("test"))
add("testImplementation", project(":core:testing"))
add("androidTestImplementation", kotlin("test"))
add("androidTestImplementation", project(":core:testing"))
add("androidTestImplementation", project(":core:designsystem"))

add("implementation", libs.findLibrary("coil.kt").get())
add("implementation", libs.findLibrary("coil.kt.compose").get())
add("implementation", libs.findLibrary("coil.kt.svg").get())

add("implementation", libs.findLibrary("androidx.hilt.navigation.compose").get())
add("implementation", libs.findLibrary("androidx.lifecycle.runtimeCompose").get())
add("implementation", libs.findLibrary("androidx.lifecycle.viewModelCompose").get())

add("implementation", libs.findLibrary("kotlinx.coroutines.android").get())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ class AndroidLibraryComposeConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
pluginManager.apply("com.android.library")
// Screenshot Tests
pluginManager.apply("io.github.takahirom.roborazzi")

val extension = extensions.getByType<LibraryExtension>()
configureAndroidCompose(extension)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
}
dependencies {
add("testImplementation", kotlin("test"))
add("testImplementation", project(":core:testing"))
add("androidTestImplementation", kotlin("test"))
add("androidTestImplementation", project(":core:testing"))

// Timber
add("implementation", libs.findLibrary("timber").get())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ internal fun Project.configureAndroidCompose(commonExtension: CommonExtension<*,
val bom = libs.findLibrary("androidx-compose-bom").get()
add("implementation", platform(bom))
add("androidTestImplementation", platform(bom))
// Add ComponentActivity to debug manifest
add("debugImplementation", libs.findLibrary("androidx.compose.ui.testManifest").get())
// Screenshot Tests on JVM
add("testImplementation", libs.findLibrary("robolectric").get())
add("testImplementation", libs.findLibrary("roborazzi").get())
}

testOptions {
Expand Down
7 changes: 6 additions & 1 deletion core/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ android {
dependencies {
// LifeCycle
implementation(libs.androidx.lifecycle.runtimeCompose)

// Coroutines
implementation(libs.kotlinx.coroutines.android)

testImplementation(projects.core.testing)
// For flow test
testImplementation(libs.turbine)

androidTestImplementation(projects.core.testing)
}
7 changes: 2 additions & 5 deletions core/datastore-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ android {
}

dependencies {
api(projects.core.datastore)
implementation(projects.core.testing)
implementation(projects.core.common)
implementation(projects.core.model)

implementation(projects.core.datastore)
implementation(libs.hilt.android.testing)
// DataStore
implementation(libs.androidx.datastore)

// Protobuf
implementation(libs.protobuf.kotlin.lite)
}
2 changes: 0 additions & 2 deletions core/datastore/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ dependencies {
api(projects.core.model)

implementation(projects.core.common)

// DataStore
implementation(libs.androidx.datastore)

// Protobuf
implementation(libs.protobuf.kotlin.lite)
}
27 changes: 13 additions & 14 deletions core/designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
alias(libs.plugins.at.android.library)
alias(libs.plugins.at.android.library.compose)
alias(libs.plugins.at.android.hilt)
alias(libs.plugins.roborazzi)
}

android {
Expand All @@ -15,11 +16,8 @@ android {
dependencies {
androidTestImplementation(projects.core.testing)

// Write trace events to the system trace buffer.
api(libs.androidx.tracing.ktx)
// Material Design 3
api(libs.androidx.compose.material3)
api(libs.androidx.compose.material3.windowSizeClass)
api(libs.androidx.compose.material.iconsExtended)
// main APIs for the underlying toolkit systems,
// such as input and measurement/layout
Expand All @@ -29,23 +27,24 @@ dependencies {
api(libs.androidx.compose.runtime)
// Android Studio Preview support
api(libs.androidx.compose.ui.tooling.preview)
api(libs.androidx.compose.ui.tooling)
// Optional - Integration with window
api(libs.androidx.window)
// Optional - Integration with LiveData
api(libs.androidx.compose.runtime.livedata)
// Optional - accompanist adaptive
api(libs.accompanist.adaptive)

implementation(libs.androidx.core.ktx)
// Optional - Integration with activities
implementation(libs.androidx.activity.compose)
// Optional - Integration with browser
implementation(libs.androidx.browser)
debugApi(libs.androidx.compose.ui.tooling)

// Coil
implementation(libs.coil.kt)
implementation(libs.coil.kt.compose)
implementation(libs.coil.kt.svg)
// kotlin datetime
implementation(libs.kotlinx.datetime)

testImplementation(libs.androidx.compose.ui.test)
testImplementation(libs.accompanist.testharness)
testImplementation(libs.hilt.android.testing)
testImplementation(libs.robolectric)
testImplementation(libs.roborazzi)
testImplementation(projects.core.testing)

androidTestImplementation(libs.androidx.compose.ui.test)
androidTestImplementation(projects.core.testing)
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import kotlin.contracts.contract
* Information about the posture of the device
*/
sealed interface DevicePosture {
object NormalPosture : DevicePosture
data object NormalPosture : DevicePosture

data class TableTopPosture(
val hingePosition: Rect,
Expand Down
2 changes: 2 additions & 0 deletions core/domain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ android {
dependencies {
api(projects.core.data)
api(projects.core.model)

testImplementation(projects.core.testing)
}
7 changes: 2 additions & 5 deletions core/network/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,12 @@ dependencies {
api(projects.core.common)
api(projects.core.model)

// KotlinxSerializationJson
implementation(libs.kotlinx.serialization.json)
// Okhttp Interceptor
implementation(libs.okhttp.logging)

// Retrofit2
implementation(libs.retrofit.core)

// RetrofitKotlinxSerializationJson
implementation(libs.retrofit.kotlin.serialization)

// KotlinxSerializationJson
implementation(libs.kotlinx.serialization.json)
}
28 changes: 11 additions & 17 deletions core/testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,25 @@ android {
}

dependencies {
api(projects.core.data)
api(projects.core.model)

api(libs.junit4)
api(libs.androidx.activity.compose)
api(kotlin("test"))
api(libs.androidx.compose.ui.test)
api(libs.androidx.test.espresso.core)
api(libs.androidx.test.core)
api(libs.androidx.test.runner)
// testharness
api(libs.accompanist.testharness)
// Coroutines test
api(libs.kotlinx.coroutines.test)
api(libs.hilt.android.testing)
// Google truth
api(libs.google.truth)
// For flow test
api(libs.turbine)
// Android Unit Testing Framework
api(libs.robolectric.shadows)
// For screenshot tests
api(libs.roborazzi)
api(projects.core.data)
api(projects.core.model)

debugApi(libs.androidx.compose.ui.testManifest)

// testharness
implementation(libs.accompanist.testharness)
implementation(libs.androidx.activity.compose)
implementation(libs.hilt.android.testing)
// Coroutines test
implementation(libs.kotlinx.coroutines.test)
// Android Unit Testing Framework
implementation(libs.robolectric.shadows)
implementation(projects.core.common)
implementation(projects.core.designsystem)
}
7 changes: 6 additions & 1 deletion feature/contactme/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ android {
}

dependencies {
}
implementation(projects.core.data)

testImplementation(projects.core.testing)

androidTestImplementation(projects.core.testing)
}
7 changes: 6 additions & 1 deletion feature/home/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ android {
}

dependencies {
}
implementation(projects.core.data)

testImplementation(projects.core.testing)

androidTestImplementation(projects.core.testing)
}
7 changes: 6 additions & 1 deletion feature/login/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ android {
}

dependencies {
}
implementation(projects.core.data)

testImplementation(projects.core.testing)

androidTestImplementation(projects.core.testing)
}
8 changes: 7 additions & 1 deletion feature/teacherschedule/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,10 @@ android {
}

dependencies {
}
implementation(projects.core.data)
implementation(projects.core.domain)

testImplementation(projects.core.testing)

androidTestImplementation(projects.core.testing)
}
Loading
Loading