Hi,
I am using a flat repository to store all jars needed by the
dependency resolver. Now, I am trying to implement a task which
updates the lib folders of all sub-projects.
In the subproject section I have created the following task. The idea
is to check the date of the libraries to see if a copy from the
repository to the project lib folder is needed.
createTask('update_lib', dependsOn: 'archive_jar') { task ->
if( isProjectPresent( task.project.name ) ) {
deps = task.project.dependencies.resolve('compile', true, true )
deps.each { resolveFile ->
repoFile = new File( mainRepo.path+"/"+resolveFile.getName() )
libName = repoFile.getName()
libFile = new File( task.project.buildDir.path+"/../lib/"+libName )
if( libFile.exists() == true ) {
repoDate = repoFile.lastModified()
libDate = libFile.lastModified()
if( repoDate <= libDate ) {
return
}
}
ant.copy( file: repoFile, todir:
task.project.buildDir.path+"/../lib", overwrite:true)
}
}
}
my problem is that the line
deps = task.project.dependencies.resolve('compile', true, true )
does not contain the dependencies between projects. I mean, for each
project I have used the following in the dependency section
if( isProjectPresent( "prjA" ) == true )
compile project(':prjA')
else
compile "prjA:prjA:jar"
it seems deps contains only the jars specified without the project
dependency, i.e
compile "prjA:prjA:jar"
Note that I am using Gradle 0.5.2 and that I am using
resolve('compile', true, true ) which should include also the project
dependencies if I have understood its meaning declared in the
documentation
java.util.List<java.io.File> resolve(java.lang.String conf,
boolean failForMissingDependencies,
boolean includeProjectDependencies)
Returns a list of file objects, denoting the path to the classpath
elements belonging to this configuration.
Parameters:
failForMissingDependencies - If this method should throw an
exception in case a dependency of the configuration can't be resolved
includeProjectDependencies - Whether project dependencies
should be resolved as well.
Returns:
A list of file objects
Any hints? Thanks
Regards,
Walter
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email