Commits

Meikel Brandmeyer committed f3f7ddb Draft

Repository change!

  • Participants
  • Parent commits 55ce699

Comments (0)

Files changed (44)

LICENSE.txt

-Copyright 2009,2010 © Meikel Brandmeyer.
-All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-# clojuresque – a Clojure plugin for Gradle
+# Repository change!
 
-## What is Gradle?
+This repository is obsolete! Please use [the new repository](http://bitbucket.org/clojuresque/clojuresque)!
 
-[Gradle][] is a build system written in Java and [Groovy][]. One advantage
-of [Gradle][] is, that the build script itself is also a [Groovy][] script.
-That means whatever can be done in [Groovy][] can be done in the build
-script. This is useful to abstract away common patterns in the build like
-repetition or conditional decisions.
-
-On top of that [Gradle][] provides a convenient build system which comes
-in form of different plugins. Each plugin defines certain conventions which
-(if followed) automasie 95% of the build completely. Still the conventions
-are freely configurable to be adapted to different project structures.
-
-## What is clojuresque?
-
-[clojuresque][cg] is now a plugin for [Gradle][], which adds [Clojure][clj]
-support. It allows compilation with automatic namespace recognition. The
-plugin is based on the Java plugin and hooks into the standard configurations
-and archives.
-
-Contrary to the [Groovy][] plugin, there is no special `groovy` configuration.
-Java code in the same project might want to hook into [Clojure][] as well. So
-the [Clojure][] jar must be available also to the Java portion of the project.
-
-## Caveats
-
-* Automatic recognition of namespaces only works if the `ns` form is the
-  first in the file. Comments may precede the form. The symbol is allowed
-  to be fully qualified: `clojure.core/ns`.
-
-* [Clojars][cr] deployment is currently broken, because the clojars server
-  does not like a single Java implementation of ssh. With other servers like
-  the „real“ ssh it works quite well, though. I suspect the issue to be on
-  the clojars side.
-
-## Usage
-
-Create a `build.gradle` script in the root directory of your project. *Note
-that gradle derives the project name from the name of this directory!*
-
-    buildscript {
-        repositories {
-            mavenRepo name: 'clojars', urls: 'http://clojars.org/repo'
-        }
-        dependencies {
-            classpath 'clojuresque:clojuresque:1.4.1'
-        }
-    }
-    
-    group = 'example.group'
-    version = '1.0.0'
-    
-    apply plugin: 'clojure'
-    
-    warnOnReflection = true
-    aotCompile = true
-    
-    repositories {
-        mavenCentral()
-        clojarsRepo()
-    }
-    
-    dependencies {
-        compile 'org.clojure:clojure:1.2.1'
-    }
-
-A small walkthrough:
-
-* The `buildscript` part defines a dependency and automatically fetches
-  clojuresque from Clojars.
-* The `group` and `version` properties define the respective attributes of
-  your project. They are required for the POM generation.
-* `apply` basically loads the clojure plugin.
-* `warnOnReflection` turns on the reflection warnings of the clojure compiler
-* `aotCompile` specifies whether to produce a source jar or an AOT compiled
-  jar. The default is produce a source jar, because they also tend to be
-  smaller. [This issue was discussed on the Google group.][aot]
-* `clojarsRepo` adds the [Clojars Repository][cr].
-* In the `dependencies` section we add a dependency on clojure.
-
-## Filter
-
-In the filesets you can specify filters with `include` resp. `exclude`.
-This is fine for mostly file based languages. However clojure is strongly
-based on namespaces. Therefor the clojure part of the source sets support
-also `clojureIncludeNamespace` and `clojureExcludeNamespace` which can be
-used to filter on the namespace name. Eg. to exclude examples from the
-final jar one could use
-
-    sourceSets.main.clojure {
-        clojureExcludeNamespace 'my.project.examples.**.*'
-    }
-
-## Clojars Deployment
-
-**Note: Does work only on Unix/Mac OS via shell out to scp. Does not
-work on Windows! Make sure you have an agent running which handles your
-clojars key.**
-
-## Uberjars
-
-As Leiningen, Clojuresque now supports uberjars. That means you can enable
-the `uberjar` task with
-
-    uberjar.enabled = true
-
-Then invoking `gradle ueberjar` will create a jar file with all runtime
-dependencies included.
-
-## Issues
-
-This is **alpha** software! Expect problems! Please report issues in the
-bugtracker at [the lighthouse tracker][lh]. Or email them to me.
-
-General support is available on the [clojuresque google group][cgg].
-
--- 
-Meikel Brandmeyer <mb@kotka.de>
-Frankfurt am Main, January 2010
-
-[Gradle]: http://www.gradle.org
-[Groovy]: http://groovy.codehaus.org
-[clj]:    http://clojure.org
-[cg]:     http://bitbucket.org/kotarak/clojuresque
-[lh]:     http://kotka.lighthouseapp.com/projects/45093-clojuresque/overview
-[cr]:     http://clojars.org
-[hudson]: http://build.clojure.org
-[antbug]: https://issues.apache.org/bugzilla/show_bug.cgi?id=41090
-[aot]:    http://groups.google.com/group/clojure/browse_thread/thread/6cef4fcf523f936/3cfe17ba2d2a8a23
-[cgg]:    https://groups.google.com/forum/#!forum/clojuresque

build.gradle

-subprojects {
-    group = 'clojuresque'
-    version = '1.5.3'
-
-    apply plugin: 'signing'
-}
-
-project(':clojuresque') {
-    apply {
-        plugin 'groovy'
-        plugin 'maven'
-    }
-
-    dependencies {
-        compile gradleApi()
-        // Workaround for milestone4
-        compile fileTree(dir: "${gradle.gradleHomeDir}/lib/plugins", include: '**/*.jar')
-        groovy localGroovy()
-    }
-
-    processResources {
-        from(sourceSets.main.resources.srcDirs) {
-            expand("version": project.version)
-        }
-    }
-}
-
-project(':runtime') {
-    apply {
-        plugin 'java'
-        plugin 'maven'
-    }
-
-    repositories {
-        mavenCentral()
-    }
-
-    dependencies {
-        compile 'org.clojure:clojure:[1.2,1.5)'
-    }
-}
-
-subprojects {
-    ext.pomFile = project.buildDir.path + "/" +
-            project.mavenPomDir.name + "/" +
-            project.name + "-" + project.version + ".xml"
-
-    task writePom {
-        outputs.file project.pomFile
-    } << {
-        project.pom {
-            project {
-                licenses {
-                    license {
-                        name 'MIT License'
-                        url 'http://opensource.org/licenses/MIT'
-                        distribution 'repo'
-                    }
-                }
-                description "A Clojure plugin for the Gradle build system"
-                url "http://bitbucket.org/kotarak/clojuresque"
-                scm {
-                    connection 'scm:hg:hg@bitbucket.org:kotarak/clojuresque'
-                    developerConnection 'scm:hg:hg@bitbucket.org:kotarak/clojuresque'
-                    url 'hg@bitbucket.org:kotarak/clojuresque'
-                }
-            }
-        }.writeTo(project.pomFile)
-    }
-
-    artifacts {
-        writePom.outputs.files.each { archives it }
-    }
-
-    signing {
-        sign configurations.archives
-    }
-
-    signArchives {
-        dependsOn writePom
-    }
-
-    uploadArchives {
-        dependsOn project.writePom
-    } << {
-        project.exec {
-            commandLine(
-                '/usr/bin/scp',
-                project.pomFile,
-                project.pomFile + ".asc",
-                project.jar.archivePath.path,
-                project.jar.archivePath.path + ".asc",
-                'clojars@clojars.org:'
-            )
-        }
-    }
-}
-
-task wrapper(type: Wrapper) {
-    gradleVersion = "1.0"
-}

clojuresque/src/main/groovy/clojuresque/ClojureBasePlugin.groovy

-/*-
- * Copyright 2009,2010 © Meikel Brandmeyer.
- * All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-package clojuresque
-
-import org.gradle.api.Plugin
-import org.gradle.api.Project
-import org.gradle.api.artifacts.dsl.RepositoryHandler
-import org.gradle.api.internal.project.ProjectInternal
-import org.gradle.api.plugins.JavaPlugin
-import org.gradle.api.plugins.MavenPlugin
-import org.gradle.api.tasks.Upload
-
-import java.io.InputStreamReader
-import java.util.Properties
-
-public class ClojureBasePlugin implements Plugin<Project> {
-    public void apply(Project project) {
-        project.apply plugin: JavaPlugin.class
-        project.apply plugin: MavenPlugin.class
-
-        project.convention.plugins.clojure =
-            new ClojurePluginConvention(project)
-
-        RepositoryHandler repos = project.repositories
-        repos.convention.plugins.clojure =
-            new ClojureRepositoryConvention(repos)
-
-        configureConfigurations(project)
-        configureSourceSets(project)
-        configureCompilation(project)
-        configureDocs(project)
-        configureTests(project)
-        configureClojarsUpload(project)
-    }
-
-    private Properties getProperties() {
-        Properties props = new Properties()
-        InputStreamReader propStream =
-            new InputStreamReader(this.class.getResourceAsStream("clojuresque.properties"), "UTF-8")
-
-        try {
-            props.load(propStream)
-        } finally {
-            propStream.close()
-        }
-
-        return props
-    }
-
-    private void configureConfigurations(Project project) {
-        project.configurations {
-            clojuresque {
-                transitive = false
-                visible = false
-                description = "Clojuresque internal configuration. Don't use!"
-            }
-            development {
-                transitive = false
-                visible = false
-                description = "Development only dependencies"
-            }
-        }
-        project.dependencies {
-            clojuresque group: "clojuresque", name: "runtime",
-                version: this.properties.getProperty("clojuresque.version")
-        }
-    }
-
-    private void configureSourceSets(Project project) {
-        ProjectInternal projectInternal = (ProjectInternal)project
-
-        project.sourceSets.each { sourceSet ->
-            ClojureSourceSet clojureSourceSet =
-                new ClojureSourceSet(sourceSet.name, projectInternal.fileResolver)
-
-            sourceSet.convention.plugins.clojure = clojureSourceSet
-            sourceSet.clojure.srcDirs = [ String.format("src/%s/clojure", sourceSet.name) ]
-            sourceSet.resources.filter.exclude("**/*.clj")
-            sourceSet.allSource.source(clojureSourceSet.clojure)
-        }
-    }
-
-    private void configureCompilation(Project project) {
-        project.sourceSets.each { set ->
-            if (set.equals(project.sourceSets.test))
-                return
-            String compileTaskName = set.getCompileTaskName("clojure")
-            ClojureCompileTask task = project.tasks.add(name: compileTaskName,
-                    type: ClojureCompileTask.class) {
-                destinationDir = set.output.classesDir
-                source set.clojure
-                clojureRoots = set.clojure
-                classpath = project.files(
-                    set.compileClasspath,
-                    project.configurations.development
-                )
-                description =
-                    String.format("Compile the %s Clojure source.",
-                            set.name)
-            }
-            project.tasks[set.classesTaskName].dependsOn task
-        }
-    }
-
-    private void configureDocs(Project project) {
-        project.sourceSets.each { set ->
-            if (set.equals(project.sourceSets.test))
-                return
-            String compileTaskName = set.getCompileTaskName("clojure")
-            String docTaskName = set.getTaskName(null, "clojuredoc")
-            ClojureCompileTask compileTask = project.tasks[compileTaskName]
-            ClojureDocTask task = project.tasks.add(name: docTaskName,
-                    type: ClojureDocTask.class) {
-                destinationDir = project.file(
-                    project.docsDir.path + "/clojuredoc"
-                )
-                source set.clojure
-                clojureRoots = set.clojure
-                classpath = compileTask.classpath
-                description =
-                    String.format("Generate documentation for the %s Clojure source.",
-                            set.name)
-            }
-        }
-    }
-
-    private void configureTests(Project project) {
-        ClojureTestTask clojureTest = project.tasks.add(name: "clojureTest",
-                type: ClojureTestTask.class) {
-            source project.sourceSets.test.clojure
-            testRoots = project.sourceSets.test.clojure
-            classpath = project.configurations.testRuntime
-            classesDir = project.sourceSets.main.output.classesDir
-            dependsOn project.tasks.classes, project.configurations.testRuntime
-            description = "Run Clojure tests in src/test."
-            if (project.hasProperty("clojuresque.test.vars")) {
-                tests = project.getProperty("clojuresque.test.vars").split(",")
-            }
-        }
-        project.tasks.test.dependsOn clojureTest
-    }
-
-    private void configureClojarsUpload(Project project) {
-        project.tasks.whenTaskAdded { upload ->
-            if (!(upload instanceof Upload))
-                return
-            upload.convention.plugins.clojure =
-                new ClojureUploadConvention(upload)
-        }
-    }
-}

