Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Commit

Permalink
Merge pull request #58 from ysb33r/development
Browse files Browse the repository at this point in the history
1.0-beta7 Release
FIXED #57
  • Loading branch information
ysb33r authored Jan 2, 2017
2 parents 59df909 + a38fbc8 commit 51ec49d
Show file tree
Hide file tree
Showing 14 changed files with 89 additions and 50 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ for a specific release, please visit the http://ysb33r.github.io/gradleTest[plug
* https://github.com/ysb33r/gradleTest/issues/49[#49] - When folders below `gradleTest` are removed, generated code
should be removed too.
* https://github.com/ysb33r/gradleTest/issues/53[#53] - Skip test generation if `src/gradleTest` does not exist.
* https://github.com/ysb33r/gradleTest/issues/57[#57] - Transitive dependencies for pluginsare not injected into classpath.

=== Other

Expand Down
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ plugins {
id 'com.gradle.plugin-publish' version '0.9.4'
id 'com.github.hierynomus.license' version '0.13.1'
id 'org.asciidoctor.convert' version '1.5.3'
id 'org.ysb33r.cloudci' version '1.0'
}

import org.asciidoctor.gradle.AsciidoctorTask

group = 'org.ysb33r.gradle'
archivesBaseName = 'gradletest'
version = '1.0-beta5'
version = '1.0-beta7'

apply from : 'gradle/integration-tests.gradle'
apply from : 'gradle/compatibility-tests.gradle'
Expand Down Expand Up @@ -326,7 +327,8 @@ asciidoctor {
}

attributes revnumber: "${version}",
projectdir : projectDir.absolutePath
topdir : projectDir.absolutePath,
compatdir : file('compatibility').absolutePath
}


Expand Down
27 changes: 24 additions & 3 deletions compatibility/compatibility.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// be accessed as a rootProject as would be the normal convention.
// - We redirect the build directory to be underneath the calling project's
// build directory.
// - Any test dpenedencies are picked up from the test dependencies of the
// - Any test dpenedencie/Users/schalkc/Projects/GradleTest/compatibility/compatibility.gradles are picked up from the test dependencies of the
// calling project.
// - We need to run this project with the GradleTest jat that was created by
// the calling project
Expand All @@ -19,9 +19,16 @@
// the sanityCheck task will fail the build if need be.
// ----------------------------------------------------------------------------


buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath fileTree("${projectDir}/../build/libs") { include "gradletest-${compatibilityVersion}.jar"}
classpath "org.ysb33r.gradle:gradle-cloudci-plugin:1.0"
}
}

Expand All @@ -33,12 +40,14 @@ repositories {
}
}


// tag::applyplugin1[]
apply plugin : 'org.ysb33r.gradletest'
// end::applyplugin1[]


apply plugin : 'java'
apply plugin : 'org.ysb33r.cloudci'

