Skip to content

Commit

Permalink
Merge pull request #1915 from dhis2/1.7.1-rc
Browse files Browse the repository at this point in the history
fix: [1.7.1] Version 1.7.1
  • Loading branch information
vgarciabnz authored Jan 27, 2023
2 parents 2dcfb0c + 8ffd5b0 commit 1267d6e
Show file tree
Hide file tree
Showing 221 changed files with 8,711 additions and 3,609 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 83 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
pipeline {
agent {
label "ec2-android"
}

stages{
stage('Checks') {
steps {
script {
echo 'Running Check style and quality'
sh './runChecks.sh'
}
}
}
stage('Unit tests') {
steps {
script {
echo 'Running unit tests'
sh './gradlew testDebugUnitTest --stacktrace --no-daemon'
}
}
}
stage('Instrumented tests') {
environment {
BROWSERSTACK = credentials('android-browserstack')
}
steps {
script {
echo 'Browserstack deployment and running tests'
sh 'chmod +x ./scripts/browserstackJenkins.sh'
sh './scripts/browserstackJenkins.sh'
}
}
}
stage('JaCoCo report') {
steps {
script {
echo 'JaCoCo report'
sh './gradlew jacocoReport --stacktrace --no-daemon'
}
}
}
stage('Sonarqube') {
environment {
GIT_BRANCH = "${env.GIT_BRANCH}"
// Jenkinsfile considers empty value ('') as null
GIT_BRANCH_DEST = "${env.CHANGE_TARGET == null ? '' : env.CHANGE_TARGET}"
PULL_REQUEST = "${env.CHANGE_ID == null ? '' : env.CHANGE_ID }"
SONAR_TOKEN = credentials('android-sonarcloud-token')
}
steps {
script {
echo 'Sonarqube'
sh 'chmod +x ./scripts/sonarqube.sh'
sh './scripts/sonarqube.sh'
}
}
}
stage('Deploy') {
when {
allOf {
// Do not deploy on PR builds
expression { env.CHANGE_ID == null }
anyOf {
expression { env.GIT_BRANCH == "master" }
expression { env.GIT_BRANCH == "1.7.1-rc" }
}
}
}
environment {
NEXUS_USERNAME = credentials('android-sonatype-nexus-username')
NEXUS_PASSWORD = credentials('android-sonatype-nexus-password')
GPG_KEY_ID = credentials('android-sdk-signing-public-key-id')
GPG_PASSPHRASE = credentials('android-sdk-signing-private-key-password')
GPG_KEY_LOCATION = credentials('android-sdk-signing-private-key-ring-file')
}
steps {
echo 'Deploy to Sonatype nexus'
sh './gradlew :core:publish'
}
}
}
}
7 changes: 3 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ plugins {

sonarqube {
properties {
def branch = System.getenv("BITRISE_GIT_BRANCH")
def targetBranch = System.getenv("BITRISEIO_GIT_BRANCH_DEST")
def pullRequestId = System.getenv("BITRISE_PULL_REQUEST")
def branch = System.getenv("GIT_BRANCH")
def targetBranch = System.getenv("GIT_BRANCH_DEST")
def pullRequestId = System.getenv("PULL_REQUEST")
property "sonar.projectKey", "dhis2_dhis2-android-sdk"
property "sonar.organization", "dhis2"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.projectName", "dhis2-android-sdk"
if (pullRequestId == null) {
property "sonar.branch.name", branch
property "sonar.branch.target", targetBranch
} else {
property "sonar.pullrequest.base", targetBranch
property "sonar.pullrequest.branch", branch
Expand Down
9 changes: 5 additions & 4 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ ext {
buildToolsVersion: "30.0.2",
minSdkVersion : 21,
targetSdkVersion : 31,
versionCode : 270,
versionName : "1.7.0"
versionCode : 271,
versionName : "1.7.1"
]

libraries = [
Expand All @@ -62,7 +62,7 @@ ext {
dagger : "2.39.1",
rxJava : "2.2.12",
rxAndroid : "2.1.1",
sqlCipher : "4.4.0",
sqlCipher : "4.4.3",
jexl : "2.1.1",
jodaTime : "2.10.6",
smsCompression : "0.2.0",
Expand Down Expand Up @@ -218,9 +218,10 @@ dependencies {
// Android test dependencies
androidTestImplementation "commons-logging:commons-logging:${libraries.commonsLogging}"
androidTestImplementation "org.mockito:mockito-core:${libraries.mockito}"
androidTestImplementation "androidx.arch.core:core-testing:${libraries.coreTesting}"
androidTestImplementation "com.jraska.livedata:testing-ktx:${libraries.liveDataTesting}"
androidTestImplementation "androidx.arch.core:core-testing:${libraries.coreTesting}"
androidTestImplementation "androidx.test:runner:${libraries.testRunner}"
androidTestImplementation "androidx.test:rules:${libraries.testRunner}"
androidTestImplementation "com.squareup.okhttp3:logging-interceptor:${libraries.okHttp}"
androidTestImplementation("com.google.truth:truth:${libraries.truth}") {
exclude group: 'junit' // Android has JUnit built in.
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.7.0
VERSION_CODE=270
VERSION_NAME=1.7.1
VERSION_CODE=271

GROUP=org.hisp.dhis

Expand Down
20 changes: 10 additions & 10 deletions core/plugins/gradle-mvn-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,24 @@ def getSnapshotRepositoryUrl() {
: "https://oss.sonatype.org/content/repositories/snapshots/"
}

def getRepositoryUsername() {
return hasProperty("NEXUS_USERNAME") ? NEXUS_USERNAME : ""
static def getRepositoryUsername() {
return System.getenv("NEXUS_USERNAME")
}

def getRepositoryPassword() {
return hasProperty("NEXUS_PASSWORD") ? NEXUS_PASSWORD : ""
static def getRepositoryPassword() {
return System.getenv("NEXUS_PASSWORD")
}

def gpgKeyId() {
return hasProperty("GPG_KEY_ID") ? GPG_KEY_ID : ""
static def gpgKeyId() {
return System.getenv("GPG_KEY_ID")
}

def gpgKeyLocation() {
return hasProperty("GPG_KEY_LOCATION") ? GPG_KEY_LOCATION : ""
static def gpgKeyLocation() {
return System.getenv("GPG_KEY_LOCATION")
}

def gpgPassphrase() {
return hasProperty("GPG_PASSPHRASE") ? GPG_PASSPHRASE : ""
static def gpgPassphrase() {
return System.getenv("GPG_PASSPHRASE")
}

gradle.taskGraph.whenReady { taskGraph ->
Expand Down
5 changes: 4 additions & 1 deletion core/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@
package="org.hisp.dhis.android">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

<application
android:usesCleartextTraffic="true"
android:label="androidTests"
tools:replace="android:label">
tools:replace="android:label"
android:requestLegacyExternalStorage="true">
<activity android:name="com.facebook.flipper.android.diagnostics.FlipperDiagnosticActivity"
android:exported="true"/>
</application>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,22 @@ abstract class BaseRealIntegrationTest {

@Before
open fun setUp() {
d2 = D2Factory.forNewDatabase()
d2 = D2Factory.forNewDatabase(isRealIntegration = true)
}

@After
open fun tearDown() {
D2Factory.clear()
}

protected fun getGenericCallData(d2: D2): GenericCallData {
internal fun getGenericCallData(d2: D2): GenericCallData {
return GenericCallData.create(
d2.databaseAdapter(), d2.retrofit(), ResourceHandler.create(d2.databaseAdapter()),
d2.systemInfoModule().versionManager()
)
}

protected fun getD2DIComponent(d2: D2): D2DIComponent {
internal fun getD2DIComponent(d2: D2): D2DIComponent {
return d2.d2DIComponent
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ package org.hisp.dhis.android.core

import org.hisp.dhis.android.core.arch.d2.internal.D2DIComponent

object D2DIComponentAccessor {
internal object D2DIComponentAccessor {
fun getD2DIComponent(d2: D2): D2DIComponent {
return d2.d2DIComponent
}
Expand Down
15 changes: 10 additions & 5 deletions core/src/androidTest/java/org/hisp/dhis/android/core/D2Factory.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ import org.hisp.dhis.android.core.maintenance.D2Error
internal object D2Factory {

@JvmStatic
fun forNewDatabase(): D2 {
return forNewDatabaseInternal(InMemorySecureStore(), InMemoryUnsecureStore())
fun forNewDatabase(isRealIntegration: Boolean = false): D2 {
return forNewDatabaseInternal(InMemorySecureStore(), InMemoryUnsecureStore(), isRealIntegration)
}

@JvmStatic
Expand All @@ -50,14 +50,19 @@ internal object D2Factory {
@Throws(D2Error::class)
fun forNewDatabaseWithAndroidSecureStore(): D2 {
val context = InstrumentationRegistry.getInstrumentation().context
return forNewDatabaseInternal(AndroidSecureStore(context), AndroidInsecureStore(context))
return forNewDatabaseInternal(AndroidSecureStore(context), AndroidInsecureStore(context), false)
}

private fun forNewDatabaseInternal(secureStore: SecureStore, insecureStore: InsecureStore): D2 {
private fun forNewDatabaseInternal(
secureStore: SecureStore,
insecureStore: InsecureStore,
isRealIntegration: Boolean
): D2 {
val context = InstrumentationRegistry.getInstrumentation().context
val d2Configuration = d2Configuration(context)

D2Manager.setTestMode(true)
D2Manager.isTestMode = true
D2Manager.isRealIntegration = isRealIntegration
D2Manager.setTestingSecureStore(secureStore)
D2Manager.setTestingInsecureStore(insecureStore)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class MockIntegrationTestObjects(val content: MockIntegrationTestDatabaseContent
var resourceHandler: ResourceHandler = ResourceHandler.create(databaseAdapter)

@JvmField
val d2DIComponent: D2DIComponent = d2.d2DIComponent
internal val d2DIComponent: D2DIComponent = d2.d2DIComponent
val dhis2MockServer: Dhis2MockServer = Dhis2MockServer(0)

@Throws(IOException::class)
Expand Down

This file was deleted.

Loading

0 comments on commit 1267d6e

Please sign in to comment.