Thanks a lot, I'll go with option 2 or 3, that's exactly what I was looking
for. I am planning to provide a Gradle-plugin for our build-environment, so
we can use Gradle in severeral our projects and the build should work behind
the VW firewall as well as from the Home Office (just by setting one config
property).

@Ken: Thanks for your links, I will definitely check them out.

On Tue, Mar 15, 2011 at 12:32 AM, Adam Murdoch
<[email protected]>wrote:

>
> On 15/03/2011, at 9:05 AM, Andreas Sahlbach wrote:
>
> Hi!
>
> I have a fairly complicated repository setting (depending if I am behind
> the firewall in the office or at home using the internet). What is the best
> way to share the repository entries without dumb copying 20 lines of code
> from the allprojects {} to the buildscript{} ? Can't believe that there
> isn't a more elegant way to do this in groovy...
>
>
> Some options:
>
> 1. use an external script:
>
> in build.gradle:
>
> buildscript {
>     apply from: 'repositories.gradle', to: repositories
> }
>
> allprojects {
>     apply from: 'repositories.gradle', to: repositories
> }
>
> in repositories.gradle:
>
> mavenCentral()
> mavenRepo urls: '...'
> ...
>
> 2. copy the repositories:
>
> buildscript {
>     repositories {
>         //... define the repositories here ...
>     }
> }
>
> allprojects {
>     rootProject.buildscript.repositories.each {
>         repositories.add(it)
>     }
> }
>
> 3. configure everything from the root buildscript closure:
>
> buildscript {
>     (allprojects*.repositories + [repositories]).each {
>         configure {
>             // ... define the repositories here ...
>         }
>     }
> }
>
>
>
> --
> Adam Murdoch
> Gradle Developer
> http://www.gradle.org
> Co-Founder and VP of Engineering, Gradleware Inc. - Gradle Training,
> Support, Consulting
> http://www.gradleware.com
>
>


-- 
Andreas Sahlbach

Reply via email to