Skip to content

Commit

Permalink
Merge pull request #882 from TNG/fix/release-1.2.1
Browse files Browse the repository at this point in the history
Fix/release 1.2.1
  • Loading branch information
l-1squared authored Jun 3, 2022
2 parents 9e6cec6 + aa3e648 commit 0ec9bf3
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 34 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/jgiven_align_gh_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Align gh-pages branch
on:
push:
branches:
- 'master'

jobs:
build:
name: Rebase gh-pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout gh-pages
run: git checkout -f gh-pages
- name: Rebase on master
run: git rebase origin/master
- name: Replace version on origin
run: git push --force-with-lease
26 changes: 19 additions & 7 deletions .github/workflows/jgiven_examples_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,35 @@ jobs:
uses: android-actions/setup-android@v2
- name: Grant execute permission for bash script
run: chmod +x scripts/local_release_with_version.sh
- name: Load the bash script
- name: Produce a local release with version 1.1-t
run: source scripts/local_release_with_version.sh
- name: Test Kotlin Example Project
run: source scripts/source_files/helper_functions.sh && runGradleTestOnGivenProject example-projects/kotlin/build.gradle 1.1-t
run: >
source scripts/source_files/helper_functions.sh
&& runGradleTestOnGivenProject example-projects/kotlin/build.gradle 1.1-t
- name: Test JUnit5 Example Project
run: source scripts/source_files/helper_functions.sh && runGradleTestOnGivenProject example-projects/junit5/build.gradle 1.1-t
run: >
source scripts/source_files/helper_functions.sh
&& runGradleTestOnGivenProject example-projects/junit5/build.gradle 1.1-t
- uses: olafurpg/setup-scala@v13
- name: Test Scala Example Project
run: source scripts/source_files/helper_functions.sh && runScalaTest
- name: Test Selenium Example Project
run: source scripts/source_files/helper_functions.sh && runGradleTestOnGivenProject example-projects/selenium/build.gradle 1.1-t
run: >
source scripts/source_files/helper_functions.sh
&& runGradleTestOnGivenProject example-projects/selenium/build.gradle 1.1-t
- name: Test Spock Example Project
run: source scripts/source_files/helper_functions.sh && runGradleTestOnGivenProject example-projects/spock/build.gradle 1.1-t
run: >
source scripts/source_files/helper_functions.sh
&& runGradleTestOnGivenProject example-projects/spock/build.gradle 1.1-t
- name: Test Spring-Boot Example Project
run: source scripts/source_files/helper_functions.sh && runGradleTestOnGivenProject example-projects/spring-boot/build.gradle 1.1-t
run: >
source scripts/source_files/helper_functions.sh
&& runGradleTestOnGivenProject example-projects/spring-boot/build.gradle 1.1-t
- name: Test Maven Example Project
run: source scripts/source_files/helper_functions.sh && runMavenTestOnGivenProject example-projects/maven/pom.xml 1.1-t
run: >
source scripts/source_files/helper_functions.sh
&& runMavenTestOnGivenProject example-projects/maven/pom.xml 1.1-t
- name: Upload test results html files
continue-on-error: true
if: ${{failure()}}
Expand Down
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ subprojects {
junitDataproviderVersion = '1.13.1'
// set default junit version if not set via command line
junitVersion = rootProject.hasProperty('junitVersion') ? rootProject.junitVersion : '4.13.2'
junit5Version = '5.8.2'
junit5PlatformRunnerVersion = '1.8.2'
junitParamsVersion = '1.1.1'
testngVersion = '7.5'
assertjVersion = '3.22.0'
Expand All @@ -69,7 +67,7 @@ subprojects {
gsonVersion = '2.8.8'
guavaVersion = '30.1.1-jre'
guavaAndroidVersion = '28.1-android'
springVersion = '5.3.9'
springVersion = '5.3.19'
jacocoVersion = '0.8.5'
quickcheckVersion = '0.6'
hsqldbVersion = '2.3.2'
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ to use different dependencies.
If you are using JUnit, you must depend on the `jgiven-junit` artifact.
Note that `jgiven-junit` does not directly depend on JUnit,
thus you also must have a dependency to JUnit itself.
JGiven requires at least JUnit 4.9, while the recommended version is 4.12.
JGiven requires at least JUnit 4.9, while the recommended version is 4.13.2.

==== Maven Dependency
[source,maven,subs="verbatim,attributes"]
Expand Down
5 changes: 2 additions & 3 deletions example-projects/junit5/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ compileJava {
}

ext {
junit5Version = '5.8.2'
jgivenVersion = version
}

Expand All @@ -40,8 +39,8 @@ repositories {

dependencies {
testImplementation "com.tngtech.jgiven:jgiven-junit5:${jgivenVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${junit5Version}"
testImplementation "org.junit.jupiter:junit-jupiter-engine:${junit5Version}"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}

test {
Expand Down
17 changes: 13 additions & 4 deletions example-projects/kotlin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath "com.tngtech.jgiven:jgiven-gradle-plugin:${version}"
}
}

plugins {
id "org.jetbrains.kotlin.jvm" version "1.6.21"
id "com.tngtech.jgiven.gradle-plugin" version "1.2.1"
}

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'com.tngtech.jgiven.gradle-plugin'

compileJava {
sourceCompatibility = 1.8
Expand All @@ -15,7 +25,6 @@ compileJava {
}

ext {
junit5Version = '5.7.2'
jgivenVersion = version
}

Expand All @@ -27,8 +36,8 @@ repositories {
dependencies {
testImplementation 'com.tngtech.jgiven:jgiven-junit5:' + jgivenVersion
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
testImplementation 'org.junit.jupiter:junit-jupiter-api:' + junit5Version
testImplementation 'org.junit.jupiter:junit-jupiter-engine:' + junit5Version
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}

test {
Expand Down
8 changes: 4 additions & 4 deletions jgiven-spring-junit5/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ dependencies {
api project(':jgiven-junit5')
compileOnly "org.springframework:spring-context:$springVersion"
compileOnly "org.springframework:spring-test:$springVersion"
compileOnly "org.junit.jupiter:junit-jupiter-api:$junit5Version"
compileOnly 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testImplementation project(':jgiven-html5-report')
testImplementation "org.junit.jupiter:junit-jupiter-engine:$junit5Version"
testImplementation "org.junit.platform:junit-platform-runner:$junit5PlatformRunnerVersion"
testImplementation "org.junit.jupiter:junit-jupiter-params:$junit5Version"
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
testImplementation 'org.junit.platform:junit-platform-runner:1.8.2'
testImplementation "org.junit.jupiter:junit-jupiter-params:5.8.2"
testImplementation "org.springframework:spring-tx:$springVersion"
testImplementation "org.springframework:spring-context:$springVersion"
testImplementation "org.springframework:spring-test:$springVersion"
Expand Down
11 changes: 5 additions & 6 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,17 @@
],
"groupName": "junit5"
},
{
"packagePatterns": [
"powermock"
],
"groupName": "powermock"
},
{
"matchUpdateTypes": ["minor", "patch"],
"matchCurrentVersion": "!/^0/",
"automerge": true
}
],
"maven":{
"fileMatch": [
"jgiven-maven-plugin/src/main/maven/pom.xml"
]
},
"schedule": [
"after 10pm every weekday",
"before 5am every weekday",
Expand Down
13 changes: 9 additions & 4 deletions scripts/source_files/helper_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function update_version(){
local target_file="$2"
local version_property="version"
local version_matcher="${version_property}=.*"
if grep -E "${version_matcher}" "${target_file}" ;then
if grep -E "${version_matcher}" "${target_file}">/dev/null ;then
sed -i -e "s/${version_matcher}/${version_property}=${target_version}/" "${target_file}" || return 12
else
printf "Could not find version property to replace in file %s\n" "${target_file}"
Expand All @@ -22,7 +22,7 @@ function update_maven_version() {
local target_file="$2"
local version_property="jgiven.version"
local version_matcher="<${version_property}>.*<\/${version_property}>"
if grep -E "${version_matcher}" "${target_file}" ;then
if grep -E -q "${version_matcher}" "${target_file}" ;then
sed -i -e "s/${version_matcher}/<${version_property}>${target_version}<\/${version_property}>/" "${target_file}" || return 12
else
printf "Could not find version property to replace in file %s\n" "${target_file}"
Expand All @@ -38,7 +38,7 @@ function update_scala_version() {
local target_file="$2"
local version_property="jgivenVersion"
local version_matcher="${version_property} = .*"
if grep -E "${version_matcher}" "${target_file}" ;then
if grep -E "${version_matcher}" "${target_file}" >/dev/null ;then
sed -i -e "s/${version_matcher}/${version_property} = \"${target_version}\"/" "${target_file}" || return 22
else
printf "Could not find version property to replace in file %s\n" "${target_file}"
Expand All @@ -51,7 +51,7 @@ function updateAllVersionInformation() {
[ $# -eq 1 ] || return 31
local VERSION="$1"

echo Updating version in gradle.properties...
printf "Updating version in gradle.properties..."
for file in "gradle.properties" \
"example-projects/junit5/gradle.properties" \
"example-projects/spock/gradle.properties" \
Expand All @@ -63,12 +63,17 @@ function updateAllVersionInformation() {
do
update_version "${VERSION}" "${file}" || exit $?
done
printf "Done.\n"

printf "Updating version in scala files..."
update_scala_version "${VERSION}" "example-projects/scala/build.sbt" || exit $?
printf "Done.\n"

printf "Updating version in maven files..."
for file in "example-projects/java11/pom.xml" "example-projects/maven/pom.xml"; do
update_maven_version "${VERSION}" "${file}"
done
printf "Done.\n"
}

function runGradleTestOnGivenProject() {
Expand Down
3 changes: 1 addition & 2 deletions scripts/tests/test_helper_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ test_update_version_replaces_version_in_pom(){

test_update_version_fails_if_property_not_in_file() {
local test_file="properties.tmp"
trap "rm -f '${test_file}';exit" SIGTERM SIGINT
trap "rm -f '${test_file}';exit" SIGTERM SIGINT EXIT
echo 'venison=0.x' > "${test_file}"
update_version '1.0' "${test_file}"
local output_variable=$?
rm -f "${test_file}"
return $( [ ${output_variable} -ge 1 ]; echo $?)
}

Expand Down

0 comments on commit 0ec9bf3

Please sign in to comment.