Skip to content

Commit

Permalink
Merge pull request spockframework#1048 from spockframework/spock-2.0-m1
Browse files Browse the repository at this point in the history
Spock 2.0 m1
  • Loading branch information
leonard84 authored Nov 4, 2019
2 parents d751a0a + adf3011 commit 0444e42
Show file tree
Hide file tree
Showing 215 changed files with 3,501 additions and 36,149 deletions.
14 changes: 4 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@ build/
target/

# IDEA
.idea/libraries
.idea/scopes
.idea/.name
.idea/compiler.xml
.idea/encodings.xml
.idea/gradle.xml
.idea/misc.xml
.idea/modules.xml
.idea/workspace.xml
.idea/
*.iml
*.ipr
*.iws
Expand All @@ -39,4 +31,6 @@ stacktrace.log
.DS_Store

# Shippable CI
/shippable/
/shippable/

Foo.*
2 changes: 1 addition & 1 deletion .idea/copyright/ASLv2.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@ cache:

dist: precise # downgrade to avoid jdk7 SSL Bug https://github.com/docker-library/openjdk/issues/117
jdk:
- oraclejdk7 # openjdk7 has SSL Bug avoid jdk7 SSL Bug https://github.com/docker-library/openjdk/issues/117
- oraclejdk8
- openjdk10
- openjdk11
- openjdk12

env:
matrix:
- VARIANT=2.4
- VARIANT=2.5
global:
# SIGNING_PASSWORD
Expand Down
87 changes: 47 additions & 40 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
import java.text.SimpleDateFormat

plugins {
id 'com.gradle.build-scan' version '1.16'
id 'com.gradle.build-scan' version '2.2.1'
id "base"
id "org.asciidoctor.convert" version "1.5.7"
id "org.asciidoctor.convert" version "1.6.0"
id "jacoco"
id "net.nemerosa.versioning" version "2.6.1"
id "net.nemerosa.versioning" version "2.8.2"
id "de.marcphilipp.nexus-publish" version "0.3.1" apply false
// id "com.github.ben-manes.versions" version "0.21.0"
}

description = "Spock Framework"

