Hi. I’ve applyed “maven-publish” plugin to my project and here is publishing code block (labels is list of strings)
publishing {
publications {
labels.each { label ->
“model${label}”(MavenPublication) {
artifactId “model-${label.toLowerCase()}”
artifact tasks."${label.toLowerCase()}Jar"
artifact tasks.“source${label}Jar” {
classifier ‘sources’
}
}
}
}
repositories {
maven { name ‘snapshot’; url snapshotRepository }
maven { name ‘release’; url releaseRepository }
}
}
My goal is to create task which dependsOn all publishToSnapshotRepository tasks. In old gradle this worked:
task deliver(dependsOn: tasks.findAll { task -> task.name.endsWith(‘ToSnapshotRepository’) })
But since 2.2 and http://gradle.org/docs/2.2/release-notes#publishing-plugins-and-native-language-support-plugins-changes publishing tasks are created after afterEvaluate
I try to write:
model {
tasks.deliver.dependsOn tasks.findAll { task -> task.name.endsWith(‘ToSnapshotRepository’) })
}
but get
No signature of method: org.gradle.model.dsl.internal.NonTransformedModelDslBacking.endsWith() is applicable for argument types: (java.lang.String) values: [ToSnapshotRepository]
What should I do and where can I read more information about ‘model’ extension?