Hi David,

Was you able to create a task (or anything else) which is capable to specify
dependencies between eclipse projects instead of going to the repository?

What I've done up until now is this.

configurations.all {
    resolutionStrategy.eachDependency { details ->
        def groupName = details.requested.group 
        def libName = details.requested.name;
        // here we check if the requested dependency is developed by
ourselves 
        if ( groupName== 'br.com.<OUR_COMPANY>') { 
            // If so, we check in the current workspace if there is an
project with the appropriated name
            project.file("../").list().each {projectName ->
                if( projectName.equalsIgnoreCase(libName) ){
                    // If so, we change the dependency from jar to local
eclipse project
                    project.eclipse.classpath.file {
                        withXml { xml ->
                            def node = xml.asNode()
                            
                                println "The project " + projectName + " was
found into the current workspace. Using it instead of the equivalent lib"
                                node.appendNode( 'classpathentry', [ kind:
'src', path: "/${projectName}", exported: 'true',
combineaccessrules:'false'])
                                
                                def libNode =  node.find
{[email protected](libName)}
                                if(libNode != null) {
                                    node.remove(libNode)
                                }                                               
                 
                            }
                     }
                    // Then we do not resolve the jar dependency
                    details.useTarget ''
                }
            }
        }
    }
}

This seems to work for 'java' projects with eclipse classpath container
'org.springsource.ide.eclipse.gradle.dsld.classpathcontainer' disabled (On
the other hand, this container adds back the jar dependecy). But for war
projects, we could not avoid resolving jar dependencies because whenever we
would like to build the war it must be inside WEB-INF/lib dir. 

Moreover, it seems we have to update the file
'org.eclipse.wst.common.component' in a similar way we did with .classpath,
but we didn't found how to do it with current api.


any example/idea will be appreciated
Thanks
Fernando Rubbo



--
View this message in context: 
http://gradle.1045684.n5.nabble.com/Switch-between-jar-and-project-dependency-for-eclipse-tp3395869p5711824.html
Sent from the gradle-user mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email


Reply via email to