Commits

Anonymous committed 6538195 Merge

Merging with latest upstream

  • Participants
  • Parent commits f9af0d7, 40613bc

Comments (0)

Files changed (43)

 build/*
 lib/*
 .gradle/*
+.gradle*
+.idea/*
+*.iml
 ab1c08a1b455839a35353e00201e1659bd9cf381 v1.5.2
 9ad5c08355ba5c19e01ba0e5211ffaf8f340f4c5 v1.5.3
 40f259618c828be99e8c67ecd7b90d07bffac43e v1.5.4
+9db547b64ee5e40b5d73fcc5d95be2ac1701ebe9 v1.5.5
+bef1b88980563a2aaa3dee574910069c8ba01922 v1.5.6
+e53fa04c0cf57fcf7fb60e2b763dc0218ef09f6b v1.5.7
+8a20d9be8028a34591510cee58b0c01fdebf988b v1.5.8

File build.gradle

 buildscript {
+    repositories {
+        mavenCentral()
+        maven { url "http://clojars.org/repo" }
+    }
+
     dependencies {
-        classpath files("gradle/plugins/clojars-1.0.0.jar")
+        classpath "de.kotka.gradle:gradle-plugin:1.1.0"
     }
 }
 
-import clojuresque.ClojarsPlugin
-
 subprojects {
     group = 'clojuresque'
     version = '1.6.0-SNAPSHOT'
 
-    ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
+    ext.kotka = [
+        repository:     "clojuresque/clojuresque",
+        wrapperVersion: "1.8"
+    ]
 
     apply {
         plugin 'java'
-        plugin 'signing'
-        plugin ClojarsPlugin
+        plugin 'kotka'
     }
 
     repositories {
-        maven { url "http://127.0.0.1:8080/repository/internal" }
         mavenCentral()
     }
-
-    clojars {
-        deploy(uploadArchives) {
-            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/clojuresque/clojuresque"
-                scm {
-                    connection 'scm:hg:hg@bitbucket.org:clojuresque/clojuresque'
-                    developerConnection 'scm:hg:hg@bitbucket.org:clojuresque/clojuresque'
-                    url 'hg@bitbucket.org:clojuresque/clojuresque'
-                }
-            }
-        }
-    }
-
-    signing {
-        sign configurations.archives
-    }
 }
 
 project(':clojuresque') {
+    description = "A Clojure plugin for gradle"
+
     apply {
         plugin 'groovy'
     }
 
     dependencies {
         compile gradleApi()
-        // Workaround for milestone4
-        compile fileTree(dir: "${gradle.gradleHomeDir}/lib/plugins", include: '**/*.jar')
-        groovy localGroovy()
+        compile localGroovy()
+
+        compile "de.kotka.gradle:gradle-utils:0.1.0"
+
+        testCompile('org.spockframework:spock-core:0.7-groovy-1.8') {
+            exclude group: 'org.codehaus.groovy', module: 'groovy-all'
+        }
+    }
+
+    compileJava {
+        sourceCompatibility = "1.6"
+        targetCompatibility = "1.6"
+    }
+
+    compileGroovy {
+        sourceCompatibility = "1.6"
+        targetCompatibility = "1.6"
     }
 
     processResources {
+        inputs.property "version", {-> project.version}
         from(sourceSets.main.resources.srcDirs) {
             expand("version": project.version)
         }
 }
 
 project(':clojuresque-runtime') {
+    description = "A Clojure plugin for gradle (runtime files)"
+
+    configurations {
+        clojure
+    }
+
     dependencies {
-        compile 'org.clojure:clojure:[1.2,1.5)'
+        clojure 'org.clojure:clojure:1.5.1'
     }
+
+    sourceSets.main {
+        compileClasspath = project.files(
+            compileClasspath,
+            project.configurations.clojure
+        )
+    }
+
+    compileJava {
+        sourceCompatibility = "1.6"
+        targetCompatibility = "1.6"
+    }
+
 }
 
 task wrapper(type: Wrapper) {
-    gradleVersion = "1.0"
+    gradleVersion = "1.8"
 }

File clojuresque-runtime/gradle/wrapper/gradle-wrapper.jar

