Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19850

Call tasks of composite builds directly

$
0
0

While not without some limitations, here’s what I’ve used as a workaround for now

tasks.addRule( 'Pattern: <included build>%<task>' ) { String taskName ->
    if( taskName.contains( '%' ) ) {
        def parts = taskName.split( '%' )
        if( parts.size() != 2 ) {
            throw new RuntimeException( "Invalid included build task reference '${taskName}'" )
        }
        task( taskName ) {
            dependsOn gradle.includedBuild( parts[0] ).task( ":${parts[1]}" )
        }
    }
}

Viewing all articles
Browse latest Browse all 19850

Trending Articles