compile "myjar:myjar:jar"
says that you want organization "myjar", module "myjar" and revision "jar" (and 
since it's a compile dependency, it automatically assumes "jar" as the 
extension)

I assume you really want either:

   compile "myjar:myjar"
or
   compile "myjar:my...@jar"

affected by needs of raw artifact versus potential transitive dependencies.

-Spencer

--- On Wed, 5/19/10, Walter Di Carlo <[email protected]> wrote:

From: Walter Di Carlo <[email protected]>
Subject: [gradle-user] Issue with the name of cached dependency artifacts
To: [email protected]
Date: Wednesday, May 19, 2010, 9:36 AM

As last step to adopt gradle as building system I am trying to create
a task to build a folder for the distribution of the application. So,
in one of the sub-project gradle file I have put the following


package_folder = 'My_App_v'+project.version
package_path = new File(rootDir.path+'/'+package_folder)

gradle.taskGraph.beforeTask { task ->
  if (task == mypackage) {
      pkg_file = new File( package_path.path )
      if( pkg_file.exists() == true ) {
        pkg_file.deleteDir()
      }
  }
}

afterEvaluate {
  task mypackage(type: Copy )  {
    doFirst {
      println "packaging ...."
    }
    from new File(project(':prjA').projectDir.path )
    into new File( package_path.path )
    exclude "tmp"
    exclude "bin"
    exclude "dist"
    exclude "build"
    exclude "lib"
    exclude "src"
    exclude ".project"
    exclude ".classpath"
    exclude "build.xml"
    exclude "build-jars.xml"
    exclude "build.gradle"

    into( 'lib'){
      from project(':prjA').configurations.default
      from project(':prjA').configurations.default.allArtifacts*.file
    }
  }
}


I am sure there is a better solution to do it, but my problem is that
in the lib folder I am getting jars with a wrong name. In few words
dependency with jar without version like the following

           compile "myjar:myjar:jar"

is copied into the lib folder with the filename myjar-jar.jar

I have tried to play with the syntax of the dependency specification
but with no success. Perhaps I have broken something, but before it
was working correctly. Any idea suggestion?  Note that such jars are
also present in the cache of gradle. In my case, for example, I am
getting the file ivy-jar.xml with the following content

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="1.0">
    <info organisation="myjar"
        module="myjar"
        revision="jar"
        status="release"
        publication="20100519154402"
        default="true"
    />
    <configurations>
        <conf name="default" visibility="public"/>
    </configurations>
    <publications>
        <artifact name="myjar" type="jar" ext="jar" conf="default"/>
    </publications>
</ivy-modu>

I think the revision="jar" is not correct, but I could be wrong

Ciao

Walter

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

    http://xircles.codehaus.org/manage_email





      

Reply via email to