Binary file added.

File clojuresque-runtime/gradle/wrapper/gradle-wrapper.properties

+#Sun Sep 29 20:53:20 CEST 2013
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip

File clojuresque-runtime/gradlew

+#!/usr/bin/env 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 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 "$@"

File clojuresque-runtime/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

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

 /*-
- * 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 copy
 package clojuresque;
 
 import clojure.lang.RT;
-import clojure.lang.Symbol;
+import clojure.lang.Var;
 
 public class Driver {
+    static final Var require = RT.var("clojure.core", "require");
+    static final Var apply   = RT.var("clojure.core", "apply");
+    static final Var symbol  = RT.var("clojure.core", "symbol");
+    static final Var seq     = RT.var("clojure.core", "seq");
+    static final Var next    = RT.var("clojure.core", "next");
+    static final Var sa      = RT.var("clojure.core", "shutdown-agents");
+
     public static void main(String[] args) throws Exception {
+        int exitCode = 1;
         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))
-        );
+        try {
+            require.invoke(symbol.invoke(namespace));
+            Boolean result = (Boolean)apply.invoke(
+                    RT.var(namespace, function).deref(),
+                    next.invoke(seq.invoke(args))
+            );
+            if (result)
+                exitCode = 0;
+        } finally {
+            sa.invoke();
+        }
+
+        System.exit(exitCode);
     }
 }

File clojuresque-runtime/src/main/resources/clojuresque/tasks/compile.clj

     (binding [*warn-on-reflection* warn-on-reflection
               *compile-path*       (System/getProperty "clojure.compile.path")]
       (doseq [nspace namespaces]
-        (mode nspace)))))
+        (mode nspace))))
+  true)

File clojuresque-runtime/src/main/resources/clojuresque/tasks/doc.clj

                  :description description
                  :output-dir  destination
                  :sources     sources}]
-    (generate-docs project)))
+    (generate-docs project)
+    true))

File clojuresque-runtime/src/main/resources/clojuresque/tasks/test.clj

 
 (defn check-result
   [result]
-  (when (or (pos? (:fail result)) (pos? (:error result)))
-    (System/exit 1)))
+  (and (zero? (:fail result)) (zero? (:error result))))
 
 (deftask test-namespaces
   "Run all tests in the namespaces of the given files by virtue of clojure.test."

File clojuresque-runtime/src/main/resources/clojuresque/tasks/test_junit.clj

         ; test each namespace individually to allow per ns reporting of failures at the end
         (doseq [namespace namespaces]
           (test-namespace-with-junit-output namespace output-dir))
-        (shutdown-agents)
-        (when (:test @results)
-          (println "\nTotals:")
-          (report @results)
-          (println)
-          (if (successful? @results)
-            (do 
-              (println "Success!!!")
-              (System/exit 0))
-            (do
-              (println "\n!!! There were test failures:")
-              ; Print results for each namespace which was unsuccessful
-              (doseq [[ns summary] @failed]
-                (println ns ": " (:fail summary) "failures," (:error summary) "errors."))
-              (println)
-              (System/exit 1))))
-        (System/exit 0)))))
+        (if (:test @results)
+          (do
+            (println "\nTotals:")
+            (report @results)
+            (println)
+            (if (successful? @results)
+              (do
+                (println "Success!!!")
+                true)
+              (do
+                (println "\n!!! There were test failures:")
+                ; Print results for each namespace which was unsuccessful
+                (doseq [[ns summary] @failed]
+                  (println ns ": " (:fail summary) "failures," (:error summary) "errors."))
+                (println)
+                false)))
+          true)))))
 

File clojuresque/gradle/wrapper/gradle-wrapper.jar

Binary file added.

File clojuresque/gradle/wrapper/gradle-wrapper.properties

+#Sun Sep 29 20:53:20 CEST 2013
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip

File clojuresque/gradlew

+#!/usr/bin/env 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 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 "$@"

File clojuresque/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

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

 /*-
- * 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
 
 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 clojuresque.tasks.ClojureCompileTask
+import clojuresque.tasks.ClojureDocTask
+import clojuresque.tasks.ClojureSourceSet
+import clojuresque.tasks.ClojureTestTask
+import clojuresque.tasks.ClojureUploadConvention
+
 public class ClojureBasePlugin implements Plugin<Project> {
-    public void apply(Project project) {
-        project.apply plugin: JavaPlugin.class
-        project.apply plugin: MavenPlugin.class
+    void apply(Project project) {
+        project.apply plugin: "java"
+        project.apply plugin: "maven"
 
         project.convention.plugins.clojure =
             new ClojurePluginConvention(project)
 
-        RepositoryHandler repos = project.repositories
+        project.extensions.create("clojure", ClojurePluginExtension)
+
+        def repos = project.repositories
         repos.convention.plugins.clojure =
             new ClojureRepositoryConvention(repos)
 
         configureClojarsUpload(project)
     }
 
-    private void configureConfigurations(Project project) {
+    private void configureConfigurations(project) {
         project.configurations {
             clojuresque {
                 transitive = false
         }
     }
 
-    private void configureSourceSets(Project project) {
+    private void configureSourceSets(project) {
         ProjectInternal projectInternal = (ProjectInternal)project
 
         project.sourceSets.each { sourceSet ->
-            ClojureSourceSet clojureSourceSet =
+             def clojureSourceSet =
                 new ClojureSourceSet(sourceSet.name, projectInternal.fileResolver)
 
             sourceSet.convention.plugins.clojure = clojureSourceSet
-            sourceSet.clojure.srcDirs = [ String.format("src/%s/clojure", sourceSet.name) ]
+            sourceSet.clojure.srcDirs = [
+                String.format("src/%s/clojure", sourceSet.name)
+            ]
             sourceSet.allSource.source(clojureSourceSet.clojure)
         }
     }
 
-    private void configureCompilation(Project project) {
+    private void configureCompilation(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
+            def compileTaskName = set.getCompileTaskName("clojure")
+            def task = project.task(compileTaskName,
+                    type: ClojureCompileTask) {
+                delayedDestinationDir = { set.output.classesDir }
                 source set.clojure
                 clojureRoots = set.clojure
-                classpath = project.files(
-                    set.compileClasspath,
-                    project.configurations.development
-                )
+                delayedClasspath = {
+                    project.files(
+                        set.compileClasspath,
+                        project.configurations.development
+                    )
+                }
                 description =
                     String.format("Compile the %s Clojure source.",
                             set.name)
         }
     }
 
-    private void configureDocs(Project project) {
+    private void configureDocs(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"
-                )
+            def compileTaskName = set.getCompileTaskName("clojure")
+            def docTaskName = set.getTaskName(null, "clojuredoc")
+            def compileTask = project.tasks[compileTaskName]
+            def task = project.task(docTaskName, type: ClojureDocTask) {
+                delayedDestinationDir = {
+                    project.file(project.docsDir.path + "/clojuredoc")
+                }
+                jvmOpts = { compileTask.jvmOpts }
                 source set.clojure
                 clojureRoots = set.clojure
-                classpath = compileTask.classpath
+                delayedClasspath = { 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) {
+    private void configureTests(project) {
+        def compileTask = project.tasks[
+            project.sourceSets.main.getCompileTaskName("clojure")
+        ]
+        def clojureTest = project.task("clojureTest",
+                type: ClojureTestTask) {
             source project.sourceSets.test.clojure
             testRoots = project.sourceSets.test.clojure
-            classpath = project.configurations.testRuntime
-            classesDir = project.sourceSets.main.output.classesDir
+            delayedJvmOpts = { compileTask.jvmOpts }
+            delayedClasspath  = { project.configurations.testRuntime }
+            delayedClassesDir = { project.sourceSets.main.output.classesDir }
+            delayedJunitOutputDir = {
+                project.file(project.buildDir.path + "/test-results")
+            }
             dependsOn project.tasks.classes, project.configurations.testRuntime
             description = "Run Clojure tests in src/test."
             if (project.hasProperty("clojuresque.test.vars")) {
         project.tasks.test.dependsOn clojureTest
     }
 
-    private void configureClojarsUpload(Project project) {
+    private void configureClojarsUpload(project) {
         project.tasks.whenTaskAdded { upload ->
             if (!(upload instanceof Upload))
                 return

File 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
-            }
-        }
-    }
-}

File 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
-        }
-    }
-}

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

     }
 
     private void configureUberjar(Project project) {
-        project.tasks.withType(Jar.class).asMap.each { name, jar ->
-            project.tasks.add(name: "uber" + name, type: Jar.class) {
+        project.tasks.withType(Jar).asMap.each { name, jar ->
+            project.task("uber" + name, type: Jar) {
                 description =
                     'Constructs a jar with all runtime dependencies included'
                 dependsOn jar.source, project.configurations.runtime
     }
 
     private void configureDepsTask(Project project) {
-        Copy deps = project.tasks.add("deps", Copy.class)
+        Copy deps = project.task("deps", type: Copy)
 
         deps.configure {
             description =

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

 /*-
- * 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
 
 package clojuresque
 
+import clojuresque.tasks.ClojureExecAction
+import kotka.gradle.utils.ConfigureUtil
+
 import org.gradle.api.Project
 import org.gradle.process.ExecResult
 
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
+
 import groovy.lang.Closure
 
 class ClojurePluginConvention {
-    def boolean warnOnReflection = false
-    def boolean aotCompile = false
-    final Project project
+    private static final Logger LOGGER = LoggerFactory.getLogger(ClojurePluginConvention)
+    private final Project project
 
     public ClojurePluginConvention(Project project) {
         this.project = project
     }
 
     public ExecResult clojureexec(Closure spec) {
-        ClojureExecAction action = project.configure(
+        ClojureExecAction action = ConfigureUtil.configure(
             new ClojureExecAction(project.fileResolver,
                 project.configurations.clojuresque),
             spec
         )
         return action.execute()
     }
+
+    public void setAotCompile(boolean f) {
+        Util.deprecationWarning(LOGGER, "aotCompile", "clojure.aotCompile")
+        project.clojure.aotCompile = f
+    }
+
+    public boolean getAotCompile() {
+        Util.deprecationWarning(LOGGER, "aotCompile", "clojure.aotCompile")
+        return project.clojure.aotCompile
+    }
+
+    public void setWarnOnReflection(boolean f) {
+        Util.deprecationWarning(LOGGER, "warnOnReflection", "clojure.warnOnReflection")
+        project.clojure.warnOnReflection = f
+    }
+
+    public boolean getWarnOnReflection() {
+        Util.deprecationWarning(LOGGER, "warnOnReflection", "clojure.warnOnReflection")
+        return project.clojure.warnOnReflection
+    }
 }

File clojuresque/src/main/groovy/clojuresque/ClojurePluginExtension.groovy

+/*-
+ * Copyright 2009-2013 © 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
+
+class ClojurePluginExtension {
+    def boolean warnOnReflection = false
+    def boolean aotCompile       = false
+}

File 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"
-        )
-    }
-}

File 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
-    }
-}

File 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 boolean junit = false
-    def String junitOutputDir = "build/test-results" 
-    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 (junit) {
-                main = "clojuresque.tasks.test-junit/test-namespaces"
-                args = ["-o", junitOutputDir] + this.source.files
-            } else {
-                if (tests.size() == 0) {
-                    main = "clojuresque.tasks.test/test-namespaces"
-                    args = this.source.files
-                } else {
-                    main = "clojuresque.tasks.test/test-vars"
-                    args = tests
-                }
-            }
-        }
-    }
-}

File 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:' ]
-            }
-        }
-    }
-}

File clojuresque/src/main/groovy/clojuresque/Delay.groovy

+/*-
+ * Copyright 2013 © 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
+
+class Delay {
+    def Closure fn
+    def value
+
+    Delay(Closure f) {
+        fn = f
+    }
+
+    Delay(Object o) {
+        value = o
+    }
+
+    def getValue() {
+        if (fn != null) {
+            value = fn()
+            fn = null
+        }
+
+        this.value
+    }
+
+    def static force(Delay d) {
+        d.value
+    }
+
+    def static force(Object o) {
+        o
+    }
+}

File clojuresque/src/main/groovy/clojuresque/Util.groovy

 /*-
- * Copyright 2012 © Meikel Brandmeyer.
+ * Copyright 2012,2013 © Meikel Brandmeyer.
  * All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
 
 package clojuresque
 
-import java.io.InputStreamReader
+import org.slf4j.Logger
+
 import java.util.Properties
 
-public class Util {
+class Util {
     static Properties props = null;
 
-    public static Properties getProperties() {
+    static Properties getProperties() {
         if (props == null) {
             props = new Properties()
 
-            InputStreamReader propStream = new InputStreamReader(Util.class.getResourceAsStream("clojuresque.properties"), "UTF-8")
-
-            try {
-                props.load(propStream)
-            } finally {
-                propStream.close()
-            }
+            Util.class.
+                getResourceAsStream("clojuresque.properties").
+                withReader("UTF-8") { props.load it }
         }
 
         return props
     }
+
+    static deprecationWarning(Logger l, String o, String n) {
+        l.warn(String.format("'%s' is deprecated and will go away in a future version. Please use '%s' instead.", o, n))
+    }
 }

File clojuresque/src/main/groovy/clojuresque/tasks/ClojureCompileTask.groovy

+/*-
+ * Copyright 2009-2013 © 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.tasks
+
+import kotka.gradle.utils.ConfigureUtil
+import kotka.gradle.utils.Delayed
+
+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 {
+    @OutputDirectory
+    @Delayed
+    def destinationDir
+
+    @InputFiles
+    @Delayed
+    def classpath
+
+    def dirMode  = null
+    def fileMode = null
+
+    def clojureRoots
+
+    @Delayed
+    def jvmOptions = {}
+
+    @TaskAction
+    public void compile() {
+        def destDir = getDestinationDir()
+        if (destDir == null) {
+            throw new StopExecutionException("destinationDir not set!")
+        }
+        destDir.mkdirs()
+
+        List<String> options = []
+        if (project.clojure.aotCompile) {
+            options.add("--compile")
+        } else {
+            options.add("--require")
+        }
+        if (project.clojure.warnOnReflection) {
+            options.add("--warn-on-reflection")
+        }
+
+        project.clojureexec {
+            ConfigureUtil.configure delegate, this.jvmOptions
+            systemProperties "clojure.compile.path": destDir.path
+            classpath = project.files(
+                this.clojureRoots.srcDirs,
+                destDir,
+                this.classpath
+            )
+            main = "clojuresque.tasks.compile/main"
+            args = options + this.source.files
+        }
+
+        if (!project.clojure.aotCompile) {
+            project.copy {
+                dirMode  = this.dirMode
+                fileMode = this.fileMode
+
+                from source
+                into destDir
+            }
+        }
+    }
+}

File clojuresque/src/main/groovy/clojuresque/tasks/ClojureDocTask.groovy

+/*-
+ * Copyright 2011-2013 © 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.tasks
+
+import kotka.gradle.utils.ConfigureUtil
+import kotka.gradle.utils.Delayed
+
+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 {
+    @OutputDirectory
+    @Delayed
+    def destinationDir
+
+    @InputFiles
+    @Delayed
+    def classpath
+
+    def clojureRoots
+
+    @Delayed
+    def jvmOptions
+
+    @TaskAction
+    public void clojuredoc() {
+        def destDir = getDestinationDir()
+        if (destDir == null) {
+            throw new StopExecutionException("destinationDir not set!")
+        }
+        destDir.mkdirs()
+
+        project.clojureexec {
+            ConfigureUtil.configure delegate, this.jvmOptions
+            classpath = project.files(
+                this.clojureRoots.srcDirs,
+                this.classpath
+            )
+            main = "clojuresque.tasks.doc/main"
+            args = [
+                "-d", destDir.path,
+                "-n", project.name ?: "",
+                "-D", project.description ?: "",
+                "-v", project.version ?: ""
+            ] + source*.path
+        }
+    }
+}

File clojuresque/src/main/groovy/clojuresque/tasks/ClojureSourceSet.groovy

+/*-
+ * Copyright 2009-2013 © 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.tasks
+
+import kotka.gradle.utils.tasks.GenericSourceSet