Skip to content
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
816c726
Add dependencyUpdates task
grzesiek2010 Jul 8, 2026
8c7f5d4
Update gradle
grzesiek2010 Jul 8, 2026
95f4f15
Update dependencies
grzesiek2010 Jul 8, 2026
cba7fa1
Update pmd
grzesiek2010 Jul 8, 2026
46aa4b6
Update compileSdk
grzesiek2010 Jul 8, 2026
e4afd21
Update CircleCI image
grzesiek2010 Jul 8, 2026
9851c88
Remove duplicated material-icons-extended entry from version catalog
grzesiek2010 Jul 8, 2026
2dfaa1c
Remove redundant kotlin-stdlib dependency declarations
grzesiek2010 Jul 8, 2026
83a3208
Remove dead fileTree dependencies
grzesiek2010 Jul 8, 2026
72553ff
Remove duplicated mlkit-barcodescanning dependency
grzesiek2010 Jul 8, 2026
0383d1c
Remove unused dependencies
grzesiek2010 Jul 8, 2026
956efc6
Remove redundant transitive = true configuration
grzesiek2010 Jul 8, 2026
d0e0e8d
Remove unused KSP plugin declarations
grzesiek2010 Jul 9, 2026
9f6f57a
Remove redundant repositories block
grzesiek2010 Jul 9, 2026
fb0ff80
Remove redundant test dependencies
grzesiek2010 Jul 9, 2026
23e09b5
Fix typo and use val instead of var in build scripts
grzesiek2010 Jul 9, 2026
3677adf
Remove obsolete dependency force rules
grzesiek2010 Jul 9, 2026
31a0fa7
Update bikram sambat
grzesiek2010 Jul 9, 2026
a56b72c
Update checkstyle
grzesiek2010 Jul 9, 2026
53ef689
Convert root build script to Kotlin DSL
grzesiek2010 Jul 9, 2026
23bbab5
Pin Robolectric SDK for modules missing robolectric.properties
grzesiek2010 Jul 9, 2026
8fdff40
Fix ktlint violations
grzesiek2010 Jul 10, 2026
4281443
Add dependency locking
grzesiek2010 Jul 13, 2026
fb26935
Fix location request test for play-services-location 21.4.0
grzesiek2010 Jul 14, 2026
a095230
Simplify dependencyUpdates task setup
grzesiek2010 Jul 21, 2026
f6a4b80
Bump Robolectric SDK to 36
grzesiek2010 Jul 21, 2026
a28e8c3
Document dependencyUpdates task in README
grzesiek2010 Jul 21, 2026
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
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ references:
android_config_small: &android_config_small
working_directory: ~/work
docker:
- image: cimg/android:2026.02
- image: cimg/android:2026.07
resource_class: small

android_config: &android_config
working_directory: ~/work
docker:
- image: cimg/android:2026.02
- image: cimg/android:2026.07
resource_class: large

android_config_large: &android_config_large
working_directory: ~/work
docker:
- image: cimg/android:2026.02
- image: cimg/android:2026.07
resource_class: xlarge

gcloud_config: &gcloud_config
Expand Down
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ ktlint_standard_binary-expression-wrapping = disabled
ktlint_standard_condition-wrapping = disabled
ktlint_standard_function-literal = disabled
ktlint_standard_backing-property-naming = disabled
ktlint_standard_blank-line-between-when-conditions = disabled
ktlint_standard_when-entry-bracing = disabled
ktlint_function_naming_ignore_when_annotated_with = Composable
ktlint_standard_no-unused-imports=enabled
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ robolectric-deps/

.local-m2
apks

# Empty side effect of writing dependency locks
settings-gradle.lockfile
1 change: 0 additions & 1 deletion analytics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ android {
}

dependencies {
implementation(libs.kotlinStdlib)
implementation(libs.androidxCoreKtx)
implementation(libs.firebaseCrashlytics)
implementation(libs.firebaseAnalytics)
Expand Down
2 changes: 0 additions & 2 deletions androidshared/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
alias(libs.plugins.androidLibrary)
alias(libs.plugins.kotlinKsp)
alias(libs.plugins.composeCompiler)
}

