Hi,
Am 27.08.2011 um 16:15 schrieb [email protected]:
> It seems to me that repository information should by default live in the
> user's home directory. I don't think it should be up to a gradle script to
> define repositories. At my company, we've written custom plugins that look
> to a gradle.properties in the user's home directory to define repository
> urls. It would be nice if there could be a more default mechanism for
> this.
I wrote a small plugin called “local-dotgradle.” It reads looks for a file
called “local.gradle” and reads it. It may look like this:
localRepositories {
mavenRepo urls: http://my.company.com/archiva/repository/internal
}
In the “build.gradle” I have:
apply plugin: "local-dotgradle"
defaultRepositories {
mavenCentral()
}
So anyone grabbing my project can build it out of the box by using
mavenCentral. Or she provides her own “local.gradle.” The “defaultRepositories”
is skipped if a “localRepositories” was called before. This could be extended
to look also for “local.gradle” in the users home directory (or rather
~/.gradle).
I also put other settings and tasks which are specific to my dev environment
(eg. my IDE) into “local.gradle.” So the “build.gradle” really contains only
stuff concerned with the actual build.
To make this self-contained I deliver all plugins with my project source.
Sincerely
Meikel
Sources: https://bitbucket.org/kotarak/local-dotgradle
Plugin: http://clojars.org/repo/local-dotgradle/local-dotgradle
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email