gradleTestGenerator {
pluginJarDirectory = file("${projectDir}/../build/libs")
Expand All @@ -64,8 +73,8 @@ gradleTest {
// end::applyplugin2[]
dependsOn sanityCheck
// tag::applyplugin2[]
versions '3.2', '3.1', '3.0'
versions '2.14'
versions '3.2.1', '3.1', '3.0'
versions '2.14.1'
versions '2.13'
versions '2.12' ,'2.11','2.10','2.9','2.8'
versions '2.7','2.6','2.5'
Expand All @@ -74,9 +83,21 @@ gradleTest {
beforeTest {
println " ${it.name}"
}

}
// end::applyplugin2[]

appveyor {
gradleTest {
if (JavaVersion.current().isJava7()) {
jvmArgs '-XX:+CMSClassUnloadingEnabled', '-XX:+CMSPermGenSweepingEnabled',
'-XX:+UseConcMarkSweepGC'
}

maxParallelForks = 4
}
}


test.enabled = false

Expand Down
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 @@
#Thu Apr 30 16:37:11 BST 2015
#Sun Jan 01 17:16:06 SAST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
52 changes: 26 additions & 26 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,30 @@
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# 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\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

Expand All @@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
Expand All @@ -40,31 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=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.
Expand All @@ -90,7 +89,7 @@ location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
Expand All @@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
Expand Down
8 changes: 4 additions & 4 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
@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 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=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

Expand Down Expand Up @@ -46,7 +46,7 @@ echo location of your Java installation.
goto fail

:init
@rem Get command-line arguments, handling Windowz variants
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
Expand Down
2 changes: 1 addition & 1 deletion src/docs/asciidoc/parts/usage.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ the appropriate configurations and tasks will be added.

[source,groovy]
----
include::{projectDir}/compatibility/compatibility.gradle[tags=addTestSets]
include::{compatdir}/compatibility.gradle[tags=addTestSets]
----
<1> Supply basename to `additionalGradleTestSet`
<2> This will result in a test task in the format `${baseName}GradleTest`. Sources are expected to be layed out below
Expand Down
2 changes: 1 addition & 1 deletion src/docs/landingPage/display-versions.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# List versions in order that they should appear on the landing page
#
1.0-beta5
1.0-beta7
0.5.5
27 changes: 23 additions & 4 deletions src/main/groovy/org/ysb33r/gradle/gradletest/TestGenerator.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ import groovy.io.FileType
import groovy.transform.CompileDynamic
import groovy.transform.CompileStatic
import org.gradle.api.DefaultTask
import org.gradle.api.DomainObjectSet
import org.gradle.api.GradleException
import org.gradle.api.artifacts.DependencySet
import org.gradle.api.artifacts.ExternalModuleDependency
import org.gradle.api.artifacts.UnknownConfigurationException
import org.gradle.api.file.FileCollection
import org.gradle.api.file.SourceDirectorySet
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputDirectory
Expand Down Expand Up @@ -167,7 +172,15 @@ class TestGenerator extends DefaultTask {
final File repoDir = new File(workDir,'repo')
final List<Pattern> testPatternsForFailures = getLinkedTask().getExpectedFailures()

createInitScript(workDir,pluginJarDirectory,repoDir)
Set<File> externalDependencies = []
try {
DomainObjectSet<ExternalModuleDependency> externalDependencySet = project.configurations.getByName('runtime').allDependencies.withType(ExternalModuleDependency)
externalDependencies = project.configurations.getByName('runtime').files { dep ->
externalDependencySet.contains(dep)
}
} catch(UnknownConfigurationException e) {}

createInitScript(workDir,pluginJarDirectory,repoDir,externalDependencies)

testMap.each { String testName,File testLocation ->

Expand Down Expand Up @@ -208,17 +221,23 @@ class TestGenerator extends DefaultTask {
* @param targetDir Where the init script is copied to
* @param jarDir THe path where the plugin JAR will be found
* @param repoDir The path to where the local repo will be created
* @param externalDependencies A list of external dependencies (JARs).
*/
@CompileDynamic
private void createInitScript(final File targetDir,final File jarDir,final File repoDir) {
private void createInitScript(final File targetDir,final File jarDir,final File repoDir,Set<File> externalDependencies) {
final def fromSource = templateInitScript
final String pluginJarPath = pathAsUriStr(jarDir)
final String repoPath = pathAsUriStr(repoDir)
final String externalDepPaths = externalDependencies.collect {
"'${pathAsUriStr(it)}'.toURI()"
}.join(',')

project.copy {
from fromSource
into targetDir
expand PLUGINJARPATH: pluginJarPath,
LOCALREPOPATH : repoPath
LOCALREPOPATH : repoPath,
EXTERNAL_DEP_URILIST : externalDepPaths
}
}

Expand Down Expand Up @@ -301,7 +320,7 @@ class TestGenerator extends DefaultTask {
* (This helps with compatibility across operating systems).
* @param path Path to output
*/
private String pathAsUriStr(final File path) {
String pathAsUriStr(final File path) {
path.absoluteFile.toURI().toString()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ class TestRunner {

systemProperties 'org.gradle.appname' : this.class.name

// Capture standardOutput and errorOutput
// errorOutput = new ByteArrayOutputStream()
// standardOutput = new ByteArrayOutputStream()
// systemProperties & environment in a later release
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.ysb33r.gradle.gradletest.Names
*/
class Unpacker {

/** Creates a downloader to download a a distrbution to a specific location
/** Creates a downloader to download a a distribution to a specific location
*
* @param logger Logger to use. (Older versions of Wrapper API will ignore this).
* @return An instance of a downloader
Expand Down Expand Up @@ -156,5 +156,4 @@ class Unpacker {
return target
}
}

}
1 change: 1 addition & 0 deletions src/main/resources/org/ysb33r/gradletest/init.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ allprojects {
classpath fileTree ('${PLUGINJARPATH}'.toURI()) {
include '*.jar'
}
${EXTERNAL_DEP_URILIST.size() ? 'classpath files('+EXTERNAL_DEP_URILIST+')' : ''}
}
repositories {
flatDir {
Expand Down
2 changes: 1 addition & 1 deletion website
Submodule website updated 77 files
+0 −196 1.0-beta3/api/help-doc.html
+0 −614 1.0-beta3/api/index-all.html
+0 −418 1.0-beta3/api/org/ysb33r/gradle/gradletest/Names.html
+0 −387 1.0-beta3/api/org/ysb33r/gradle/gradletest/TestSet.html
+0 −347 1.0-beta3/api/org/ysb33r/gradle/gradletest/legacy20/DeprecatingGradleTestExtension.html
+0 −271 1.0-beta3/api/org/ysb33r/gradle/gradletest/legacy20/Distribution.html
+0 −401 1.0-beta3/api/org/ysb33r/gradle/gradletest/legacy20/internal/DistributionInternal.html
+0 −330 1.0-beta3/api/org/ysb33r/gradle/gradletest/legacy20/internal/Unpacker.html
+0 −51 1.0-beta3/api/overview-frame.html
+0 −517 1.0-beta3/docs/changelog.html
+0 −1,115 1.0-beta3/docs/product-documentation.html
+0 −58 1.0-beta4/api/allclasses-frame.html
+0 −106 1.0-beta4/api/deprecated-list.html
+ 1.0-beta4/api/groovy.ico
+0 −90 1.0-beta4/api/index.html
+ 1.0-beta4/api/inherit.gif
+0 −408 1.0-beta4/api/org/ysb33r/gradle/gradletest/ClasspathManifest.html
+0 −530 1.0-beta4/api/org/ysb33r/gradle/gradletest/GradleTest.html
+0 −507 1.0-beta4/api/org/ysb33r/gradle/gradletest/TestGenerator.html
+0 −279 1.0-beta4/api/org/ysb33r/gradle/gradletest/legacy20/AvailableDistributions.html
+0 −262 1.0-beta4/api/org/ysb33r/gradle/gradletest/legacy20/CompatibilityTestResult.html
+0 −448 1.0-beta4/api/org/ysb33r/gradle/gradletest/legacy20/GradleTest.html
+0 −500 1.0-beta4/api/org/ysb33r/gradle/gradletest/legacy20/GradleTestExtension.html
+0 −269 1.0-beta4/api/org/ysb33r/gradle/gradletest/legacy20/LegacyGradleTestPlugin.html
+0 −317 1.0-beta4/api/org/ysb33r/gradle/gradletest/legacy20/internal/AvailableDistributionsInternal.html
+0 −438 1.0-beta4/api/org/ysb33r/gradle/gradletest/legacy20/internal/GradleTestDownloader.html
+0 −257 1.0-beta4/api/org/ysb33r/gradle/gradletest/legacy20/internal/Infrastructure.html
+0 −372 1.0-beta4/api/org/ysb33r/gradle/gradletest/legacy20/internal/TestRunner.html
+0 −58 1.0-beta4/api/org/ysb33r/gradle/gradletest/legacy20/internal/package-frame.html
+0 −185 1.0-beta4/api/org/ysb33r/gradle/gradletest/legacy20/internal/package-summary.html
+0 −66 1.0-beta4/api/org/ysb33r/gradle/gradletest/legacy20/package-frame.html
+0 −211 1.0-beta4/api/org/ysb33r/gradle/gradletest/legacy20/package-summary.html
+0 −58 1.0-beta4/api/org/ysb33r/gradle/gradletest/package-frame.html
+0 −185 1.0-beta4/api/org/ysb33r/gradle/gradletest/package-summary.html
+0 −142 1.0-beta4/api/overview-summary.html
+0 −3 1.0-beta4/api/package-list
+0 −2,324 1.0-beta4/api/stylesheet.css
+1 −0 1.0-beta7/api/allclasses-frame.html
+1 −1 1.0-beta7/api/deprecated-list.html
+ 1.0-beta7/api/groovy.ico
+1 −1 1.0-beta7/api/help-doc.html
+18 −4 1.0-beta7/api/index-all.html
+0 −0 1.0-beta7/api/index.html
+ 1.0-beta7/api/inherit.gif
+6 −6 1.0-beta7/api/org/ysb33r/gradle/gradletest/ClasspathManifest.html
+71 −16 1.0-beta7/api/org/ysb33r/gradle/gradletest/GradleTest.html
+17 −18 1.0-beta7/api/org/ysb33r/gradle/gradletest/GradleTestBasePlugin.html
+5 −4 1.0-beta7/api/org/ysb33r/gradle/gradletest/GradleTestPlugin.html
+19 −4 1.0-beta7/api/org/ysb33r/gradle/gradletest/Names.html
+66 −10 1.0-beta7/api/org/ysb33r/gradle/gradletest/TestGenerator.html
+4 −4 1.0-beta7/api/org/ysb33r/gradle/gradletest/TestSet.html
+4 −4 1.0-beta7/api/org/ysb33r/gradle/gradletest/legacy20/AvailableDistributions.html
+4 −4 1.0-beta7/api/org/ysb33r/gradle/gradletest/legacy20/CompatibilityTestResult.html
+4 −4 1.0-beta7/api/org/ysb33r/gradle/gradletest/legacy20/DeprecatingGradleTestExtension.html
+4 −4 1.0-beta7/api/org/ysb33r/gradle/gradletest/legacy20/Distribution.html
+6 −6 1.0-beta7/api/org/ysb33r/gradle/gradletest/legacy20/GradleTest.html
+4 −4 1.0-beta7/api/org/ysb33r/gradle/gradletest/legacy20/GradleTestExtension.html
+4 −4 1.0-beta7/api/org/ysb33r/gradle/gradletest/legacy20/LegacyGradleTestPlugin.html
+4 −4 1.0-beta7/api/org/ysb33r/gradle/gradletest/legacy20/internal/AvailableDistributionsInternal.html
+4 −4 1.0-beta7/api/org/ysb33r/gradle/gradletest/legacy20/internal/DistributionInternal.html
+6 −6 1.0-beta7/api/org/ysb33r/gradle/gradletest/legacy20/internal/GradleTestDownloader.html
+4 −4 1.0-beta7/api/org/ysb33r/gradle/gradletest/legacy20/internal/Infrastructure.html
+4 −4 1.0-beta7/api/org/ysb33r/gradle/gradletest/legacy20/internal/TestRunner.html
+6 −6 1.0-beta7/api/org/ysb33r/gradle/gradletest/legacy20/internal/Unpacker.html
+0 −0 1.0-beta7/api/org/ysb33r/gradle/gradletest/legacy20/internal/package-frame.html
+0 −0 1.0-beta7/api/org/ysb33r/gradle/gradletest/legacy20/internal/package-summary.html
+0 −0 1.0-beta7/api/org/ysb33r/gradle/gradletest/legacy20/package-frame.html
+0 −0 1.0-beta7/api/org/ysb33r/gradle/gradletest/legacy20/package-summary.html
+1 −1 1.0-beta7/api/org/ysb33r/gradle/gradletest/package-frame.html
+10 −1 1.0-beta7/api/org/ysb33r/gradle/gradletest/package-summary.html
+1 −1 1.0-beta7/api/overview-frame.html
+1 −1 1.0-beta7/api/overview-summary.html
+0 −0 1.0-beta7/api/package-list
+0 −0 1.0-beta7/api/stylesheet.css
+21 −5 1.0-beta7/docs/changelog.html
+138 −25 1.0-beta7/docs/product-documentation.html
+15 −9 index.html

0 comments on commit 51ec49d

Please sign in to comment.