Skip to content

Commit

Permalink
Merge pull request #2092 from dhis2/version-1.9.1
Browse files Browse the repository at this point in the history
fix: [VERSION-1.9.1] Patch release 1.9.1
  • Loading branch information
vgarciabnz authored Jan 29, 2024
2 parents 2cd5a13 + 90badb7 commit ac711cf
Show file tree
Hide file tree
Showing 120 changed files with 2,348 additions and 1,263 deletions.
12 changes: 5 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType

buildscript {
val kotlinVersion = "1.9.10"

repositories {
google()
mavenLocal()
Expand All @@ -11,15 +9,15 @@ buildscript {
}

dependencies {
classpath("com.android.tools.build:gradle:8.1.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
classpath("org.jlleitschuh.gradle:ktlint-gradle:11.5.1")
classpath("org.jacoco:org.jacoco.core:0.8.10")
classpath(libs.gradle)
classpath(libs.kotlin)
classpath(libs.ktlint)
classpath(libs.jacoco)
}
}

plugins {
id("org.sonarqube") version "3.3"
alias(libs.plugins.sonarqube)
}

sonarqube {
Expand Down
163 changes: 60 additions & 103 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@

plugins {
id("com.android.library")
id("com.google.devtools.ksp") version "1.9.10-1.0.13"
id("com.google.devtools.ksp") version "${libs.versions.kotlin.get()}-1.0.16"
id("kotlin-android")
id("kotlin-kapt")
id("io.gitlab.arturbosch.detekt") version "1.21.0"
id("org.jetbrains.dokka") version "1.8.20" apply false
alias(libs.plugins.detekt)
alias(libs.plugins.dokka) apply false
}

apply(from = project.file("plugins/android-checkstyle.gradle"))
Expand All @@ -45,60 +45,15 @@ repositories {
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
}

val _targetSdkVersion = 34
val _minSdkVersion = 21
val VERSION_CODE: String by project
val VERSION_NAME: String by project

/*
** Libraries
*/
val libraryDesugaring = "2.0.3"

// android
val annotation = "1.6.0"
val paging = "2.1.2"

// java
val jackson = "2.13.4"
val autoValue = "1.10.2"
val autoValueCursor = "2.0.1"
val retrofit = "2.9.0"
val okHttp = "4.10.0"
val rxJava = "2.2.21"
val rxAndroid = "2.1.1"
val sqlCipher = "4.4.3"
val smsCompression = "0.2.0"
val expressionParser = "1.0.33"

// Kotlin
val kotlinxDatetime = "0.4.0"
val coroutines = "1.6.4"
val koin = "3.5.0"
val koinKsp = "1.3.0"

// test dependencies
val coreTesting = "2.2.0"
val jUnit = "4.13.2"
val mockito = "3.4.6"
val mockitoKotlin = "2.2.0"
val truth = "1.1.3"
val testRunner = "1.5.2"
val testRules = "1.5.0"
val equalsVerifier = "3.14"
val flipper = "0.83.0"
val soloader = "0.10.5"
val liveDataTesting = "1.3.0"

// open id
val appauth = "0.8.1"

android {
compileSdk = _targetSdkVersion
compileSdk = libs.versions.targetSdkVersion.get().toInt()

defaultConfig {
minSdk = _minSdkVersion
targetSdk = _targetSdkVersion
minSdk = libs.versions.minSdkVersion.get().toInt()
targetSdk = libs.versions.targetSdkVersion.get().toInt()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled = true
vectorDrawables.useSupportLibrary = true
Expand Down Expand Up @@ -153,96 +108,98 @@ android {
}

namespace = "org.hisp.dhis.android"
buildFeatures {
buildConfig = true
}
}

dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:$libraryDesugaring")

coreLibraryDesugaring(libs.desugaring)

// RxJava
api("io.reactivex.rxjava2:rxjava:$rxJava")
api("io.reactivex.rxjava2:rxandroid:$rxAndroid")
api(libs.rx.java)
api(libs.rx.android)

// AndroidX
api("androidx.annotation:annotation:$annotation")
api("androidx.paging:paging-runtime:$paging")
api(libs.androidx.annotation)
api(libs.androidx.paging)

// Auto Value
api("com.google.auto.value:auto-value-annotations:$autoValue")
kapt("com.google.auto.value:auto-value:$autoValue")
api(libs.google.auto.value.annotation)
kapt(libs.google.auto.value)

// Koin
implementation("io.insert-koin:koin-core:$koin")
implementation("io.insert-koin:koin-annotations:$koinKsp")
ksp("io.insert-koin:koin-ksp-compiler:$koinKsp")
implementation(libs.koin.core)
implementation(libs.koin.annotations)
ksp(libs.koin.compiler)

// Jackson
api("com.fasterxml.jackson.core:jackson-databind:$jackson")
api("com.fasterxml.jackson.module:jackson-module-kotlin:$jackson")
api(libs.jackson.core)
api(libs.jackson.kotlin)

// Square libraries
api("com.squareup.okhttp3:okhttp:$okHttp")
api("com.squareup.retrofit2:retrofit:$retrofit")
api("com.squareup.retrofit2:converter-jackson:$retrofit")
api("com.squareup.retrofit2:adapter-rxjava2:$retrofit")
api(libs.okhttp)
api(libs.okhttp.mockwebserver)
api(libs.retrofit.core)
api(libs.retrofit.jackson)
api(libs.retrofit.rxjava2)

// Kotlin
api("org.jetbrains.kotlinx:kotlinx-datetime:$kotlinxDatetime")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines")
api("org.jetbrains.kotlinx:kotlinx-coroutines-rx2:$coroutines")

// sms compression library
api("com.github.dhis2:sms-compression:$smsCompression")
api(libs.kotlinx.datetime)
api(libs.kotlinx.coroutines.core)
api(libs.kotlinx.coroutines.rx2)

// DHIS 2 antlr expression parser
api("org.hisp.dhis.parser:dhis-antlr-expression-parser:$expressionParser")
// DHIS2 libraries
api(libs.dhis2.compression)
api(libs.dhis2.antlr.parser)

// Extension which generates mappers for work with cursor and content values
api("com.gabrielittner.auto.value:auto-value-cursor-annotations:$autoValueCursor")
kapt("com.gabrielittner.auto.value:auto-value-cursor:$autoValueCursor")
api(libs.auto.value.cursor.annotations)
kapt(libs.auto.value.cursor)

api("net.zetetic:android-database-sqlcipher:$sqlCipher")
api(libs.sqlcipher)
// From SQLCipher 4.5.5, it depends on androidx.sqlite:sqlite
api(libs.sqlite)

api("com.squareup.okhttp3:mockwebserver:$okHttp")
implementation(libs.openid.appauth)
implementation(libs.listenablefuture.empty)

// Java test dependencies
testImplementation("junit:junit:$jUnit")
testImplementation("org.mockito:mockito-core:$mockito")
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:$mockitoKotlin")
testImplementation("com.google.truth:truth:$truth") {
testImplementation(libs.junit)
testImplementation(libs.mockito.core)
testImplementation(libs.mockito.kotlin)
testImplementation(libs.google.truth) {
exclude(group = "junit") // Android has JUnit built in.
}

testImplementation("nl.jqno.equalsverifier:equalsverifier:$equalsVerifier")
testImplementation("com.squareup.okhttp3:mockwebserver:$okHttp")
testImplementation("androidx.test:runner:$testRunner")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines")
testImplementation(libs.equalsverifier)
testImplementation(libs.androidx.test.runner)
testImplementation(libs.kotlinx.coroutines.test)

// Android test dependencies
androidTestImplementation("org.mockito:mockito-core:$mockito")
androidTestImplementation("com.jraska.livedata:testing-ktx:$liveDataTesting")
androidTestImplementation("androidx.arch.core:core-testing:$coreTesting")
androidTestImplementation("androidx.test:runner:$testRunner")
androidTestImplementation("androidx.test:rules:$testRules")
androidTestImplementation("com.squareup.okhttp3:logging-interceptor:$okHttp")
androidTestImplementation("com.google.truth:truth:$truth") {
androidTestImplementation(libs.mockito.core)
androidTestImplementation(libs.livedata.testing.ktx)
androidTestImplementation(libs.androidx.arch.core.testing)
androidTestImplementation(libs.androidx.test.runner)
androidTestImplementation(libs.androidx.test.rules)
androidTestImplementation(libs.okhttp.logging)
androidTestImplementation(libs.google.truth) {
exclude(group = "junit") // Android has JUnit built in.
}
androidTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines")
androidTestImplementation(libs.kotlinx.coroutines.test)

debugImplementation("com.facebook.flipper:flipper:$flipper")
debugImplementation("com.facebook.soloader:soloader:$soloader")
debugImplementation("com.facebook.flipper:flipper-network-plugin:$flipper") {
debugImplementation(libs.facebook.soloader)
debugImplementation(libs.facebook.flipper.core)
debugImplementation(libs.facebook.flipper.network) {
exclude(group = "com.squareup.okhttp3")
}

releaseImplementation("com.facebook.flipper:flipper-noop:$flipper")

implementation("net.openid:appauth:$appauth")
implementation("com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava")
releaseImplementation(libs.facebook.flipper.noop)
}

detekt {
toolVersion = "1.18.0"
toolVersion = libs.versions.detekt.get()
config = files("config/detekt.yml")
parallel = true
buildUponDefaultConfig = false
Expand Down
4 changes: 2 additions & 2 deletions core/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
# Properties which are consumed by plugins/gradle-mvn-push.gradle plugin.
# They are used for publishing artifact to snapshot repository.

VERSION_NAME=1.9.0
VERSION_CODE=290
VERSION_NAME=1.9.1
VERSION_CODE=291

GROUP=org.hisp.dhis

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
package org.hisp.dhis.android.core.domain.metadata

import com.google.common.truth.Truth.assertThat
import org.hisp.dhis.android.core.attribute.Attribute
import org.hisp.dhis.android.core.category.Category
import org.hisp.dhis.android.core.constant.Constant
import org.hisp.dhis.android.core.dataset.DataSet
Expand Down Expand Up @@ -63,7 +64,7 @@ class MetadataCallMockIntegrationShould : BaseMockIntegrationTestEmptyDispatcher

testObserver.awaitTerminalEvent()

testObserver.assertValueCount(15)
testObserver.assertValueCount(16)

val values = testObserver.values()

Expand All @@ -89,6 +90,7 @@ class MetadataCallMockIntegrationShould : BaseMockIntegrationTestEmptyDispatcher
ProgramIndicator::class,
Indicator::class,
LegendSet::class,
Attribute::class,
ExpressionDimensionItem::class,
).map { it.java.simpleName },
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@
package org.hisp.dhis.android.core.program.internal

import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.runBlocking
import org.hisp.dhis.android.core.arch.call.executors.internal.D2CallExecutor
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import org.hisp.dhis.android.core.category.CategoryComboTableInfo
import org.hisp.dhis.android.core.category.internal.CreateCategoryComboUtils
import org.hisp.dhis.android.core.common.Unit
import org.hisp.dhis.android.core.data.program.ProgramRuleVariableSamples
import org.hisp.dhis.android.core.data.program.ProgramSamples
import org.hisp.dhis.android.core.data.program.ProgramTrackedEntityAttributeSamples
Expand All @@ -53,6 +52,7 @@ import org.junit.runner.RunWith
import org.mockito.internal.util.collections.Sets

@RunWith(D2JunitRunner::class)
@OptIn(ExperimentalCoroutinesApi::class)
class ProgramEndpointCallMockIntegrationShould : BaseMockIntegrationTestEmptyEnqueable() {

@Test
Expand Down Expand Up @@ -92,11 +92,11 @@ class ProgramEndpointCallMockIntegrationShould : BaseMockIntegrationTestEmptyEnq

@BeforeClass
@JvmStatic
fun setUpTestClass() {
fun setUpTestClass() = runTest {
setUpClass()

val executor = D2CallExecutor.create(databaseAdapter)
executor.executeD2CallTransactionally {
val executor = objects.d2DIComponent.coroutineApiCallExecutor
executor.wrapTransactionally {
val categoryComboUid = "m2jTvAj5kkm"
val categoryCombo = CreateCategoryComboUtils.create(1L, categoryComboUid)
databaseAdapter.insert(CategoryComboTableInfo.TABLE_INFO.name(), null, categoryCombo)
Expand All @@ -117,11 +117,8 @@ class ProgramEndpointCallMockIntegrationShould : BaseMockIntegrationTestEmptyEnq
val programStage = CreateProgramStageUtils.create(1L, "dBwrot7S420", programUid)
databaseAdapter.insert(ProgramStageTableInfo.TABLE_INFO.name(), null, programStage)
dhis2MockServer.enqueueMockResponse("program/programs.json")
runBlocking {
objects.d2DIComponent.programCall.download(Sets.newSet(programUid))
}

Unit()
objects.d2DIComponent.programCall.download(Sets.newSet(programUid))
}
}
}
Expand Down
Loading

0 comments on commit ac711cf

Please sign in to comment.