On 28/06/2011, at 8:57 AM, M A wrote:
> Hi all,
>
> When I do this I get "Could not find property 'com' on project
> ':someSubproject'":
>
> subprojects {
> buildscript {
> dependencies {
> classpath files(
> "$project.rootProject.projectDir/libs/gradle-onejar-0.1-SNAPSHOT.jar"
> )
> }
> }
>
> apply plugin: com.curiousattemptbunny.gradle.onejar.OneJarPlugin
>
> // ....
> }
The expression 'subprojects { buildscript { ... } }' defines the classpath for
the build script of each sub project. It doesn't do anything to the classpath
of the current script.
The expression 'apply plugin:
com.curiousattemptbunny.gradle.onejar.OneJarPlugin' uses the classpath of the
current script to resolve the OneJarPlugin class.
One option to fix this is to move the buildscript { } closure to the top of
the current script. Another option is to give the OneJarPlugin an id, and use
that to apply the plugin.
--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com