here a simplified version of plugin 'custom-resolvers':
(it is a bit strange to extend the DSL like this and maybe not the
best way to do it ... mavenCentral() comes in quite differently)
class CustomResolversPlugin implements Plugin<Project> {
def void use(Project project) {
// setUp Convention-Object
CustomResolversPluginConvention conventionObject = new
CustomResolversPluginConvention(project)
project.convention.plugins.customresolvers = conventionObject
}
}
class CustomResolversPluginConvention{
private Project project
private static final String REPOS_HOME = 'somepath_to_flatdir_repos'
private final Logger log =
Logging.getLogger(CustomResolversPluginConvention.class)
CustomResolversPluginConvention(Project project) {
this.project = project
}
/*
* Setup Repository-Chain for Resolving (Downstream)
*/
public void customDownstreamRepos() {
RepositoryHandler repositories = project.getRepositories()
repositories.flatDir(name: 'repo1', dirs: new File(REPOS_HOME +
'/repo1'))
repositories.flatDir(name: 'repo2', dirs: new File(REPOS_HOME +
'/repo2'))
log.info 'customDownstreamRepos() was called'
}
/*
* Setup Repository for Publishing (Upstream)
*/
public void customUpstreamRepos() {
RepositoryHandler repositories =
project.uploadArchives.repositories
repositories.flatDir(name: 'repo3', dirs: new File(REPOS_HOME +
'/repo3'))
log.info 'customUpstreamRepos() was called'
}
have a nice day
--
View this message in context:
http://old.nabble.com/Can-I-add-other-dependency-resolvers--tp27758967p27872534.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