On Feb 5, 2009, at 5:28 PM, Marco Hunsicker wrote:

Howdy,

after some fiddling with the class path configuration, I've finally managed to compile my whole project. Hurray!

I have a big pile of unmanaged and mostly unversioned dependency jars. The best way I found to add these to the class path, was to configure the unmanagedClasspath. Works fine, but requires the invocation of a custom method, which might be avoidable.

Searching through the archives, I found mention of an artifactPattern approach, that could work for me. But I was not able to make sense of the information. The OP described a similar usecase and came up with a solution, but not provided all the bits.

He used something like

   addFlatDirResolver('common', commonLib)
   .addArtifactPattern(commonLib.path+'/[artifact].[ext]')

with compile dependencies in the form of ":[artifact]::[type]"

<http://markmail.org/message/otoahsvtmhnkucc2?q=unmanagedClasspath>

I'm not sure whether the resolver still requires one to add an artifact description for each jar file in the deps directory. That would render this approach useless for me. But maybe I'm just doing something wrong?

I want to replace the following

compile.unmanagedClasspath(findJars("$rootDir/deps")

with something like this

dependencies {
  commonLib = new File("$rootDir/deps")
  addFlatDirResolver('deps', commonLib)
      .addArtifactPattern(commonLib.path+'/[artifact].[ext]')
  compile ':[artifact]::[type]'
}

Is this possible? Thanks in advance of all your insight.

It should be possible. But Gradle doesn't allow this at the moment. In 0.5.3 (probably released next week) we will allow this. But all in all this is not a very nice way of solving your use case.

As Adam has pointed out, in 0.6 we will provide a more natural, convenient and powerful way to solve use cases like yours.

- Hans



--
Cheers,
 Marco

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email



--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to