Skip to content

Commit

Permalink
Upgrade to rc-1, which means we don't need the path convert code
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Ryan committed Apr 12, 2012
1 parent 1fe3dcb commit a1a70cf
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 50 deletions.
30 changes: 1 addition & 29 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,33 +51,5 @@ jenkinsPlugin {
}
}

task createWrapper(type: Wrapper) { gradleVersion = '1.0-milestone-9' }
task createWrapper(type: Wrapper) { gradleVersion = '1.0-rc-1' }

/** Added to work around the bug GRADLE-1420 */
task pathingJar(type: Jar , dependsOn: 'cleanPathingJar') {
/**
* If the gradle_user_home env var has been set to
* C:\ on a Win7 machine, we may not have permission to write the jar to
* this directory, so we will write it to the caches subdir instead.
* This assumes a caches subdir containing the jars
* will always exist.
*/
gradleUserHome = new File(gradle.getGradleUserHomeDir(), "caches")

relativeClasspathEntries = configurations.compile.files.collect {
new File(gradleUserHome.getAbsolutePath()).toURI().
relativize(new File(it.getAbsolutePath()).toURI()).getPath()
}
appendix = "pathing"
destinationDir = gradleUserHome
doFirst {
manifest {
attributes "Class-Path": relativeClasspathEntries.join(" ")
}
}
}

compileGroovy {
dependsOn(pathingJar)
classpath = files(pathingJar.archivePath)
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Mar 26 12:28:35 PDT 2012
#Thu Apr 12 10:05:08 PDT 2012
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.0-milestone-9-bin.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-1.0-rc-1-bin.zip
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
JAVA_OPTS="$JAVA_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
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
Expand Down
90 changes: 90 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
@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
31 changes: 13 additions & 18 deletions src/test/groovy/javaposse/jobdsl/dsl/JobTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -37,34 +37,29 @@ class JobTest extends Specification {
job.using("TMPL")

then:
1 * jm.getConfig("TMPL") >> '''
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties/>
</project>
'''
1 * jm.getConfig("TMPL") >> minimalXml
}

def "load template and generate xml from job"() {
setup:
JobManagement jm = Mock()
Job job = new Job(jm)
def xml = '''
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties/>
</project>
'''


when:
job.using("TMPL")

then:
1 * jm.getConfig("TMPL") >> xml
job.xml == '<?xml version="1.0" encoding="UTF-8"?>'+xml
1 * jm.getConfig("TMPL") >> minimalXml
job.xml == '<?xml version="1.0" encoding="UTF-8"?>'+minimalXml
}

def minimalXml =
'''<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties/>
</project>
'''
}

0 comments on commit a1a70cf

Please sign in to comment.