Expand Down Expand Up @@ -45,7 +44,6 @@ dependencies {
implementation(project(":strings"))
implementation(project(":shared"))
implementation(project(":async"))
implementation(libs.kotlinStdlib)
implementation(libs.androidxCoreKtx)
implementation(libs.androidxLifecycleLivedataKtx)
implementation(libs.androidMaterial)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ import androidx.core.os.BundleCompat

inline fun <reified T : Parcelable> Bundle.getParcelableCompat(name: String): T? {
return BundleCompat.getParcelable(this, name, T::class.java)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ object TamperDetector {
return false
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ object EdgeToEdge {
0
}

view.translationY = -maxOf(windowInsets.keyboardSafeOffset(), anchorOffset).toFloat()
view.translationY = -maxOf(windowInsets.keyboardSafeOffset(), anchorOffset).toFloat()
}
windowInsets
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ fun marginSmall(): Dp {
@Composable
fun marginExtraSmall(): Dp {
return dimensionResource(id = dimen.margin_extra_small)
}
}
2 changes: 1 addition & 1 deletion androidtest/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies {
implementation(libs.androidxTestEspressoIntents)
implementation(libs.timber)
implementation(libs.kotlinxCoroutinesTest)
var composeBom = platform(libs.androidxComposeBom)
val composeBom = platform(libs.androidxComposeBom)
implementation(composeBom)
implementation(libs.androidXComposeUiTestJunit4)

Expand Down
2 changes: 0 additions & 2 deletions async/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ android {
dependencies {
coreLibraryDesugaring(libs.desugar)

implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation(libs.kotlinStdlib)
implementation(libs.androidxCoreKtx)
implementation(libs.kotlinxCoroutinesAndroid)
implementation(libs.androidxWorkRuntime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ object SchedulerBuilder {
override fun <T> flowOnBackground(flow: Flow<T>): Flow<T> {
return taskRunner.flowOnBackground(flow)
}

}
}
}
1 change: 1 addition & 0 deletions async/src/test/resources/robolectric.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sdk=33

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably bump the Robolectric target SDK up right?

2 changes: 0 additions & 2 deletions audio-clips/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ android {
dependencies {
coreLibraryDesugaring(libs.desugar)

implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation(project(":androidshared"))
implementation(project(":async"))
implementation(libs.androidxActivity)
implementation(libs.kotlinStdlib)
implementation(libs.androidxCoreKtx)
implementation(libs.androidxLifecycleViewmodelKtx)
implementation(libs.androidxLifecycleLivedataKtx)
Expand Down
2 changes: 0 additions & 2 deletions audio-recorder/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ android {
dependencies {
coreLibraryDesugaring(libs.desugar)

implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation(project(":icons"))
implementation(project(":strings"))
implementation(project(":async"))
implementation(project(":androidshared"))
implementation(libs.kotlinStdlib)
implementation(libs.androidxCoreKtx)
implementation(libs.androidxAppcompat)
implementation(libs.androidxLifecycleLivedataKtx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ import dagger.BindsInstance
import dagger.Component
import dagger.Module
import dagger.Provides
import kotlinx.coroutines.Dispatchers
import org.odk.collect.androidshared.utils.UniqueIdGenerator
import org.odk.collect.async.coroutines.CoroutineTaskRunner
import org.odk.collect.async.Scheduler
import org.odk.collect.async.SchedulerBuilder
import org.odk.collect.audiorecorder.mediarecorder.AACRecordingResource
import org.odk.collect.audiorecorder.mediarecorder.AMRRecordingResource
import org.odk.collect.audiorecorder.recorder.Output
Expand Down
115 changes: 0 additions & 115 deletions build.gradle

This file was deleted.

120 changes: 120 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

apply(from = "secrets.gradle")

@Suppress("UNCHECKED_CAST")
fun getSecrets(): java.util.Properties =
(extra["getSecrets"] as groovy.lang.Closure<*>).call() as java.util.Properties

buildscript {
repositories {
google()

mavenCentral()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}

dependencies {
classpath(libs.gradle)
classpath(libs.googleServices)
classpath(libs.firebaseCrashlyticsGradle)
classpath(libs.kotlinGradlePlugin)
classpath(libs.ktlintGradle)
classpath(libs.gradleVersionsPlugin)
classpath(libs.navigationSafeArgsGradlePlugin)
classpath(libs.ossLicensesPlugin)
}
}

allprojects {
repositories {
maven {
url = uri("$rootDir/.local-m2/")
metadataSources {
mavenPom()
artifact() // Supports artifact only dependencies like those from medicmobile repo
}
}

// Needs to go first to get specialty libraries https://stackoverflow.com/a/48438866/137744
google()

mavenLocal() // Only used for javarosa_local dependency
mavenCentral()

maven { url = uri("https://central.sonatype.com/repository/maven-snapshots") }
maven { url = uri("https://jitpack.io") }
maven {
url = uri("https://staging.dev.medicmobile.org/_couch/maven-repo")
metadataSources { artifact() }
}

maven {
url = uri("https://api.mapbox.com/downloads/v2/releases/maven")
authentication {
create<BasicAuthentication>("basic")
}
credentials {
username = "mapbox"
password = getSecrets().getProperty("MAPBOX_DOWNLOADS_TOKEN", "")
}
}
}

tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
freeCompilerArgs.set(listOf("-Xjvm-default=all"))
jvmTarget.set(JvmTarget.JVM_17)
}
}
}

apply(from = "config/dependency_updates.gradle")

tasks.register<GradleBuild>("checkCode") {
tasks = listOf("pmd", "ktlintCheck", "checkstyle", "lintDebug")
}

// Create local Maven repo from cached Gradle dependencies
tasks.register<Sync>("cacheToMavenLocal") {
from(File(gradle.gradleUserHomeDir, "caches/modules-2/files-2.1"))
into("$rootDir/.local-m2")

duplicatesStrategy = DuplicatesStrategy.INCLUDE

// Convert from Gradle cache to Maven format
eachFile {
val parts = path.split("/")
path = parts[0].replace(".", "/") +
"/" + parts[1] +
"/" + parts[2] +
"/" + parts[4]
}

includeEmptyDirs = false
}

tasks.register<Exec>("testLab") {
dependsOn("collect_app:assembleDebug", "collect_app:assembleDebugAndroidTest")

executable = "gcloud"
args = listOf(
"beta", "firebase", "test", "android", "run",
"--type", "instrumentation",
"--num-uniform-shards=25",
"--app", "collect_app/build/outputs/apk/debug/ODK-Collect-debug.apk",
"--test", "collect_app/build/outputs/apk/androidTest/debug/ODK-Collect-debug-androidTest.apk",
"--device", "model=MediumPhone.arm,version=34,locale=en,orientation=portrait",
"--timeout", "15m",
"--directories-to-pull", "/sdcard",
"--test-targets", "notPackage org.odk.collect.android.regression",
"--test-targets", "notPackage org.odk.collect.android.benchmark"
)
}

tasks.register("releaseCheck") {
dependsOn("testLab", "collect_app:assembleOdkCollectRelease")
}
Loading