Skip to content

Commit

Permalink
Merge pull request #109 from CrisisCleanup/pull-refresh
Browse files Browse the repository at this point in the history
Pull refresh
  • Loading branch information
hueachilles authored Apr 5, 2024
2 parents ac780de + 6fc9ddd commit 100d230
Show file tree
Hide file tree
Showing 99 changed files with 1,577 additions and 1,606 deletions.
41 changes: 15 additions & 26 deletions app-sandbox/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import com.google.samples.apps.nowinandroid.NiaBuildType

plugins {
id("nowinandroid.android.application")
id("nowinandroid.android.application.compose")
id("nowinandroid.android.application.flavors")
id("nowinandroid.android.hilt")
alias(libs.plugins.nowinandroid.android.application)
alias(libs.plugins.nowinandroid.android.application.compose)
alias(libs.plugins.nowinandroid.android.application.flavors)
alias(libs.plugins.nowinandroid.android.hilt)
}

android {
Expand Down Expand Up @@ -36,22 +36,16 @@ android {
}

dependencies {
implementation(project(":feature:caseeditor"))
implementation(projects.feature.caseeditor)

implementation(project(":core:appnav"))
implementation(project(":core:common"))
implementation(project(":core:commoncase"))
implementation(project(":core:data"))
implementation(project(":core:designsystem"))
implementation(project(":core:network"))
implementation(project(":core:model"))
implementation(project(":core:ui"))

androidTestImplementation(libs.androidx.navigation.testing)
androidTestImplementation(libs.accompanist.testharness)
androidTestImplementation(kotlin("test"))
debugImplementation(libs.androidx.compose.ui.testManifest)
debugImplementation(project(":ui-test-hilt-manifest"))
implementation(projects.core.appnav)
implementation(projects.core.common)
implementation(projects.core.commoncase)
implementation(projects.core.data)
implementation(projects.core.designsystem)
implementation(projects.core.network)
implementation(projects.core.model)
implementation(projects.core.ui)

implementation(libs.kotlinx.serialization.json)

Expand All @@ -75,11 +69,6 @@ dependencies {
implementation(libs.playservices.maps)
}

// androidx.test is forcing JUnit, 4.12. This forces it to use 4.13
configurations.configureEach {
resolutionStrategy {
force(libs.junit4)
// Temporary workaround for https://issuetracker.google.com/174733673
force("org.objenesis:objenesis:2.6")
}
dependencyGuard {
configuration("releaseRuntimeClasspath")
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ class AppSyncer @Inject constructor() : SyncPuller, SyncPusher {

override fun scheduleSyncWorksitesFull() {}

override suspend fun pullIncidents() {}

override fun appPullIncident(id: Long) {}

override suspend fun syncPullIncidentAsync(id: Long) =
Expand Down
54 changes: 27 additions & 27 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {

android {
defaultConfig {
val buildVersion = 192
val buildVersion = 193
applicationId = "com.crisiscleanup"
versionCode = buildVersion
versionName = "0.9.${buildVersion - 168}"
Expand Down Expand Up @@ -106,36 +106,36 @@ androidComponents {
}

dependencies {
implementation(project(":feature:authentication"))
implementation(project(":feature:caseeditor"))
implementation(project(":feature:cases"))
implementation(project(":feature:dashboard"))
implementation(project(":feature:menu"))
implementation(project(":feature:mediamanage"))
implementation(project(":feature:organizationmanage"))
implementation(project(":feature:syncinsights"))
implementation(project(":feature:team"))
implementation(project(":feature:userfeedback"))

implementation(project(":core:appnav"))
implementation(project(":core:common"))
implementation(project(":core:data"))
implementation(project(":core:designsystem"))
implementation(project(":core:model"))
implementation(project(":core:network"))
implementation(project(":core:ui"))

implementation(project(":sync:work"))

androidTestImplementation(project(":core:testing"))
androidTestImplementation(project(":core:datastore-test"))
androidTestImplementation(project(":core:data-test"))
androidTestImplementation(project(":core:network"))
implementation(projects.feature.authentication)
implementation(projects.feature.caseeditor)
implementation(projects.feature.cases)
implementation(projects.feature.dashboard)
implementation(projects.feature.menu)
implementation(projects.feature.mediamanage)
implementation(projects.feature.organizationmanage)
implementation(projects.feature.syncinsights)
implementation(projects.feature.team)
implementation(projects.feature.userfeedback)

implementation(projects.core.appnav)
implementation(projects.core.common)
implementation(projects.core.data)
implementation(projects.core.designsystem)
implementation(projects.core.model)
implementation(projects.core.network)
implementation(projects.core.ui)

implementation(projects.sync.work)

androidTestImplementation(projects.core.testing)
androidTestImplementation(projects.core.dataTest)
androidTestImplementation(projects.core.datastoreTest)
androidTestImplementation(projects.core.network)
androidTestImplementation(libs.androidx.navigation.testing)
androidTestImplementation(libs.accompanist.testharness)
androidTestImplementation(kotlin("test"))
debugImplementation(libs.androidx.compose.ui.testManifest)
debugImplementation(project(":ui-test-hilt-manifest"))
debugImplementation(projects.uiTestHiltManifest)

implementation(libs.kotlinx.serialization.json)

Expand Down
14 changes: 14 additions & 0 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,20 @@ tasks.withType<KotlinCompile>().configureEach {

dependencies {
compileOnly(libs.android.gradlePlugin)
compileOnly(libs.android.tools.common)
compileOnly(libs.firebase.crashlytics.gradlePlugin)
compileOnly(libs.firebase.performance.gradlePlugin)
compileOnly(libs.kotlin.gradlePlugin)
compileOnly(libs.ksp.gradlePlugin)
compileOnly(libs.room.gradlePlugin)
implementation(libs.truth)
}

tasks {
validatePlugins {
enableStricterValidation = true
failOnWarning = true
}
}

gradlePlugin {
Expand Down Expand Up @@ -92,6 +102,10 @@ gradlePlugin {
id = "nowinandroid.android.application.flavors"
implementationClass = "AndroidApplicationFlavorsConventionPlugin"
}
register("androidLint") {
id = "nowinandroid.android.lint"
implementationClass = "AndroidLintConventionPlugin"
}
register("jvmLibrary") {
id = "nowinandroid.jvm.library"
implementationClass = "JvmLibraryConventionPlugin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ class AndroidApplicationComposeConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
pluginManager.apply("com.android.application")

val extension = extensions.getByType<ApplicationExtension>()
configureAndroidCompose(extension)
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,39 @@

import com.android.build.api.dsl.ApplicationExtension
import com.android.build.api.variant.ApplicationAndroidComponentsExtension
import com.android.build.gradle.BaseExtension
import com.google.samples.apps.nowinandroid.DefaultConfigTargetSdk
import com.google.samples.apps.nowinandroid.configureBadgingTasks
import com.google.samples.apps.nowinandroid.configureGradleManagedDevices
import com.google.samples.apps.nowinandroid.configureKotlinAndroid
import com.google.samples.apps.nowinandroid.configurePrintApksTask
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.getByType

class AndroidApplicationConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("com.android.application")
apply("org.jetbrains.kotlin.android")
apply("nowinandroid.android.lint")
apply("com.dropbox.dependency-guard")
}

extensions.configure<ApplicationExtension> {
configureKotlinAndroid(this)
defaultConfig.targetSdk = DefaultConfigTargetSdk
@Suppress("UnstableApiUsage")
testOptions.animationsDisabled = true
configureGradleManagedDevices(this)
}
extensions.configure<ApplicationAndroidComponentsExtension> {
configurePrintApksTask(this)
configureBadgingTasks(extensions.getByType<BaseExtension>(), this)
}
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,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 @@ -35,31 +34,31 @@ class AndroidFeatureConventionPlugin : Plugin<Project> {
testInstrumentationRunner =
"com.crisiscleanup.core.testing.CrisisCleanupTestRunner"
}
testOptions.animationsDisabled = true
configureGradleManagedDevices(this)
}

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

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

add("implementation", libs.findLibrary("coil.kt").get())
add("implementation", libs.findLibrary("coil.kt.compose").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("androidx.tracing.ktx").get())

add("implementation", libs.findLibrary("kotlinx.coroutines.android").get())
add(
"androidTestImplementation",
libs.findLibrary("androidx.lifecycle.runtimeTesting").get(),
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,16 @@ class AndroidHiltConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("com.google.devtools.ksp")
apply("dagger.hilt.android.plugin")
// KAPT must go last to avoid build warnings.
// See: https://stackoverflow.com/questions/70550883/warning-the-following-options-were-not-recognized-by-any-processor-dagger-f
apply("org.jetbrains.kotlin.kapt")
}

dependencies {
"implementation"(libs.findLibrary("hilt.android").get())
"kapt"(libs.findLibrary("hilt.compiler").get())
"kaptAndroidTest"(libs.findLibrary("hilt.compiler").get())
"ksp"(libs.findLibrary("hilt.compiler").get())
}

}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@ import com.android.build.gradle.LibraryExtension
import com.google.samples.apps.nowinandroid.configureAndroidCompose
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType
import org.gradle.kotlin.dsl.kotlin

class AndroidLibraryComposeConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
pluginManager.apply("com.android.library")

val extension = extensions.getByType<LibraryExtension>()
configureAndroidCompose(extension)
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,28 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
with(pluginManager) {
apply("com.android.library")
apply("org.jetbrains.kotlin.android")
apply("nowinandroid.android.lint")
}

extensions.configure<LibraryExtension> {
configureKotlinAndroid(this)
defaultConfig.targetSdk = DefaultConfigTargetSdk
testOptions.animationsDisabled = true
configureFlavors(this)
configureGradleManagedDevices(this)
// The resource prefix is derived from the module name,
// so resources inside ":core:module1" must be prefixed with "core_module1_"
resourcePrefix = path.split("""\W""".toRegex()).drop(1).distinct().joinToString(separator = "_").lowercase() + "_"
}
extensions.configure<LibraryAndroidComponentsExtension> {
configurePrintApksTask(this)
disableUnnecessaryAndroidTests(target)
}
configurations.configureEach {
resolutionStrategy {
force(libs.findLibrary("junit4").get())
// Temporary workaround for https://issuetracker.google.com/174733673
force("org.objenesis:objenesis:2.6")
}
}
dependencies {
add("androidTestImplementation", kotlin("test"))
add("testImplementation", kotlin("test"))

add("implementation", libs.findLibrary("androidx.tracing.ktx").get())
}
}
}
}
}
Loading

0 comments on commit 100d230

Please sign in to comment.