ext {
baseVersion = "1.3.1"
baseVersion = "2.0"
snapshotVersion = true
releaseCandidate = 0
variants = [2.4, 2.5]
variants = [2.5]
variant = System.getProperty("variant") as BigDecimal ?: variants.first()
if (variant == 2.4) {
groovyVersion = "2.4.15"
minGroovyVersion = "2.4.0"
groovyDependency = ["org.codehaus.groovy:groovy-all:${groovyVersion}"]
groovyConsoleExtraDependency = [] //bundled in groovy-all
} else if (variant == 2.5) {
groovyVersion = "2.5.4"
if (variant == 2.5) {
groovyVersion = "2.5.8"
minGroovyVersion = "2.5.0"
groovyDependency = [
"org.codehaus.groovy:groovy:${groovyVersion}",
Expand All @@ -46,7 +43,7 @@ ext {
}
fullVersion = baseVersion + ((!snapshotVersion && releaseCandidate) ? "-RC$releaseCandidate" : "") + "-groovy-$variant" + (snapshotVersion ? "-SNAPSHOT" : '')
variantLessVersion = baseVersion + (snapshotVersion ? "-SNAPSHOT" : (releaseCandidate ? "-RC$releaseCandidate" : ""))
javaVersions = [1.7, 1.8, 9, 10, 11] // ensure that latest version is actually build on travis, otherwise no docs get published
javaVersions = [1.8, 9, 10, 11, 12] // ensure that latest version is actually build on travis, otherwise no docs get published
javaVersion = System.getProperty("java.specification.version") as BigDecimal

if (javaVersion >= 9) {
Expand All @@ -55,15 +52,20 @@ ext {

libs = [
jetbrainsAnnotations: "org.jetbrains:annotations:13.0",
ant: "org.apache.ant:ant:1.9.7",
asm: "org.ow2.asm:asm:7.0",
bytebuddy: "net.bytebuddy:byte-buddy:1.9.3",
cglib: "cglib:cglib-nodep:3.2.9",
ant: "org.apache.ant:ant:1.10.5",
asm: "org.ow2.asm:asm:7.1",
bytebuddy: "net.bytebuddy:byte-buddy:1.9.11",
cglib: "cglib:cglib-nodep:3.2.10",
groovy: groovyDependency,
h2database: "com.h2database:h2:1.3.176",
junit: "junit:junit:4.12",
junit4: "junit:junit:4.12",
junitBom: "org.junit:junit-bom:5.5.2",
jupiter: "org.junit.jupiter:junit-jupiter",
junitPlatform: "org.junit.platform:junit-platform-engine",
junitPlatformTestkit: "org.junit.platform:junit-platform-testkit",
junitPlatformConsole: "org.junit.platform:junit-platform-console",
log4j: "log4j:log4j:1.2.17",
objenesis: "org.objenesis:objenesis:2.6"
objenesis: "org.objenesis:objenesis:3.0.1"
]
Date buildTimeAndDate = new Date()
buildDate = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
Expand All @@ -90,6 +92,12 @@ allprojects {
options.compilerArgs += ['--release', '8']
options.encoding = 'UTF-8'
}
tasks.withType(GroovyCompile) {
sourceCompatibility = javaVersions.min()
targetCompatibility = javaVersions.min()
options.compilerArgs += ['--release', '8']
options.encoding = 'UTF-8'
}

tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
Expand Down Expand Up @@ -131,14 +139,20 @@ subprojects {

repositories {
mavenCentral()
maven { url "https://oss.jfrog.org/oss-snapshot-local/" }
maven {
url 'https://jitpack.io'
content {
includeGroup "com.github.junit-team.junit5"
}
}
}

configurations {
all*.exclude module: "junit-dep"
}

dependencies {
compile(platform(libs.junitBom))
compile(project.name == "spock-gradle" ? [] : libs.groovy)
}

Expand All @@ -156,6 +170,7 @@ subprojects {
}

tasks.withType(Test) {
useJUnitPlatform()
def taskName = name
reports {
junitXml {
Expand Down Expand Up @@ -202,22 +217,12 @@ task collectTestXml (group: 'Test reports') {

task codeCoverageReport (type: JacocoReport, group: 'Coverage reports') {
description = "Creates an aggregate coverage for the whole project."
def reportingProjects = subprojects.findAll()
dependsOn(reportingProjects.tasks.collectMany{it.withType(Test)})
def reportingProjects = subprojects
dependsOn(reportingProjects.tasks.collectMany { it.withType(Test) })

onlyIf = { true } // required to circumvent a wrong check in the jacoco report plugin (v2.13)

sourceDirectories = files() //must be set
classDirectories = files() //must be set
additionalSourceDirs files(reportingProjects.sourceSets.main.allSource.srcDirs)
additionalClassDirs files(reportingProjects.sourceSets.main.output)

executionData = files(reportingProjects.jacocoTestReport.executionData)

doFirst {
// find all *.exec files
executionData = fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
}
additionalSourceDirs.from(reportingProjects.sourceSets.main.allSource.srcDirs)
additionalClassDirs.from(reportingProjects.sourceSets.main.output)
executionData.from(files(reportingProjects.jacocoTestReport.executionData).filter { it.exists() })

reports {
html.enabled = true
Expand All @@ -234,9 +239,7 @@ if (gradle.startParameter.taskNames == ["travisCiBuild"]) {
maxParallelForks = 2
}
}
if (System.getenv("TRAVIS_PULL_REQUEST") == "false" && System.getenv("TRAVIS_BRANCH") == "master" && baseVersion.startsWith('2.')) { /* TODO remove baseVersion check when switching to 2.x
1.3 is EOL so don't publish new snapshot/docs when updating Readme.md until 2.x is merged to master
*/
if (System.getenv("TRAVIS_PULL_REQUEST") == "false" && System.getenv("TRAVIS_BRANCH") == "master") {
if (javaVersion == javaVersions.min()) {
gradle.startParameter.taskNames += ["publish"]
if (!snapshotVersion) {
Expand Down Expand Up @@ -373,6 +376,10 @@ def configureGroovydoc(task) {
}

buildScan {
licenseAgreementUrl = 'https://gradle.com/terms-of-service'
licenseAgree = 'yes'
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}

subprojects {
task allDependencyInsight(type: DependencyInsightReportTask) {}
}
34 changes: 34 additions & 0 deletions docs/release_notes.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,40 @@
= Release Notes
include::include.adoc[]

== 2.0-M1 (tbd)

This is the first milestone release to version 2.0. This means that we have migrated to the new
JUnit Platform and all internal tests pass. We have tried to keep the API as compatible as possible
and if you've only used the public spock API then there is a high possibility that all you have to
do is to update the spock version and configure gradle/maven to use the JUnit Platform.

However, this doesn't mean that the API is finalized yet, the goal for the first milestone was just
to get it running on the new platform. The next milestones will focus on improvements like the much
requested parallel execution support.

Please try it out and report any new bugs so that we can fix them for the final 2.0 release.

=== Breaking Changes

==== New JUnit Platform
Switch from JUnit 4 to the JUnit Platform.
See https://junit.org/junit5/docs/current/user-guide/#running-tests-build on how to configure
maven and gradle to use the JUnit Platform.

JUnit 4 Rules are not supported by `spock-core` anymore, however, there is a new `spock-junit4`
module that provides best effort support to ease migration.

==== Misc

- Spock now requires at least Java 8
- All data-driven test iterations are always reported (unrolled), while `@Unroll` is not necessary anymore
it can still be used to define the name template
- `@Retry.Mode.FEATURE` didn't work anymore and has been removed
- `spock-report` module has been removed, it was never officially released
- The `SpockReportingExtension` has been disabled until we can integrate it with JUnitPlatform
- Removed testing for `spring-2.x` as it is incompatible

Special thanks goes to Marc Philipp who helped a lot with the integration of the JUnit Platform.

== 1.3 (2019-03-05)

Expand Down
16 changes: 7 additions & 9 deletions gradle/publishMaven.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply plugin: "maven-publish"
apply plugin: "de.marcphilipp.nexus-publish"
apply plugin: "signing"

def optionalDeps = []
Expand Down Expand Up @@ -66,15 +66,13 @@ publishing {
}
}
}
}

nexusPublishing {
repositories {
maven {
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
url = snapshotVersion ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = "pniederw"
password = System.getenv("SONATYPE_OSS_PASSWORD")
}
sonatype {
username = "pniederw"
password = System.getenv("SONATYPE_OSS_PASSWORD")
}
}
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 2 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#Fri Aug 04 11:59:26 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=60a6d8f687e3e7a4bc901cc6bc3db190efae0f02f0cc697e323e0f9336f224a3
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=b49c6da1b2cb67a0caf6c7480630b51c70a11ca2016ff2f555eaeda863143a29
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
22 changes: 19 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# 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.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

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

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down Expand Up @@ -109,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
Expand Down
Loading

0 comments on commit 0444e42

Please sign in to comment.