Makes sense. Because method definitions are not allowed in closures I created
a closure for it:
buildscript {
def gitHub = {
def resolver = new URLResolver()
resolver.with {
name = 'GitHub'
addArtifactPattern
'http://cloud.github.com/downloads/[organisation]/[module]/[module]-[revision].[ext]'
}
resolver
}
repositories {
add gitHub()
}
}
This works all good but when I try to access the gitHub closure outside of
the buildscript closure Gradle doesn't find it.
repositories {
add gitHub()
mavenCentral()
}
Caused by: org.gradle.api.internal.MissingMethodException: Could not find
method gitHub() for arguments [] on root project 'template-project'.
Any ideas why it can't be found?
--
View this message in context:
http://gradle.1045684.n5.nabble.com/Define-repository-similar-to-mavenCentral-within-build-script-tp4503651p4503899.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email