Skip to content

Commit

Permalink
Merge branch 'mwcore-dev' into 69-questmalawi-core-android-app-hapi-f…
Browse files Browse the repository at this point in the history
…hir-update-to-v619
  • Loading branch information
calmwalija authored Jun 25, 2024
2 parents a050b93 + acbc015 commit de2ce39
Show file tree
Hide file tree
Showing 336 changed files with 8,133 additions and 15,710 deletions.
45 changes: 21 additions & 24 deletions .github/workflows/apk-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,36 +62,33 @@ jobs:
env:
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}

- name: Spotless check quest application
run: ./gradlew :quest:spotlessCheck
working-directory: android
# - name: Spotless check quest application
# run: ./gradlew :quest:spotlessCheck
# working-directory: android

- name: Generate AAB (Android App Bundle) file
if: ${{ false }}
run: ./gradlew :quest:bundle${{steps.product-flavor.outputs.idCapitalized}} -x :quest:test${{steps.product-flavor.outputs.idCapitalized}}DebugUnitTest --stacktrace
working-directory: android
# - name: Generate AAB (Android App Bundle) file
# if: ${{ false }}
# run: ./gradlew :quest:bundle${{steps.product-flavor.outputs.idCapitalized}} -x :quest:test${{steps.product-flavor.outputs.idCapitalized}}DebugUnitTest --stacktrace
# working-directory: android

- name: Upload AAB file to tag assets
if: ${{ false }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: android/quest/build/outputs/bundle/${{steps.product-flavor.outputs.id}}/release/quest-${{steps.product-flavor.outputs.id}}-release.aab
asset_name: "quest-$tag.aab"
tag: ${{ github.ref }}
overwrite: true
# - name: Upload AAB file to tag assets
# if: ${{ false }}
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: android/quest/build/outputs/bundle/${{steps.product-flavor.outputs.id}}/release/quest-${{steps.product-flavor.outputs.id}}-release.aab
# asset_name: "quest-$tag.aab"
# tag: ${{ github.ref }}
# overwrite: true

- name: Generate APK (Android App PacKage) file
run: ./gradlew :quest:assemble${{steps.product-flavor.outputs.idCapitalized}} -x :quest:test${{steps.product-flavor.outputs.idCapitalized}}DebugUnitTest --stacktrace
working-directory: android

- name: Upload APK file to tag assets
uses: svenstaro/upload-release-action@v2
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: android/quest/build/outputs/apk/${{steps.product-flavor.outputs.id}}/release/quest-${{steps.product-flavor.outputs.id}}-release.apk
asset_name: "quest-$tag.apk"
tag: ${{ github.ref }}
prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') }}
overwrite: true

appId: ${{secrets.FIREBASE_APP_ID}}
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
groups: dev
file: android/quest/build/outputs/apk/${{steps.product-flavor.outputs.id}}/release/quest-${{steps.product-flavor.outputs.id}}-release.apk
48 changes: 32 additions & 16 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,49 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent

buildscript {
repositories {
google()
maven(url = "https://plugins.gradle.org/m2/")
maven(url = "https://oss.sonatype.org/content/repositories/snapshots/")
}

dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22")
classpath("org.jetbrains.kotlin:kotlin-serialization:1.8.22")
classpath("com.google.dagger:hilt-android-gradle-plugin:2.45")
classpath(Deps.spotless)
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.24")
classpath(Deps.kotlin_coveralls_plugin)
classpath(Deps.dokka_plugin)
classpath("com.android.tools.build:gradle:8.2.2")
classpath("com.google.gms:google-services:4.3.14")
classpath("com.google.firebase:perf-plugin:1.4.2")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.5")
classpath(Deps.dokka_plugin)
}
}

plugins {
id("org.jetbrains.kotlin.jvm") version "1.9.24"
id("com.github.kt3k.coveralls") version "2.12.2"
id("org.jetbrains.kotlin.plugin.serialization") version "1.8.10"
id("com.google.dagger.hilt.android") version Deps.versions.hiltVersion apply false
id("androidx.navigation.safeargs.kotlin") version "2.5.3" apply false
id("org.jetbrains.dokka") version "1.8.20"
id("com.diffplug.spotless") version "6.25.0" apply false
id("de.mannodermaus.android-junit5") version "1.9.3.0" apply false
id("com.google.gms.google-services") version "4.3.14" apply false
id("com.google.firebase.firebase-perf") version "1.4.2" apply false
id("com.google.firebase.crashlytics") version "2.9.5"
id("com.google.firebase.appdistribution") version "5.0.0" apply false
}

