diff --git a/android/build.gradle.kts b/android/build.gradle.kts index 7a27c04503..81758b3e57 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -14,6 +14,7 @@ buildscript { } plugins { + `project-properties` alias(libs.plugins.org.jetbrains.kotlin.jvm) alias(libs.plugins.kt3k.coveralls) alias(libs.plugins.kotlin.serialization) @@ -23,7 +24,6 @@ plugins { alias(libs.plugins.org.owasp.dependencycheck) alias(libs.plugins.com.diffplug.spotless) apply false alias(libs.plugins.android.junit5) apply false - } tasks.dokkaHtmlMultiModule { @@ -42,13 +42,17 @@ allprojects { google() mavenCentral() maven(url = "https://oss.sonatype.org/content/repositories/snapshots") + maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots") maven(url = "https://jcenter.bintray.com/") apply(plugin = "org.owasp.dependencycheck") tasks.dependencyCheckAggregate{ dependencyCheck.formats.add("XML") } - configurations.all{ - resolutionStrategy.force ("com.google.android.gms:play-services-location:19.0.1") + maven { + url = uri("https://api.mapbox.com/downloads/v2/releases/maven") + credentials.username = "mapbox" + credentials.password = System.getenv("MAPBOX_SDK_TOKEN") ?: property("MAPBOX_SDK_TOKEN").toString() + authentication.create("basic") } } } diff --git a/android/geowidget/build.gradle.kts b/android/geowidget/build.gradle.kts index 0ad95063d1..a0fbe9fabc 100644 --- a/android/geowidget/build.gradle.kts +++ b/android/geowidget/build.gradle.kts @@ -20,7 +20,11 @@ android { defaultConfig { minSdk = BuildConfigs.minSdk - buildConfigField("String", "MAPBOX_SDK_TOKEN", """"${project.extra["MAPBOX_SDK_TOKEN"]}"""") + buildConfigField( + "String", + "MAPBOX_SDK_TOKEN", + System.getenv("MAPBOX_SDK_TOKEN") ?: """"${project.extra["MAPBOX_SDK_TOKEN"]}"""", + ) testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") diff --git a/android/geowidget/src/main/java/org/smartregister/fhircore/geowidget/screens/GeoWidgetFragment.kt b/android/geowidget/src/main/java/org/smartregister/fhircore/geowidget/screens/GeoWidgetFragment.kt index e7c2f59587..aa3f804477 100644 --- a/android/geowidget/src/main/java/org/smartregister/fhircore/geowidget/screens/GeoWidgetFragment.kt +++ b/android/geowidget/src/main/java/org/smartregister/fhircore/geowidget/screens/GeoWidgetFragment.kt @@ -91,7 +91,9 @@ class GeoWidgetFragment : Fragment() { savedInstanceState: Bundle?, ): View { Mapbox.getInstance(requireContext(), BuildConfig.MAPBOX_SDK_TOKEN) - return setupViews() + val view = setupViews() + mapView.onCreate(savedInstanceState) + return view } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/android/gradle/libs.versions.toml b/android/gradle/libs.versions.toml index 552f6126ca..32fc125f18 100644 --- a/android/gradle/libs.versions.toml +++ b/android/gradle/libs.versions.toml @@ -41,7 +41,7 @@ knowledge = "0.1.0-alpha03-preview5-SNAPSHOT" kotlin = "1.9.22" kotlinx-coroutines = "1.7.3" kotlinx-serialization-json = "1.6.0" -kujaku-library = "0.9.0" +kujaku-library = "0.10.2-SNAPSHOT" ktlint = "0.50.0" leakcanary-android = "2.10" lifecycle= "2.7.0" @@ -148,7 +148,7 @@ kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx- ktlint-main = { group = "com.pinterest", name = "ktlint", version.ref = "ktlint"} ktlint-cli-ruleset = { group = "com.pinterest.ktlint", name = "ktlint-cli-ruleset-core", version.ref = "ktlint" } ktlint-rule-engine-core = { group = "com.pinterest.ktlint", name = "ktlint-rule-engine-core", version.ref = "ktlint" } -kujaku-library = { group = "io.ona.kujaku", name = "library", version.ref = "kujaku-library" } +kujaku-library = { group = "io.ona.kujaku", name ="library", version.ref = "kujaku-library" } leakcanary-android = { group = "com.squareup.leakcanary", name = "leakcanary-android", version.ref = "leakcanary-android" } lifecycle-livedata-ktx = { group = "androidx.lifecycle", name = "lifecycle-livedata-ktx", version.ref = "lifecycle" } lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle" }