Hi

I am rewriting our build infrastructure to use Gradle.

At the moment I am trying to make a clever (possibly too clever) bootstrap
process that intends to do this:

 * Use an environment variable to find a bootstrap jar, containing a
bootstrap plugin called 'buildscripts'
 * This plugin uses a specified BuildScripts version string copy the actual
BuildScripts to a the local computer (our NAS is painfully slow)
 * The additional plugins in the BuildScripts project are then loaded.

My code - that works - looks like this:

----------------------------------------------------------------------------------
buildscript {
  dependencies {
    classpath
files("file://${System.getenv('JB_BUILDSCRIPTS_BOOTSTRAP_JAR')}")
  }
}
apply(plugin: 'buildscripts')

println buildScriptsHome

buildscript {
    dependencies {
        // FAILS: classpath fileTree(dir: buildScriptsHome, include:
"*.jar")
        classpath fileTree(dir:
"d:/udvikler/ws/eclipse/jb.jbit.im.tools.buildscripts/dist", include:
"*.jar")  // WORKS
    }
}
apply plugin: 'ivy'
----------------------------------------------------------------------------------


But when I try to internalize the bottow half into the plugin code itself,
it fails.

If I put this in my 'buildscripts' plugin:
-----
        project.buildscript {
            dependencies {
                classpath project.fileTree(dir:
pluginConvention.buildScriptsHome, include: "*.jar")
            }
        }
-----

The result is "You can't change a configuration which is not in unresolved
state!"

Any ideas for how to fix this?





In the end, I would like my projects to just contain:

 apply plugin: 'buildscripts'

and let the 'buildscripts' plugin apply our default plugins (such as ivy).
But adding my bootstrap jar to the Gradle classpath does not mean it gets
added to the buildscript classpath. Any chance of getting such behavior in
the future (and a GRADLE_EXTRA_CLASSPATH or somesuch in the wrapper?)


Thanks,
Jesper

Reply via email to