wttech/gradle-aem-plugin

Merging packages does not work since Gradle 7.x

pun-ky opened this issue · 6 comments

image

       rootProject.name = "example"
                
                include("ui.apps")
                include("ui.content") 
                include("assembly")
plugins {
    id("com.cognifide.aem.package")
    id("maven-publish")
}

group = "com.company.example.aem"

tasks {
    packageCompose {
        mergePackageProject(":ui.apps")
        mergePackageProject(":ui.content")
    }
}

publishing {
    repositories {
        maven(rootProject.file("build/repository"))
    }

    publications {
        create<MavenPublication>("maven") {
            artifact(tasks["packageCompose"])
        }
    }
}

Adding

evaluationDependsOn(":ui.apps")
evaluationDependsOn(":ui.content")

fixes initial problem but looks like Gradle changed sth internally about configuration phase task ordering.
GAP need to align here to recover that advanced package merging feature or redesign it completely. Right now bundle built by other modules is not included effectively in assembly package which is regression.

Added error reporting when detected Gradle >= 7.x and usage of mergePackage method.

probably no longer needed, closing