Browse Source

upgrade to gradle 0.9 preview 1

kimchy 15 years ago
parent
commit
6ed23744fc

+ 31 - 19
build.gradle

@@ -2,7 +2,7 @@ import java.text.SimpleDateFormat
 
 defaultTasks "clean", "release"
 
-usePlugin BasePlugin
+apply plugin: 'base'
 
 archivesBaseName = 'elasticsearch'
 
@@ -69,32 +69,44 @@ task explodedDist(dependsOn: [configurations.distLib], description: 'Builds a mi
     ant.chmod(dir: "$explodedDistDir/bin", perm: "ugo+rx", includes: "**/*")
 }
 
-task zip(type: Zip) {
-    dependsOn explodedDist
-//    classifier = 'all'
-}
-
-zip.doFirst {task ->
+task zip(type: Zip, dependsOn: ['explodedDist']) {
     zipRootFolder = "$archivesBaseName-${-> version}"
-    task.configure {
-        zipFileSet(dir: explodedDistDir, prefix: zipRootFolder) {
-            exclude 'bin/*'
-        }
-        zipFileSet(dir: explodedDistDir, prefix: zipRootFolder, fileMode: '775') {
-            include 'bin/*'
-            exclude 'bin/*.*'
-        }
-        zipFileSet(dir: explodedDistDir, prefix: zipRootFolder) {
-            include 'bin/*.*'
-        }
+    from(explodedDistDir) {
+        into zipRootFolder
+        exclude 'bin/*'
+    }
+    from(explodedDistDir) {
+        into zipRootFolder
+        include 'bin/*'
+        exclude 'bin/*.*'
+        fileMode: '775'
+    }
+    from(explodedDistDir) {
+        into zipRootFolder
+        include 'bin/*.*'
     }
 }
 
+//zip.doFirst {task ->
+//    task.configure {
+//        zipFileSet(dir: explodedDistDir, prefix: zipRootFolder) {
+//            exclude 'bin/*'
+//        }
+//        zipFileSet(dir: explodedDistDir, prefix: zipRootFolder, fileMode: '775') {
+//            include 'bin/*'
+//            exclude 'bin/*.*'
+//        }
+//        zipFileSet(dir: explodedDistDir, prefix: zipRootFolder) {
+//            include 'bin/*.*'
+//        }
+//    }
+//}
+//
 task release(dependsOn: [zip, ":plugins-attachments:release"]) << {
     ant.delete(dir: explodedDistDir)
 }
 
 task wrapper(type: Wrapper) {
-    gradleVersion = '0.8'
+    gradleVersion = '0.9-preview-1'
     jarPath = 'gradle'
 }

BIN
gradle/gradle-wrapper.jar


+ 2 - 2
gradle/gradle-wrapper.properties

@@ -1,8 +1,8 @@
-#Sun Dec 13 20:16:46 IST 2009
+#Fri Apr 02 15:36:16 IDT 2010
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
-distributionVersion=0.8
+distributionVersion=0.9-preview-1
 zipStorePath=wrapper/dists
 urlRoot=http\://dist.codehaus.org/gradle
 distributionName=gradle

+ 9 - 3
gradlew

@@ -10,6 +10,8 @@
 GRADLE_OPTS="$GRADLE_OPTS -Xmx512m"
 # JAVA_OPTS="$JAVA_OPTS -Xmx512"
 
+GRADLE_APP_NAME=Gradle
+
 warn ( ) {
     echo "${PROGNAME}: $*"
 }
@@ -60,7 +62,7 @@ if $cygwin ; then
     [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
 fi
 
-STARTER_MAIN_CLASS=org.gradle.wrapper.WrapperMain
+STARTER_MAIN_CLASS=org.gradle.wrapper.GradleWrapperMain
 CLASSPATH=`dirname "$0"`/gradle/gradle-wrapper.jar
 WRAPPER_PROPERTIES=`dirname "$0"`/gradle/gradle-wrapper.properties
 # Determine the Java command to use to start the JVM.
@@ -83,10 +85,15 @@ if [ -z "$JAVA_HOME" ] ; then
     warn "JAVA_HOME environment variable is not set"
 fi
 
+# For Darwin, add GRADLE_APP_NAME to the JAVA_OPTS as -Xdock:name
+if $darwin; then
+    JAVA_OPTS="$JAVA_OPTS -Xdock:name=$GRADLE_APP_NAME"
+# we may also want to set -Xdock:image
+fi
+
 # For Cygwin, switch paths to Windows format before running java
 if $cygwin ; then
     JAVA_HOME=`cygpath --path --mixed "$JAVA_HOME"`
-    TOOLS_JAR=`cygpath --path --mixed "$TOOLS_JAR"`
     CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
 
     # We build the pattern for arguments to be converted via cygpath
@@ -130,7 +137,6 @@ fi
 
 "$JAVACMD" $JAVA_OPTS $GRADLE_OPTS \
         -classpath "$CLASSPATH" \
-        -Dtools.jar="$TOOLS_JAR" \
         -Dorg.gradle.wrapper.properties="$WRAPPER_PROPERTIES" \
         $STARTER_MAIN_CLASS \
         "$@"

+ 125 - 126
gradlew.bat

@@ -1,127 +1,126 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem                                                                         ##
-@rem  Gradle startup script for Windows                                      ##
-@rem                                                                         ##
-@rem ##########################################################################
-
-@rem
-@rem $Revision: 10602 $ $Date: 2008-01-25 02:49:54 +0100 (ven., 25 janv. 2008) $
-@rem
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together.
-set GRADLE_OPTS=%GRADLE_OPTS% -Xmx512m
-@rem set JAVA_OPTS=%JAVA_OPTS% -Xmx512
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.\
-
-@rem Determine the command interpreter to execute the "CD" later
-set COMMAND_COM="cmd.exe"
-if exist "%SystemRoot%\system32\cmd.exe" set COMMAND_COM="%SystemRoot%\system32\cmd.exe"
-if exist "%SystemRoot%\command.com" set COMMAND_COM="%SystemRoot%\command.com"
-
-@rem Use explicit find.exe to prevent cygwin and others find.exe from being used
-set FIND_EXE="find.exe"
-if exist "%SystemRoot%\system32\find.exe" set FIND_EXE="%SystemRoot%\system32\find.exe"
-if exist "%SystemRoot%\command\find.exe" set FIND_EXE="%SystemRoot%\command\find.exe"
-
-:check_JAVA_HOME
-@rem Make sure we have a valid JAVA_HOME
-if not "%JAVA_HOME%" == "" goto have_JAVA_HOME
-
-echo.
-echo ERROR: Environment variable JAVA_HOME has not been set.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-echo.
-goto end
-
-:have_JAVA_HOME
-@rem Validate JAVA_HOME
-%COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %FIND_EXE% /I /C "%JAVA_HOME%" >nul
-if not errorlevel 1 goto init
-
-echo.
-echo ERROR: JAVA_HOME might be 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 if there are problems.
-echo.
-
-:init
-@rem get name of script to launch with full path
-@rem Get command-line arguments, handling Windowz variants
-SET _marker=%JAVA_HOME: =%
-@rem IF NOT "%_marker%" == "%JAVA_HOME%" ECHO JAVA_HOME "%JAVA_HOME%" contains spaces. Please change to a location without spaces if this causes problems.
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%eval[2+2]" == "4" goto 4NT_args
-
-IF "%_marker%" == "%JAVA_HOME%" goto :win9xME_args
-
-set _FIXPATH=
-call :fixpath "%JAVA_HOME%"
-set JAVA_HOME=%_FIXPATH:~1%
-
-goto win9xME_args
-
-:fixpath
-if not %1.==. (
-for /f "tokens=1* delims=;" %%a in (%1) do (
-call :shortfilename "%%a" & call :fixpath "%%b"
-)
-)
-goto :EOF
-:shortfilename
-for %%i in (%1) do set _FIXPATH=%_FIXPATH%;%%~fsi
-goto :EOF
-
-
-: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 STARTER_MAIN_CLASS=org.gradle.wrapper.WrapperMain
-set CLASSPATH=%DIRNAME%\gradle\gradle-wrapper.jar
-set WRAPPER_PROPERTIES=%DIRNAME%\gradle\gradle-wrapper.properties
-set JAVA_EXE=%JAVA_HOME%\bin\java.exe
-set TOOLS_JAR=%JAVA_HOME%\lib\tools.jar
-
-set GRADLE_OPTS=%JAVA_OPTS% %GRADLE_OPTS% -Dtools.jar="%TOOLS_JAR%" -Dorg.gradle.wrapper.properties="%WRAPPER_PROPERTIES%" 
-
-"%JAVA_EXE%" %GRADLE_OPTS% -classpath "%CLASSPATH%" %STARTER_MAIN_CLASS% %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-if not "%OS%"=="Windows_NT" echo 1 > nul | choice /n /c:1
-
-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 "%ERRORLEVEL%"
-exit /b "%ERRORLEVEL%"
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem                                                                         ##
+@rem  Gradle startup script for Windows                                      ##
+@rem                                                                         ##
+@rem ##########################################################################
+
+@rem
+@rem $Revision: 10602 $ $Date: 2008-01-25 02:49:54 +0100 (ven., 25 janv. 2008) $
+@rem
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together.
+set GRADLE_OPTS=%GRADLE_OPTS% -Xmx512m
+@rem set JAVA_OPTS=%JAVA_OPTS% -Xmx512
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.\
+
+@rem Determine the command interpreter to execute the "CD" later
+set COMMAND_COM="cmd.exe"
+if exist "%SystemRoot%\system32\cmd.exe" set COMMAND_COM="%SystemRoot%\system32\cmd.exe"
+if exist "%SystemRoot%\command.com" set COMMAND_COM="%SystemRoot%\command.com"
+
+@rem Use explicit find.exe to prevent cygwin and others find.exe from being used
+set FIND_EXE="find.exe"
+if exist "%SystemRoot%\system32\find.exe" set FIND_EXE="%SystemRoot%\system32\find.exe"
+if exist "%SystemRoot%\command\find.exe" set FIND_EXE="%SystemRoot%\command\find.exe"
+
+:check_JAVA_HOME
+@rem Make sure we have a valid JAVA_HOME
+if not "%JAVA_HOME%" == "" goto have_JAVA_HOME
+
+echo.
+echo ERROR: Environment variable JAVA_HOME has not been set.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+echo.
+goto end
+
+:have_JAVA_HOME
+@rem Validate JAVA_HOME
+%COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %FIND_EXE% /I /C "%JAVA_HOME%" >nul
+if not errorlevel 1 goto init
+
+echo.
+echo ERROR: JAVA_HOME might be 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 if there are problems.
+echo.
+
+:init
+@rem get name of script to launch with full path
+@rem Get command-line arguments, handling Windowz variants
+SET _marker=%JAVA_HOME: =%
+@rem IF NOT "%_marker%" == "%JAVA_HOME%" ECHO JAVA_HOME "%JAVA_HOME%" contains spaces. Please change to a location without spaces if this causes problems.
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%eval[2+2]" == "4" goto 4NT_args
+
+IF "%_marker%" == "%JAVA_HOME%" goto :win9xME_args
+
+set _FIXPATH=
+call :fixpath "%JAVA_HOME%"
+set JAVA_HOME=%_FIXPATH:~1%
+
+goto win9xME_args
+
+:fixpath
+if not %1.==. (
+for /f "tokens=1* delims=;" %%a in (%1) do (
+call :shortfilename "%%a" & call :fixpath "%%b"
+)
+)
+goto :EOF
+:shortfilename
+for %%i in (%1) do set _FIXPATH=%_FIXPATH%;%%~fsi
+goto :EOF
+
+
+: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 STARTER_MAIN_CLASS=org.gradle.wrapper.GradleWrapperMain
+set CLASSPATH=%DIRNAME%\gradle\gradle-wrapper.jar
+set WRAPPER_PROPERTIES=%DIRNAME%\gradle\gradle-wrapper.properties
+set JAVA_EXE=%JAVA_HOME%\bin\java.exe
+
+set GRADLE_OPTS=%JAVA_OPTS% %GRADLE_OPTS% -Dorg.gradle.wrapper.properties="%WRAPPER_PROPERTIES%"
+
+"%JAVA_EXE%" %GRADLE_OPTS% -classpath "%CLASSPATH%" %STARTER_MAIN_CLASS% %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+if not "%OS%"=="Windows_NT" echo 1 > nul | choice /n /c:1
+
+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 "%ERRORLEVEL%"
+exit /b "%ERRORLEVEL%"
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
 :omega

+ 4 - 4
modules/benchmark/micro/build.gradle

@@ -1,6 +1,6 @@
 dependsOn(':elasticsearch')
 
-usePlugin 'java'
+apply plugin: 'java'
 
 archivesBaseName = "$rootProject.archivesBaseName-$project.archivesBaseName"
 
@@ -20,7 +20,7 @@ dependencies {
 
 test {
     useTestNG()
-    options.suiteName = project.name
-    options.listeners = ["org.elasticsearch.util.testng.Listeners"]
-    options.systemProperties = ["es.test.log.conf": System.getProperty("es.test.log.conf", "log4j-gradle.properties")]
+    suiteName = project.name
+    listeners = ["org.elasticsearch.util.testng.Listeners"]
+    systemProperties["es.test.log.conf"] = System.getProperty("es.test.log.conf", "log4j-gradle.properties")
 }

+ 5 - 5
modules/elasticsearch/build.gradle

@@ -1,7 +1,7 @@
 dependsOn(':test-testng')
 
-usePlugin 'java'
-usePlugin 'maven'
+apply plugin: 'java'
+apply plugin: 'maven'
 
 archivesBaseName = "$project.archivesBaseName"
 
@@ -63,9 +63,9 @@ dependencies {
 test {
     useTestNG()
     jmvArgs = ["-ea", "-Xmx1024m"]
-    options.suiteName = project.name
-    options.listeners = ["org.elasticsearch.util.testng.Listeners"]
-    options.systemProperties = ["es.test.log.conf": System.getProperty("es.test.log.conf", "log4j-gradle.properties")]
+    suiteName = project.name
+    listeners = ["org.elasticsearch.util.testng.Listeners"]
+    systemProperties["es.test.log.conf"] = System.getProperty("es.test.log.conf", "log4j-gradle.properties")
 }
 
 configure(install.repositories.mavenInstaller) {

+ 5 - 7
modules/test/integration/build.gradle

@@ -1,6 +1,6 @@
 dependsOn(':elasticsearch')
 
-usePlugin 'java'
+apply plugin: 'java'
 
 archivesBaseName = "$rootProject.archivesBaseName-$project.archivesBaseName"
 
@@ -22,10 +22,8 @@ dependencies {
 test {
     useTestNG()
     jmvArgs = ["-ea", "-Xmx1024m"]
-    options.suiteName = project.name
-    options.listeners = ["org.elasticsearch.util.testng.Listeners"]
-    options.systemProperties = [
-            "es.test.log.conf": System.getProperty("es.test.log.conf", "log4j-gradle.properties"),
-            "java.net.preferIPv4Stack": "true"
-    ]
+    suiteName = project.name
+    listeners = ["org.elasticsearch.util.testng.Listeners"]
+    systemProperties["es.test.log.conf"] = System.getProperty("es.test.log.conf", "log4j-gradle.properties")
+    systemProperties["java.net.preferIPv4Stack"] = "true"
 }

+ 2 - 2
modules/test/testng/build.gradle

@@ -1,4 +1,4 @@
-usePlugin 'java'
+apply plugin: 'java'
 
 archivesBaseName = "$rootProject.archivesBaseName-$project.archivesBaseName"
 
@@ -18,5 +18,5 @@ dependencies {
 
 test {
     useTestNG()
-    options.systemProperties = ["es.test.log.conf": "log4j-gradle.properties"]
+    systemProperties['es.test.log.conf'] = 'log4j-gradle.properties'
 }

+ 6 - 17
plugins/attachments/build.gradle

@@ -1,6 +1,6 @@
 dependsOn(':elasticsearch')
 
-usePlugin 'java'
+apply plugin: 'java'
 
 archivesBaseName = "elasticsearch-attachments"
 
@@ -43,11 +43,9 @@ dependencies {
 test {
     useTestNG()
     jmvArgs = ["-ea", "-Xmx1024m"]
-    options.suiteName = project.name
-    options.listeners = ["org.elasticsearch.util.testng.Listeners"]
-    options.systemProperties = [
-            "es.test.log.conf": System.getProperty("es.test.log.conf", "log4j-gradle.properties")
-    ]
+    suiteName = project.name
+    listeners = ["org.elasticsearch.util.testng.Listeners"]
+    systemProperties["es.test.log.conf"] = System.getProperty("es.test.log.conf", "log4j-gradle.properties")
 }
 
 task explodedDist(dependsOn: [jar], description: 'Builds the plugin zip file') << {
@@ -67,17 +65,8 @@ task explodedDist(dependsOn: [jar], description: 'Builds the plugin zip file') <
     }
 }
 
-task zip(type: Zip) {
-    dependsOn explodedDist
-//    classifier = 'all'
-}
-
-zip.doFirst {task ->
-    zipRootFolder = "" // its the plugin, don't create it under a specific name
-    task.configure {
-        zipFileSet(dir: explodedDistDir, prefix: zipRootFolder) {
-            // just copy over everything
-        }
+task zip(type: Zip, dependsOn: ['explodedDist']) {
+    from(explodedDistDir) {
     }
 }