clojuresque/src/main/groovy/clojuresque/ClojureCompileTask.groovy

-/*-
- * Copyright 2009,2010 © Meikel Brandmeyer.
- * All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-package clojuresque
-
-import org.gradle.api.file.FileCollection
-import org.gradle.api.file.SourceDirectorySet
-import org.gradle.api.tasks.InputFiles
-import org.gradle.api.tasks.OutputDirectory
-import org.gradle.api.tasks.StopExecutionException
-import org.gradle.api.tasks.TaskAction
-
-import java.io.File
-import java.io.InputStream
-
-import groovy.lang.Closure
-
-public class ClojureCompileTask extends ClojureSourceTask {
-    def File destinationDir
-    def FileCollection classpath
-    def SourceDirectorySet clojureRoots
-    def Closure jvmOptions = {}
-
-    @OutputDirectory
-    public File getDestinationDir() {
-        return this.destinationDir
-    }
-
-    @InputFiles
-    public FileCollection getClasspath() {
-        return this.classpath
-    }
-
-    @TaskAction
-    public void compile() {
-        if (destinationDir == null) {
-            throw new StopExecutionException("destinationDir not set!")
-        }
-        destinationDir.mkdirs()
-
-        List<String> options = []
-        if (project.aotCompile) {
-            options.add("--compile")
-        } else {
-            options.add("--require")
-        }
-        if (project.warnOnReflection) {
-            options.add("--warn-on-reflection")
-        }
-
-
-        project.clojureexec {
-            project.configure delegate, this.jvmOptions
-            systemProperties "clojure.compile.path": this.destinationDir.path
-            classpath = project.files(
-                this.clojureRoots.srcDirs,
-                this.destinationDir,
-                this.classpath
-            )
-            main = "clojuresque.tasks.compile/main"
-            args = options + this.source.files
-        }
-
-        if (!project.aotCompile) {
-            project.copy {
-                from this.source
-                into this.destinationDir
-            }
-        }
-    }
-}

clojuresque/src/main/groovy/clojuresque/ClojureDocTask.groovy

-/*-
- * Copyright 2011 © Meikel Brandmeyer.
- * All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-package clojuresque
-
-import org.gradle.api.file.FileCollection
-import org.gradle.api.file.SourceDirectorySet
-import org.gradle.api.tasks.InputFiles
-import org.gradle.api.tasks.OutputDirectory
-import org.gradle.api.tasks.StopExecutionException
-import org.gradle.api.tasks.TaskAction
-
-import java.io.File
-import java.io.InputStream
-
-import groovy.lang.Closure
-
-public class ClojureDocTask extends ClojureSourceTask {
-    def File destinationDir
-    def FileCollection classpath
-    def SourceDirectorySet clojureRoots
-    def Closure jvmOptions = {}
-
-    @OutputDirectory
-    public File getDestinationDir() {
-        return this.destinationDir
-    }
-
-    @InputFiles
-    public FileCollection getClasspath() {
-        return this.classpath
-    }
-
-    @TaskAction
-    public void clojuredoc() {
-        if (destinationDir == null) {
-            throw new StopExecutionException("destinationDir not set!")
-        }
-
-        project.clojureexec {
-            this.jvmOptions()
-            classpath = project.files(
-                this.clojureRoots.srcDirs,
-                this.classpath
-            )
-            main = "clojuresque.tasks.doc/main"
-            args = [
-                "-d", this.destinationDir.path,
-                "-n", this.project.name ?: "",
-                "-D", this.project.description ?: "",
-                "-v", this.project.version ?: ""
-            ] + this.source*.path
-        }
-    }
-}

clojuresque/src/main/groovy/clojuresque/ClojurePlugin.groovy

-/*-
- * Copyright 2009,2010 © Meikel Brandmeyer.
- * All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-package clojuresque
-
-import org.gradle.api.Plugin
-import org.gradle.api.Project
-import org.gradle.api.tasks.Copy
-import org.gradle.api.tasks.bundling.Jar
-
-public class ClojurePlugin implements Plugin<Project> {
-    public void apply(Project project) {
-        project.apply plugin: ClojureBasePlugin.class
-
-        configureUberjar(project)
-        configureDepsTask(project)
-    }
-
-    private void configureUberjar(Project project) {
-        project.tasks.withType(Jar.class).each { jar ->
-            project.tasks.add(name: "uber" + jar.name, type: Jar.class) {
-                description =
-                    'Constructs a jar with all runtime dependencies included'
-                dependsOn jar.source, project.configurations.runtime
-                baseName = jar.baseName + "-standalone"
-                enabled = false
-                doFirst {
-                    project.configurations.runtime.each {
-                        from project.zipTree(it)
-                        exclude 'META-INF/MANIFEST.MF'
-                        exclude 'META-INF/*.SF'
-                        exclude 'META-INF/*.DSA'
-                        exclude 'META-INF/*.RSA'
-                    }
-                    from jar.source
-                }
-            }
-        }
-    }
-
-    private void configureDepsTask(Project project) {
-        Copy deps = project.tasks.add("deps", Copy.class)
-
-        deps.configure {
-            description =
-                'Copy runtime dependencies into the build/lib directory'
-            into 'lib'
-            from project.configurations.testRuntime
-            from project.configurations.development
-        }
-    }
-}

clojuresque/src/main/groovy/clojuresque/ClojurePluginConvention.groovy

-/*-
- * Copyright 2009,2010 © Meikel Brandmeyer.
- * All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-package clojuresque
-
-import org.gradle.api.Project
-import org.gradle.process.ExecResult
-
-import groovy.lang.Closure
-
-class ClojurePluginConvention {
-    def boolean warnOnReflection = false
-    def boolean aotCompile = false
-    final Project project
-
-    public ClojurePluginConvention(Project project) {
-        this.project = project
-    }
-
-    public ExecResult clojureexec(Closure spec) {
-        ClojureExecAction action = project.configure(spec,
-            new ClojureExecAction(project.fileResolver,
-                project.configurations.clojuresque))
-        return action.execute()
-    }
-}

clojuresque/src/main/groovy/clojuresque/ClojureRepositoryConvention.groovy

-/*-
- * Copyright 2009,2010 © Meikel Brandmeyer.
- * All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-package clojuresque
-
-import org.gradle.api.Project
-import org.gradle.api.artifacts.dsl.RepositoryHandler
-
-class ClojureRepositoryConvention {
-    private RepositoryHandler repos
-
-    public ClojureRepositoryConvention(RepositoryHandler repos) {
-        this.repos = repos
-    }
-
-    public void clojarsRepo() {
-        repos.maven { url 'http://clojars.org/repo' }
-    }
-}

clojuresque/src/main/groovy/clojuresque/ClojureSourceSet.groovy

-/*-
- * Copyright 2009,2010 © Meikel Brandmeyer.
- * All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-package clojuresque
-
-import groovy.lang.Closure
-
-import org.gradle.api.file.FileTree
-import org.gradle.api.file.SourceDirectorySet
-import org.gradle.api.internal.file.UnionFileTree
-import org.gradle.api.internal.file.DefaultSourceDirectorySet
-import org.gradle.api.internal.file.FileResolver
-import org.gradle.api.tasks.util.PatternFilterable
-import org.gradle.api.tasks.util.PatternSet
-import org.gradle.util.ConfigureUtil
-
-class ClojureSourceSet {
-    private final SourceDirectorySet clojure
-    private final UnionFileTree allClojure
-    private final PatternFilterable clojurePatterns = new PatternSet()
-
-    public ClojureSourceSet(String displayName, FileResolver fileResolver) {
-        clojure = new DefaultSourceDirectorySet(String.format("%s Clojure source", displayName), fileResolver)
-        clojure.filter.include("**/*.clj")
-        clojurePatterns.include("**/*.clj")
-        allClojure = new UnionFileTree(String.format("%s Clojure source", displayName), clojure.matching(clojurePatterns))
-    }
-
-    public SourceDirectorySet getClojure() {
-        return clojure
-    }
-
-    public ClojureSourceSet clojure(Closure configureClosure) {
-        ConfigureUtil.configure(configureClosure, this.clojure)
-        return this
-    }
-
-    public PatternFilterable getClojureSourcePatterns() {
-        return clojurePatterns
-    }
-
-    public FileTree getAllClojure() {
-        return allClojure
-    }
-
-    public void clojureIncludeNamespace(String pattern) {
-        clojure.include(
-            pattern.replaceAll("-", "_").replaceAll("\\.", "/") + ".clj"
-        )
-    }
-
-    public void clojureExcludeNamespace(String pattern) {
-        clojure.exclude(
-            pattern.replaceAll("-", "_").replaceAll("\\.", "/") + ".clj"
-        )
-    }
-}

