On 26/11/2010, at 10:15 PM, paulcager wrote:

> 
> (My apologies if you see this twice - I sent it to the wrong Nabble list
> yesterday).
> 
> I know how to upload archives to the repository, but I can't work out how to
> easily upload "flat" files. Here's what I'm using at the moment (gradle
> 0.9-rc3): 
> 
>  apply plugin: "base" 
>  version = "01.04.05" 
>  group = "com.example" 
>  files = [ "file1", "file2" ] 
>  configurations { scripts } 
> 
>  assemble << { 
>    files.each { f -> 
>      def artifact = [ 
>        getName: { f }, 
>        getExtension: { "gradle" }, 
>        getType: { "gradle" }, 
>        getClassifier: { null }, 
>        getFile: { file("${f}.gradle") }, 
>        getDate: { new Date() } 
>      ] as org.gradle.api.artifacts.PublishArtifact 
> 
>      configurations.scripts.addArtifact artifact 
>    } 
>  } 
> 
>  uploadScripts { 
>    uploadDescriptor = true 
>    repositories { 
>      org.apache.ivy.util.url.CredentialsStore.INSTANCE.addCredentials(...) 
>      mavenRepo urls: "http://..."; 
>    } 
>  } 
> 
>  uploadScripts.dependsOn assemble 
> 
> It works but I get the feeling I'm missing something obvious that would make
> my life easier. 

I think what's missing is some way in Gradle to easily publish artifacts which 
are not archives. There's a JIRA issue for this: 
http://jira.codehaus.org/browse/GRADLE-1237


--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz

Reply via email to