From 2ce1ecdee5bb585f82141c654f64a3783ec2a212 Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Mon, 23 Sep 2024 05:38:35 +0200 Subject: [PATCH] Add Convention Plugins for Android --- .github/workflows/build.yaml | 19 ------- .gitignore | 1 + app/build.gradle.kts | 14 ++--- gradle.properties | 4 +- gradle/aggregation/build.gradle.kts | 40 +++++++++++++- gradle/libs.versions.toml | 10 ++++ gradle/plugins/build.gradle.kts | 6 +- ...le.gradle.base.dependency-rules.gradle.kts | 10 ++++ ...rg.example.gradle.base.identity.gradle.kts | 2 +- ...ample.gradle.check.dependencies.gradle.kts | 2 +- ...radle.component.android-library.gradle.kts | 9 +++ ...le.gradle.component.application.gradle.kts | 7 +-- ...dle.feature.android-application.gradle.kts | 55 +++++++++++++++++++ ....gradle.feature.android-library.gradle.kts | 33 +++++++++++ ...example.gradle.feature.checksum.gradle.kts | 4 -- ...e.feature.repositories.settings.gradle.kts | 1 + ....gradle.feature.test-end-to-end.gradle.kts | 33 ----------- .../org.example.gradle.feature.war.gradle.kts | 19 ------- ...ple.gradle.report.code-coverage.gradle.kts | 25 --------- .../org.example.gradle.report.test.gradle.kts | 23 -------- kamino/build.gradle.kts | 5 +- kashyyyk/build.gradle.kts | 2 +- settings.gradle.kts | 2 + 23 files changed, 177 insertions(+), 149 deletions(-) create mode 100644 gradle/plugins/src/main/kotlin/org.example.gradle.component.android-library.gradle.kts create mode 100644 gradle/plugins/src/main/kotlin/org.example.gradle.feature.android-application.gradle.kts create mode 100644 gradle/plugins/src/main/kotlin/org.example.gradle.feature.android-library.gradle.kts delete mode 100644 gradle/plugins/src/main/kotlin/org.example.gradle.feature.test-end-to-end.gradle.kts delete mode 100644 gradle/plugins/src/main/kotlin/org.example.gradle.feature.war.gradle.kts diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d5ff3ad6..4b73a6b8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,24 +19,5 @@ jobs: with: cache-read-only: false - run: "./gradlew qualityCheck" - - run: "./gradlew test" - - run: "./gradlew testEndToEnd" - - run: "./gradlew testEndToEndSlow" - run: "./gradlew check" - - run: "./gradlew cyclonedxBom --no-configuration-cache" - run: "./gradlew publish" - if: ${{ !contains(github.ref_name, '/') }} - - uses: actions/upload-artifact@v4 - if: always() - with: - name: reports - path: gradle/aggregation/build/reports - - uses: DependencyTrack/gh-upload-sbom@v3 - if: ${{ !contains(github.ref_name, '/') }} - with: - apiKey: ${{ secrets.DEPENDENCYTRACK_APIKEY }} - bomFilename: "gradle/aggregation/build/reports/sbom/bom.xml" - serverHostname: ${{ secrets.DEPENDENCYTRACK_URL }} - projectName: "gradle-project-setup-howto" - projectVersion: ${{ github.ref_name }} - autoCreate: true diff --git a/.gitignore b/.gitignore index e0d53d80..7e762bc2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .gradle .idea build +local.properties diff --git a/app/build.gradle.kts b/app/build.gradle.kts index ad5bfa1d..271a37d3 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,7 +1,5 @@ plugins { id("org.example.gradle.component.application") } -application { mainClass = "org.example.product.app.Application" } - // Complicated notation for 'capabilities' - upvote: https://github.com/gradle/gradle/issues/25629 dependencies { implementation(projects.bespin) @@ -10,18 +8,16 @@ dependencies { implementation(projects.kashyyyk) implementation(projects.naboo) implementation(projects.tatooine) + implementation(libs.android.material) + implementation(libs.androidx.appcompat) implementation(libs.guice) implementation(libs.guice.servlet) implementation(libs.slf4j.api) runtimeOnly(libs.slf4j.simple) - providedCompile(libs.jakarta.servlet.api) - mockApiImplementation(projects.app) - mockApiImplementation(libs.guava) + androidTestImplementation(libs.androidx.test.junit) + androidTestImplementation(libs.androidx.test.monitor) + androidTestImplementation(libs.junit4) testImplementation(libs.junit.jupiter.api) - - testEndToEndImplementation(projects.app) { capabilities { requireCapability("${project.group}:$name-mock-api") } } - testEndToEndImplementation(libs.guava) - testEndToEndImplementation(libs.junit.jupiter.api) } diff --git a/gradle.properties b/gradle.properties index 2b18a0b8..f72c2762 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Configure the Grade Daemon - memory and same encoding on all machines -org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError +org.gradle.jvmargs=-Xmx6g -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError # activate Gradle configuration cache - instantly start builds that ran before, full parallelism org.gradle.configuration-cache=true @@ -8,3 +8,5 @@ org.gradle.configuration-cache=true # activate Gradle build cache - switch between branches/commits without rebuilding every time org.gradle.caching=true + +android.useAndroidX=true diff --git a/gradle/aggregation/build.gradle.kts b/gradle/aggregation/build.gradle.kts index 40c98fcd..cc680787 100644 --- a/gradle/aggregation/build.gradle.kts +++ b/gradle/aggregation/build.gradle.kts @@ -1,12 +1,48 @@ +import com.android.build.api.attributes.BuildTypeAttr + plugins { id("org.gradle.java") id("org.example.gradle.base.lifecycle") id("org.example.gradle.base.dependency-rules") id("org.example.gradle.check.format-gradle") - id("org.example.gradle.report.code-coverage") + // id("org.example.gradle.report.code-coverage") id("org.example.gradle.report.plugin-analysis") id("org.example.gradle.report.sbom") - id("org.example.gradle.report.test") + // id("org.example.gradle.report.test") } dependencies { implementation(projects.app) } + +configurations { + compileClasspath { selectRelease() } + runtimeClasspath { selectRelease() } + testCompileClasspath { selectRelease() } + testRuntimeClasspath { selectRelease() } +} + +fun Configuration.selectRelease() { + attributes.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, "jar") + attributes.attribute(BuildTypeAttr.ATTRIBUTE, objects.named("release")) +} + +// Allow AARs to appear along JARs on the joint classpath for reports +dependencies { + attributesSchema { getMatchingStrategy(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE).compatibilityRules.add(AarJarCompatibility::class.java) } + attributesSchema { getMatchingStrategy(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE).compatibilityRules.add(AarJarStringCompatibility::class.java) } +} + +class AarJarCompatibility : AttributeCompatibilityRule { + override fun execute(details: CompatibilityCheckDetails) { + if (details.producerValue?.name == "aar") { + details.compatible() + } + } +} + +class AarJarStringCompatibility : AttributeCompatibilityRule { + override fun execute(details: CompatibilityCheckDetails) { + if (details.producerValue == "aar" || details.producerValue == "android-classes-jar") { + details.compatible() + } + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index bf943923..a55ebb28 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,9 @@ [versions] +android-material = "1.12.0" +androidx-appcompat = "1.7.0" +androidx-test = "1.1.5" assertj = "3.22.0" +espresso = "3.5.1" guava = "30.1-jre" guice = "5.1.0" httpcomponents = "4.5.13" @@ -22,6 +26,11 @@ velocity = "2.3" zookeeper = "3.8.0" [libraries] +android-material = { module = "com.google.android.material:material", version.ref = "android-material" } +androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" } +androidx-espresso = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso"} +androidx-test-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-test" } +androidx-test-monitor = { module = "androidx.test:monitor" } assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj" } commons-io = { module = "commons-io:commons-io" } guava = { module = "com.google.guava:guava", version.ref = "guava" } @@ -39,6 +48,7 @@ jakarta-mail-impl = { module = "com.sun.mail:jakarta.mail", version.ref = "jakar jakarta-servlet-api = { module = "jakarta.servlet:jakarta.servlet-api", version.ref = "jakarta-servlet" } jsr305 = { module = "com.google.code.findbugs:jsr305", version.ref = "jsr305" } junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit5" } +junit4 = { module = "junit:junit" } opensaml = { module = "org.opensaml:opensaml", version.ref = "opensaml" } org-json = { module = "org.json:json", version.ref = "org-json" } org-reflections = { module = "org.reflections:reflections", version.ref = "org-reflections" } diff --git a/gradle/plugins/build.gradle.kts b/gradle/plugins/build.gradle.kts index 4921fb0c..12d181c4 100644 --- a/gradle/plugins/build.gradle.kts +++ b/gradle/plugins/build.gradle.kts @@ -1,8 +1,12 @@ plugins { `kotlin-dsl` } -repositories { gradlePluginPortal() } +repositories { + gradlePluginPortal() + google() +} dependencies { + implementation("com.android.tools.build:gradle:8.3.0") implementation("com.autonomousapps:dependency-analysis-gradle-plugin:2.0.2") implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0") implementation("com.gradle:develocity-gradle-plugin:3.18") diff --git a/gradle/plugins/src/main/kotlin/org.example.gradle.base.dependency-rules.gradle.kts b/gradle/plugins/src/main/kotlin/org.example.gradle.base.dependency-rules.gradle.kts index de54d984..79ee1c8a 100644 --- a/gradle/plugins/src/main/kotlin/org.example.gradle.base.dependency-rules.gradle.kts +++ b/gradle/plugins/src/main/kotlin/org.example.gradle.base.dependency-rules.gradle.kts @@ -14,6 +14,16 @@ jvmDependencyConflicts { logging { enforceSlf4JSimple() } patch { + // Avoid conflict between 'javax.activation' and 'jakarta.activation-api' in the + // detachedConfiguration that is input to AndroidLintTask.lintTool.classpath + // Because for 'detachedConfigurations' you cannot inject conflict resolution strategies + // select(JAVAX_ACTIVATION_API, "jakarta.activation:jakarta.activation-api") + // would not solve the issue. + module("com.android.tools:repository") { + removeDependency("com.sun.activation:javax.activation") + addApiDependency("jakarta.activation:jakarta.activation-api") + } + module("com.github.racc:typesafeconfig-guice") { // remove and re-add due to 'no_aop' classifier removeDependency("com.google.inject:guice") diff --git a/gradle/plugins/src/main/kotlin/org.example.gradle.base.identity.gradle.kts b/gradle/plugins/src/main/kotlin/org.example.gradle.base.identity.gradle.kts index be33eaaf..2c79e6fb 100644 --- a/gradle/plugins/src/main/kotlin/org.example.gradle.base.identity.gradle.kts +++ b/gradle/plugins/src/main/kotlin/org.example.gradle.base.identity.gradle.kts @@ -2,7 +2,7 @@ plugins { id("org.gradle.base") } // Set the group required to refer to a Module "from outside". // I.e., when it is published or used in Included Builds. -group = "org.example.product.java" +group = "org.example.product.android" // Set the version from 'version.txt' version = providers.fileContents(isolated.rootProject.projectDirectory.file("gradle/version.txt")).asText.getOrElse("") diff --git a/gradle/plugins/src/main/kotlin/org.example.gradle.check.dependencies.gradle.kts b/gradle/plugins/src/main/kotlin/org.example.gradle.check.dependencies.gradle.kts index a8d77759..c905e02c 100644 --- a/gradle/plugins/src/main/kotlin/org.example.gradle.check.dependencies.gradle.kts +++ b/gradle/plugins/src/main/kotlin/org.example.gradle.check.dependencies.gradle.kts @@ -2,7 +2,7 @@ import com.autonomousapps.DependencyAnalysisSubExtension import com.autonomousapps.tasks.ProjectHealthTask plugins { - id("org.gradle.java") + id("org.gradle.java-base") id("com.autonomousapps.dependency-analysis") id("io.fuchs.gradle.classpath-collision-detector") id("org.example.gradle.base.lifecycle") diff --git a/gradle/plugins/src/main/kotlin/org.example.gradle.component.android-library.gradle.kts b/gradle/plugins/src/main/kotlin/org.example.gradle.component.android-library.gradle.kts new file mode 100644 index 00000000..5ff221b1 --- /dev/null +++ b/gradle/plugins/src/main/kotlin/org.example.gradle.component.android-library.gradle.kts @@ -0,0 +1,9 @@ +plugins { + id("org.example.gradle.base.dependency-rules") + id("org.example.gradle.base.identity") + id("org.example.gradle.base.lifecycle") + id("org.example.gradle.check.dependencies") + id("org.example.gradle.check.format-gradle") + id("org.example.gradle.check.format-java") + id("org.example.gradle.feature.android-library") +} diff --git a/gradle/plugins/src/main/kotlin/org.example.gradle.component.application.gradle.kts b/gradle/plugins/src/main/kotlin/org.example.gradle.component.application.gradle.kts index 6cd73278..55cbdfe5 100644 --- a/gradle/plugins/src/main/kotlin/org.example.gradle.component.application.gradle.kts +++ b/gradle/plugins/src/main/kotlin/org.example.gradle.component.application.gradle.kts @@ -1,15 +1,10 @@ plugins { - id("org.gradle.application") id("org.example.gradle.base.dependency-rules") id("org.example.gradle.base.identity") id("org.example.gradle.base.lifecycle") id("org.example.gradle.check.dependencies") id("org.example.gradle.check.format-gradle") id("org.example.gradle.check.format-java") + id("org.example.gradle.feature.android-application") id("org.example.gradle.feature.checksum") - id("org.example.gradle.feature.compile-java") - id("org.example.gradle.feature.javadoc") - id("org.example.gradle.feature.test") - id("org.example.gradle.feature.test-end-to-end") - id("org.example.gradle.feature.war") } diff --git a/gradle/plugins/src/main/kotlin/org.example.gradle.feature.android-application.gradle.kts b/gradle/plugins/src/main/kotlin/org.example.gradle.feature.android-application.gradle.kts new file mode 100644 index 00000000..2fa39950 --- /dev/null +++ b/gradle/plugins/src/main/kotlin/org.example.gradle.feature.android-application.gradle.kts @@ -0,0 +1,55 @@ +plugins { + id("org.example.gradle.base.lifecycle") + id("org.example.gradle.base.dependency-rules") + id("com.android.application") +} + +val versionString = + providers.fileContents(isolated.rootProject.projectDirectory.file("gradle/version.txt")).asText.getOrElse("") +val versionInt = versionString.split(".")[0].toInt() * 1000 + versionString.split(".")[1].toInt() + +android { + compileSdk = 34 + namespace = "org.example.product.${project.name}" + defaultConfig { + applicationId = "org.example.product.app" + minSdk = 26 + targetSdk = 34 + versionCode = versionInt + versionName = versionString + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes.getByName("release") { minifyEnabled(false) } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + + packaging { resources.excludes.add("META-INF/**") } +} + +// Configure common test runtime dependencies for android application projects +dependencies { androidTestRuntimeOnly("androidx.test.espresso:espresso-core") } + +// Required, because 'org.gradlex.jvm-dependency-conflict-resolution' does not +// automatically configure everything for Android (yet) +android { + applicationVariants.all { + compileConfiguration.configureConsistentResolution() + runtimeConfiguration.configureConsistentResolution() + unitTestVariant.compileConfiguration.configureConsistentResolution() + unitTestVariant.runtimeConfiguration.configureConsistentResolution() + if (testVariant != null) { + testVariant.compileConfiguration.configureConsistentResolution() + testVariant.runtimeConfiguration.configureConsistentResolution() + } + } +} + +fun Configuration.configureConsistentResolution() { + extendsFrom(configurations["internal"]) + shouldResolveConsistentlyWith(configurations["mainRuntimeClasspath"]) +} diff --git a/gradle/plugins/src/main/kotlin/org.example.gradle.feature.android-library.gradle.kts b/gradle/plugins/src/main/kotlin/org.example.gradle.feature.android-library.gradle.kts new file mode 100644 index 00000000..158ab3e0 --- /dev/null +++ b/gradle/plugins/src/main/kotlin/org.example.gradle.feature.android-library.gradle.kts @@ -0,0 +1,33 @@ +plugins { + id("org.example.gradle.base.lifecycle") + id("org.example.gradle.base.dependency-rules") + id("com.android.library") +} + +android { + compileSdk = 34 + namespace = "org.example.product.${project.name}" + + defaultConfig { minSdk = 26 } +} + +// Required, because 'org.gradlex.jvm-dependency-conflict-resolution' does not +// automatically configure everything for Android (yet) +android { + libraryVariants.all { + compileConfiguration.configureConsistentResolution() + runtimeConfiguration.configureConsistentResolution() + unitTestVariant.compileConfiguration.configureConsistentResolution() + unitTestVariant.runtimeConfiguration.configureConsistentResolution() + if (testVariant != null) { + testVariant.compileConfiguration.configureConsistentResolution() + testVariant.runtimeConfiguration.configureConsistentResolution() + } + } + packaging { resources.excludes.add("META-INF/*") } +} + +fun Configuration.configureConsistentResolution() { + extendsFrom(configurations["internal"]) + shouldResolveConsistentlyWith(configurations["mainRuntimeClasspath"]) +} diff --git a/gradle/plugins/src/main/kotlin/org.example.gradle.feature.checksum.gradle.kts b/gradle/plugins/src/main/kotlin/org.example.gradle.feature.checksum.gradle.kts index 42d16c69..d0201204 100644 --- a/gradle/plugins/src/main/kotlin/org.example.gradle.feature.checksum.gradle.kts +++ b/gradle/plugins/src/main/kotlin/org.example.gradle.feature.checksum.gradle.kts @@ -1,12 +1,8 @@ import org.example.gradle.tasks.MD5DirectoryChecksum -plugins { id("org.gradle.java") } - // Generate additional resources required at application runtime // This is an example for creating and integrating a custom task implementation. tasks.register("resourcesChecksum") { inputDirectory = layout.projectDirectory.dir("src/main/resources") checksumFile = layout.buildDirectory.file("generated-resources/md5/resources.MD5") } - -tasks.processResources { from(tasks.named("resourcesChecksum")) } diff --git a/gradle/plugins/src/main/kotlin/org.example.gradle.feature.repositories.settings.gradle.kts b/gradle/plugins/src/main/kotlin/org.example.gradle.feature.repositories.settings.gradle.kts index 2d49da7c..4086988f 100644 --- a/gradle/plugins/src/main/kotlin/org.example.gradle.feature.repositories.settings.gradle.kts +++ b/gradle/plugins/src/main/kotlin/org.example.gradle.feature.repositories.settings.gradle.kts @@ -1,4 +1,5 @@ dependencyResolutionManagement { // Get components from Maven Central repositories.mavenCentral() + repositories.google() } diff --git a/gradle/plugins/src/main/kotlin/org.example.gradle.feature.test-end-to-end.gradle.kts b/gradle/plugins/src/main/kotlin/org.example.gradle.feature.test-end-to-end.gradle.kts deleted file mode 100644 index 6bcab2e5..00000000 --- a/gradle/plugins/src/main/kotlin/org.example.gradle.feature.test-end-to-end.gradle.kts +++ /dev/null @@ -1,33 +0,0 @@ -plugins { id("org.gradle.java") } - -// Specific API fixtures used for testing without live service -val mockApi = sourceSets.create("mockApi") - -java.registerFeature(mockApi.name) { usingSourceSet(mockApi) } - -tasks.named("mockApiJar") { group = null } - -// end-to-end tests -testing.suites.create("testEndToEnd") { - testType = TestSuiteType.FUNCTIONAL_TEST - targets.named("testEndToEnd") { - testTask { - group = "build" - options { - this as JUnitPlatformOptions - excludeTags("slow") - } - } - tasks.check { dependsOn(testTask) } - } - // Add a second task for the endToEndTest suite - targets.register("testEndToEndSlow") { - testTask { - group = "build" - options { - this as JUnitPlatformOptions - includeTags("slow") - } - } - } -} diff --git a/gradle/plugins/src/main/kotlin/org.example.gradle.feature.war.gradle.kts b/gradle/plugins/src/main/kotlin/org.example.gradle.feature.war.gradle.kts deleted file mode 100644 index 53477adf..00000000 --- a/gradle/plugins/src/main/kotlin/org.example.gradle.feature.war.gradle.kts +++ /dev/null @@ -1,19 +0,0 @@ -plugins { - id("org.gradle.war") - id("org.example.gradle.base.dependency-rules") -} - -tasks.war { setGroup(null) } - -// The war plugin used 'providedRuntime' / 'providedCompile' to resolve dependencies for packaging -// the WAR file -configurations.providedCompile { shouldResolveConsistentlyWith(configurations["mainRuntimeClasspath"]) } - -configurations.providedRuntime { shouldResolveConsistentlyWith(configurations["mainRuntimeClasspath"]) } - -tasks.register("deployWebApp") { - group = "distribution" - description = "Deploy web app into local Tomcat found via CATALINA_HOME" - from(tasks.war) { into("webapps") } - into(providers.gradleProperty("catalinaHome").orElse(providers.environmentVariable("CATALINA_HOME"))) -} diff --git a/gradle/plugins/src/main/kotlin/org.example.gradle.report.code-coverage.gradle.kts b/gradle/plugins/src/main/kotlin/org.example.gradle.report.code-coverage.gradle.kts index 4c684e35..1da2d8ab 100644 --- a/gradle/plugins/src/main/kotlin/org.example.gradle.report.code-coverage.gradle.kts +++ b/gradle/plugins/src/main/kotlin/org.example.gradle.report.code-coverage.gradle.kts @@ -8,30 +8,5 @@ plugins { // Make aggregation "classpath" use the platform for versions (gradle/versions) configurations.aggregateCodeCoverageReportResults { extendsFrom(configurations["internal"]) } -// Integrate FUNCTIONAL_TEST results into the aggregated UNIT_TEST coverage results -tasks.testCodeCoverageReport { - reports.html.outputLocation = layout.buildDirectory.dir("reports/coverage") - reports.xml.outputLocation = layout.buildDirectory.file("reports/coverage.xml") - executionData.from( - configurations.aggregateCodeCoverageReportResults - .get() - .incoming - .artifactView { - withVariantReselection() - attributes { - attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.VERIFICATION)) - attribute(TestSuiteType.TEST_SUITE_TYPE_ATTRIBUTE, objects.named(TestSuiteType.FUNCTIONAL_TEST)) - attribute(TestSuiteTargetName.TEST_SUITE_TARGET_NAME_ATTRIBUTE, objects.named("testEndToEnd")) - attribute( - VerificationType.VERIFICATION_TYPE_ATTRIBUTE, - objects.named(VerificationType.JACOCO_RESULTS) - ) - attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.BINARY_DATA_TYPE) - } - } - .files - ) -} - // Generate report when running 'check' tasks.check { dependsOn(tasks.testCodeCoverageReport) } diff --git a/gradle/plugins/src/main/kotlin/org.example.gradle.report.test.gradle.kts b/gradle/plugins/src/main/kotlin/org.example.gradle.report.test.gradle.kts index f0c3fef6..ca84370d 100644 --- a/gradle/plugins/src/main/kotlin/org.example.gradle.report.test.gradle.kts +++ b/gradle/plugins/src/main/kotlin/org.example.gradle.report.test.gradle.kts @@ -8,29 +8,6 @@ plugins { // Make aggregation "classpath" use the platform for versions (gradle/versions) configurations.aggregateTestReportResults { extendsFrom(configurations["internal"]) } -// Integrate FUNCTIONAL_TEST results into the aggregated UNIT_TEST test results -tasks.testAggregateTestReport { - destinationDirectory = layout.buildDirectory.dir("reports/tests") - testResults.from( - configurations.aggregateTestReportResults - .get() - .incoming - .artifactView { - withVariantReselection() - attributes { - attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.VERIFICATION)) - attribute(TestSuiteType.TEST_SUITE_TYPE_ATTRIBUTE, objects.named(TestSuiteType.FUNCTIONAL_TEST)) - attribute(TestSuiteTargetName.TEST_SUITE_TARGET_NAME_ATTRIBUTE, objects.named("testEndToEnd")) - attribute( - VerificationType.VERIFICATION_TYPE_ATTRIBUTE, - objects.named(VerificationType.TEST_RESULTS) - ) - } - } - .files - ) -} - // Generate report when running 'check' tasks.check { dependsOn(tasks.testAggregateTestReport) } diff --git a/kamino/build.gradle.kts b/kamino/build.gradle.kts index dbc6bab8..749c0f48 100644 --- a/kamino/build.gradle.kts +++ b/kamino/build.gradle.kts @@ -1,7 +1,4 @@ -plugins { - id("org.example.gradle.component.library") - id("org.example.gradle.feature.publish") -} +plugins { id("org.example.gradle.component.android-library") } dependencies { api(projects.coruscant) diff --git a/kashyyyk/build.gradle.kts b/kashyyyk/build.gradle.kts index 63630d2f..ee80d215 100644 --- a/kashyyyk/build.gradle.kts +++ b/kashyyyk/build.gradle.kts @@ -1,4 +1,4 @@ -plugins { id("org.example.gradle.component.library") } +plugins { id("org.example.gradle.component.android-library") } dependencies { api(projects.naboo) diff --git a/settings.gradle.kts b/settings.gradle.kts index 8f44e7d2..e0b27a15 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,5 +1,7 @@ pluginManagement { includeBuild("gradle/plugins") + repositories.gradlePluginPortal() + repositories.google() } plugins { id("org.example.gradle.report.develocity")