diff --git a/fladle-plugin/src/main/java/com/osacky/flank/gradle/ImportReportDelegate.kt b/fladle-plugin/src/main/java/com/osacky/flank/gradle/ImportReportDelegate.kt index 52fca1c3..f07314f2 100644 --- a/fladle-plugin/src/main/java/com/osacky/flank/gradle/ImportReportDelegate.kt +++ b/fladle-plugin/src/main/java/com/osacky/flank/gradle/ImportReportDelegate.kt @@ -16,7 +16,8 @@ import com.gradle.enterprise.gradleplugin.test.JUnitXmlDialect as GEJUnitXmlDial fun canImportReport(): Boolean = JUnitXmlHandler.canImport() fun importReport( - project: Project, flankTaskProvider: TaskProvider, + project: Project, + flankTaskProvider: TaskProvider, ) { val enableTestUploads = project.providers @@ -24,25 +25,26 @@ fun importReport( .getOrElse("true") .toBoolean() if (enableTestUploads) { - val resultsProvider: Provider = project.layout.buildDirectory - .dir("fladle") - .flatMap { fladleDir -> - val localResultsDirProvider: Provider = fladleDir - .dir(flankTaskProvider.flatMap { task -> task.config.localResultsDir }) + val resultsProvider: Provider = + project.layout.buildDirectory + .dir("fladle") + .flatMap { fladleDir -> + val localResultsDirProvider: Provider = + fladleDir + .dir(flankTaskProvider.flatMap { task -> task.config.localResultsDir }) - localResultsDirProvider.map { localResultsDir -> localResultsDir.file("JUnitReport.xml") } - } + localResultsDirProvider.map { localResultsDir -> localResultsDir.file("JUnitReport.xml") } + } JUnitXmlHandler.get()?.register( project.tasks, flankTaskProvider, - resultsProvider + resultsProvider, ) } } /** Abstraction over Develocity and GE impls of JUnitXml reporting. */ sealed class JUnitXmlHandler { - abstract fun register( tasks: TaskContainer, flankTask: TaskProvider, @@ -50,12 +52,13 @@ sealed class JUnitXmlHandler { ) companion object { - private fun canImport(name: String) = try { - Class.forName(name) - true - } catch (e: ClassNotFoundException) { - false - } + private fun canImport(name: String) = + try { + Class.forName(name) + true + } catch (e: ClassNotFoundException) { + false + } private val canImportDevelocity get() = canImport("com.gradle.develocity.agent.gradle.test.ImportJUnitXmlReports") @@ -63,13 +66,14 @@ sealed class JUnitXmlHandler { fun canImport() = canImportDevelocity || canImportGE - fun get() = if (canImportDevelocity) { - DevelocityJunitXmlHandler - } else if (canImportGE) { - GEJunitXmlHandler - } else { - null - } + fun get() = + if (canImportDevelocity) { + DevelocityJunitXmlHandler + } else if (canImportGE) { + GEJunitXmlHandler + } else { + null + } } object DevelocityJunitXmlHandler : JUnitXmlHandler() { diff --git a/fladle-plugin/src/test/resources/android-library-project-flavors/build.gradle b/fladle-plugin/src/test/resources/android-library-project-flavors/build.gradle index 4b92c86e..73bcc57c 100644 --- a/fladle-plugin/src/test/resources/android-library-project-flavors/build.gradle +++ b/fladle-plugin/src/test/resources/android-library-project-flavors/build.gradle @@ -27,11 +27,11 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'androidx.appcompat:appcompat:1.6.1' implementation("androidx.navigation:navigation-fragment-ktx:2.3.0") implementation 'androidx.constraintlayout:constraintlayout:2.0.1' - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test:rules:1.3.0' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test:rules:1.5.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/fladle-plugin/src/test/resources/android-library-project-flavors/src/main/AndroidManifest.xml b/fladle-plugin/src/test/resources/android-library-project-flavors/src/main/AndroidManifest.xml index d7735fe2..2d886939 100644 --- a/fladle-plugin/src/test/resources/android-library-project-flavors/src/main/AndroidManifest.xml +++ b/fladle-plugin/src/test/resources/android-library-project-flavors/src/main/AndroidManifest.xml @@ -5,7 +5,8 @@ - + diff --git a/fladle-plugin/src/test/resources/android-library-project/build.gradle b/fladle-plugin/src/test/resources/android-library-project/build.gradle index f4841dd4..7890fc20 100644 --- a/fladle-plugin/src/test/resources/android-library-project/build.gradle +++ b/fladle-plugin/src/test/resources/android-library-project/build.gradle @@ -17,12 +17,12 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'androidx.appcompat:appcompat:1.6.1' implementation("androidx.navigation:navigation-fragment-ktx:2.3.0") implementation 'androidx.constraintlayout:constraintlayout:2.0.1' - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test:rules:1.3.0' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test:rules:1.5.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/fladle-plugin/src/test/resources/android-library-project/src/main/AndroidManifest.xml b/fladle-plugin/src/test/resources/android-library-project/src/main/AndroidManifest.xml index d7735fe2..2d886939 100644 --- a/fladle-plugin/src/test/resources/android-library-project/src/main/AndroidManifest.xml +++ b/fladle-plugin/src/test/resources/android-library-project/src/main/AndroidManifest.xml @@ -5,7 +5,8 @@ - + diff --git a/fladle-plugin/src/test/resources/android-project-flavors/build.gradle b/fladle-plugin/src/test/resources/android-project-flavors/build.gradle index 8f56e210..f9e08150 100644 --- a/fladle-plugin/src/test/resources/android-project-flavors/build.gradle +++ b/fladle-plugin/src/test/resources/android-project-flavors/build.gradle @@ -30,12 +30,12 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'androidx.appcompat:appcompat:1.6.1' implementation("androidx.navigation:navigation-fragment-ktx:2.3.0") implementation 'androidx.constraintlayout:constraintlayout:2.0.1' - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test:rules:1.3.0' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test:rules:1.5.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/fladle-plugin/src/test/resources/android-project/build.gradle b/fladle-plugin/src/test/resources/android-project/build.gradle index 58efa9b7..3d4ab993 100644 --- a/fladle-plugin/src/test/resources/android-project/build.gradle +++ b/fladle-plugin/src/test/resources/android-project/build.gradle @@ -46,12 +46,12 @@ fladle { } dependencies { - implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'androidx.appcompat:appcompat:1.6.1' implementation("androidx.navigation:navigation-fragment-ktx:2.3.0") implementation 'androidx.constraintlayout:constraintlayout:2.0.1' - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test:rules:1.3.0' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test:rules:1.5.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/fladle-plugin/src/test/resources/android-project2/build.gradle b/fladle-plugin/src/test/resources/android-project2/build.gradle index 25b40b33..9a1bc5bc 100644 --- a/fladle-plugin/src/test/resources/android-project2/build.gradle +++ b/fladle-plugin/src/test/resources/android-project2/build.gradle @@ -49,12 +49,12 @@ fulladleModuleConfig { environmentVariables = ["clearPackageData": "false"] } dependencies { - implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'androidx.appcompat:appcompat:1.6.1' implementation("androidx.navigation:navigation-fragment-ktx:2.3.0") implementation 'androidx.constraintlayout:constraintlayout:2.0.1' - testImplementation 'junit:junit:4.13' - androidTestImplementation 'androidx.test:rules:1.3.0' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test:rules:1.5.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' }