allprojects {
repositories {
mavenLocal()
gradlePluginPortal()
mavenLocal()
google()
mavenCentral()
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
maven(url = "https://jcenter.bintray.com/")
ProjectProperties.readProperties("local.properties")
.takeIf { it.getProperty("dtreeRepositoryUsername") != null && it.getProperty("dtreeRepositoryPassword") != null }
?.let {
maven {
url = uri("https://maven.pkg.github.com/d-tree-org/android-fhir")
name = "dtreeRepository"
credentials {
username = it["dtreeRepositoryUsername"]?.toString()
password = it["dtreeRepositoryPassword"]?.toString()
}
}
}
maven {
name = "fhirsdk"
url = uri("/Users/ndegwamartin/.m2.dev/fhirsdk")
Expand All @@ -42,7 +58,7 @@ allprojects {
subprojects {
apply {
plugin("com.diffplug.spotless")
plugin( "jacoco")
plugin("jacoco")
}

configure<SpotlessExtension> {
Expand Down
2 changes: 1 addition & 1 deletion android/buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ object Dependencies {
HapiFhir.validationDstu3Module to { version { strictly(Versions.hapiFhir) } },
HapiFhir.validationR4Module to { version { strictly(Versions.hapiFhir) } },
HapiFhir.validationR5Module to { version { strictly(Versions.hapiFhir) } },
Jackson.annotationsBase to { version { strictly(Versions.jackson) } },
Jackson.annotationsBase to { version { strictly(Versions.jackson) } },
Jackson.bomBase to { version { strictly(Versions.jackson) } },
Jackson.coreBase to { version { strictly(Versions.jacksonCore) } },
Jackson.databindBase to { version { strictly(Versions.jackson) } },
Expand Down
16 changes: 8 additions & 8 deletions android/buildSrc/src/main/kotlin/Deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

object Deps {
object sdk_versions {
const val compile_sdk = 33
const val compile_sdk = 34
const val min_sdk = 26
const val target_sdk = 33
const val target_sdk = 34
}

const val build_tool_version = "30.0.3"
Expand All @@ -23,7 +23,7 @@ object Deps {
const val atsl_runner = "1.5.2"
const val caffeine = "2.9.0"
const val constraint_layout = "1.1.3"
const val coroutines = "1.7.3"
const val coroutines = "1.8.1"
const val core = "1.7.0"
const val cql_engine = "1.3.14-SNAPSHOT"
const val desugar = "2.0.4"
Expand All @@ -32,7 +32,7 @@ object Deps {
const val guava = "28.2-android"
const val hapi_r4 = "5.3.0"
const val junit5_api = "5.9.3"
const val kotlin = "1.8.22"
const val kotlin = "1.9.24"
const val lifecycle = "2.2.0"
const val material = "1.5.0"
const val okhttp_logging_interceptor = "4.0.0"
Expand All @@ -42,20 +42,20 @@ object Deps {
const val room = "2.4.2"
const val spotless = "6.25.0"
const val truth = "1.0.1"
const val work = "2.7.1"
const val work = "2.9.0"
const val json_tools = "1.13"
const val kotlin_coveralls = "2.12.2"
const val jacoco_tool = "0.8.11"
const val ktlint = "0.41.0"
const val joda_time = "2.10.5"
const val timber = "4.7.1"
const val mockk = "1.13.5"
const val dokka = "1.5.0"
const val dokka = "1.8.20"
const val androidx_test = "2.2.0"
const val accompanist_swiperefresh = "0.26.4-beta"
const val compose = "1.4.3"
const val hiltVersion = "2.45"
const val hiltWorkerVersion ="1.0.0"
const val hiltVersion = "2.51"
const val hiltWorkerVersion ="1.2.0"
}

const val activity = "androidx.activity:activity:${versions.activity}"
Expand Down
19 changes: 19 additions & 0 deletions android/buildSrc/src/main/kotlin/Properties.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import java.io.File
import java.io.FileInputStream
import java.io.InputStreamReader
import java.util.Properties

object ProjectProperties {
fun readProperties(file: String): Properties {
val properties = Properties()
val localProperties = File(file)
if (localProperties.isFile) {
InputStreamReader(FileInputStream(localProperties), Charsets.UTF_8).use { reader
->
properties.load(reader)
}
} else println("\u001B[34mFILE_NOT_FOUND_EXCEPTION: File $file not found\u001B[0m")

return properties
}
}
32 changes: 5 additions & 27 deletions android/buildSrc/src/main/kotlin/fhir-properties.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,45 +1,23 @@
import org.gradle.api.Project
import org.gradle.kotlin.dsl.extra
import java.io.File
import java.io.FileInputStream
import java.io.FileNotFoundException
import java.io.InputStreamReader
import java.util.Properties

val fhirAuthArray = arrayOf(
"FHIR_BASE_URL", "OAUTH_BASE_URL", "OAUTH_CIENT_ID", "OAUTH_CLIENT_SECRET", "OAUTH_SCOPE"
"FHIR_BASE_URL", "OAUTH_BASE_URL", "OAUTH_CIENT_ID", "OAUTH_CLIENT_SECRET", "OAUTH_SCOPE", "APP_ID"
)
//KEYSTORE CREDENTIALS
val keystoreAuthArray = arrayOf(
"KEYSTORE_ALIAS", "KEY_PASSWORD", "KEYSTORE_PASSWORD"
)

val localProperties = readProperties((properties["localPropertiesFile"] ?: "${rootProject.projectDir}/local.properties").toString())
val localProperties = ProjectProperties.readProperties((properties["localPropertiesFile"] ?: "${rootProject.projectDir}/local.properties").toString())

fhirAuthArray.forEach { property ->
extra.set(property, localProperties.getProperty(property, when {
property.contains("URL") -> "https://sample.url/fhir/"
else -> "sample_" + property
else -> "sample_$property"
}
))
}


val keystoreProperties = readProperties((properties["keystorePropertiesFile"] ?: "${rootProject.projectDir}/keystore.properties").toString())
val keystoreProperties = ProjectProperties.readProperties((properties["keystorePropertiesFile"] ?: "${rootProject.projectDir}/keystore.properties").toString())

keystoreAuthArray.forEach { property ->
extra.set(property, keystoreProperties.getProperty(property, "sample_" + property))
}

fun Project.readProperties(file: String): Properties {
val properties = Properties()
val localProperties = File(file)
if (localProperties.isFile) {
InputStreamReader(FileInputStream(localProperties), Charsets.UTF_8).use { reader
->
properties.load(reader)
}
} else println("\u001B[34mFILE_NOT_FOUND_EXCEPTION: File $file not found\u001B[0m")

return properties
extra.set(property, keystoreProperties.getProperty(property, "sample_$property"))
}
Loading

0 comments on commit de2ce39

Please sign in to comment.