Skip to content

Commit

Permalink
#9: Upgrade gradle and plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
arburk committed Dec 31, 2023
1 parent 6a41d5f commit ecb305e
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 31 deletions.
81 changes: 54 additions & 27 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ plugins {
id "org.sonarqube" version "4.2.1.3168"
}

sonarqube {
properties {
property "sonar.projectKey", "arburk_vscp"
property "sonar.organization", "arburk"
property "sonar.host.url", "https://sonarcloud.io"
}
}

android {
namespace 'com.github.arburk.vscp.app'
compileSdk 33
Expand All @@ -24,7 +16,8 @@ android {
versionCode 1
versionName "1.0"

testInstrumentationRunner "com.github.arburk.vscp.app.AndroidJunitRunnerWithDexOpener"
//testInstrumentationRunner "com.github.arburk.vscp.app.AndroidJunitRunnerWithDexOpener"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand Down Expand Up @@ -97,17 +90,26 @@ android {
}
}

sonarqube {
properties {
property "sonar.projectKey", "arburk_vscp"
property "sonar.organization", "arburk"
property "sonar.host.url", "https://sonarcloud.io"
}
}

apply plugin: 'jacoco'

jacoco {
version = "0.8.11"
toolVersion = "0.8.11"
}

tasks.register('jacocoTestReport', JacocoReport) {
dependsOn(testDebugUnitTest)
dependsOn(testReleaseUnitTest)
dependsOn(compileDebugJavaWithJavac)
dependsOn(compileDebugKotlin)
//dependsOn(testReleaseUnitTest)
//dependsOn(compileDebugJavaWithJavac)
//dependsOn(compileDebugKotlin)
//dependsOn(nexus5api27DebugAndroidTest)
//dependsOn(pixel3api30DebugAndroidTest)

Expand All @@ -124,14 +126,29 @@ tasks.register('jacocoTestReport', JacocoReport) {
//kotlin compiled classes
def kotlinTree = fileTree(dir: "$project.projectDir/build/tmp/kotlin-classes/debug", excludes: fileFilter)

/*
def releaseKotlinClasses = fileTree(dir: "$project.projectDir/build/tmp/kotlin-classes/release", excludes: fileFilter)
def debugKotlinClasses = fileTree(dir: "$project.projectDir/build/tmp/kotlin-classes/debug")
def releaseJavaClasses = fileTree(dir: "$project.projectDir/build/intermediates/javac/release", excludes: fileFilter)
def debugJavaClasses = fileTree(dir: "$project.projectDir/build/intermediates/javac/debug")
def mainClasses = releaseKotlinClasses + debugKotlinClasses
def javaClasses = releaseJavaClasses + debugJavaClasses
sourceDirectories.from = files([mainSrc])
classDirectories.from = files([mainClasses, javaClasses])
executionData.from = fileTree(dir: "$project.projectDir/build", include: [
"jacoco/testReleaseUnitTest.exec",
"outputs/unit_test_code_coverage/debugUnitTest/testDebugUnitTest.exec"])
*/

sourceDirectories.setFrom(files([mainSrc]))
classDirectories.from = files([javaTree, kotlinTree])
executionData.setFrom(fileTree(dir: "$projectDir/build", includes: [
"jacoco/testReleaseUnitTest.exec",
// "jacoco/testReleaseUnitTest.exec",
"outputs/unit_test_code_coverage/debugUnitTest/testDebugUnitTest.exec",
"outputs/managed_device_code_coverage/**/coverage.ec",
"outputs/code_coverage/debugAndroidTest/connected/**/coverage.ec",
// "outputs/managed_device_code_coverage/**/coverage.ec",
// "outputs/code_coverage/debugAndroidTest/connected/**/coverage.ec",
]))
}

Expand All @@ -150,7 +167,17 @@ dependencies {

// Required -- JUnit 4 framework
testImplementation "junit:junit:$jUnitVersion"
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.8.2")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.9.2")
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
// If using JUnit Jupiter
//testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
//testRuntimeOnly 'org.junit.platform:junit-platform-launcher'


//testRuntimeOnly("org.jacoco:org.jacoco.core:0.8.11")



// Optional -- Robolectric environment
// testImplementation "androidx.test:core:$androidXTestVersion"
// Optional -- Mockito framework
Expand All @@ -165,15 +192,15 @@ dependencies {
// testImplementation "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion"
// testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion"

androidTestImplementation 'com.github.tmurakami:dexopener:2.0.5'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.1'
androidTestImplementation "io.mockk:mockk-android:$mockkVersion"
androidTestImplementation "io.mockk:mockk-agent:$mockkVersion"
androidTestImplementation 'io.insert-koin:koin-test-junit4:3.0.2'

debugImplementation "androidx.fragment:fragment-testing:$fragmentTestingVersion"
// androidTestImplementation 'com.github.tmurakami:dexopener:2.0.5'
// androidTestImplementation 'androidx.test.ext:junit:1.1.5'
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
// androidTestImplementation 'androidx.test:runner:1.5.2'
// androidTestImplementation 'androidx.test:rules:1.5.0'
// androidTestImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.1'
// androidTestImplementation "io.mockk:mockk-android:$mockkVersion"
// androidTestImplementation "io.mockk:mockk-agent:$mockkVersion"
// androidTestImplementation 'io.insert-koin:koin-test-junit4:3.0.2'

// debugImplementation "androidx.fragment:fragment-testing:$fragmentTestingVersion"
}
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.1.4' apply false
id 'com.android.library' version '8.1.4' apply false
id 'org.jetbrains.kotlin.android' version '1.9.21' apply false
id 'com.android.application' version '8.2.0' apply false
id 'com.android.library' version '8.2.0' apply false
id 'org.jetbrains.kotlin.android' version '1.9.22' apply false
}

ext {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit ecb305e

Please sign in to comment.