Meikel  Brandmeyer avatar Meikel Brandmeyer committed 96424c7

Added configure helper for clojars upload

Comments (0)

Files changed (2)

     groovy name: 'logback-classic', version:'0.9.9'
     groovy name: 'antlr', version:'2.7.7'
     groovy name: 'ant', version:'1.7.0'
+    groovy name: 'ivy', version:'2.1.0-rc2'
 }
 
 // Dummy to make gradle generate a POM.

src/main/groovy/clojuresque/ClojurePluginConvention.groovy

 
 import org.gradle.api.Project
 import org.gradle.api.artifacts.dsl.RepositoryHandler
+import org.gradle.api.tasks.Upload
 
 class ClojurePluginConvention {
     Project project
             didConfigureDeployerJars = true
         }
     }
+
+    public void configureClojarsDeploy(Upload task) {
+        File dummyRepo = new File(project.buildDir, 'deploy')
+
+        configureDeployerJars()
+
+        project.configure(task) {
+            repositories.mavenDeployer {
+                name = 'dummyClojarsLocalDeployer'
+                description  = 'Dummy deployer to trick gradle into pom generation'
+                repository(url: 'file://' + dummyRepo.path)
+            }
+        }
+
+        task.doLast {
+            project.ant.clojarsScpDeploy(todir: 'clojars@clojars.org:', keyfile: new File(project.clojarsKeyfile).absolutePath, passphrase: project.clojarsPassphrase) {
+                fileset(dir: dummyRepo, excludes: '**/maven-metadata.xml*')
+            }
+        }
     }
 
     public boolean getWarnOnReflection() {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.