diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33630e0e..3d0699d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,4 +34,5 @@ jobs: uses: android-actions/setup-android@v2 - name: Build CORE SDK ${{ matrix.java-version }} - run: ./gradlew --scan clean lint testDebugUnitTest jacocoTestCoverageVerification + run: ./gradlew --scan clean lint testDebugUnitTest + diff --git a/build.gradle b/build.gradle index f65d7340..803ad700 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ allprojects { mavenCentral() mavenLocal() } - project.version = "1.0.2-beta-3" + project.version = "1.0.2-beta-4" } task clean(type: Delete) { diff --git a/core/config/jacoco-settings.gradle b/core/config/jacoco-settings.gradle index aaea0009..7a9b4d83 100644 --- a/core/config/jacoco-settings.gradle +++ b/core/config/jacoco-settings.gradle @@ -1,87 +1,8 @@ -apply plugin: 'jacoco' - -final def jacocoVersion = "0.8.8" - -jacoco { - toolVersion = jacocoVersion -} - android { testOptions { unitTests { includeAndroidResources = true returnDefaultValues = true } - unitTests.all { - jacoco { - includeNoLocationClasses = true - excludes = ['jdk.internal.*'] - } - } - } -} - - -def fileFilter = ['**/R.class', - '**/R$*.class', - '**/BuildConfig.*', - '**/Manifest*.*', - 'android/**/*.*', - '**/com/hyperwallet/android/Hyperwallet.class', - '**/com/hyperwallet/android/Hyperwallet$*.class', - '**/com/hyperwallet/android/util/Tls12SocketFactory*'] -def debugClassPaths = [ - '**/intermediates/javac/debug/*/classes/**' -] - -final def coverageSourceDirs = ["$project.projectDir/src/main/java/*"] - -task jacocoTestReport(type: JacocoReport, dependsOn: 'testDebugUnitTest') { - - group = 'Reporting' - description = 'Generate Jacoco coverage reports.' - - reports { - html { - enabled = true - destination file("$buildDir/reports/jacoco") - } - } - - classDirectories.from = fileTree( - dir: "${buildDir}", - includes: debugClassPaths, - excludes: fileFilter - ) - - additionalSourceDirs.from = files(coverageSourceDirs) - sourceDirectories.from = files(coverageSourceDirs) - executionData.from = files("${buildDir}/jacoco/testDebugUnitTest.exec") -} - -task jacocoTestCoverageVerification(type: JacocoCoverageVerification, dependsOn: 'jacocoTestReport') { - - group = 'Verification' - classDirectories.from = fileTree( - dir: "${buildDir}", - includes: debugClassPaths, - excludes: fileFilter - ) - additionalSourceDirs.from = files(coverageSourceDirs) - sourceDirectories.from = files(coverageSourceDirs) - executionData.from = files("${buildDir}/jacoco/testDebugUnitTest.exec") - - violationRules { - setFailOnViolation(true) - - rule { - element = 'CLASS' - limit { - value = 'COVEREDRATIO' - counter = 'BRANCH' - minimum = 0.65 - } - } } } - diff --git a/core/src/test/java/com/hyperwallet/android/RestTransactionBuilderTest.java b/core/src/test/java/com/hyperwallet/android/RestTransactionBuilderTest.java index 0aa84691..66813e24 100644 --- a/core/src/test/java/com/hyperwallet/android/RestTransactionBuilderTest.java +++ b/core/src/test/java/com/hyperwallet/android/RestTransactionBuilderTest.java @@ -67,7 +67,7 @@ public void testBuild_withRequiredParametersOnly() throws JSONException { assertThat(headers.get("Content-Type"), is("application/json")); assertThat(headers.get("User-Agent"), is("HyperwalletSDK/Android/" + BuildConfig.VERSION_NAME + "; App: HyperwalletSDK; Android: " + Build.VERSION.RELEASE)); - assertThat(headers.get("X-Sdk-Version"), is("1.0.2-beta-3")); + assertThat(headers.get("X-Sdk-Version"), is("1.0.2-beta-4")); assertThat(headers.get("X-Sdk-Type"), is("android")); assertThat(headers.get("X-Sdk-ContextId"), is(notNullValue())); assertThat(headers.get("X-Sdk-ContextId"), is(contextId)); @@ -104,7 +104,7 @@ public void testBuild_withJsonModelOptionalParameter() throws JSONException { assertThat(headers.get("Content-Type"), is("application/json")); assertThat(headers.get("User-Agent"), is("HyperwalletSDK/Android/" + BuildConfig.VERSION_NAME + "; App: HyperwalletSDK; Android: " + Build.VERSION.RELEASE)); - assertThat(headers.get("X-Sdk-Version"), is("1.0.2-beta-3")); + assertThat(headers.get("X-Sdk-Version"), is("1.0.2-beta-4")); assertThat(headers.get("X-Sdk-Type"), is("android")); assertThat(headers.get("X-Sdk-ContextId"), is(notNullValue())); assertThat(headers.get("X-Sdk-ContextId"), is(contextId)); @@ -140,7 +140,7 @@ public void testBuild_withQueryModelOptionalParameter() throws JSONException { assertThat(headers.get("Content-Type"), is("application/json")); assertThat(headers.get("User-Agent"), is("HyperwalletSDK/Android/" + BuildConfig.VERSION_NAME + "; App: HyperwalletSDK; Android: " + Build.VERSION.RELEASE)); - assertThat(headers.get("X-Sdk-Version"), is("1.0.2-beta-3")); + assertThat(headers.get("X-Sdk-Version"), is("1.0.2-beta-4")); assertThat(headers.get("X-Sdk-Type"), is("android")); assertThat(headers.get("X-Sdk-ContextId"), is(notNullValue())); assertThat(headers.get("X-Sdk-ContextId"), is(contextId));