From 3eecac2466a55c206eedb4280458b0284c90c50e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Mon, 2 Jan 2017 08:04:55 +0200 Subject: [PATCH 01/26] Working on 1.0-beta8 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d6c79f9..1d86e0f 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ import org.asciidoctor.gradle.AsciidoctorTask group = 'org.ysb33r.gradle' archivesBaseName = 'gradletest' -version = '1.0-beta7' +version = '1.0-beta8-SNAPSHOT' apply from : 'gradle/integration-tests.gradle' apply from : 'gradle/compatibility-tests.gradle' From aecd5d05efe6751004fa178305c43140d79aef53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Tue, 3 Jan 2017 22:16:42 +0200 Subject: [PATCH 02/26] Added support for Gradle 3.3 (#61) --- compatibility/compatibility.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compatibility/compatibility.gradle b/compatibility/compatibility.gradle index 3b8d206..7222a26 100644 --- a/compatibility/compatibility.gradle +++ b/compatibility/compatibility.gradle @@ -73,7 +73,7 @@ gradleTest { // end::applyplugin2[] dependsOn sanityCheck // tag::applyplugin2[] - versions '3.2.1', '3.1', '3.0' + versions '3.3', '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' @@ -106,6 +106,7 @@ if(GradleVersion.current() >= GradleVersion.version('2.13')) { additionalGradleTestSet 'nonLegacyOnly' // <1> nonLegacyOnlyGradleTest { // <2> + versions '3.3' versions '3.2', '3.1', '3.0' // <3> versions '2.14','2.13' } From 33b132012481f304a48a038dc0d54560615a6ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Wed, 4 Jan 2017 10:25:27 +0200 Subject: [PATCH 03/26] Adjust JVM memory test requirements for CI (#55,#56) --- compatibility/compatibility.gradle | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/compatibility/compatibility.gradle b/compatibility/compatibility.gradle index 7222a26..180c588 100644 --- a/compatibility/compatibility.gradle +++ b/compatibility/compatibility.gradle @@ -94,7 +94,17 @@ appveyor { '-XX:+UseConcMarkSweepGC' } - maxParallelForks = 4 + maxParallelForks = 2 + minHeapSize = "256m" + maxHeapSize = "768m" + } +} + +travisci { + gradleTest { + maxParallelForks = 2 + minHeapSize = "256m" + maxHeapSize = "768m" } } From 2892ebda01ca88c3c7493b130435613e5707494b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Wed, 4 Jan 2017 11:04:46 +0200 Subject: [PATCH 04/26] Enable sudo mode on Travis (#56) --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index af3d228..927c76e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: groovy -sudo: false +sudo: required before_script: - ./gradlew -S clean --console=plain @@ -34,4 +34,4 @@ branches: only: - master - development -# - release \ No newline at end of file +# - release From 8c00984df1649b707b6cfb4f5fe5543c37513cf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Wed, 4 Jan 2017 11:17:53 +0200 Subject: [PATCH 05/26] Split compatibility test into a number of smaller runs on Appveyor (#55) --- appveyor.yml | 10 ++++++++-- compatibility/compatibility.gradle | 6 ++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index b41a519..4355a11 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,10 +4,16 @@ build: verbosity: detailed build_script: - - gradlew.bat assemble --info --no-daemon -PbintrayUserName -PbintrayApiKey + - gradlew.bat assemble --info --no-daemon test_script: - - gradlew.bat test integrationTest compatibilityTest --info --no-daemon -PbintrayUserName -PbintrayApiKey + - gradlew.bat test integrationTest --info --no-daemon + - gradlew.bat test compatibilityTest --info --no-daemon -DgradleTest.versions=2.0,2.1,2.2,2.3 -DnonLegacyOnlyGradleTest.versions=2.13 + - gradlew.bat test compatibilityTest --info --no-daemon -DgradleTest.versions=2.4,2.5,2.6,2.7 -DnonLegacyOnlyGradleTest.versions=2.14.1 + - gradlew.bat test compatibilityTest --info --no-daemon -DgradleTest.versions=2.8,2.9,2.10,2.11 -DnonLegacyOnlyGradleTest.versions=3.0 + - gradlew.bat test compatibilityTest --info --no-daemon -DgradleTest.versions=2.12,2.13,2.14.1 -DnonLegacyOnlyGradleTest.versions=3.1 + - gradlew.bat test compatibilityTest --info --no-daemon -DgradleTest.versions=3.0,3.1,3.2.1 -DnonLegacyOnlyGradleTest.versions=3.2.1 + - gradlew.bat test compatibilityTest --info --no-daemon -DgradleTest.versions=3.3 -DnonLegacyOnlyGradleTest.versions=3.3 branches: only: diff --git a/compatibility/compatibility.gradle b/compatibility/compatibility.gradle index 180c588..74ab9e7 100644 --- a/compatibility/compatibility.gradle +++ b/compatibility/compatibility.gradle @@ -9,7 +9,7 @@ // build directory. // - 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 +// - We need to run this project with the GradleTest jar that was created by // the calling project // - We also need to tell the gradleTestGenerator where to find the GradleTest // jar. (This is not something a consumer of this plugin would normally do.) @@ -68,6 +68,7 @@ task sanityCheck { } +// *IMPORTANT* If you update this list also update .travil.yml & appveyor.yml // tag::applyplugin2[] gradleTest { // end::applyplugin2[] @@ -111,6 +112,7 @@ travisci { test.enabled = false +// *IMPORTANT* If you update this list also update .travis.yml & appveyor.yml if(GradleVersion.current() >= GradleVersion.version('2.13')) { // tag::addTestSets[] additionalGradleTestSet 'nonLegacyOnly' // <1> @@ -118,7 +120,7 @@ if(GradleVersion.current() >= GradleVersion.version('2.13')) { nonLegacyOnlyGradleTest { // <2> versions '3.3' versions '3.2', '3.1', '3.0' // <3> - versions '2.14','2.13' + versions '2.14.1','2.13' } nonLegacyOnlyGradleTestGenerator { // <4> From a9c5149e592c1987406d0ee2d9a54fab26261a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Wed, 4 Jan 2017 16:34:05 +0200 Subject: [PATCH 06/26] CHANGELOG updates (#53,#57,#61) --- CHANGELOG.adoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 4e8a8e8..dbc6693 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -38,6 +38,7 @@ for a specific release, please visit the http://ysb33r.github.io/gradleTest[plug 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. +* https://github.com/ysb33r/gradleTest/issues/61[#61] - Validate support for Gradle 3.3. === Other @@ -50,6 +51,8 @@ for a specific release, please visit the http://ysb33r.github.io/gradleTest[plug from check. * https://github.com/ysb33r/gradleTest/issues/50[#50] - Removed the use of deprecated `TaskInputs.source(Object)` when running under Gradle 3.0+. +* https://github.com/ysb33r/gradleTest/issues/55[#55] - Memory: Split compatiblity tests into smaller runs on Appveyor. +* https://github.com/ysb33r/gradleTest/issues/55[#56] - Memory: Use virtual image rather than container on TravisCI. // end::changelog[] == Contributors From cffde65ba6a5fe10c7f74beb6d65e564fee94e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Wed, 4 Jan 2017 17:18:46 +0200 Subject: [PATCH 07/26] Honour --rerun-tasks (#62) --- CHANGELOG.adoc | 2 +- src/docs/asciidoc/parts/cmdline.adoc | 5 + src/docs/asciidoc/product-documentation.adoc | 2 + .../CommandLineIntegrationSpec.groovy | 106 ++++++++++++++++++ .../gradle/gradletest/GradleTest.groovy | 7 +- 5 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 src/docs/asciidoc/parts/cmdline.adoc create mode 100644 src/integrationTest/groovy/org/ysb33r/gradle/gradletest/CommandLineIntegrationSpec.groovy diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index dbc6693..88a0bfb 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -30,7 +30,7 @@ for a specific release, please visit the http://ysb33r.github.io/gradleTest[plug * https://github.com/ysb33r/gradleTest/issues/42[#42] - `GradleTest` HTML reports should not overwrite over Test task reports. * https://github.com/ysb33r/gradleTest/issues/45[#45] - When there is no `src/gradleTest` the build fails. -* https://github.com/ysb33r/gradleTest/issues/46[#46] - When folders below `src/gradleTest` non-word characters, +* https://github.com/ysb33r/gradleTest/issues/46[#46] - When folders below `src/gradleTest` contain non-word characters, compilation of test classes fails. * https://github.com/ysb33r/gradleTest/issues/47[#47] - Classpath not correctly resolved under test. * https://github.com/ysb33r/gradleTest/issues/48[#48] - When copying gradleTest folders maintain same permissions diff --git a/src/docs/asciidoc/parts/cmdline.adoc b/src/docs/asciidoc/parts/cmdline.adoc new file mode 100644 index 0000000..ff5a73d --- /dev/null +++ b/src/docs/asciidoc/parts/cmdline.adoc @@ -0,0 +1,5 @@ +== Command-line Awareness + +GradleTest is aware of certain command-line parameters and will pass them on to running tests. + +* `--rerun-tasks` - All tests will be re-run even if they were previsouly successful. diff --git a/src/docs/asciidoc/product-documentation.adoc b/src/docs/asciidoc/product-documentation.adoc index ba696fc..28ff7e9 100644 --- a/src/docs/asciidoc/product-documentation.adoc +++ b/src/docs/asciidoc/product-documentation.adoc @@ -19,6 +19,8 @@ include::parts/structure.adoc[] include::parts/usage.adoc[] +include::parts/cmdline.adoc[] + include::parts/advanced.adoc[] include::parts/base-plugin.adoc[] diff --git a/src/integrationTest/groovy/org/ysb33r/gradle/gradletest/CommandLineIntegrationSpec.groovy b/src/integrationTest/groovy/org/ysb33r/gradle/gradletest/CommandLineIntegrationSpec.groovy new file mode 100644 index 0000000..21a8d89 --- /dev/null +++ b/src/integrationTest/groovy/org/ysb33r/gradle/gradletest/CommandLineIntegrationSpec.groovy @@ -0,0 +1,106 @@ +/* + * ============================================================================ + * (C) Copyright Schalk W. Cronje 2015 - 2016 + * + * This software is licensed under the Apache License 2.0 + * See http://www.apache.org/licenses/LICENSE-2.0 for license details + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and limitations under the License. + * + * ============================================================================ + */ +package org.ysb33r.gradle.gradletest + +import org.gradle.api.Project +import org.gradle.testfixtures.ProjectBuilder +import org.gradle.testkit.runner.GradleRunner +import org.gradle.testkit.runner.TaskOutcome +import org.gradle.util.GradleVersion +import org.ysb33r.gradle.gradletest.internal.GradleTestIntegrationSpecification +import spock.lang.Issue + + +class CommandLineIntegrationSpec extends GradleTestIntegrationSpecification { + + static final List TESTNAMES = ['alpha'] + static final File GRADLETESTREPO = new File(System.getProperty('GRADLETESTREPO') ?: 'build/integrationTest/repo').absoluteFile + @Delegate Project project + File srcDir + + void setup() { + project = ProjectBuilder.builder().withProjectDir(testProjectDir.root).build() + + buildFile = new File(project.projectDir,'build.gradle') + writeBuildScriptHeader(project.gradle.gradleVersion) + + buildFile << """ + repositories { + flatDir { + dirs '${GRADLETESTREPO.toURI()}'.toURI() + } + } + dependencies { + gradleTest 'org.ysb33r.gradle:doxygen:0.2' + } + gradleTest { + versions '3.2' + gradleDistributionUri '${GRADLETESTREPO.toURI()}' + + doFirst { + println 'I am the actual invocation of GradleTest (from GradleIntegrationSpec) and I am ' + GradleVersion.current() + } + } + """ + + new File(project.projectDir,'settings.gradle').text = '' + + + srcDir = new File(project.projectDir,'src/gradleTest') + srcDir.mkdirs() + + } + + void genTestStructureForSuccess( File genToDir ) { + TESTNAMES.each { + File testDir = new File(genToDir, it) + testDir.mkdirs() + new File(testDir, 'build.gradle').text = ''' + task runGradleTest { + doLast { + println "I'm runGradleTest and I'm " + GradleVersion.current() + println "Hello, ${project.name}" + } + } +''' + } + } + + def "Running with 2.13+ honours --rerun-tasks"() { + + setup: + genTestStructureForSuccess(srcDir) + buildFile << """ + gradleTest { + if(!gradle.startParameter.isRerunTasks()) { + throw new GradleException("--rerun-tasks not set") + } + } +""" + + when: + println "I'm starting this test chain and I'm " + GradleVersion.current() + def result = GradleRunner.create() + .withProjectDir(projectDir) + .withArguments('gradleTest','-i','--rerun-tasks') + .withPluginClasspath(readMetadataFile()) + .forwardOutput() + .build() + + then: + result.task(":gradleTest").outcome == TaskOutcome.SUCCESS + + } + +} \ No newline at end of file diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/GradleTest.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/GradleTest.groovy index 5c125aa..5e3c107 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/GradleTest.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/GradleTest.groovy @@ -42,6 +42,11 @@ class GradleTest extends Test { arguments+= '--offline' } + + if(project.gradle.startParameter.isRerunTasks()) { + arguments+= '--rerun-tasks' + } + setHtmlReportFolder() } @@ -147,7 +152,7 @@ class GradleTest extends Test { */ @Input List getGradleArguments() { - ([ '--init-script',winSafeCmdlineSafe(initScript) ] as List) + + List args = ([ '--init-script',winSafeCmdlineSafe(initScript) ] as List) + CollectionUtils.stringize(this.arguments) as List } From 5e57c6c490beea809ec30e04f9f9f498ed2a7044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Wed, 4 Jan 2017 20:03:50 +0200 Subject: [PATCH 08/26] Documented --offline behaviour (#63) --- CHANGELOG.adoc | 5 ++++- src/docs/asciidoc/parts/cmdline.adoc | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 88a0bfb..8c8e29a 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -17,6 +17,7 @@ for a specific release, please visit the http://ysb33r.github.io/gradleTest[plug * https://github.com/ysb33r/gradleTest/issues/5[#5] - Allow tests to be executed in parallel * https://github.com/ysb33r/gradleTest/issues/52[#52] - Allow for expected failure cases * https://github.com/ysb33r/gradleTest/issues/54[#54] - Added base plugin `org.ysb33r.gradletest.base`. +* https://github.com/ysb33r/gradleTest/issues/62[#62] - Propagate `--rerun-tasks` down to test instances. === Bugs @@ -38,7 +39,6 @@ for a specific release, please visit the http://ysb33r.github.io/gradleTest[plug 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. -* https://github.com/ysb33r/gradleTest/issues/61[#61] - Validate support for Gradle 3.3. === Other @@ -53,6 +53,9 @@ for a specific release, please visit the http://ysb33r.github.io/gradleTest[plug when running under Gradle 3.0+. * https://github.com/ysb33r/gradleTest/issues/55[#55] - Memory: Split compatiblity tests into smaller runs on Appveyor. * https://github.com/ysb33r/gradleTest/issues/55[#56] - Memory: Use virtual image rather than container on TravisCI. +* https://github.com/ysb33r/gradleTest/issues/61[#61] - Validate support for Gradle 3.3. +* https://github.com/ysb33r/gradleTest/issues/63[#63] - Documented `--offline` behaviour. + // end::changelog[] == Contributors diff --git a/src/docs/asciidoc/parts/cmdline.adoc b/src/docs/asciidoc/parts/cmdline.adoc index ff5a73d..27917a1 100644 --- a/src/docs/asciidoc/parts/cmdline.adoc +++ b/src/docs/asciidoc/parts/cmdline.adoc @@ -3,3 +3,4 @@ GradleTest is aware of certain command-line parameters and will pass them on to running tests. * `--rerun-tasks` - All tests will be re-run even if they were previsouly successful. +* `--offline` - No dependency checks will be performed and if plugins implements any offline behaviour this will automatically be enabled. From 331f9f724c2234fa9612de03053ad673e166c271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Fri, 6 Jan 2017 08:11:51 +0200 Subject: [PATCH 09/26] Describe alternative approaches to GradleTest (#60) - GradleTestKit - Gradle Stutter --- CHANGELOG.adoc | 5 ++-- src/docs/asciidoc/parts/alternatives.adoc | 30 ++++++++++++++++++++ src/docs/asciidoc/product-documentation.adoc | 2 ++ 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 src/docs/asciidoc/parts/alternatives.adoc diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 8c8e29a..e037695 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -42,17 +42,18 @@ for a specific release, please visit the http://ysb33r.github.io/gradleTest[plug === Other -* https://github.com/ysb33r/gradleTest/issues/12[#12] - Fix Javadoc errors. +* https://github.com/ysb33r/gradleTest/issues/12[#12] - Fixed Javadoc errors. * https://github.com/ysb33r/gradleTest/issues/36[#36] - Integration test for `GradleTest` failure under M$ Windows. * https://github.com/ysb33r/gradleTest/issues/37[#37] - Integration test for `legacy20.GeadleTest` failure under M$ Windows. -* https://github.com/ysb33r/gradleTest/issues/40[#40] - Add gh-pages based docs +* https://github.com/ysb33r/gradleTest/issues/40[#40] - Added `gh-pages`-based . * https://github.com/ysb33r/gradleTest/issues/44[#44] - If license plugin is applied, exclude GradleTest sourcesets from check. * https://github.com/ysb33r/gradleTest/issues/50[#50] - Removed the use of deprecated `TaskInputs.source(Object)` when running under Gradle 3.0+. * https://github.com/ysb33r/gradleTest/issues/55[#55] - Memory: Split compatiblity tests into smaller runs on Appveyor. * https://github.com/ysb33r/gradleTest/issues/55[#56] - Memory: Use virtual image rather than container on TravisCI. +* https://github.com/ysb33r/gradleTest/issues/60[#60] - Mention alternative approaches to `GradleTest`. * https://github.com/ysb33r/gradleTest/issues/61[#61] - Validate support for Gradle 3.3. * https://github.com/ysb33r/gradleTest/issues/63[#63] - Documented `--offline` behaviour. diff --git a/src/docs/asciidoc/parts/alternatives.adoc b/src/docs/asciidoc/parts/alternatives.adoc new file mode 100644 index 0000000..5a33b3e --- /dev/null +++ b/src/docs/asciidoc/parts/alternatives.adoc @@ -0,0 +1,30 @@ += Alternative Approaches + +== Gradle TestKit + +`GradleTestKit` is the core API that ships with Gradle since Gradle 2.6. which is meant for plugin developers to test compatibility across Gradle versions. Easrly versions could only tests against the same version of Gradle that was running, but it has been enhanced over different Gradle releases. Today it is powereful allowing multiple versions to be tested and a number of different environments to be set up. + +It is also a core compoenent of `GradleTest` when the version of Gradle is 2.13 or later. (When the current build version is older `GradleTest` falls back to legacy mode, simply because the `GradleTestKit` API either is non-existent or not mature enough. + +`GradleTestKit` works well for integration testing when writing plugins if a select small group of Gradle versions are used or even if it only targets the current Gradle version. In this way one can quickly determine issues in a plugin which cannot be discovered via normal testing. `GradleTest` used `GradleTestKit` directly for its integration tests for exactly this reason. + +Testing multiple versions of Gradle with GradleTestKit soon bcomes a burden for developers as the API differs and classpath setups can be tricky. Older versions of Gradle give the most issues. In addition `GradleTestKit` is essentially a library it focuses on the developer rather than the build script user. + +In this regard `GradleTest` steps in as it allow tests to be written as if a normal buildscript would be written. it also manages differences (or non-existance) in API from Gradle 2.0 onwards in a completely transparent way to the plugin author. + +Overall the approach should be to write integration tests with `GradleTestKit` using a limited or even just one Gradle version. This is then complimented by some `GradleTest` scripts to test a wider range of Gradle versions. + +== Stutter + +https://github.com/ajoberstar/gradle-stutter[Stutter] is another library by https://github.com/ajoberstar[Andy Oberstar] to aid with plugin development. It focuses on the cases where you might have to run the same tests against all supported versions, but don't want to deal with making each test loop over those versions (or `@Unroll` with a `where` block in Spock). `Stutter` generates one task per supported version for you and runs the full set of tests against it. + +It definitely removes some of the complexity of setting up the `GradleTestKit` environment, but beware that it works from Gradle 2.13 onwards. The latter is not a restriction, but essentialy the same reason why `GradleTest` reverts to legacy mode if the build version of Gradle is older than 2.13: a lack of maturity in the `GradleTestKit` API in those releases. + +It adds a `compatTest` source set, which will not clash with the `gradleTest` source set from `GradleTest`. + +`Stutter` is essentialy developer-centric whereas `GradleTest` is script author-centric. This distinction is important as it clarifies different levels of validation: + +- If you want to create good samples and make sure they build, GradleTest is a clear win. Not having to write the extra test code (or touch the TestKit API) is a great benefit. +- If you need to validate what the build did, you are back in `GradleTestKit` land and then `Stutter` will make it easier for you. + +It can be an easy way to manage some more complex plugin integration tests. There is no reason to not use it alongside `GradleTest` as part of plugin development. \ No newline at end of file diff --git a/src/docs/asciidoc/product-documentation.adoc b/src/docs/asciidoc/product-documentation.adoc index 28ff7e9..3578997 100644 --- a/src/docs/asciidoc/product-documentation.adoc +++ b/src/docs/asciidoc/product-documentation.adoc @@ -32,3 +32,5 @@ include::parts/upgrading.adoc[] include::parts/legacy-mode.adoc[] include::parts/other-plugins.adoc[] + +include::parts/alternatives.adoc[] From e98064f59a115f0e0c380a5ddecc9630da18a560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Fri, 6 Jan 2017 09:48:49 +0200 Subject: [PATCH 10/26] Detect removed folder below gradleTest folder (#49) - Delete generated sources befoer generating sources - Delete compile class files before compiling new class files --- CHANGELOG.adoc | 2 +- .../gradletest/CompileIntegrationSpec.groovy | 125 +++++++++++++++++- .../gradle/gradletest/TestGenerator.groovy | 3 + .../ysb33r/gradle/gradletest/TestSet.groovy | 9 +- 4 files changed, 134 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index e037695..5818ab6 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -44,7 +44,7 @@ for a specific release, please visit the http://ysb33r.github.io/gradleTest[plug * https://github.com/ysb33r/gradleTest/issues/12[#12] - Fixed Javadoc errors. * https://github.com/ysb33r/gradleTest/issues/36[#36] - Integration test for `GradleTest` failure under M$ Windows. -* https://github.com/ysb33r/gradleTest/issues/37[#37] - Integration test for `legacy20.GeadleTest` failure under +* https://github.com/ysb33r/gradleTest/issues/37[#37] - Integration test for `legacy20.GradleTest` failure under M$ Windows. * https://github.com/ysb33r/gradleTest/issues/40[#40] - Added `gh-pages`-based . * https://github.com/ysb33r/gradleTest/issues/44[#44] - If license plugin is applied, exclude GradleTest sourcesets diff --git a/src/integrationTest/groovy/org/ysb33r/gradle/gradletest/CompileIntegrationSpec.groovy b/src/integrationTest/groovy/org/ysb33r/gradle/gradletest/CompileIntegrationSpec.groovy index 803bfcd..29d19e8 100644 --- a/src/integrationTest/groovy/org/ysb33r/gradle/gradletest/CompileIntegrationSpec.groovy +++ b/src/integrationTest/groovy/org/ysb33r/gradle/gradletest/CompileIntegrationSpec.groovy @@ -40,13 +40,12 @@ class CompileIntegrationSpec extends Specification { } void setupForNames(List projNames) { - File srcDir = new File(project.projectDir,'src/gradleTest') srcDir.mkdirs() projNames.each { File testDir = new File(srcDir,it) testDir.mkdirs() - new File(testDir,'build.gradle').text = '' + new File(testDir,'build.gradle').text = "task runGradleTest {println '${it}'}" } } @@ -123,4 +122,126 @@ class CompileIntegrationSpec extends Specification { new File(classesDir,"gradleTest/tests/Contains_s_p_a_c_e_sCompatibilitySpec.class").exists() } + + @Issue('https://github.com/ysb33r/gradleTest/issues/49') + def "Delete old generated files when tests are deleted"() { + given: "A GradleTest project" + File buildDir = project.buildDir + setupForNames(TESTNAMES) + def configureProject = { + configure(project) { + apply plugin : 'org.ysb33r.gradletest' + + repositories { + flatDir { + dirs GRADLETESTREPO + } + } + + gradleTest { + versions '2.13' + } + + evaluate() + } + } + + when: "The generated source is compiled" + configureProject() + Task generatorTask = tasks.getByName('gradleTestGenerator') + Task compileTask = tasks.getByName('compileGradleTestGroovy') + File classesDir = project.sourceSets.getByName('gradleTest').output.classesDir + File alphaSource = new File(buildDir,"gradleTest/src/AlphaCompatibilitySpec.groovy") + File betaSource = new File(buildDir,"gradleTest/src/BetaCompatibilitySpec.groovy") + File alphaClass = new File(classesDir,"gradleTest/tests/AlphaCompatibilitySpec.class") + File betaClass = new File(classesDir,"gradleTest/tests/BetaCompatibilitySpec.class") + generatorTask.execute() + compileTask.execute() + + + then: "Generator task to have executed" + generatorTask.didWork + alphaSource.exists() + betaSource.exists() + alphaClass.exists() + betaClass.exists() + + when: "Alpha test is deleted" + new File(project.projectDir,'src/gradleTest/alpha').deleteDir() + project = ProjectBuilder.builder().withProjectDir(testProjectDir.root).build() + configureProject() + generatorTask = tasks.getByName('gradleTestGenerator') + compileTask = tasks.getByName('compileGradleTestGroovy') + generatorTask.execute() + compileTask.execute() + + then: "Alpha generated source & compiles class is also deleted" + generatorTask.didWork + !alphaSource.exists() + betaSource.exists() + !alphaClass.exists() + betaClass.exists() + } + + @Issue('https://github.com/ysb33r/gradleTest/issues/59') + def "Adding folders rerun test task"() { + given: "A GradleTest project" + File buildDir = project.buildDir + setupForNames(TESTNAMES) + def configureProject = { + configure(project) { + apply plugin : 'org.ysb33r.gradletest' + + repositories { + flatDir { + dirs GRADLETESTREPO + } + } + + gradleTest { + versions '2.13' + } + + evaluate() + } + } + + when: "The generated source is compiled" + configureProject() + Task generatorTask = tasks.getByName('gradleTestGenerator') + Task compileTask = tasks.getByName('compileGradleTestGroovy') + File classesDir = project.sourceSets.getByName('gradleTest').output.classesDir + File alphaSource = new File(buildDir,"gradleTest/src/AlphaCompatibilitySpec.groovy") + File betaSource = new File(buildDir,"gradleTest/src/BetaCompatibilitySpec.groovy") + File alphaClass = new File(classesDir,"gradleTest/tests/AlphaCompatibilitySpec.class") + File betaClass = new File(classesDir,"gradleTest/tests/BetaCompatibilitySpec.class") + generatorTask.execute() + compileTask.execute() + + + then: "Generator task to have executed" + generatorTask.didWork + alphaSource.exists() + betaSource.exists() + alphaClass.exists() + betaClass.exists() + + when: "Alpha test is deleted" + new File(project.projectDir,'src/gradleTest/alpha').deleteDir() + project = ProjectBuilder.builder().withProjectDir(testProjectDir.root).build() + configureProject() + generatorTask = tasks.getByName('gradleTestGenerator') + compileTask = tasks.getByName('compileGradleTestGroovy') + generatorTask.execute() + compileTask.execute() + println "*** ${alphaClass.parentFile.listFiles()}" + + then: "Alpha generated source & compiles class is also deleted" + generatorTask.didWork + !alphaSource.exists() + betaSource.exists() + !alphaClass.exists() + betaClass.exists() + } + } \ No newline at end of file diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/TestGenerator.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/TestGenerator.groovy index 6ad52d6..1778320 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/TestGenerator.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/TestGenerator.groovy @@ -182,6 +182,9 @@ class TestGenerator extends DefaultTask { createInitScript(workDir,pluginJarDirectory,repoDir,externalDependencies) + // Before generation delete existing generated code + outputDir.deleteDir() + testMap.each { String testName,File testLocation -> boolean expectFailure = testPatternsForFailures.find { pat -> diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/TestSet.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/TestSet.groovy index 332f8d8..42f51f1 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/TestSet.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/TestSet.groovy @@ -175,7 +175,13 @@ class TestSet { project.sourceSets.main.output } - project.tasks.getByName(compileTaskName).dependsOn(genTaskName) + project.tasks.getByName(compileTaskName).with { + dependsOn(genTaskName) + doFirst { + destinationDir.deleteDir() + } + + } project.tasks.getByName(testTaskName).configure { testClassesDir = project.sourceSets.getByName(testSetBaseName).output.classesDir @@ -223,7 +229,6 @@ class TestSet { mustRunAfter 'test' } - project.tasks.getByName('check').dependsOn testTaskName } From 7c9f6c59f52b6761313efc2b8723ebb4489d790a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Fri, 6 Jan 2017 11:12:29 +0200 Subject: [PATCH 11/26] If folders are added below gradleTest, GradleTest task should execute (#59) --- CHANGELOG.adoc | 1 + .../gradletest/CompileIntegrationSpec.groovy | 61 ------------------- .../GradleTestIntegrationSpec.groovy | 43 +++++++++++++ 3 files changed, 44 insertions(+), 61 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 5818ab6..a2aedd1 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -39,6 +39,7 @@ for a specific release, please visit the http://ysb33r.github.io/gradleTest[plug 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. +* https://github.com/ysb33r/gradleTest/issues/59[#59] - GradleTest does not detect new folders if previous task completed successfully === Other diff --git a/src/integrationTest/groovy/org/ysb33r/gradle/gradletest/CompileIntegrationSpec.groovy b/src/integrationTest/groovy/org/ysb33r/gradle/gradletest/CompileIntegrationSpec.groovy index 29d19e8..e9e859f 100644 --- a/src/integrationTest/groovy/org/ysb33r/gradle/gradletest/CompileIntegrationSpec.groovy +++ b/src/integrationTest/groovy/org/ysb33r/gradle/gradletest/CompileIntegrationSpec.groovy @@ -183,65 +183,4 @@ class CompileIntegrationSpec extends Specification { betaClass.exists() } - @Issue('https://github.com/ysb33r/gradleTest/issues/59') - def "Adding folders rerun test task"() { - given: "A GradleTest project" - File buildDir = project.buildDir - setupForNames(TESTNAMES) - def configureProject = { - configure(project) { - apply plugin : 'org.ysb33r.gradletest' - - repositories { - flatDir { - dirs GRADLETESTREPO - } - } - - gradleTest { - versions '2.13' - } - - evaluate() - } - } - - when: "The generated source is compiled" - configureProject() - Task generatorTask = tasks.getByName('gradleTestGenerator') - Task compileTask = tasks.getByName('compileGradleTestGroovy') - File classesDir = project.sourceSets.getByName('gradleTest').output.classesDir - File alphaSource = new File(buildDir,"gradleTest/src/AlphaCompatibilitySpec.groovy") - File betaSource = new File(buildDir,"gradleTest/src/BetaCompatibilitySpec.groovy") - File alphaClass = new File(classesDir,"gradleTest/tests/AlphaCompatibilitySpec.class") - File betaClass = new File(classesDir,"gradleTest/tests/BetaCompatibilitySpec.class") - generatorTask.execute() - compileTask.execute() - - - then: "Generator task to have executed" - generatorTask.didWork - alphaSource.exists() - betaSource.exists() - alphaClass.exists() - betaClass.exists() - - when: "Alpha test is deleted" - new File(project.projectDir,'src/gradleTest/alpha').deleteDir() - project = ProjectBuilder.builder().withProjectDir(testProjectDir.root).build() - configureProject() - generatorTask = tasks.getByName('gradleTestGenerator') - compileTask = tasks.getByName('compileGradleTestGroovy') - generatorTask.execute() - compileTask.execute() - println "*** ${alphaClass.parentFile.listFiles()}" - - then: "Alpha generated source & compiles class is also deleted" - generatorTask.didWork - !alphaSource.exists() - betaSource.exists() - !alphaClass.exists() - betaClass.exists() - } - } \ No newline at end of file diff --git a/src/integrationTest/groovy/org/ysb33r/gradle/gradletest/GradleTestIntegrationSpec.groovy b/src/integrationTest/groovy/org/ysb33r/gradle/gradletest/GradleTestIntegrationSpec.groovy index 73172aa..4fe8576 100644 --- a/src/integrationTest/groovy/org/ysb33r/gradle/gradletest/GradleTestIntegrationSpec.groovy +++ b/src/integrationTest/groovy/org/ysb33r/gradle/gradletest/GradleTestIntegrationSpec.groovy @@ -189,4 +189,47 @@ class GradleTestIntegrationSpec extends GradleTestIntegrationSpecification { } + @Issue('https://github.com/ysb33r/gradleTest/issues/59') + def "Adding folders will re-run test task"() { + setup: "A GradleTest structrue with three tests" + def gradleRunner = GradleRunner.create() + .withProjectDir(projectDir) + .withArguments('gradleTest','-i') + .withPluginClasspath(readMetadataFile()) + .forwardOutput() + genTestStructureForSuccess(srcDir) + + when: 'When executed' + println "I'm starting this test chain and I'm " + GradleVersion.current() + def result = gradleRunner.build() + + then: 'The tests execute successfully' + result.task(":gradleTest").outcome == TaskOutcome.SUCCESS + + when: 'It is executed again' + println "I'm running this test chain again and I'm " + GradleVersion.current() + result = gradleRunner.build() + + then: 'The task should be skipped' + result.task(":gradleTest").outcome == TaskOutcome.UP_TO_DATE + + when: 'An additional test is added' + File testDir = new File(srcDir, 'delta') + testDir.mkdirs() + new File(testDir, 'build.gradle').text = ''' + task runGradleTest { + doLast { + println "DELTA: I'm runGradleTest and I'm " + GradleVersion.current() + println "DELTA: Hello, ${project.name}" + } + } +''' + + and: 'The task is executed again' + result = gradleRunner.build() + + then: 'Then the task will be successfully executed' + result.task(":gradleTest").outcome == TaskOutcome.SUCCESS + } + } \ No newline at end of file From d127a5b059989760fdabc54161ee38ec51d7fba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Fri, 6 Jan 2017 12:14:30 +0200 Subject: [PATCH 12/26] Compatibility test for multi-project plugin projects (#51) --- CHANGELOG.adoc | 1 + .../multiPluginProject/build.gradle | 5 +++ .../multiPluginProject/myLib/build.gradle | 5 +++ .../src/main/groovy/multiproject/MyLib.groovy | 5 +++ .../multiPluginProject/pluginA/build.gradle | 31 +++++++++++++++++++ .../src/gradleTest/testMyPlugin/build.gradle | 5 +++ .../groovy/multiproject/MyLibPlugin.groovy | 14 +++++++++ .../multiPluginProject/settings.gradle | 2 ++ 8 files changed, 68 insertions(+) create mode 100644 compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/build.gradle create mode 100644 compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/myLib/build.gradle create mode 100644 compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/myLib/src/main/groovy/multiproject/MyLib.groovy create mode 100644 compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/build.gradle create mode 100644 compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/src/gradleTest/testMyPlugin/build.gradle create mode 100644 compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/src/main/groovy/multiproject/MyLibPlugin.groovy create mode 100644 compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/settings.gradle diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index a2aedd1..cd0a07f 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -52,6 +52,7 @@ for a specific release, please visit the http://ysb33r.github.io/gradleTest[plug from check. * https://github.com/ysb33r/gradleTest/issues/50[#50] - Removed the use of deprecated `TaskInputs.source(Object)` when running under Gradle 3.0+. +* https://github.com/ysb33r/gradleTest/issues/51[#51] - Compatibility test for multi-project scenarios. * https://github.com/ysb33r/gradleTest/issues/55[#55] - Memory: Split compatiblity tests into smaller runs on Appveyor. * https://github.com/ysb33r/gradleTest/issues/55[#56] - Memory: Use virtual image rather than container on TravisCI. * https://github.com/ysb33r/gradleTest/issues/60[#60] - Mention alternative approaches to `GradleTest`. diff --git a/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/build.gradle b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/build.gradle new file mode 100644 index 0000000..07e4a31 --- /dev/null +++ b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/build.gradle @@ -0,0 +1,5 @@ +// See https://github.com/ysb33r/gradleTest/issues/51 + +task runGradleTest { + dependsOn ':pluginA:runGradleTest' +} \ No newline at end of file diff --git a/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/myLib/build.gradle b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/myLib/build.gradle new file mode 100644 index 0000000..621c28a --- /dev/null +++ b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/myLib/build.gradle @@ -0,0 +1,5 @@ +apply plugin : 'groovy' + +dependencies { + compile localGroovy() +} \ No newline at end of file diff --git a/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/myLib/src/main/groovy/multiproject/MyLib.groovy b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/myLib/src/main/groovy/multiproject/MyLib.groovy new file mode 100644 index 0000000..2edb141 --- /dev/null +++ b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/myLib/src/main/groovy/multiproject/MyLib.groovy @@ -0,0 +1,5 @@ +package multiproject + +class MyLib { + final static String NAME = 'MyLib' +} \ No newline at end of file diff --git a/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/build.gradle b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/build.gradle new file mode 100644 index 0000000..753b1c7 --- /dev/null +++ b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/build.gradle @@ -0,0 +1,31 @@ +apply plugin : 'groovy' +apply plugin : 'org.ysb33r.gradletest' + +repositories { + jcenter() +} + +dependencies { + compile project(':myLib') + compile localGroovy() + compile gradleApi() +} + + +gradleTest { + versions '2.13','3.0' +} + +// This is nice for debugging, but can only be done on later versions +if(GradleVersion.current() > GradleVersion.version('2.13')) { + gradleTest { + beforeTest { + println '-'.multiply(60) + println "| [${project.name}] ${it.name}" + println "| ${configurations.gradleTestCompile.asPath}" + println '-'.multiply(60) + } + } +} + +task runGradleTest( dependsOn : ['assemble','gradleTest'] ) diff --git a/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/src/gradleTest/testMyPlugin/build.gradle b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/src/gradleTest/testMyPlugin/build.gradle new file mode 100644 index 0000000..c1f600c --- /dev/null +++ b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/src/gradleTest/testMyPlugin/build.gradle @@ -0,0 +1,5 @@ +apply plugin : MyLibPlugin + +task runGradleTest { + dependsOn myLibRunner +} \ No newline at end of file diff --git a/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/src/main/groovy/multiproject/MyLibPlugin.groovy b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/src/main/groovy/multiproject/MyLibPlugin.groovy new file mode 100644 index 0000000..983b96e --- /dev/null +++ b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/src/main/groovy/multiproject/MyLibPlugin.groovy @@ -0,0 +1,14 @@ +package multiproject + +import org.gradle.api.Plugin +import org.gradle.api.Project + +class MyLibPlugin implements Plugin { + void apply(Project project) { + project.tasks.create ('myLibRunner') { + doLast { + println MyLib.NAME + } + } + } +} \ No newline at end of file diff --git a/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/settings.gradle b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/settings.gradle new file mode 100644 index 0000000..e5036fa --- /dev/null +++ b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/settings.gradle @@ -0,0 +1,2 @@ +include 'myLib' +include 'pluginA' From de8cb8b7de9da018601f173b5ede8acbfc0d6bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Fri, 6 Jan 2017 12:36:55 +0200 Subject: [PATCH 13/26] Remove debug output from Travis CI log --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 927c76e..0f36075 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ before_script: script: - ./gradlew -S -i --console=plain assemble - - ./gradlew -S -i --console=plain --debug test + - ./gradlew -S -i --console=plain test - ./gradlew -S -i --console=plain integrationTest compatibilityTest jdk: From 619f3a21a6a477ab471fafa5c52642a87eec4dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Fri, 6 Jan 2017 13:03:01 +0200 Subject: [PATCH 14/26] Fixed spelling mistakes in groovydoc --- src/docs/landingPage/display-versions.txt | 2 +- .../gradle/gradletest/legacy20/CompatibilityTestResult.groovy | 2 +- .../org/ysb33r/gradle/gradletest/legacy20/Distribution.groovy | 2 +- .../gradle/gradletest/legacy20/internal/Infrastructure.groovy | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/docs/landingPage/display-versions.txt b/src/docs/landingPage/display-versions.txt index f8e3b5a..80d5414 100644 --- a/src/docs/landingPage/display-versions.txt +++ b/src/docs/landingPage/display-versions.txt @@ -1,4 +1,4 @@ # List versions in order that they should appear on the landing page # -1.0-beta7 +1.0-beta8 0.5.5 diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/CompatibilityTestResult.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/CompatibilityTestResult.groovy index 8303683..b6b9f26 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/CompatibilityTestResult.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/CompatibilityTestResult.groovy @@ -13,7 +13,7 @@ */ package org.ysb33r.gradle.gradletest.legacy20 -/** Inteface used in legacy mode to report test results +/** Interface used in legacy mode to report test results * */ interface CompatibilityTestResult { diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/Distribution.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/Distribution.groovy index f3e2ed1..62e79e5 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/Distribution.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/Distribution.groovy @@ -13,7 +13,7 @@ */ package org.ysb33r.gradle.gradletest.legacy20 -/** Inteface for handlign distributions in legacy mode. +/** Interface for handling distributions in legacy mode. * */ interface Distribution extends Comparable { diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/Infrastructure.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/Infrastructure.groovy index aed1935..66028f3 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/Infrastructure.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/Infrastructure.groovy @@ -17,7 +17,7 @@ import org.gradle.api.Project import org.gradle.api.logging.Logger import org.gradle.api.tasks.WorkResult -/** Utiity class to aid in building the files structure for compatibility testing +/** Utility class to aid in building the files structure for compatibility testing * * */ From d38019c73d49d31853aa8b9de47c55d839e36e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Fri, 6 Jan 2017 12:14:30 +0200 Subject: [PATCH 15/26] Compatibility test for multi-project plugin projects (#51) Project dependencies must be added to the external dependency list for init script paths. --- compatibility/compatibility.gradle | 2 ++ .../multiPluginProject/pluginA/build.gradle | 1 - .../pluginA/src/gradleTest/testMyPlugin/build.gradle | 4 ++-- .../groovy/org/ysb33r/gradle/gradletest/TestGenerator.groovy | 4 +++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/compatibility/compatibility.gradle b/compatibility/compatibility.gradle index 74ab9e7..cf4e906 100644 --- a/compatibility/compatibility.gradle +++ b/compatibility/compatibility.gradle @@ -73,6 +73,7 @@ task sanityCheck { gradleTest { // end::applyplugin2[] dependsOn sanityCheck + systemProperties = [:] // tag::applyplugin2[] versions '3.3', '3.2.1', '3.1', '3.0' versions '2.14.1' @@ -130,6 +131,7 @@ if(GradleVersion.current() >= GradleVersion.version('2.13')) { nonLegacyOnlyGradleTest { dependsOn sanityCheck + systemProperties = [:] beforeTest { println " ${it.name}" diff --git a/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/build.gradle b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/build.gradle index 753b1c7..f824fac 100644 --- a/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/build.gradle +++ b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/build.gradle @@ -11,7 +11,6 @@ dependencies { compile gradleApi() } - gradleTest { versions '2.13','3.0' } diff --git a/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/src/gradleTest/testMyPlugin/build.gradle b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/src/gradleTest/testMyPlugin/build.gradle index c1f600c..7425c50 100644 --- a/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/src/gradleTest/testMyPlugin/build.gradle +++ b/compatibility/src/nonLegacyOnlyGradleTest/multiPluginProject/pluginA/src/gradleTest/testMyPlugin/build.gradle @@ -1,5 +1,5 @@ -apply plugin : MyLibPlugin +apply plugin : multiproject.MyLibPlugin task runGradleTest { dependsOn myLibRunner -} \ No newline at end of file +} diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/TestGenerator.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/TestGenerator.groovy index 1778320..cdd9024 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/TestGenerator.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/TestGenerator.groovy @@ -21,6 +21,7 @@ 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.ProjectDependency import org.gradle.api.artifacts.UnknownConfigurationException import org.gradle.api.file.FileCollection import org.gradle.api.file.SourceDirectorySet @@ -175,8 +176,9 @@ class TestGenerator extends DefaultTask { Set externalDependencies = [] try { DomainObjectSet externalDependencySet = project.configurations.getByName('runtime').allDependencies.withType(ExternalModuleDependency) + DomainObjectSet projectDependencySet = project.configurations.getByName('runtime').allDependencies.withType(ProjectDependency) externalDependencies = project.configurations.getByName('runtime').files { dep -> - externalDependencySet.contains(dep) + externalDependencySet.contains(dep) || projectDependencySet.contains(dep) } } catch(UnknownConfigurationException e) {} From 2c04f40a498b911800cc266ae83ff520b999d12d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Tue, 11 Apr 2017 12:33:58 +0200 Subject: [PATCH 16/26] Added compatibility matrix for 3.4.1 & 3.5 --- appveyor.yml | 2 +- compatibility/compatibility.gradle | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 4355a11..43ea2e3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,7 +13,7 @@ test_script: - gradlew.bat test compatibilityTest --info --no-daemon -DgradleTest.versions=2.8,2.9,2.10,2.11 -DnonLegacyOnlyGradleTest.versions=3.0 - gradlew.bat test compatibilityTest --info --no-daemon -DgradleTest.versions=2.12,2.13,2.14.1 -DnonLegacyOnlyGradleTest.versions=3.1 - gradlew.bat test compatibilityTest --info --no-daemon -DgradleTest.versions=3.0,3.1,3.2.1 -DnonLegacyOnlyGradleTest.versions=3.2.1 - - gradlew.bat test compatibilityTest --info --no-daemon -DgradleTest.versions=3.3 -DnonLegacyOnlyGradleTest.versions=3.3 + - gradlew.bat test compatibilityTest --info --no-daemon -DgradleTest.versions=3.3,3.4.1,3.5 -DnonLegacyOnlyGradleTest.versions=3.3,3.4.1,3.5 branches: only: diff --git a/compatibility/compatibility.gradle b/compatibility/compatibility.gradle index cf4e906..4b47ca6 100644 --- a/compatibility/compatibility.gradle +++ b/compatibility/compatibility.gradle @@ -75,6 +75,7 @@ gradleTest { dependsOn sanityCheck systemProperties = [:] // tag::applyplugin2[] + versions '3.5', '3.4.1' versions '3.3', '3.2.1', '3.1', '3.0' versions '2.14.1' versions '2.13' @@ -119,7 +120,7 @@ if(GradleVersion.current() >= GradleVersion.version('2.13')) { additionalGradleTestSet 'nonLegacyOnly' // <1> nonLegacyOnlyGradleTest { // <2> - versions '3.3' + versions '3.5', '3.4.1', '3.3' versions '3.2', '3.1', '3.0' // <3> versions '2.14.1','2.13' } From 712d4a04acf4b1049e61e4115e00104942de1cef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Tue, 11 Apr 2017 12:35:04 +0200 Subject: [PATCH 17/26] Additional excludes for license plugin --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 1d86e0f..f232966 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ import org.asciidoctor.gradle.AsciidoctorTask group = 'org.ysb33r.gradle' archivesBaseName = 'gradletest' -version = '1.0-beta8-SNAPSHOT' +version = '1.0-beta8' apply from : 'gradle/integration-tests.gradle' apply from : 'gradle/compatibility-tests.gradle' @@ -230,7 +230,7 @@ license { strictCheck = true ignoreFailures = false ext.year = '2015 - 2016' - excludes(['**/*.ad', '**/*.asciidoc', '**/*.adoc', '**/*.md','**/*.properties']) + excludes(['**/*.ad', '**/*.asciidoc', '**/*.adoc', '**/*.md','**/*.properties','**/*.groovy.template']) mapping 'gradle', 'SLASHSTAR_STYLE' } From 28fea15bc38139a4652020fa5db26d345611ac14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Tue, 11 Apr 2017 12:35:21 +0200 Subject: [PATCH 18/26] Fixed formatting --- CHANGELOG.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index cd0a07f..1ef228f 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -64,7 +64,7 @@ for a specific release, please visit the http://ysb33r.github.io/gradleTest[plug == Contributors // tag::contributors[] -* + // end::contributors[] == v0.5.5 From 96e5b37a11c63e4a1793acd21bc89ae06447f41f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Thu, 25 May 2017 16:06:39 +0200 Subject: [PATCH 19/26] Added support for GradleRunnerSteps (#67) --- CHANGELOG.adoc | 1 + build.gradle | 3 +- .../gradleRunnerProject/build.gradle | 10 + src/docs/asciidoc/parts/alternatives.adoc | 2 +- src/docs/asciidoc/parts/bootstrap.adoc | 11 +- src/docs/asciidoc/parts/gradle-runner.adoc | 26 +++ src/docs/asciidoc/parts/legacy-mode.adoc | 2 +- src/docs/asciidoc/parts/other-plugins.adoc | 4 +- src/docs/asciidoc/parts/structure.adoc | 2 + src/docs/asciidoc/product-documentation.adoc | 9 +- .../gradlerunner/GradleRunnerPlugin.groovy | 17 ++ .../gradlerunner/GradleRunnerSteps.groovy | 173 ++++++++++++++++++ .../ysb33r/gradle/gradlerunner/Step.groovy | 30 +++ .../gradle/gradlerunner/StepInfo.groovy | 29 +++ .../gradlerunner/internal/AbstractStep.groovy | 79 ++++++++ .../gradlerunner/internal/ActionStep.groovy | 33 ++++ .../gradlerunner/internal/ClosureStep.groovy | 36 ++++ .../gradlerunner/internal/GradleStep.groovy | 73 ++++++++ .../gradletest/ClasspathManifest.groovy | 2 +- .../org.ysb33r.gradlerunner.properties | 1 + .../gradlerunner/GradleRunnerSpec.groovy | 48 +++++ 21 files changed, 578 insertions(+), 13 deletions(-) create mode 100644 compatibility/src/nonLegacyOnlyGradleTest/gradleRunnerProject/build.gradle create mode 100644 src/docs/asciidoc/parts/gradle-runner.adoc create mode 100644 src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerPlugin.groovy create mode 100644 src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSteps.groovy create mode 100644 src/main/groovy/org/ysb33r/gradle/gradlerunner/Step.groovy create mode 100644 src/main/groovy/org/ysb33r/gradle/gradlerunner/StepInfo.groovy create mode 100644 src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/AbstractStep.groovy create mode 100644 src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/ActionStep.groovy create mode 100644 src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/ClosureStep.groovy create mode 100644 src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/GradleStep.groovy create mode 100644 src/main/resources/META-INF/gradle-plugins/org.ysb33r.gradlerunner.properties create mode 100644 src/test/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSpec.groovy diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 1ef228f..1d8d9ce 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -18,6 +18,7 @@ for a specific release, please visit the http://ysb33r.github.io/gradleTest[plug * https://github.com/ysb33r/gradleTest/issues/52[#52] - Allow for expected failure cases * https://github.com/ysb33r/gradleTest/issues/54[#54] - Added base plugin `org.ysb33r.gradletest.base`. * https://github.com/ysb33r/gradleTest/issues/62[#62] - Propagate `--rerun-tasks` down to test instances. +* https://github.com/ysb33r/gradleTest/issues/67[#67] - `org.ysb33r.gradlerunner` plugin provides `gradleRunner` task which can interleave different steps with independent Gradle executions. === Bugs diff --git a/build.gradle b/build.gradle index f232966..297b883 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ import org.asciidoctor.gradle.AsciidoctorTask group = 'org.ysb33r.gradle' archivesBaseName = 'gradletest' -version = '1.0-beta8' +version = '1.0-beta9-SNAPSHOT' apply from : 'gradle/integration-tests.gradle' apply from : 'gradle/compatibility-tests.gradle' @@ -66,6 +66,7 @@ dependencies { compile gradleApi() compile localGroovy() compile depCommonsIO + compile gradleTestKit() testCompile (depSpock) { exclude module : 'groovy-all' diff --git a/compatibility/src/nonLegacyOnlyGradleTest/gradleRunnerProject/build.gradle b/compatibility/src/nonLegacyOnlyGradleTest/gradleRunnerProject/build.gradle new file mode 100644 index 0000000..1c11dce --- /dev/null +++ b/compatibility/src/nonLegacyOnlyGradleTest/gradleRunnerProject/build.gradle @@ -0,0 +1,10 @@ +apply plugin : 'org.ysb33r.gradlerunner' + +gradleRunner { + step 'gradleTasks', 'tasks', '--all' +} + + +task runGradleTest { + dependsOn gradleRunner +} \ No newline at end of file diff --git a/src/docs/asciidoc/parts/alternatives.adoc b/src/docs/asciidoc/parts/alternatives.adoc index 5a33b3e..e866657 100644 --- a/src/docs/asciidoc/parts/alternatives.adoc +++ b/src/docs/asciidoc/parts/alternatives.adoc @@ -1,4 +1,4 @@ -= Alternative Approaches += Alternative Approaches to GradleTest == Gradle TestKit diff --git a/src/docs/asciidoc/parts/bootstrap.adoc b/src/docs/asciidoc/parts/bootstrap.adoc index c632787..81f4371 100644 --- a/src/docs/asciidoc/parts/bootstrap.adoc +++ b/src/docs/asciidoc/parts/bootstrap.adoc @@ -1,14 +1,19 @@ -== Bootstrap += Bootstrap GradleTest is available in the https://plugins.gradle.org/plugin/org.ysb33r.gradletest[Gradle Plugins] repository. -To use it, add the following snippet into your build script. +To use it, add the appropriate plugin to the `plugins` block. [source,groovy,subs="attributes"] ---- plugins { - id 'org.ysb33r.gradletest' version '{revnumber}' + id 'org.ysb33r.gradletest' version '{revnumber}' // <1> + id 'org.ysb33r.gradletest.base' version '{revnumber}' // <2> + id 'org.ysb33r.gradlerunner' version '{revnumber}' // <3> } ---- +<1> The common use case for compatibility testing +<2> Use the base plugin when you do not require the default `gradleTest` tasks (and related source sets) +<3> Use the `gradlerunner` to easily execute independent steps of `GradleRunner`. When your setup is more complex and the plugins block does not work OR if you are using Gradle 2.0 use the following instead diff --git a/src/docs/asciidoc/parts/gradle-runner.adoc b/src/docs/asciidoc/parts/gradle-runner.adoc new file mode 100644 index 0000000..1a67911 --- /dev/null +++ b/src/docs/asciidoc/parts/gradle-runner.adoc @@ -0,0 +1,26 @@ += GradleRunner + +The `org.ysb33r.gradlerunner` plugin will add a default task called `gradleRunner` which is of type `GradleRunnerSteps`. This task allows people to run specific Gradle steps interlevaed via other actions such as copying files. This is specifically useful for people who need to document development steps where Gradle is involved. + +Steps are added via the `step` keyword. Each step has a name which can later be used to extract information after execution. + +[source,groovy] +---- +gradleRunner { + step 'a simple closure', { // <1> + new File(workingDir,'build.gradle').text = '/* empty build file */' + new File(reportsDir,'foo.txt').txt = 'output to report directory' // <2> + } + + step 'running gradle', 'tasks', '--all' // <3> + + failingStep 'this gradle will fail', 'non-existing-task' // <4> +} + +---- +<1> A step can be a closure or an `Action`. +<2> Every step will have an unique directory for dropping files, +<3> A step can be a Gradle execution. Supply all command-line parameters after the name. A Gradle execution will drop `out.txt` and `err.txt` in the report directory. +<4> A step can also be a Gradle execution that is known to fail. + +After execution use `gradleRunner.getStepReportDir(STEP_NAME)` to obtain the reporting directory for a step. diff --git a/src/docs/asciidoc/parts/legacy-mode.adoc b/src/docs/asciidoc/parts/legacy-mode.adoc index 1887651..9da0bae 100644 --- a/src/docs/asciidoc/parts/legacy-mode.adoc +++ b/src/docs/asciidoc/parts/legacy-mode.adoc @@ -1,4 +1,4 @@ -= Legacy Mode (Gradle 2.0-2.12) += GradleTest Legacy Mode (Gradle 2.0-2.12) If you are building your plugin project with any Gradle version 2.0 - 2.12 it automatically invoked legacy mode and behaves like the v0.5.5 version of this plugin. diff --git a/src/docs/asciidoc/parts/other-plugins.adoc b/src/docs/asciidoc/parts/other-plugins.adoc index 75dc2f8..b3cdb73 100644 --- a/src/docs/asciidoc/parts/other-plugins.adoc +++ b/src/docs/asciidoc/parts/other-plugins.adoc @@ -1,6 +1,6 @@ -= Compatibility with Other Plugins +== Compatibility with Other Plugins -== License plugin +=== License plugin The https://github.com/hierynomus/license-gradle-plugin[License plugin] is a really useful plugin to help with maintenance of license headers in source code. One standard feature of this plugin is to scan all source sets diff --git a/src/docs/asciidoc/parts/structure.adoc b/src/docs/asciidoc/parts/structure.adoc index ab4b5f8..9a885fe 100644 --- a/src/docs/asciidoc/parts/structure.adoc +++ b/src/docs/asciidoc/parts/structure.adoc @@ -1,3 +1,5 @@ += Testkit Mode (Gradle 2.13+) + == Conventions === Filesystem diff --git a/src/docs/asciidoc/product-documentation.adoc b/src/docs/asciidoc/product-documentation.adoc index 3578997..6d16622 100644 --- a/src/docs/asciidoc/product-documentation.adoc +++ b/src/docs/asciidoc/product-documentation.adoc @@ -11,8 +11,6 @@ that can directly be used in documentation. NOTE: *If you are using a Gradle version < 2.13, it will run in legacy mode and behave like the 0.5.5 version of the plugin*. -= Testkit Mode (Gradle 2.13+) - include::parts/bootstrap.adoc[] include::parts/structure.adoc[] @@ -29,8 +27,11 @@ include::parts/known-limitations.adoc[] include::parts/upgrading.adoc[] -include::parts/legacy-mode.adoc[] - include::parts/other-plugins.adoc[] include::parts/alternatives.adoc[] + +include::parts/legacy-mode.adoc[] + +include::parts/gradle-runner.adoc[] + diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerPlugin.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerPlugin.groovy new file mode 100644 index 0000000..c01f02c --- /dev/null +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerPlugin.groovy @@ -0,0 +1,17 @@ +package org.ysb33r.gradle.gradlerunner + +import org.gradle.api.Plugin +import org.gradle.api.Project + +/** Adds a default task called {@code gradleRunner} + * + * @since 1.0 + */ +class GradleRunnerPlugin implements Plugin { + static final String DEFAULT_TASK = 'gradleRunner' + + @Override + void apply(Project project) { + project.tasks.create DEFAULT_TASK, GradleRunnerSteps + } +} diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSteps.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSteps.groovy new file mode 100644 index 0000000..def4cce --- /dev/null +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSteps.groovy @@ -0,0 +1,173 @@ +package org.ysb33r.gradle.gradlerunner + +import groovy.transform.CompileStatic +import org.gradle.api.Action +import org.gradle.api.DefaultTask +import org.gradle.api.GradleException +import org.gradle.api.tasks.OutputDirectory +import org.gradle.api.tasks.TaskAction +import org.gradle.internal.FileUtils +import org.ysb33r.gradle.gradlerunner.internal.ActionStep +import org.ysb33r.gradle.gradlerunner.internal.ClosureStep +import org.ysb33r.gradle.gradlerunner.internal.GradleStep + +/** Executes a set of staps including running Gradle with tasks and capturing the output + * + * @since 1.0 + */ +@CompileStatic +class GradleRunnerSteps extends DefaultTask { + + GradleRunnerSteps() { + super() + Closure up2Date = { GradleRunnerSteps runner -> + List allSteps = runner.getSteps() + "${allSteps.size()}:" + allSteps.collect { Step step -> + step.class.getName() + }.join(':') + }.curry(this) + inputs.property 'steps-up2date', up2Date + } + + void workingDir(final Object path) { + setWorkingDir(path) + } + + void setWorkingDir(final Object path) { + this.workingDir = path + } + + @OutputDirectory + File getWorkingDir() { + project.file(this.workingDir) + } + + void reportsDir(final Object path) { + setWorkingDir(path) + } + + void setReportsDir(final Object path) { + this.reportsDir = path + } + + @OutputDirectory + File getReportsDir() { + project.file(this.reportsDir) + } + + /** Executes a closure + * + * @param name Name of the step + * @param action The action to execute. Will be passed a {@link StepInfo}. + */ + void step(final String name, Closure action) { + steps.add new ClosureStep(name,action) + } + + /** Executes an {@code Action}. + * + * @param name Name of the step + * @param action The action to execute. Will be passed a {@link StepInfo}. + */ + void step(final String name, Action action) { + steps.add new ActionStep(name,action) + } + + /** Execute a Gradle step in the directory specified by {@link #getWorkingDir()}. + * + * Outputs from the step will be stored in a fodler before {@link #getReportsDir()} + * + * @param name Name of step + * @param gradleArgs Arguments to pass to Gradle + */ + void step(final String name, Iterable gradleArgs) { + this.steps.add new GradleStep(name,gradleArgs,false) + } + + /** Execute a Gradle step in the directory specified by {@link #getWorkingDir()}. + * + * Outputs from the step will be stored in a folder before {@link #getReportsDir()} + * + * @param name Name of step + * @param gradleArgs Arguments to pass to Gradle + */ + void step(final String name, String... gradleArgs) { + step(name,gradleArgs as List) + } + + /** Execute a failing Gradle step in the directory specified by {@link #getWorkingDir()}. + * + * Outputs from the step will be stored in a fodler before {@link #getReportsDir()} + * + * @param name Name of step + * @param gradleArgs Arguments to pass to Gradle + */ + void failingStep(final String name, Iterable gradleArgs) { + this.steps.add new GradleStep(name,gradleArgs,true) + } + + /** Execute a failing Gradle step in the directory specified by {@link #getWorkingDir()}. + * + * Outputs from the step will be stored in a fodler before {@link #getReportsDir()} + * + * @param name Name of step + * @param gradleArgs Arguments to pass to Gradle + */ + void failingStep(final String name, String... gradleArgs) { + failingStep(name,gradleArgs as List) + } + + /** Returns the list of steps. + * + * @return Steps in order as that they were added + */ + List getSteps() { + this.steps + } + + /** Returns the working directory for a specific step. + * + * @param stepName Name of step. + * @return The reposrting directory for the step. Can be {@code null} if the step did not execute. + */ + File getStepReportDir(final String stepName) { + Step needle = steps.find { Step step -> + step.name == stepName + } + + if(needle == null) { + throw new GradleException("Step '${stepName}' does not exist") + } + + needle.stepInfo.reportDir + } + + /** Returns the working directory for a specific step. + * + * @param stepIndex Index number of step. + * @return The reposrting directory for the step. Can be {@code null} if the step did not execute. + */ + File getStepReportDir(int stepIndex) { + steps.get(stepIndex).stepInfo.reportDir + } + + @TaskAction + void exec() { + final File work = getWorkingDir() + final File report = getReportsDir() + + [ work, report ].each { File it -> + it.deleteDir() + it.mkdirs() + } + + for (Step step : steps ) { + step.execute( work, new File(report,FileUtils.toSafeFileName(step.getName()) ) ) + } + } + + private final List steps = [] + private final String pathIdentifier = FileUtils.toSafeFileName(getName()) + private Object workingDir = { String id -> "${project.buildDir}/runners/${id}"}.curry(pathIdentifier) + private Object reportsDir = { String id -> "${project.buildDir}/reports/runners/${id}"}.curry(pathIdentifier) +} diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/Step.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/Step.groovy new file mode 100644 index 0000000..eaeb7a4 --- /dev/null +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/Step.groovy @@ -0,0 +1,30 @@ +package org.ysb33r.gradle.gradlerunner + +import groovy.transform.CompileStatic + +/** A step to be executed. + * + * @since 1.0 + */ +@CompileStatic +interface Step { + + /** Name of this step. + * + * @return Name. + */ + String getName() + + /** Executes a step + * + * @param workingDir Working directory for step + * @param reportsDir Directory whether reports should be written to. + */ + void execute( final File workingDir, final File reportsDir ) + + /** Information that was used during execution of the step + * + * @return Step information. + */ + StepInfo getStepInfo() +} \ No newline at end of file diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/StepInfo.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/StepInfo.groovy new file mode 100644 index 0000000..78121b3 --- /dev/null +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/StepInfo.groovy @@ -0,0 +1,29 @@ +package org.ysb33r.gradle.gradlerunner + +import groovy.transform.CompileStatic + +/** Information requires to execute a step + * + * @since 1.0 + */ +@CompileStatic +interface StepInfo { + + /** Name of the step + * + * @return Name as a string + */ + String getName() + + /** Directory where reports should be written to + * + * @return Directory unique to this step. Can be null. + */ + File getReportDir() + + /** Base directory where work occurs in + * + * @return Directory. Can be null. + */ + File getWorkingDir() +} \ No newline at end of file diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/AbstractStep.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/AbstractStep.groovy new file mode 100644 index 0000000..f48b983 --- /dev/null +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/AbstractStep.groovy @@ -0,0 +1,79 @@ +package org.ysb33r.gradle.gradlerunner.internal + +import org.ysb33r.gradle.gradlerunner.Step +import org.ysb33r.gradle.gradlerunner.StepInfo + +/** Abstract base class for implementing steps + * + * @since 1.0 + */ +abstract class AbstractStep implements Step, StepInfo { + + /** Information that was used during execution of the step + * + * @return Step information. + */ + @Override + StepInfo getStepInfo() { + this + } + + /** Directory where reports should be written to + * + * @return Directory unique to this step + */ + @Override + File getReportDir() { + this.reportDir + } + + /** Base directory where work occurs in + * + * @return Directory/ Null if action + */ + @Override + File getWorkingDir() { + this.workingDir + } + + /** Name of this step. + * + * @return Name. + */ + @Override + String getName() { + this.name + } + + + /** Set working directory for this step. + * + * @param wd Working directory + */ + protected void setWorkingDir(File wd) { + this.workingDir = wd + } + + /** Set unique reporting directory for this step. + * + * @param rd Reporting directory + */ + protected void setReportDir(File rd) { + this.reportDir = rd + } + + protected void createDirs(File workingDir, File reportsDir) { + this.workingDir = workingDir + this.reportDir = reportsDir + this.workingDir.mkdirs() + this.reportDir.mkdirs() + } + + protected AbstractStep(final String name) { + this.name = name + } + + final String name + File reportDir + File workingDir +} diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/ActionStep.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/ActionStep.groovy new file mode 100644 index 0000000..e596842 --- /dev/null +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/ActionStep.groovy @@ -0,0 +1,33 @@ +package org.ysb33r.gradle.gradlerunner.internal + +import groovy.transform.CompileStatic +import org.gradle.api.Action +import org.gradle.api.GradleException +import org.ysb33r.gradle.gradlerunner.Step +import org.ysb33r.gradle.gradlerunner.StepInfo + +/** Using an {@code Action} as a step + * + * @since 1.0 + */ +@CompileStatic +class ActionStep extends AbstractStep { + + ActionStep(final String name, Action action) { + super(name) + this.action = action + } + + /** Executes the closure, passing a StepInfo + * + * @param workingDir Working directory for step + * @param reportsDir Directory whether reports should be written to. + */ + @Override + void execute(File workingDir, File reportsDir) { + createDirs(workingDir,reportsDir) + action.execute(this) + } + + private Action action +} diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/ClosureStep.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/ClosureStep.groovy new file mode 100644 index 0000000..bcfc489 --- /dev/null +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/ClosureStep.groovy @@ -0,0 +1,36 @@ +package org.ysb33r.gradle.gradlerunner.internal + +import groovy.transform.CompileStatic +import org.gradle.api.GradleException +import org.ysb33r.gradle.gradlerunner.Step +import org.ysb33r.gradle.gradlerunner.StepInfo + +/** Using a closure as a step + * + * @since 1.0 + */ +@CompileStatic +class ClosureStep extends AbstractStep { + + ClosureStep( final String name, Closure action) { + super(name) + if( action.parameterTypes.size() != 1 && !(action.parameterTypes[0] instanceof StepInfo) ) { + throw new GradleException( " Closure needs to take a StepInfo as parameter") + } + + this.action = action + } + + /** Executes the closure, passing a StepInfo + * + * @param workingDir Working directory for step + * @param reportsDir Directory whether reports should be written to. + */ + @Override + void execute(File workingDir, File reportsDir) { + createDirs(workingDir,reportsDir) + action.call(this) + } + + Closure action +} diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/GradleStep.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/GradleStep.groovy new file mode 100644 index 0000000..77c4f37 --- /dev/null +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/GradleStep.groovy @@ -0,0 +1,73 @@ +package org.ysb33r.gradle.gradlerunner.internal + +import groovy.transform.CompileStatic +import org.gradle.testkit.runner.BuildResult +import org.gradle.testkit.runner.GradleRunner +import org.ysb33r.gradle.gradlerunner.Step +import org.ysb33r.gradle.gradlerunner.StepInfo + +/** Runs a Gradle execution. + * + * @since 1.0 + */ +@CompileStatic +class GradleStep extends AbstractStep { + + GradleStep(final String name, final List args,boolean expectFailure) { + super(name) + this.args = args + this.expectFailure = expectFailure + } + + GradleStep(final String name,final Iterable args,boolean expectFailure) { + super(name) + this.args = [] + this.args.addAll(args) + this.expectFailure = expectFailure + } + + @Override + void execute(File projectDir, File reportDir) { + createDirs(projectDir,reportDir) + this.outputFile = new File(reportDir,'out.txt') + this.errorFile = new File(reportDir,'err.txt') + run( projectDir, this.outputFile, this.errorFile) + } + + /** Location of output from execution. + * + * @return Output file. Null if step has not executed yet. + */ + File getOutput() { + this.outputFile + } + + /** Location of error output from execution. + * + * @return Error file. Null if step has not executed yet. + */ + File getError() { + this.errorFile + } + + private BuildResult run(File projDir, File outFile,File errFile) { + BuildResult result + outFile.withWriter { Writer out -> + errFile.withWriter { Writer err -> + GradleRunner runner = GradleRunner.create(). + forwardStdError(err).forwardStdOutput(out). + withArguments(this.args).withProjectDir(projDir) + + result = this.expectFailure ? runner.buildAndFail() : runner.build() + } + } + return result + } + + private File outputFile + private File errorFile + + private final List args + private boolean expectFailure + +} diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/ClasspathManifest.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/ClasspathManifest.groovy index aa486b9..45bd4f3 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/ClasspathManifest.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/ClasspathManifest.groovy @@ -24,7 +24,7 @@ import org.gradle.api.tasks.SourceSetContainer import org.gradle.api.tasks.TaskAction /** Generates a manifest file that can be re-used by @link GradleTest tasks to set the correct classpath - * for {@code GradleRunner}. + * for {@code GradleRunnerSteps}. * * @since 1.0 */ diff --git a/src/main/resources/META-INF/gradle-plugins/org.ysb33r.gradlerunner.properties b/src/main/resources/META-INF/gradle-plugins/org.ysb33r.gradlerunner.properties new file mode 100644 index 0000000..74940d3 --- /dev/null +++ b/src/main/resources/META-INF/gradle-plugins/org.ysb33r.gradlerunner.properties @@ -0,0 +1 @@ +implementation-class=org.ysb33r.gradle.gradlerunner.GradleRunnerPlugin \ No newline at end of file diff --git a/src/test/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSpec.groovy b/src/test/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSpec.groovy new file mode 100644 index 0000000..480b524 --- /dev/null +++ b/src/test/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSpec.groovy @@ -0,0 +1,48 @@ +package org.ysb33r.gradle.gradlerunner + +import org.gradle.api.Action +import org.gradle.api.Project +import org.gradle.testfixtures.ProjectBuilder +import spock.lang.Specification + + + +class GradleRunnerSpec extends Specification { + + Project project = ProjectBuilder.builder().build() + GradleRunnerSteps gradleRunner = project.tasks.create('gradleRunner',GradleRunnerSteps) + + def 'Add basic steps and execute'() { + when: + gradleRunner.step'closure', { + StepInfo info -> println project.name + } + + gradleRunner.step'action', new Action() { + void execute(StepInfo i) { + println i.getName() + } + } + + gradleRunner.step 'gradle', 'tasks' + + gradleRunner.failingStep 'failing', 'non-existant-task' + + then: + gradleRunner.steps.size() == 4 + + when: + gradleRunner.execute() + File reportDir = gradleRunner.getStepReportDir( 'gradle') + + then: + gradleRunner.getStepReportDir(0) == new File("${project.buildDir}/reports/runners/gradleRunner/closure") + gradleRunner.workingDir == new File("${project.buildDir}/runners/gradleRunner") + reportDir.parentFile.parentFile.exists() + reportDir.parentFile.exists() + reportDir.exists() + new File(reportDir,'out.txt').exists() + + } + +} \ No newline at end of file From f663e762401689328fa978897de565ea5cd01e6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Thu, 25 May 2017 18:28:02 +0200 Subject: [PATCH 20/26] Compatibility testing for GradleRunnerSteps (#67) --- build.gradle | 2 +- .../gradleRunnerProject/build.gradle | 9 +++++++- gradle/compatibility-tests.gradle | 3 ++- .../gradlerunner/internal/GradleStep.groovy | 12 +++++----- .../gradlerunner/GradleRunnerSpec.groovy | 22 ++++++++++++++++++- 5 files changed, 37 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index 297b883..5c3608e 100644 --- a/build.gradle +++ b/build.gradle @@ -64,9 +64,9 @@ ext { dependencies { compile gradleApi() + compile gradleTestKit() compile localGroovy() compile depCommonsIO - compile gradleTestKit() testCompile (depSpock) { exclude module : 'groovy-all' diff --git a/compatibility/src/nonLegacyOnlyGradleTest/gradleRunnerProject/build.gradle b/compatibility/src/nonLegacyOnlyGradleTest/gradleRunnerProject/build.gradle index 1c11dce..b1309b8 100644 --- a/compatibility/src/nonLegacyOnlyGradleTest/gradleRunnerProject/build.gradle +++ b/compatibility/src/nonLegacyOnlyGradleTest/gradleRunnerProject/build.gradle @@ -1,10 +1,17 @@ +// This buildscript block is not required in normal build scripts. It is purely here to get the classpath +// correct during compatibility testing. +buildscript { + dependencies { + classpath gradleTestKit() + } +} + apply plugin : 'org.ysb33r.gradlerunner' gradleRunner { step 'gradleTasks', 'tasks', '--all' } - task runGradleTest { dependsOn gradleRunner } \ No newline at end of file diff --git a/gradle/compatibility-tests.gradle b/gradle/compatibility-tests.gradle index bcf6cc6..bd738af 100644 --- a/gradle/compatibility-tests.gradle +++ b/gradle/compatibility-tests.gradle @@ -4,7 +4,8 @@ task compatibilityTest( type : GradleBuild ) { dependsOn 'integrationTestRepo', 'jar' mustRunAfter 'test', 'integrationTest' - tasks = ['gradleTest','nonLegacyOnlyGradleTest'] +// tasks = ['gradleTest','nonLegacyOnlyGradleTest'] + tasks = ['nonLegacyOnlyGradleTest'] dir = file("${projectDir}/compatibility") buildFile = 'compatibility/compatibility.gradle' startParameter.projectProperties.compatibilityVersion = version diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/GradleStep.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/GradleStep.groovy index 77c4f37..1802e8c 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/GradleStep.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/GradleStep.groovy @@ -50,14 +50,12 @@ class GradleStep extends AbstractStep { this.errorFile } - private BuildResult run(File projDir, File outFile,File errFile) { + private BuildResult run(final File projDir, final File outFile,final File errFile) { BuildResult result - outFile.withWriter { Writer out -> - errFile.withWriter { Writer err -> - GradleRunner runner = GradleRunner.create(). - forwardStdError(err).forwardStdOutput(out). - withArguments(this.args).withProjectDir(projDir) - + GradleRunner runner = GradleRunner.create().withArguments(this.args).withProjectDir(projDir) + outFile.withPrintWriter { PrintWriter out -> + errFile.withPrintWriter { PrintWriter err -> + runner.forwardStdError(err).forwardStdOutput(out) result = this.expectFailure ? runner.buildAndFail() : runner.build() } } diff --git a/src/test/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSpec.groovy b/src/test/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSpec.groovy index 480b524..158af93 100644 --- a/src/test/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSpec.groovy +++ b/src/test/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSpec.groovy @@ -3,6 +3,7 @@ package org.ysb33r.gradle.gradlerunner import org.gradle.api.Action import org.gradle.api.Project import org.gradle.testfixtures.ProjectBuilder +import org.ysb33r.gradle.gradlerunner.internal.GradleStep import spock.lang.Specification @@ -10,10 +11,11 @@ import spock.lang.Specification class GradleRunnerSpec extends Specification { Project project = ProjectBuilder.builder().build() - GradleRunnerSteps gradleRunner = project.tasks.create('gradleRunner',GradleRunnerSteps) def 'Add basic steps and execute'() { when: + GradleRunnerSteps gradleRunner = project.tasks.create('gradleRunner',GradleRunnerSteps) + gradleRunner.step'closure', { StepInfo info -> println project.name } @@ -45,4 +47,22 @@ class GradleRunnerSpec extends Specification { } + def 'Running the task from the plugin'() { + setup: + project.allprojects { + apply plugin : 'org.ysb33r.gradlerunner' + + gradleRunner { + step 'gradle', 'tasks', '--all' + } + } + + when: + project.evaluate() + project.gradleRunner.execute() + + then: + ((GradleStep)(project.gradleRunner.getSteps()[0])).output.exists() + + } } \ No newline at end of file From fecfad06a88544514ba22be143b6468ad85a643d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Thu, 25 May 2017 18:59:57 +0200 Subject: [PATCH 21/26] GradleRunnerSteps only works with Gradle 2.14.1+ (#67) --- compatibility/compatibility.gradle | 2 +- src/docs/asciidoc/parts/gradle-runner.adoc | 4 ++-- .../ysb33r/gradle/gradlerunner/GradleRunnerPlugin.groovy | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/compatibility/compatibility.gradle b/compatibility/compatibility.gradle index 4b47ca6..c32dd3e 100644 --- a/compatibility/compatibility.gradle +++ b/compatibility/compatibility.gradle @@ -122,7 +122,7 @@ if(GradleVersion.current() >= GradleVersion.version('2.13')) { nonLegacyOnlyGradleTest { // <2> versions '3.5', '3.4.1', '3.3' versions '3.2', '3.1', '3.0' // <3> - versions '2.14.1','2.13' + versions '2.14.1' } nonLegacyOnlyGradleTestGenerator { // <4> diff --git a/src/docs/asciidoc/parts/gradle-runner.adoc b/src/docs/asciidoc/parts/gradle-runner.adoc index 1a67911..36dbb72 100644 --- a/src/docs/asciidoc/parts/gradle-runner.adoc +++ b/src/docs/asciidoc/parts/gradle-runner.adoc @@ -1,6 +1,6 @@ -= GradleRunner += GradleRunner (Gradle 2.14.1+) -The `org.ysb33r.gradlerunner` plugin will add a default task called `gradleRunner` which is of type `GradleRunnerSteps`. This task allows people to run specific Gradle steps interlevaed via other actions such as copying files. This is specifically useful for people who need to document development steps where Gradle is involved. +The `org.ysb33r.gradlerunner` plugin adds a default task called `gradleRunner` which is of type `GradleRunnerSteps`. This task allows people to run specific Gradle steps interlevaed via other actions such as copying files. This is specifically useful for people who need to document development steps where Gradle is involved. Steps are added via the `step` keyword. Each step has a name which can later be used to extract information after execution. diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerPlugin.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerPlugin.groovy index c01f02c..17bc6a3 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerPlugin.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerPlugin.groovy @@ -1,7 +1,9 @@ package org.ysb33r.gradle.gradlerunner +import org.gradle.api.GradleException import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.util.GradleVersion /** Adds a default task called {@code gradleRunner} * @@ -12,6 +14,11 @@ class GradleRunnerPlugin implements Plugin { @Override void apply(Project project) { + + if (GradleVersion.current() < GradleVersion.version('2.14.1')) { + throw new GradleException('This plugin requires a minimum version of 2.14.1') + } + project.tasks.create DEFAULT_TASK, GradleRunnerSteps } } From bd6181788c379b85f3c4d839d652d2d58027061c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Thu, 25 May 2017 19:13:51 +0200 Subject: [PATCH 22/26] Updated license headers for new files (#67) --- build.gradle | 2 +- .../gradle/gradlerunner/GradleRunnerPlugin.groovy | 13 +++++++++++++ .../gradle/gradlerunner/GradleRunnerSteps.groovy | 13 +++++++++++++ .../org/ysb33r/gradle/gradlerunner/Step.groovy | 13 +++++++++++++ .../org/ysb33r/gradle/gradlerunner/StepInfo.groovy | 13 +++++++++++++ .../gradlerunner/internal/AbstractStep.groovy | 13 +++++++++++++ .../gradle/gradlerunner/internal/ActionStep.groovy | 13 +++++++++++++ .../gradle/gradlerunner/internal/ClosureStep.groovy | 13 +++++++++++++ .../gradle/gradlerunner/internal/GradleStep.groovy | 13 +++++++++++++ .../gradle/gradletest/ClasspathManifest.groovy | 2 +- .../org/ysb33r/gradle/gradletest/GradleTest.groovy | 2 +- .../gradle/gradletest/GradleTestBasePlugin.groovy | 2 +- .../gradle/gradletest/GradleTestPlugin.groovy | 2 +- .../org/ysb33r/gradle/gradletest/Names.groovy | 2 +- .../ysb33r/gradle/gradletest/TestGenerator.groovy | 2 +- .../org/ysb33r/gradle/gradletest/TestSet.groovy | 2 +- .../legacy20/AvailableDistributions.groovy | 2 +- .../legacy20/CompatibilityTestResult.groovy | 2 +- .../legacy20/DeprecatingGradleTestExtension.groovy | 2 +- .../gradle/gradletest/legacy20/Distribution.groovy | 2 +- .../gradle/gradletest/legacy20/GradleTest.groovy | 2 +- .../gradletest/legacy20/GradleTestExtension.groovy | 2 +- .../legacy20/LegacyGradleTestPlugin.groovy | 2 +- .../internal/AvailableDistributionsInternal.groovy | 2 +- .../legacy20/internal/DistributionInternal.groovy | 2 +- .../legacy20/internal/GradleTestDownloader.groovy | 2 +- .../legacy20/internal/Infrastructure.groovy | 2 +- .../gradletest/legacy20/internal/TestRunner.groovy | 2 +- .../gradletest/legacy20/internal/Unpacker.groovy | 2 +- .../resources/org/ysb33r/gradletest/init.gradle | 2 +- .../org/ysb33r/gradletest/legacy20/init20.gradle | 3 +-- .../gradle/gradlerunner/GradleRunnerSpec.groovy | 13 +++++++++++++ .../gradle/gradletest/ClasspathManifestSpec.groovy | 2 +- .../gradle/gradletest/GradleTestPluginSpec.groovy | 2 +- .../ysb33r/gradle/gradletest/GradleTestSpec.groovy | 2 +- .../gradle/gradletest/TestGeneratorSpec.groovy | 2 +- .../internal/GradleTestSpecification.groovy | 2 +- .../gradletest/legacy20/GradleTestPluginSpec.groovy | 2 +- .../gradletest/legacy20/GradleTestSpec.groovy | 2 +- .../legacy20/internal/DistributionSpec.groovy | 2 +- .../internal/GradleTestDownloaderSpec.groovy | 2 +- 41 files changed, 149 insertions(+), 33 deletions(-) diff --git a/build.gradle b/build.gradle index 5c3608e..8e16b42 100644 --- a/build.gradle +++ b/build.gradle @@ -230,7 +230,7 @@ license { header = rootProject.file('config/HEADER') strictCheck = true ignoreFailures = false - ext.year = '2015 - 2016' + ext.year = '2015 - 2017' excludes(['**/*.ad', '**/*.asciidoc', '**/*.adoc', '**/*.md','**/*.properties','**/*.groovy.template']) mapping 'gradle', 'SLASHSTAR_STYLE' } diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerPlugin.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerPlugin.groovy index 17bc6a3..82e4f05 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerPlugin.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerPlugin.groovy @@ -1,3 +1,16 @@ +/* + * ============================================================================ + * (C) Copyright Schalk W. Cronje 2015 - 2017 + * + * This software is licensed under the Apache License 2.0 + * See http://www.apache.org/licenses/LICENSE-2.0 for license details + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and limitations under the License. + * + * ============================================================================ + */ package org.ysb33r.gradle.gradlerunner import org.gradle.api.GradleException diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSteps.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSteps.groovy index def4cce..62940db 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSteps.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSteps.groovy @@ -1,3 +1,16 @@ +/* + * ============================================================================ + * (C) Copyright Schalk W. Cronje 2015 - 2017 + * + * This software is licensed under the Apache License 2.0 + * See http://www.apache.org/licenses/LICENSE-2.0 for license details + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and limitations under the License. + * + * ============================================================================ + */ package org.ysb33r.gradle.gradlerunner import groovy.transform.CompileStatic diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/Step.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/Step.groovy index eaeb7a4..bd33ebf 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradlerunner/Step.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/Step.groovy @@ -1,3 +1,16 @@ +/* + * ============================================================================ + * (C) Copyright Schalk W. Cronje 2015 - 2017 + * + * This software is licensed under the Apache License 2.0 + * See http://www.apache.org/licenses/LICENSE-2.0 for license details + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and limitations under the License. + * + * ============================================================================ + */ package org.ysb33r.gradle.gradlerunner import groovy.transform.CompileStatic diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/StepInfo.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/StepInfo.groovy index 78121b3..420ec2e 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradlerunner/StepInfo.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/StepInfo.groovy @@ -1,3 +1,16 @@ +/* + * ============================================================================ + * (C) Copyright Schalk W. Cronje 2015 - 2017 + * + * This software is licensed under the Apache License 2.0 + * See http://www.apache.org/licenses/LICENSE-2.0 for license details + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and limitations under the License. + * + * ============================================================================ + */ package org.ysb33r.gradle.gradlerunner import groovy.transform.CompileStatic diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/AbstractStep.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/AbstractStep.groovy index f48b983..10c2121 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/AbstractStep.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/AbstractStep.groovy @@ -1,3 +1,16 @@ +/* + * ============================================================================ + * (C) Copyright Schalk W. Cronje 2015 - 2017 + * + * This software is licensed under the Apache License 2.0 + * See http://www.apache.org/licenses/LICENSE-2.0 for license details + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and limitations under the License. + * + * ============================================================================ + */ package org.ysb33r.gradle.gradlerunner.internal import org.ysb33r.gradle.gradlerunner.Step diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/ActionStep.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/ActionStep.groovy index e596842..0e2b197 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/ActionStep.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/ActionStep.groovy @@ -1,3 +1,16 @@ +/* + * ============================================================================ + * (C) Copyright Schalk W. Cronje 2015 - 2017 + * + * This software is licensed under the Apache License 2.0 + * See http://www.apache.org/licenses/LICENSE-2.0 for license details + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and limitations under the License. + * + * ============================================================================ + */ package org.ysb33r.gradle.gradlerunner.internal import groovy.transform.CompileStatic diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/ClosureStep.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/ClosureStep.groovy index bcfc489..0dbb760 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/ClosureStep.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/ClosureStep.groovy @@ -1,3 +1,16 @@ +/* + * ============================================================================ + * (C) Copyright Schalk W. Cronje 2015 - 2017 + * + * This software is licensed under the Apache License 2.0 + * See http://www.apache.org/licenses/LICENSE-2.0 for license details + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and limitations under the License. + * + * ============================================================================ + */ package org.ysb33r.gradle.gradlerunner.internal import groovy.transform.CompileStatic diff --git a/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/GradleStep.groovy b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/GradleStep.groovy index 1802e8c..8f34ba7 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/GradleStep.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradlerunner/internal/GradleStep.groovy @@ -1,3 +1,16 @@ +/* + * ============================================================================ + * (C) Copyright Schalk W. Cronje 2015 - 2017 + * + * This software is licensed under the Apache License 2.0 + * See http://www.apache.org/licenses/LICENSE-2.0 for license details + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and limitations under the License. + * + * ============================================================================ + */ package org.ysb33r.gradle.gradlerunner.internal import groovy.transform.CompileStatic diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/ClasspathManifest.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/ClasspathManifest.groovy index 45bd4f3..463884e 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/ClasspathManifest.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/ClasspathManifest.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/GradleTest.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/GradleTest.groovy index 5e3c107..598c4bf 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/GradleTest.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/GradleTest.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/GradleTestBasePlugin.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/GradleTestBasePlugin.groovy index bababe7..b3ff890 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/GradleTestBasePlugin.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/GradleTestBasePlugin.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/GradleTestPlugin.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/GradleTestPlugin.groovy index 1eb7a75..d26a2f3 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/GradleTestPlugin.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/GradleTestPlugin.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/Names.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/Names.groovy index be2d2c6..e5c1279 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/Names.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/Names.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/TestGenerator.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/TestGenerator.groovy index cdd9024..edd4652 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/TestGenerator.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/TestGenerator.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/TestSet.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/TestSet.groovy index 42f51f1..16dedd0 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/TestSet.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/TestSet.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/AvailableDistributions.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/AvailableDistributions.groovy index 6fb14cc..b1631b4 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/AvailableDistributions.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/AvailableDistributions.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/CompatibilityTestResult.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/CompatibilityTestResult.groovy index b6b9f26..c7b2805 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/CompatibilityTestResult.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/CompatibilityTestResult.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/DeprecatingGradleTestExtension.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/DeprecatingGradleTestExtension.groovy index a15d544..9a168a9 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/DeprecatingGradleTestExtension.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/DeprecatingGradleTestExtension.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/Distribution.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/Distribution.groovy index 62e79e5..c41d8aa 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/Distribution.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/Distribution.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/GradleTest.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/GradleTest.groovy index 7a207e2..83973c4 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/GradleTest.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/GradleTest.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/GradleTestExtension.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/GradleTestExtension.groovy index ff49c0d..2876809 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/GradleTestExtension.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/GradleTestExtension.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/LegacyGradleTestPlugin.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/LegacyGradleTestPlugin.groovy index 0ee4426..78b50f1 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/LegacyGradleTestPlugin.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/LegacyGradleTestPlugin.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/AvailableDistributionsInternal.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/AvailableDistributionsInternal.groovy index 587b660..ac85d59 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/AvailableDistributionsInternal.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/AvailableDistributionsInternal.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/DistributionInternal.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/DistributionInternal.groovy index 8c570dd..43a0220 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/DistributionInternal.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/DistributionInternal.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/GradleTestDownloader.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/GradleTestDownloader.groovy index 8b3bb1e..8860d78 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/GradleTestDownloader.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/GradleTestDownloader.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/Infrastructure.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/Infrastructure.groovy index 66028f3..e3c5895 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/Infrastructure.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/Infrastructure.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/TestRunner.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/TestRunner.groovy index 0394c4c..780b6b4 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/TestRunner.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/TestRunner.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/Unpacker.groovy b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/Unpacker.groovy index 30aea73..044091e 100644 --- a/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/Unpacker.groovy +++ b/src/main/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/Unpacker.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/resources/org/ysb33r/gradletest/init.gradle b/src/main/resources/org/ysb33r/gradletest/init.gradle index 09f8a09..8c3484f 100644 --- a/src/main/resources/org/ysb33r/gradletest/init.gradle +++ b/src/main/resources/org/ysb33r/gradletest/init.gradle @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/main/resources/org/ysb33r/gradletest/legacy20/init20.gradle b/src/main/resources/org/ysb33r/gradletest/legacy20/init20.gradle index 6854d2c..5df7cad 100644 --- a/src/main/resources/org/ysb33r/gradletest/legacy20/init20.gradle +++ b/src/main/resources/org/ysb33r/gradletest/legacy20/init20.gradle @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details @@ -11,7 +11,6 @@ * * ============================================================================ */ - // This is the default init script to be used. allprojects { diff --git a/src/test/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSpec.groovy b/src/test/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSpec.groovy index 158af93..eec87a8 100644 --- a/src/test/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSpec.groovy +++ b/src/test/groovy/org/ysb33r/gradle/gradlerunner/GradleRunnerSpec.groovy @@ -1,3 +1,16 @@ +/* + * ============================================================================ + * (C) Copyright Schalk W. Cronje 2015 - 2017 + * + * This software is licensed under the Apache License 2.0 + * See http://www.apache.org/licenses/LICENSE-2.0 for license details + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and limitations under the License. + * + * ============================================================================ + */ package org.ysb33r.gradle.gradlerunner import org.gradle.api.Action diff --git a/src/test/groovy/org/ysb33r/gradle/gradletest/ClasspathManifestSpec.groovy b/src/test/groovy/org/ysb33r/gradle/gradletest/ClasspathManifestSpec.groovy index 21856f2..10f0f62 100644 --- a/src/test/groovy/org/ysb33r/gradle/gradletest/ClasspathManifestSpec.groovy +++ b/src/test/groovy/org/ysb33r/gradle/gradletest/ClasspathManifestSpec.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/test/groovy/org/ysb33r/gradle/gradletest/GradleTestPluginSpec.groovy b/src/test/groovy/org/ysb33r/gradle/gradletest/GradleTestPluginSpec.groovy index 4dd6ab0..b65a601 100644 --- a/src/test/groovy/org/ysb33r/gradle/gradletest/GradleTestPluginSpec.groovy +++ b/src/test/groovy/org/ysb33r/gradle/gradletest/GradleTestPluginSpec.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/test/groovy/org/ysb33r/gradle/gradletest/GradleTestSpec.groovy b/src/test/groovy/org/ysb33r/gradle/gradletest/GradleTestSpec.groovy index d097167..30bbc5d 100644 --- a/src/test/groovy/org/ysb33r/gradle/gradletest/GradleTestSpec.groovy +++ b/src/test/groovy/org/ysb33r/gradle/gradletest/GradleTestSpec.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/test/groovy/org/ysb33r/gradle/gradletest/TestGeneratorSpec.groovy b/src/test/groovy/org/ysb33r/gradle/gradletest/TestGeneratorSpec.groovy index 915c4c4..111375a 100644 --- a/src/test/groovy/org/ysb33r/gradle/gradletest/TestGeneratorSpec.groovy +++ b/src/test/groovy/org/ysb33r/gradle/gradletest/TestGeneratorSpec.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/test/groovy/org/ysb33r/gradle/gradletest/internal/GradleTestSpecification.groovy b/src/test/groovy/org/ysb33r/gradle/gradletest/internal/GradleTestSpecification.groovy index 7cf6204..d4a4d87 100644 --- a/src/test/groovy/org/ysb33r/gradle/gradletest/internal/GradleTestSpecification.groovy +++ b/src/test/groovy/org/ysb33r/gradle/gradletest/internal/GradleTestSpecification.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/test/groovy/org/ysb33r/gradle/gradletest/legacy20/GradleTestPluginSpec.groovy b/src/test/groovy/org/ysb33r/gradle/gradletest/legacy20/GradleTestPluginSpec.groovy index 84b05a3..8a7a300 100644 --- a/src/test/groovy/org/ysb33r/gradle/gradletest/legacy20/GradleTestPluginSpec.groovy +++ b/src/test/groovy/org/ysb33r/gradle/gradletest/legacy20/GradleTestPluginSpec.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/test/groovy/org/ysb33r/gradle/gradletest/legacy20/GradleTestSpec.groovy b/src/test/groovy/org/ysb33r/gradle/gradletest/legacy20/GradleTestSpec.groovy index c6de145..0905a41 100644 --- a/src/test/groovy/org/ysb33r/gradle/gradletest/legacy20/GradleTestSpec.groovy +++ b/src/test/groovy/org/ysb33r/gradle/gradletest/legacy20/GradleTestSpec.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/test/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/DistributionSpec.groovy b/src/test/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/DistributionSpec.groovy index f9aa724..a74327a 100644 --- a/src/test/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/DistributionSpec.groovy +++ b/src/test/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/DistributionSpec.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details diff --git a/src/test/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/GradleTestDownloaderSpec.groovy b/src/test/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/GradleTestDownloaderSpec.groovy index 518cfbd..1223bfa 100644 --- a/src/test/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/GradleTestDownloaderSpec.groovy +++ b/src/test/groovy/org/ysb33r/gradle/gradletest/legacy20/internal/GradleTestDownloaderSpec.groovy @@ -1,6 +1,6 @@ /* * ============================================================================ - * (C) Copyright Schalk W. Cronje 2015 - 2016 + * (C) Copyright Schalk W. Cronje 2015 - 2017 * * This software is licensed under the Apache License 2.0 * See http://www.apache.org/licenses/LICENSE-2.0 for license details From 26b1a868bf04f78f5326e3296010b6fae70031e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Thu, 25 May 2017 19:22:18 +0200 Subject: [PATCH 23/26] Ready to release 1.0-beta9 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8e16b42..a055566 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ import org.asciidoctor.gradle.AsciidoctorTask group = 'org.ysb33r.gradle' archivesBaseName = 'gradletest' -version = '1.0-beta9-SNAPSHOT' +version = '1.0-beta9' apply from : 'gradle/integration-tests.gradle' apply from : 'gradle/compatibility-tests.gradle' From e49db751fefd8c0ec550c3994623b71b0cf31929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Thu, 25 May 2017 20:47:34 +0200 Subject: [PATCH 24/26] Upgraded scan plugin to 1.6 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index a055566..328a267 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { - id 'com.gradle.build-scan' version '1.0' + id 'com.gradle.build-scan' version '1.6' id 'groovy' id 'maven' id 'org.ysb33r.bintray' version '1.5' From dfda5e163e55d82bff2ac585d96fd93365c76a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Thu, 25 May 2017 21:01:07 +0200 Subject: [PATCH 25/26] Added 1.0-beta9 to documentation landing page --- src/docs/landingPage/display-versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/landingPage/display-versions.txt b/src/docs/landingPage/display-versions.txt index 80d5414..82ddba6 100644 --- a/src/docs/landingPage/display-versions.txt +++ b/src/docs/landingPage/display-versions.txt @@ -1,4 +1,4 @@ # List versions in order that they should appear on the landing page # -1.0-beta8 +1.0-beta9 0.5.5 From 4aead9630855e2eadd71141d91d5c72be2711954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schalk=20W=2E=20Cronj=C3=A9?= Date: Thu, 25 May 2017 21:20:32 +0200 Subject: [PATCH 26/26] Documentation for 1.0-beta9 --- website | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website b/website index 0fe737c..e817a8e 160000 --- a/website +++ b/website @@ -1 +1 @@ -Subproject commit 0fe737c7f2f9ebcd8cf0c132f0643c8c9ce02dba +Subproject commit e817a8e92fa70f667df88ac8ef18a7cbc75d1403