clojuresque/src/main/groovy/clojuresque/ClojureSourceTask.groovy

-/*-
- * Copyright 2009,2010 © Meikel Brandmeyer.
- * All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-package clojuresque
-
-import org.gradle.api.tasks.SourceTask
-
-public class ClojureSourceTask extends SourceTask {
-    /* Duplicate the functionality of ClojureSourceSet. */
-    public ClojureSourceTask includeNamespace(String pattern) {
-        include(pattern.replaceAll("-", "_").replaceAll("\\.", "/") + ".clj")
-        return this
-    }
-
-    public ClojureSourceTask excludeNamespace(String pattern) {
-        exclude(pattern.replaceAll("-", "_").replaceAll("\\.", "/") + ".clj")
-        return this
-    }
-}

clojuresque/src/main/groovy/clojuresque/ClojureTestTask.groovy

-/*-
- * Copyright 2009-2011 © Meikel Brandmeyer.
- * All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-package clojuresque
-
-import org.gradle.api.file.FileCollection
-import org.gradle.api.file.SourceDirectorySet
-import org.gradle.api.tasks.InputFiles
-import org.gradle.api.tasks.TaskAction
-
-import java.io.File
-import java.io.InputStream
-
-import groovy.lang.Closure
-
-public class ClojureTestTask extends ClojureSourceTask {
-    def File classesDir
-    def FileCollection classpath
-    def SourceDirectorySet testRoots
-    def Closure jvmOptions = {}
-    def List<String> tests = []
-
-    @InputFiles
-    public FileCollection getTestClasspath() {
-        return this.classpath
-    }
-
-    @TaskAction
-    public void runTests() {
-        project.clojureexec {
-            project.configure delegate, this.jvmOptions
-            classpath = project.files(
-                this.testRoots.srcDirs,
-                this.classesDir,
-                this.classpath
-            )
-            if (tests.size() == 0) {
-                main = "clojuresque.tasks.test/test-namespaces"
-                args = this.source.files
-            } else {
-                main = "clojuresque.tasks.test/test-vars"
-                args = tests
-            }
-        }
-    }
-}

clojuresque/src/main/groovy/clojuresque/ClojureUploadConvention.groovy

-/*-
- * Copyright 2009,2010 © Meikel Brandmeyer.
- * All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-package clojuresque
-
-import org.gradle.api.Project
-import org.gradle.api.tasks.Upload
-
-class ClojureUploadConvention {
-    private Upload upload
-
-    public ClojureUploadConvention(Upload upload) {
-        this.upload = upload
-    }
-
-    public void clojarsDeploy() {
-        upload.doLast {
-            String pomName = project.buildDir.path + "/" +
-                project.mavenPomDir.path + "/" +
-                "pom-" + upload.configuration.name + ".xml"
-
-            project.pom().writeTo(pomName)
-            project.exec {
-                executable = '/usr/bin/scp'
-                args = project.files(upload.artifacts)*.path +
-                    [ project.file(pomName).path,
-                      'clojars@clojars.org:' ]
-            }
-        }
-    }
-}

clojuresque/src/main/java/clojuresque/ClojureExec.java

-/*
- * Copyright 2009,2010 © Meikel Brandmeyer.
- * All rights reserved.
- * 
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-package clojuresque;
-
-import org.gradle.api.file.FileCollection;
-import org.gradle.api.internal.file.FileResolver;
-import org.gradle.api.internal.project.ProjectInternal;
-import org.gradle.api.internal.ConventionTask;
-import org.gradle.api.tasks.TaskAction;
-import org.gradle.process.JavaExecSpec;
-import org.gradle.process.JavaForkOptions;
-import org.gradle.process.ProcessForkOptions;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.List;
-import java.util.Map;
-
-public class ClojureExec extends ConventionTask implements JavaExecSpec {
-    private ClojureExecAction clojureExecAction;
-
-    public ClojureExec() {
-        super();
-
-        FileCollection driverConf = getProject().getConfigurations().getByName("clojuresque");
-        FileResolver fileResolver = ((ProjectInternal)getProject()).getFileResolver();
-        clojureExecAction = new ClojureExecAction(fileResolver, driverConf);
-    }
-
-    @TaskAction
-    void exec() {
-        clojureExecAction.execute();
-    }
-
-    public List<String> getAllJvmArgs() {
-        return clojureExecAction.getAllJvmArgs();
-    }
-
-    public void setAllJvmArgs(Iterable<?> arguments) {
-        clojureExecAction.setAllJvmArgs(arguments);
-    }
-
-    public List<String> getJvmArgs() {
-        return clojureExecAction.getJvmArgs();
-    }
-
-    public void setJvmArgs(Iterable<?> arguments) {
-        clojureExecAction.setJvmArgs(arguments);
-    }
-
-    public ClojureExec jvmArgs(Iterable<?> arguments) {
-        clojureExecAction.jvmArgs(arguments);
-        return this;
-    }
-
-    public ClojureExec jvmArgs(Object... arguments) {
-        clojureExecAction.jvmArgs(arguments);
-        return this;
-    }
-
-    public Map<String, Object> getSystemProperties() {
-        return clojureExecAction.getSystemProperties();
-    }
-
-    public void setSystemProperties(Map<String, ?> properties) {
-        clojureExecAction.setSystemProperties(properties);
-    }
-
-    public ClojureExec systemProperties(Map<String, ?> properties) {
-        clojureExecAction.systemProperties(properties);
-        return this;
-    }
-
-    public ClojureExec systemProperty(String name, Object value) {
-        clojureExecAction.systemProperty(name, value);
-        return this;
-    }
-
-    public FileCollection getBootstrapClasspath() {
-        return clojureExecAction.getBootstrapClasspath();
-    }
-
-    public void setBootstrapClasspath(FileCollection classpath) {
-        clojureExecAction.setBootstrapClasspath(classpath);
-    }
-
-    public ClojureExec bootstrapClasspath(Object... classpath) {
-        clojureExecAction.bootstrapClasspath(classpath);
-        return this;
-    }
-
-    public String getMaxHeapSize() {
-        return clojureExecAction.getMaxHeapSize();
-    }
-
-    public void setMaxHeapSize(String heapSize) {
-        clojureExecAction.setMaxHeapSize(heapSize);
-    }
-
-    public String getMinHeapSize() {
-        return clojureExecAction.getMinHeapSize();
-    }
-
-    public void setMinHeapSize(String heapSize) {
-        clojureExecAction.setMinHeapSize(heapSize);
-    }
-
-    public boolean getEnableAssertions() {
-        return clojureExecAction.getEnableAssertions();
-    }
-
-    public void setEnableAssertions(boolean enabled) {
-        clojureExecAction.setEnableAssertions(enabled);
-    }
-
-    public boolean getDebug() {
-        return clojureExecAction.getDebug();
-    }
-
-    public void setDebug(boolean enabled) {
-        clojureExecAction.setDebug(enabled);
-    }
-
-    public String getMain() {
-        return clojureExecAction.getMain();
-    }
-
-    public ClojureExec setMain(String mainClassName) {
-        clojureExecAction.setMain(mainClassName);
-        return this;
-    }
-
-    public List<String> getArgs() {
-        return clojureExecAction.getArgs();
-    }
-
-    public ClojureExec setArgs(Iterable<?> applicationArgs) {
-        clojureExecAction.setArgs(applicationArgs);
-        return this;
-    }
-
-    public ClojureExec args(Object... args) {
-        clojureExecAction.args(args);
-        return this;
-    }
-
-    public JavaExecSpec args(Iterable<?> args) {
-        clojureExecAction.args(args);
-        return this;
-    }
-
-    public ClojureExec setClasspath(FileCollection classpath) {
-        clojureExecAction.setClasspath(classpath);
-        return this;
-    }
-
-    public ClojureExec classpath(Object... paths) {
-        clojureExecAction.classpath(paths);
-        return this;
-    }
-
-    public FileCollection getClasspath() {
-        return clojureExecAction.getClasspath();
-    }
-
-    public ClojureExec copyTo(JavaForkOptions options) {
-        clojureExecAction.copyTo(options);
-        return this;
-    }
-
-    public String getExecutable() {
-        return clojureExecAction.getExecutable();
-    }
-
-    public void setExecutable(Object executable) {
-        clojureExecAction.setExecutable(executable);
-    }
-
-    public ClojureExec executable(Object executable) {
-        clojureExecAction.executable(executable);
-        return this;
-    }
-
-    public File getWorkingDir() {
-        return clojureExecAction.getWorkingDir();
-    }
-
-    public void setWorkingDir(Object dir) {
-        clojureExecAction.setWorkingDir(dir);
-    }
-
-    public ClojureExec workingDir(Object dir) {
-        clojureExecAction.workingDir(dir);
-        return this;
-    }
-
-    public Map<String, Object> getEnvironment() {
-        return clojureExecAction.getEnvironment();
-    }
-
-    public void setEnvironment(Map<String, ?> environmentVariables) {
-        clojureExecAction.setEnvironment(environmentVariables);
-    }
-
-    public ClojureExec environment(String name, Object value) {
-        clojureExecAction.environment(name, value);
-        return this;
-    }
-
-    public ClojureExec environment(Map<String, ?> environmentVariables) {
-        clojureExecAction.environment(environmentVariables);
-        return this;
-    }
-
-    public ClojureExec copyTo(ProcessForkOptions target) {
-        clojureExecAction.copyTo(target);
-        return this;
-    }
-
-    public ClojureExec setStandardInput(InputStream inputStream) {
-        clojureExecAction.setStandardInput(inputStream);
-        return this;
-    }
-
-    public InputStream getStandardInput() {
-        return clojureExecAction.getStandardInput();
-    }
-
-    public ClojureExec setStandardOutput(OutputStream outputStream) {
-        clojureExecAction.setStandardOutput(outputStream);
-        return this;
-    }
-
-    public OutputStream getStandardOutput() {
-        return clojureExecAction.getStandardOutput();
-    }
-
-    public ClojureExec setErrorOutput(OutputStream outputStream) {
-        clojureExecAction.setErrorOutput(outputStream);
-        return this;
-    }
-
-    public OutputStream getErrorOutput() {
-        return clojureExecAction.getErrorOutput();
-    }
-
-    public JavaExecSpec setIgnoreExitValue(boolean ignoreExitValue) {
-        clojureExecAction.setIgnoreExitValue(ignoreExitValue);
-        return this;
-    }
-
-    public boolean isIgnoreExitValue() {
-        return clojureExecAction.isIgnoreExitValue();
-    }
-
-    public List<String> getCommandLine() {
-        return clojureExecAction.getCommandLine();
-    }
-
-    public void setDefaultCharacterEncoding(String defaultCharacterEncoding) {
-        clojureExecAction.setDefaultCharacterEncoding(defaultCharacterEncoding);
-    }
-
-    public String getDefaultCharacterEncoding() {
-        return clojureExecAction.getDefaultCharacterEncoding();
-    }
-}

clojuresque/src/main/java/clojuresque/ClojureExecAction.java

-/*-
- * Copyright 2009,2010 © Meikel Brandmeyer.
- * All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-package clojuresque;
-
-import org.gradle.api.file.FileCollection;
-import org.gradle.api.internal.file.FileResolver;
-import org.gradle.process.ExecResult;
-import org.gradle.process.internal.ExecHandle;
-import org.gradle.process.internal.JavaExecAction;
-import org.gradle.process.internal.JavaExecHandleBuilder;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-public class ClojureExecAction extends JavaExecHandleBuilder implements JavaExecAction {
-    FileCollection driverClasspath;
-
-    public ClojureExecAction(FileResolver fileResolver, FileCollection driver) {
-        super(fileResolver);
-        this.driverClasspath = driver;
-    }
-
-    @Override
-    public List<String> getAllJvmArgs() {
-        List<String> allArgs = super.getAllJvmArgs();
-        String driver = driverClasspath.getAsPath();
-
-        int pos = allArgs.indexOf("-cp") + 1;
-        if (pos > 0) {
-            String oldClasspath = allArgs.remove(pos);
-            allArgs.add(pos, oldClasspath + File.pathSeparator + driver);
-        } else {
-            allArgs.add("-cp");
-            allArgs.add(driver);
-        }
-
-        return allArgs;
-    }
-
-    @Override
-    public List<String> getAllArguments() {
-        List<String> arguments = new ArrayList<String>();
-        arguments.addAll(getAllJvmArgs());
-        arguments.add("clojuresque.Driver");
-        arguments.add(getMain());
-        arguments.addAll(getArgs());
-        return arguments;
-    }
-
-    public ExecResult execute() {
-        ExecHandle execHandle = build();
-        ExecResult execResult = execHandle.start().waitForFinish();
-        if (!isIgnoreExitValue()) {
-            execResult.assertNormalExitValue();
-        }
-        return execResult;
-    }
-}

clojuresque/src/main/resources/META-INF/gradle-plugins/clojure-min.properties

-implementation-class=clojuresque.ClojureBasePlugin

clojuresque/src/main/resources/META-INF/gradle-plugins/clojure.properties

-implementation-class=clojuresque.ClojurePlugin

clojuresque/src/main/resources/clojuresque/clojuresque.properties

-clojuresque.version = ${version}

gradle/wrapper/gradle-wrapper.jar

Binary file removed.

gradle/wrapper/gradle-wrapper.properties

-#Wed Jun 13 23:01:39 CEST 2012
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.0-bin.zip

gradlew

-#!/bin/bash
-
-##############################################################################
-##
-##  Gradle start up script for UN*X
-##
-##############################################################################
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
-    echo "$*"
-}
-
-die ( ) {
-    echo
-    echo "$*"
-    echo
-    exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
-  CYGWIN* )
-    cygwin=true
-    ;;
-  Darwin* )
-    darwin=true
-    ;;
-  MINGW* )
-    msys=true
-    ;;
-esac
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
-    [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
-    ls=`ls -ld "$PRG"`
-    link=`expr "$ls" : '.*-> \(.*\)$'`
-    if expr "$link" : '/.*' > /dev/null; then
-        PRG="$link"
-    else
-        PRG=`dirname "$PRG"`"/$link"
-    fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/"
-APP_HOME="`pwd -P`"
-cd "$SAVED"
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
-    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
-        # IBM's JDK on AIX uses strange locations for the executables
-        JAVACMD="$JAVA_HOME/jre/sh/java"
-    else
-        JAVACMD="$JAVA_HOME/bin/java"
-    fi
-    if [ ! -x "$JAVACMD" ] ; then
-        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-    fi
-else
-    JAVACMD="java"
-    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
-    MAX_FD_LIMIT=`ulimit -H -n`
-    if [ $? -eq 0 ] ; then
-        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
-            MAX_FD="$MAX_FD_LIMIT"
-        fi
-        ulimit -n $MAX_FD
-        if [ $? -ne 0 ] ; then
-            warn "Could not set maximum file descriptor limit: $MAX_FD"
-        fi
-    else
-        warn "Could not query businessSystem maximum file descriptor limit: $MAX_FD_LIMIT"
-    fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
-    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
-    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
-    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
-
-    # We build the pattern for arguments to be converted via cygpath
-    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
-    SEP=""
-    for dir in $ROOTDIRSRAW ; do
-        ROOTDIRS="$ROOTDIRS$SEP$dir"
-        SEP="|"
-    done
-    OURCYGPATTERN="(^($ROOTDIRS))"
-    # Add a user-defined pattern to the cygpath arguments
-    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
-        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
-    fi
-    # Now convert the arguments - kludge to limit ourselves to /bin/sh
-    i=0
-    for arg in "$@" ; do
-        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
-        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
-
-        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
-            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
-        else
-            eval `echo args$i`="\"$arg\""
-        fi
-        i=$((i+1))
-    done
-    case $i in
-        (0) set -- ;;
-        (1) set -- "$args0" ;;
-        (2) set -- "$args0" "$args1" ;;
-        (3) set -- "$args0" "$args1" "$args2" ;;
-        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
-        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
-        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
-        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
-        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
-        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
-    esac
-fi
-
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
-    JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

gradlew.bat

-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem  Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega

runtime/src/main/java/clojuresque/Driver.java

-/*-
- * Copyright 2009,2010 © Meikel Brandmeyer.
- * All rights reserved.
- * 
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-package clojuresque;
-
-import clojure.lang.RT;
-import clojure.lang.Symbol;
-
-public class Driver {
-    public static void main(String[] args) throws Exception {
-        final String command = args[0];
-
-        int slash = command.indexOf("/");
-
-        final String namespace = command.substring(0, slash);
-        final String function  = command.substring(slash + 1);
-
-        RT.var("clojure.core", "require").invoke(Symbol.create(namespace));
-        RT.var("clojure.core", "apply").invoke(
-                RT.var(namespace, function).deref(),
-                RT.next(RT.seq(args))
-        );
-    }
-}

runtime/src/main/resources/clojuresque/cli.clj

-(ns clojuresque.cli)
-
-(defn- str-cut
-  [s n]
-  (subs s 0 (- (count s) n)))
-
-(defn- print-usage
-  "Print usage information for the given option spec."
-  [description specs]
-  (println description)
-  (newline)
-  (println "Options:")
-  (doseq [spec (filter vector? specs)]
-    (let [loption (name (first spec))
-          spec    (rest spec)
-          soption (when (symbol? (first spec)) (name (first spec)))
-          spec    (if soption (rest spec) spec)
-          descr   (first spec)
-          default (first (rest spec))]
-      (print (format "  --%-10s " loption))
-      (when soption
-        (print (format "-%-3s " soption)))
-      (print descr)
-      (when default
-        (newline)
-        (print (format "                    The default is '%s'." default))))
-    (newline))
-  (flush))
-
-(defn with-command-line*
-  "Parse the command line arguments according to the given specifications.
-  A specification consists of a vector of an option name, an optional short
-  option name, a description and an optional default value. An option name
-  ending in ? designates a boolean flag. The last entry in the list of
-  specifications might be a symbol which is bound to the rest of the command
-  line arguments when -- or the first non-option argument is encountered.
-
-  -h, --help or -? stop the parsing and trigger the printing of the usage
-  message and thunk is not called.
-
-  thunk is called with a map of option-value pairs found on the command line."
-  [args description specs thunk]
-  (let [[options soptions]
-        (reduce (fn [[opts sopts] spec]
-                  (let [lopt  (name (first spec))
-                        sopt  (second spec)
-                        sopt  (if (symbol? sopt) (name sopt) nil)
-                        [lopt sopt type]
-                        (if (.endsWith lopt "?")
-                          [(str-cut lopt 1) sopt :flag]
-                          [lopt             sopt :option])]
-                    (vector (assoc opts lopt type)
-                            (assoc sopts sopt lopt))))
-                [{} {}]
-                (filter vector? specs))
-        rest-arg (when (symbol? (last specs)) (name (last specs)))]
-    (loop [args   (seq args)
-           argmap (hash-map)]
-      (let [arg (first args)]
-        (cond
-          (nil? args)
-          (if-not rest-arg
-            (thunk argmap)
-            (throw (Exception. "Missing command line arguments")))
-
-          (some #{arg} ["-h" "--help" "-?"])
-          (print-usage description specs)
-
-          (= arg "--")
-          (if rest-arg
-            (thunk (assoc argmap rest-arg (rest args)))
-            (throw (Exception.  "Unexpected command line arguments")))
-
-          (.startsWith arg "--")
-          (let [option (subs arg 2)]
-            (condp = (get options option)
-              :flag   (recur (next args) (assoc argmap option true))
-              :option (if-let [value (second args)]
-                        (recur (nthnext args 2) (assoc argmap option value))
-                        (throw
-                          (Exception.  (str "Missing value for option: " arg))))
-              nil     (throw (Exception. (str "Unknown option: " option)))))
-
-          (.startsWith arg "-")
-          (let [option (subs arg 1)]
-            (if-let [loption (get soptions option)]
-              (recur (cons (str "--" loption) (rest args)) argmap)
-              (throw (Exception. (str "Unknown option: " option)))))
-
-          :else
-          (if rest-arg
-            (thunk (assoc argmap rest-arg args))
-            (throw (Exception.  "Unexpected command line arguments"))))))))
-
-(defmacro with-command-line
-  "Parses the command line arguments given according to the specifications.
-  A specification consists of a vector of an option name, an optional short
-  option name, a description and an optional default value. An option name
-  ending in ? designates a boolean flag. The last entry in the list of
-  specifications might be a symbol which is bound to the rest of the command
-  line arguments when -- or the first non-option argument is encountered.
-
-  -h, --help or -? stop the parsing and trigger the printing of the usage
-  message and body is not executed.
-
-  The body is executed with the long option names bound to the value found
-  on the command line or the default value if the option was not given.
-  Flags default to nil, ie. logical false."
-  [args description specs & body]
-  (let [defaults (map (fn [spec]
-                        (cond
-                          (not (vector? spec)) [spec nil]
-
-                          (-> spec first name (.endsWith "?"))
-                          (vector (-> spec first name (str-cut 1) symbol) false)
-
-                          (-> spec second symbol?)
-                          (vector (first spec) (when (= (count spec) 4)
-                                                 (nth spec 3)))
-
-                          :else
-                          (vector (first spec) (when (= (count spec) 3)
-                                                         (nth spec 2)))))
-                      specs)]
-    `(with-command-line* ~args
-       ~description
-       (quote ~specs)
-       (fn [{:strs ~(vec (map first defaults))
-             :or   ~(into {} defaults)}]
-         ~@body))))
-
-(defmacro deftask
-  "Defines a new task which is callable from clojuresque via the runtime.
-  It adds command line option parsing around a function. So a „task“ is
-  also callable as a normal function with a sequence of options."
-  [name description options & body]
-  `(defn ~name
-     ~description
-     [& args#]
-     (with-command-line args#
-       ~description
-       ~options
-       ~@body)))

runtime/src/main/resources/clojuresque/clojure/java/classpath.clj

-;;; classpath.clj: utilities for working with the Java class path
-
-;; by Stuart Sierra, http://stuartsierra.com/
-;; April 19, 2009
-
-;; Copyright (c) Rich Hickey, Stuart Sierra, and contributors.
-;; All rights reserved.  The use
-;; and distribution terms for this software are covered by the Eclipse
-;; Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
-;; which can be found in the file epl-v10.html at the root of this
-;; distribution.  By using this software in any fashion, you are
-;; agreeing to be bound by the terms of this license.  You must not
-;; remove this notice, or any other, from this software.
-
-
-(ns
-  ^{:author "Stuart Sierra"
-     :doc "Utilities for dealing with the JVM's classpath"}