Commits

Meikel Brandmeyer committed d672cd4 Draft

Initial check-in

  • Participants

Comments (0)

Files changed (6)

+^\.hg
+^\.mq
+syntax: glob
+status
+guards
+# HG changeset patch
+# User Meikel Brandmeyer <mb@kotka.de>
+# Date 1358268268 -3600
+# Node ID 2a43bd4946aacd831fc23e250d5c34b0bc279bfb
+# Parent b352e79e76b9c9ba3ef0e06b752eb10bcbb680b3
+Move clojureexec to clojure.exec and deprecate the former
+
+diff --git a/clojuresque/src/main/groovy/clojuresque/ClojureBasePlugin.groovy b/clojuresque/src/main/groovy/clojuresque/ClojureBasePlugin.groovy
+--- a/clojuresque/src/main/groovy/clojuresque/ClojureBasePlugin.groovy
++++ b/clojuresque/src/main/groovy/clojuresque/ClojureBasePlugin.groovy
+@@ -39,7 +39,7 @@
+         project.convention.plugins.clojure =
+             new ClojurePluginConvention(project)
+ 
+-        project.extensions.create("clojure", ClojurePluginExtension)
++        project.extensions.create("clojure", ClojurePluginExtension, project)
+ 
+         RepositoryHandler repos = project.repositories
+         repos.convention.plugins.clojure =
+diff --git a/clojuresque/src/main/groovy/clojuresque/ClojureCompileTask.groovy b/clojuresque/src/main/groovy/clojuresque/ClojureCompileTask.groovy
+--- a/clojuresque/src/main/groovy/clojuresque/ClojureCompileTask.groovy
++++ b/clojuresque/src/main/groovy/clojuresque/ClojureCompileTask.groovy
+@@ -69,7 +69,7 @@
+         }
+ 
+ 
+-        project.clojureexec {
++        project.clojure.exec {
+             project.configure delegate, this.jvmOptions
+             systemProperties "clojure.compile.path": this.destinationDir.path
+             classpath = project.files(
+diff --git a/clojuresque/src/main/groovy/clojuresque/ClojureDocTask.groovy b/clojuresque/src/main/groovy/clojuresque/ClojureDocTask.groovy
+--- a/clojuresque/src/main/groovy/clojuresque/ClojureDocTask.groovy
++++ b/clojuresque/src/main/groovy/clojuresque/ClojureDocTask.groovy
+@@ -1,5 +1,5 @@
+ /*-
+- * Copyright 2011 © Meikel Brandmeyer.
++ * Copyright 2011-2013 © Meikel Brandmeyer.
+  * All rights reserved.
+  *
+  * Permission is hereby granted, free of charge, to any person obtaining a
+@@ -57,7 +57,7 @@
+             throw new StopExecutionException("destinationDir not set!")
+         }
+ 
+-        project.clojureexec {
++        project.clojure.exec {
+             this.jvmOptions()
+             classpath = project.files(
+                 this.clojureRoots.srcDirs,
+diff --git a/clojuresque/src/main/groovy/clojuresque/ClojurePluginConvention.groovy b/clojuresque/src/main/groovy/clojuresque/ClojurePluginConvention.groovy
+--- a/clojuresque/src/main/groovy/clojuresque/ClojurePluginConvention.groovy
++++ b/clojuresque/src/main/groovy/clojuresque/ClojurePluginConvention.groovy
+@@ -40,12 +40,8 @@
+     }
+ 
+     public ExecResult clojureexec(Closure spec) {
+-        ClojureExecAction action = project.configure(
+-            new ClojureExecAction(project.fileResolver,
+-                project.configurations.clojuresque),
+-            spec
+-        )
+-        return action.execute()
++        Util.deprecationWarning(LOGGER, "clojureexec()", "clojure.exec()")
++        return project.clojure.exec(spec)
+     }
+ 
+     public void setAotCompile(boolean f) {
+diff --git a/clojuresque/src/main/groovy/clojuresque/ClojurePluginExtension.groovy b/clojuresque/src/main/groovy/clojuresque/ClojurePluginExtension.groovy
+--- a/clojuresque/src/main/groovy/clojuresque/ClojurePluginExtension.groovy
++++ b/clojuresque/src/main/groovy/clojuresque/ClojurePluginExtension.groovy
+@@ -23,7 +23,27 @@
+ 
+ package clojuresque
+ 
++import org.gradle.api.Project
++import org.gradle.process.ExecResult
++
++import groovy.lang.Closure
++
+ class ClojurePluginExtension {
+     def boolean warnOnReflection = false
+     def boolean aotCompile       = false
++
++    private final Project project
++
++    public ClojurePluginExtension(Project p) {
++        this.project = p
++    }
++
++    public ExecResult exec(Closure spec) {
++        ClojureExecAction action = project.configure(
++            new ClojureExecAction(project.fileResolver,
++                project.configurations.clojuresque),
++            spec
++        )
++        return action.execute()
++    }
+ }
+diff --git a/clojuresque/src/main/groovy/clojuresque/ClojureTestTask.groovy b/clojuresque/src/main/groovy/clojuresque/ClojureTestTask.groovy
+--- a/clojuresque/src/main/groovy/clojuresque/ClojureTestTask.groovy
++++ b/clojuresque/src/main/groovy/clojuresque/ClojureTestTask.groovy
+@@ -1,5 +1,5 @@
+ /*-
+- * Copyright 2009-2011 © Meikel Brandmeyer.
++ * Copyright 2009-2013 © Meikel Brandmeyer.
+  * All rights reserved.
+  *
+  * Permission is hereby granted, free of charge, to any person obtaining a
+@@ -47,7 +47,7 @@
+ 
+     @TaskAction
+     public void runTests() {
+-        project.clojureexec {
++        project.clojure.exec {
+             project.configure delegate, this.jvmOptions
+             classpath = project.files(
+                 this.testRoots.srcDirs,
+# HG changeset patch
+# User Meikel Brandmeyer <mb@kotka.de>
+# Date 1358270151 -3600
+# Node ID 48134d8cd809600749cafb0a3254503018a91969
+# Parent c4c6b430e6c98d11fcd5870b1440503e76ff71f6
+Add deprecation warning for clojarsRepo
+
+diff --git a/clojuresque/src/main/groovy/clojuresque/ClojureRepositoryConvention.groovy b/clojuresque/src/main/groovy/clojuresque/ClojureRepositoryConvention.groovy
+--- a/clojuresque/src/main/groovy/clojuresque/ClojureRepositoryConvention.groovy
++++ b/clojuresque/src/main/groovy/clojuresque/ClojureRepositoryConvention.groovy
+@@ -26,7 +26,11 @@
+ import org.gradle.api.Project
+ import org.gradle.api.artifacts.dsl.RepositoryHandler
+ 
++import org.slf4j.Logger
++import org.slf4j.LoggerFactory
++
+ class ClojureRepositoryConvention {
++    private static final Logger LOGGER = LoggerFactory.getLogger(ClojureRepositoryConvention)
+     private RepositoryHandler repos
+ 
+     public ClojureRepositoryConvention(RepositoryHandler repos) {
+@@ -34,6 +38,9 @@
+     }
+ 
+     public void clojarsRepo() {
++        Util.deprecationWarning(LOGGER, "clojarsRepo()", "clojars.repo()")
++        LOGGER.warn("(provided by new clojars plugin)")
++
+         repos.maven { url 'http://clojars.org/repo' }
+     }
+ }

move-away-from-JavaExec.diff

+# HG changeset patch
+# Parent cbb8219143d0107d6420ab5a6809e9835af4d587
+Remove dependency on JavaExec and friends
+
+diff --git a/clojuresque/src/main/groovy/clojuresque/ClojurePluginExtension.groovy b/clojuresque/src/main/groovy/clojuresque/ClojurePluginExtension.groovy
+--- a/clojuresque/src/main/groovy/clojuresque/ClojurePluginExtension.groovy
++++ b/clojuresque/src/main/groovy/clojuresque/ClojurePluginExtension.groovy
+@@ -39,11 +39,10 @@
+     }
+ 
+     public ExecResult exec(Closure spec) {
+-        ClojureExecAction action = project.configure(
+-            new ClojureExecAction(project.fileResolver,
+-                project.configurations.clojuresque),
+-            spec
+-        )
+-        return action.execute()
++        return project.javaexec {
++            project.configure delegate, spec
++            args = [ main ] + args
++            main = "clojuresque.Driver"
++        }
+     }
+ }

plugin-deploy-via-http.diff

+# HG changeset patch
+# Parent 098df244da8cf85079fa0941cdee37dfc1e01085
+Allow clojars deployment via http
+
+diff --git a/clojuresque/src/main/groovy/clojuresque/ClojureBasePlugin.groovy b/clojuresque/src/main/groovy/clojuresque/ClojureBasePlugin.groovy
+--- a/clojuresque/src/main/groovy/clojuresque/ClojureBasePlugin.groovy
++++ b/clojuresque/src/main/groovy/clojuresque/ClojureBasePlugin.groovy
+@@ -1,5 +1,5 @@
+ /*-
+- * Copyright 2009,2010 © Meikel Brandmeyer.
++ * Copyright 2009-2013 © Meikel Brandmeyer.
+  * All rights reserved.
+  *
+  * Permission is hereby granted, free of charge, to any person obtaining a
+@@ -162,6 +162,18 @@
+     }
+ 
+     private void configureClojarsUpload(Project project) {
++        if (!project.hasProperty("clojuresqueClojarsUrl")) {
++            project.ext.clojuresqueClojarsUrl = "https://clojars.org/repo"
++        }
++
++        project.configurations {
++            clojuresqueHttpDeployerJars
++        }
++
++        project.dependencies {
++            clojuresqueHttpDeployerJars "org.apache.maven.wagon:wagon-http-lightweight:2.2"
++        }
++
+         project.tasks.whenTaskAdded { upload ->
+             if (!(upload instanceof Upload))
+                 return
+diff --git a/clojuresque/src/main/groovy/clojuresque/ClojureUploadConvention.groovy b/clojuresque/src/main/groovy/clojuresque/ClojureUploadConvention.groovy
+--- a/clojuresque/src/main/groovy/clojuresque/ClojureUploadConvention.groovy
++++ b/clojuresque/src/main/groovy/clojuresque/ClojureUploadConvention.groovy
+@@ -1,5 +1,5 @@
+ /*-
+- * Copyright 2009,2010 © Meikel Brandmeyer.
++ * Copyright 2009-2013 © Meikel Brandmeyer.
+  * All rights reserved.
+  *
+  * Permission is hereby granted, free of charge, to any person obtaining a
+@@ -23,9 +23,12 @@
+ 
+ package clojuresque
+ 
++import org.gradle.api.InvalidUserDataException
+ import org.gradle.api.Project
+ import org.gradle.api.tasks.Upload
+ 
++import groovy.lang.Closure
++
+ class ClojureUploadConvention {
+     private Upload upload
+ 
+@@ -33,6 +36,27 @@
+         this.upload = upload
+     }
+ 
++    public void clojarsHttpDeploy(Closure projectSpec) {
++        Project p = upload.project
++
++        if (!p.hasProperty("clojuresqueClojarsUsername"))
++            throw new InvalidUserDataException("Clojars user is missing!")
++        if (!p.hasProperty("clojuresqueClojarsPassword"))
++            throw new InvalidUserDataException("Clojars password is missing!")
++
++        upload.mavenDeployer {
++            configuration = configurations.clojuresqueHttpDeployerJars
++            repository(url: p.clojuresqueClojarsUrl) {
++                authentication(
++                    userName: p.clojuresqueClojarsUsername,
++                    password: p.clojuresqueClojarsPassword
++                )
++            }
++            p.configure(pom.project, projectSpec)
++            beforeDeployment { signing.signPom(it) }
++        }
++    }
++
+     public void clojarsDeploy() {
+         upload.doLast {
+             String pomName = project.buildDir.path + "/" +
+205.diff
+204.diff
+move-away-from-JavaExec.diff
+plugin-deploy-via-http.diff