From 47f9b87d095ca8f19bbf8fc4288d6cc06d1d46b9 Mon Sep 17 00:00:00 2001 From: soloturn Date: Sun, 20 Dec 2020 11:23:20 +0100 Subject: [PATCH] testcases now use newest gradle --- .gitignore | 5 +++-- .../{jgitver.gradle => jgitver.gradle.kts} | 0 .../contexts/distance-depth/jgitver.gradle | 3 --- .../contexts/distance-depth/jgitver.gradle.kts | 3 +++ .../distance-first_parent/jgitver.gradle | 3 --- .../distance-first_parent/jgitver.gradle.kts | 3 +++ .../contexts/distance-log/jgitver.gradle | 3 --- .../contexts/distance-log/jgitver.gradle.kts | 3 +++ .../contexts/maven-like/jgitver.gradle | 3 --- .../contexts/maven-like/jgitver.gradle.kts | 3 +++ .../contexts/merged-branches/jgitver.gradle | 3 --- .../merged-branches/jgitver.gradle.kts | 3 +++ .../contexts/policy-latest/jgitver.gradle | 3 --- .../contexts/policy-latest/jgitver.gradle.kts | 3 +++ .../{jgitver.gradle => jgitver.gradle.kts} | 0 .../contexts/policy-nearest/jgitver.gradle | 3 --- .../contexts/policy-nearest/jgitver.gradle.kts | 3 +++ .../contexts/tag-regexp/jgitver.gradle | 4 ---- .../contexts/tag-regexp/jgitver.gradle.kts | 4 ++++ .../contexts/v1.2-tags-regexp/expectation.txt | 1 + .../contexts/v1.2-tags-regexp/jgitver.gradle | 4 ---- .../v1.2-tags-regexp/jgitver.gradle.kts | 4 ++++ .../version-strategy-normal/jgitver.gradle | 5 ----- .../version-strategy-normal/jgitver.gradle.kts | 5 +++++ .../version-strategy-tag/jgitver.gradle | 5 ----- .../version-strategy-tag/jgitver.gradle.kts | 5 +++++ src/test/integration/test/base-build.gradle | 18 ------------------ .../integration/test/base-build.gradle.kts | 11 +++++++++++ src/test/integration/test/build.sh | 6 +++--- 29 files changed, 57 insertions(+), 62 deletions(-) rename src/test/integration/contexts/distance-default/{jgitver.gradle => jgitver.gradle.kts} (100%) delete mode 100644 src/test/integration/contexts/distance-depth/jgitver.gradle create mode 100644 src/test/integration/contexts/distance-depth/jgitver.gradle.kts delete mode 100644 src/test/integration/contexts/distance-first_parent/jgitver.gradle create mode 100644 src/test/integration/contexts/distance-first_parent/jgitver.gradle.kts delete mode 100644 src/test/integration/contexts/distance-log/jgitver.gradle create mode 100644 src/test/integration/contexts/distance-log/jgitver.gradle.kts delete mode 100644 src/test/integration/contexts/maven-like/jgitver.gradle create mode 100644 src/test/integration/contexts/maven-like/jgitver.gradle.kts delete mode 100644 src/test/integration/contexts/merged-branches/jgitver.gradle create mode 100644 src/test/integration/contexts/merged-branches/jgitver.gradle.kts delete mode 100644 src/test/integration/contexts/policy-latest/jgitver.gradle create mode 100644 src/test/integration/contexts/policy-latest/jgitver.gradle.kts rename src/test/integration/contexts/policy-max/{jgitver.gradle => jgitver.gradle.kts} (100%) delete mode 100644 src/test/integration/contexts/policy-nearest/jgitver.gradle create mode 100644 src/test/integration/contexts/policy-nearest/jgitver.gradle.kts delete mode 100644 src/test/integration/contexts/tag-regexp/jgitver.gradle create mode 100644 src/test/integration/contexts/tag-regexp/jgitver.gradle.kts create mode 100644 src/test/integration/contexts/v1.2-tags-regexp/expectation.txt delete mode 100644 src/test/integration/contexts/v1.2-tags-regexp/jgitver.gradle create mode 100644 src/test/integration/contexts/v1.2-tags-regexp/jgitver.gradle.kts delete mode 100644 src/test/integration/contexts/version-strategy-normal/jgitver.gradle create mode 100644 src/test/integration/contexts/version-strategy-normal/jgitver.gradle.kts delete mode 100644 src/test/integration/contexts/version-strategy-tag/jgitver.gradle create mode 100644 src/test/integration/contexts/version-strategy-tag/jgitver.gradle.kts delete mode 100644 src/test/integration/test/base-build.gradle create mode 100644 src/test/integration/test/base-build.gradle.kts diff --git a/.gitignore b/.gitignore index 662f869..9d884f2 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,8 @@ build/ src/test/integration/test/.git/ src/test/integration/test/build/ src/test/integration/test/.gradle/ -src/test/integration/test/build.gradle +src/test/integration/test/build.gradle.kts src/test/integration/test/content .idea/ -*.iml \ No newline at end of file +*.iml + diff --git a/src/test/integration/contexts/distance-default/jgitver.gradle b/src/test/integration/contexts/distance-default/jgitver.gradle.kts similarity index 100% rename from src/test/integration/contexts/distance-default/jgitver.gradle rename to src/test/integration/contexts/distance-default/jgitver.gradle.kts diff --git a/src/test/integration/contexts/distance-depth/jgitver.gradle b/src/test/integration/contexts/distance-depth/jgitver.gradle deleted file mode 100644 index b137d3e..0000000 --- a/src/test/integration/contexts/distance-depth/jgitver.gradle +++ /dev/null @@ -1,3 +0,0 @@ -jgitver { - distanceCalculatorKind "DEPTH" -} \ No newline at end of file diff --git a/src/test/integration/contexts/distance-depth/jgitver.gradle.kts b/src/test/integration/contexts/distance-depth/jgitver.gradle.kts new file mode 100644 index 0000000..c8e3aba --- /dev/null +++ b/src/test/integration/contexts/distance-depth/jgitver.gradle.kts @@ -0,0 +1,3 @@ +jgitver { + distanceCalculatorKind = fr.brouillard.oss.jgitver.impl.DistanceCalculator.CalculatorKind.DEPTH +} \ No newline at end of file diff --git a/src/test/integration/contexts/distance-first_parent/jgitver.gradle b/src/test/integration/contexts/distance-first_parent/jgitver.gradle deleted file mode 100644 index 0942fce..0000000 --- a/src/test/integration/contexts/distance-first_parent/jgitver.gradle +++ /dev/null @@ -1,3 +0,0 @@ -jgitver { - distanceCalculatorKind "FIRST_PARENT" -} \ No newline at end of file diff --git a/src/test/integration/contexts/distance-first_parent/jgitver.gradle.kts b/src/test/integration/contexts/distance-first_parent/jgitver.gradle.kts new file mode 100644 index 0000000..2736c22 --- /dev/null +++ b/src/test/integration/contexts/distance-first_parent/jgitver.gradle.kts @@ -0,0 +1,3 @@ +jgitver { + distanceCalculatorKind = fr.brouillard.oss.jgitver.impl.DistanceCalculator.CalculatorKind.FIRST_PARENT +} \ No newline at end of file diff --git a/src/test/integration/contexts/distance-log/jgitver.gradle b/src/test/integration/contexts/distance-log/jgitver.gradle deleted file mode 100644 index fdcb1fe..0000000 --- a/src/test/integration/contexts/distance-log/jgitver.gradle +++ /dev/null @@ -1,3 +0,0 @@ -jgitver { - distanceCalculatorKind "LOG" -} \ No newline at end of file diff --git a/src/test/integration/contexts/distance-log/jgitver.gradle.kts b/src/test/integration/contexts/distance-log/jgitver.gradle.kts new file mode 100644 index 0000000..9aa94a3 --- /dev/null +++ b/src/test/integration/contexts/distance-log/jgitver.gradle.kts @@ -0,0 +1,3 @@ +jgitver { + distanceCalculatorKind = fr.brouillard.oss.jgitver.impl.DistanceCalculator.CalculatorKind.LOG +} \ No newline at end of file diff --git a/src/test/integration/contexts/maven-like/jgitver.gradle b/src/test/integration/contexts/maven-like/jgitver.gradle deleted file mode 100644 index 296f943..0000000 --- a/src/test/integration/contexts/maven-like/jgitver.gradle +++ /dev/null @@ -1,3 +0,0 @@ -jgitver { - mavenLike true -} \ No newline at end of file diff --git a/src/test/integration/contexts/maven-like/jgitver.gradle.kts b/src/test/integration/contexts/maven-like/jgitver.gradle.kts new file mode 100644 index 0000000..8b7acee --- /dev/null +++ b/src/test/integration/contexts/maven-like/jgitver.gradle.kts @@ -0,0 +1,3 @@ +jgitver { + strategy = fr.brouillard.oss.jgitver.Strategies.MAVEN +} \ No newline at end of file diff --git a/src/test/integration/contexts/merged-branches/jgitver.gradle b/src/test/integration/contexts/merged-branches/jgitver.gradle deleted file mode 100644 index 7e95fe2..0000000 --- a/src/test/integration/contexts/merged-branches/jgitver.gradle +++ /dev/null @@ -1,3 +0,0 @@ -jgitver { - mavenLike false -} \ No newline at end of file diff --git a/src/test/integration/contexts/merged-branches/jgitver.gradle.kts b/src/test/integration/contexts/merged-branches/jgitver.gradle.kts new file mode 100644 index 0000000..f8fccf7 --- /dev/null +++ b/src/test/integration/contexts/merged-branches/jgitver.gradle.kts @@ -0,0 +1,3 @@ +jgitver { + strategy = fr.brouillard.oss.jgitver.Strategies.CONFIGURABLE +} \ No newline at end of file diff --git a/src/test/integration/contexts/policy-latest/jgitver.gradle b/src/test/integration/contexts/policy-latest/jgitver.gradle deleted file mode 100644 index 120c64b..0000000 --- a/src/test/integration/contexts/policy-latest/jgitver.gradle +++ /dev/null @@ -1,3 +0,0 @@ -jgitver { - policy "LATEST" -} \ No newline at end of file diff --git a/src/test/integration/contexts/policy-latest/jgitver.gradle.kts b/src/test/integration/contexts/policy-latest/jgitver.gradle.kts new file mode 100644 index 0000000..1182e25 --- /dev/null +++ b/src/test/integration/contexts/policy-latest/jgitver.gradle.kts @@ -0,0 +1,3 @@ +jgitver { + policy = fr.brouillard.oss.jgitver.LookupPolicy.LATEST +} \ No newline at end of file diff --git a/src/test/integration/contexts/policy-max/jgitver.gradle b/src/test/integration/contexts/policy-max/jgitver.gradle.kts similarity index 100% rename from src/test/integration/contexts/policy-max/jgitver.gradle rename to src/test/integration/contexts/policy-max/jgitver.gradle.kts diff --git a/src/test/integration/contexts/policy-nearest/jgitver.gradle b/src/test/integration/contexts/policy-nearest/jgitver.gradle deleted file mode 100644 index 9c16d1e..0000000 --- a/src/test/integration/contexts/policy-nearest/jgitver.gradle +++ /dev/null @@ -1,3 +0,0 @@ -jgitver { - policy "NEAREST" -} \ No newline at end of file diff --git a/src/test/integration/contexts/policy-nearest/jgitver.gradle.kts b/src/test/integration/contexts/policy-nearest/jgitver.gradle.kts new file mode 100644 index 0000000..c3479c3 --- /dev/null +++ b/src/test/integration/contexts/policy-nearest/jgitver.gradle.kts @@ -0,0 +1,3 @@ +jgitver { + policy = fr.brouillard.oss.jgitver.LookupPolicy.NEAREST +} \ No newline at end of file diff --git a/src/test/integration/contexts/tag-regexp/jgitver.gradle b/src/test/integration/contexts/tag-regexp/jgitver.gradle deleted file mode 100644 index 8820b43..0000000 --- a/src/test/integration/contexts/tag-regexp/jgitver.gradle +++ /dev/null @@ -1,4 +0,0 @@ -jgitver { - mavenLike false - regexVersionTag 'r(.*)' -} \ No newline at end of file diff --git a/src/test/integration/contexts/tag-regexp/jgitver.gradle.kts b/src/test/integration/contexts/tag-regexp/jgitver.gradle.kts new file mode 100644 index 0000000..18788f3 --- /dev/null +++ b/src/test/integration/contexts/tag-regexp/jgitver.gradle.kts @@ -0,0 +1,4 @@ +jgitver { + strategy = fr.brouillard.oss.jgitver.Strategies.PATTERN + regexVersionTag = "r(.*)" +} \ No newline at end of file diff --git a/src/test/integration/contexts/v1.2-tags-regexp/expectation.txt b/src/test/integration/contexts/v1.2-tags-regexp/expectation.txt new file mode 100644 index 0000000..a42406f --- /dev/null +++ b/src/test/integration/contexts/v1.2-tags-regexp/expectation.txt @@ -0,0 +1 @@ +./build.sh v1.2-tags-regexp $JGITVER_GRADLE_PLUGIN_VERSION 1.2.3-1 \ No newline at end of file diff --git a/src/test/integration/contexts/v1.2-tags-regexp/jgitver.gradle b/src/test/integration/contexts/v1.2-tags-regexp/jgitver.gradle deleted file mode 100644 index c110072..0000000 --- a/src/test/integration/contexts/v1.2-tags-regexp/jgitver.gradle +++ /dev/null @@ -1,4 +0,0 @@ -jgitver { - mavenLike false - regexVersionTag 'v(1\\.2.*)' -} \ No newline at end of file diff --git a/src/test/integration/contexts/v1.2-tags-regexp/jgitver.gradle.kts b/src/test/integration/contexts/v1.2-tags-regexp/jgitver.gradle.kts new file mode 100644 index 0000000..7aabac2 --- /dev/null +++ b/src/test/integration/contexts/v1.2-tags-regexp/jgitver.gradle.kts @@ -0,0 +1,4 @@ +jgitver { + strategy = fr.brouillard.oss.jgitver.Strategies.PATTERN + regexVersionTag = "v(1\\.2.*)" +} \ No newline at end of file diff --git a/src/test/integration/contexts/version-strategy-normal/jgitver.gradle b/src/test/integration/contexts/version-strategy-normal/jgitver.gradle deleted file mode 100644 index 8e35421..0000000 --- a/src/test/integration/contexts/version-strategy-normal/jgitver.gradle +++ /dev/null @@ -1,5 +0,0 @@ -jgitver { - strategy "PATTERN" - versionPattern "\${v}-standard" - tagVersionPattern "\${v}-tag" -} \ No newline at end of file diff --git a/src/test/integration/contexts/version-strategy-normal/jgitver.gradle.kts b/src/test/integration/contexts/version-strategy-normal/jgitver.gradle.kts new file mode 100644 index 0000000..be37ee7 --- /dev/null +++ b/src/test/integration/contexts/version-strategy-normal/jgitver.gradle.kts @@ -0,0 +1,5 @@ +jgitver { + strategy = fr.brouillard.oss.jgitver.Strategies.PATTERN + versionPattern = "\${v}-standard" + tagVersionPattern = "\${v}-tag" +} \ No newline at end of file diff --git a/src/test/integration/contexts/version-strategy-tag/jgitver.gradle b/src/test/integration/contexts/version-strategy-tag/jgitver.gradle deleted file mode 100644 index 8e35421..0000000 --- a/src/test/integration/contexts/version-strategy-tag/jgitver.gradle +++ /dev/null @@ -1,5 +0,0 @@ -jgitver { - strategy "PATTERN" - versionPattern "\${v}-standard" - tagVersionPattern "\${v}-tag" -} \ No newline at end of file diff --git a/src/test/integration/contexts/version-strategy-tag/jgitver.gradle.kts b/src/test/integration/contexts/version-strategy-tag/jgitver.gradle.kts new file mode 100644 index 0000000..be37ee7 --- /dev/null +++ b/src/test/integration/contexts/version-strategy-tag/jgitver.gradle.kts @@ -0,0 +1,5 @@ +jgitver { + strategy = fr.brouillard.oss.jgitver.Strategies.PATTERN + versionPattern = "\${v}-standard" + tagVersionPattern = "\${v}-tag" +} \ No newline at end of file diff --git a/src/test/integration/test/base-build.gradle b/src/test/integration/test/base-build.gradle deleted file mode 100644 index 5d6fefe..0000000 --- a/src/test/integration/test/base-build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -buildscript { - repositories { - mavenLocal() - maven { - url "https://plugins.gradle.org/m2/" - } - jcenter() - } - dependencies { - classpath "fr.brouillard.oss.gradle:gradle-jgitver-plugin:${System.env.JGITVER_GRADLE_VERSION}" - } -} - -repositories { - jcenter() -} -apply plugin: 'fr.brouillard.oss.gradle.jgitver' - diff --git a/src/test/integration/test/base-build.gradle.kts b/src/test/integration/test/base-build.gradle.kts new file mode 100644 index 0000000..744e814 --- /dev/null +++ b/src/test/integration/test/base-build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + id("fr.brouillard.oss.gradle.jgitver") version "0.9.1" +} + +repositories { + mavenLocal() + maven { + url = uri("https://plugins.gradle.org/m2/") + } + jcenter() +} diff --git a/src/test/integration/test/build.sh b/src/test/integration/test/build.sh index a3e3165..49cc26a 100755 --- a/src/test/integration/test/build.sh +++ b/src/test/integration/test/build.sh @@ -15,11 +15,11 @@ if [[ $# -ne 3 ]] ; then exit 1 fi -if [[ -f ../contexts/$1/jgitver.gradle ]] ; then +if [[ -f ../contexts/$1/jgitver.gradle.kts ]] ; then if [[ -f ../contexts/$1/git-history.sh ]] ; then ../contexts/$1/git-history.sh - cat base-build.gradle ../contexts/$1/jgitver.gradle > build.gradle - (export JGITVER_GRADLE_VERSION=$2 && ./gradlew -b build.gradle version) | tee build.log + cat base-build.gradle.kts ../contexts/$1/jgitver.gradle.kts > build.gradle.kts + (export JGITVER_GRADLE_VERSION=$2 && ./gradlew -b build.gradle.kts version) | tee build.log COMPUTED_VERSION=`grep Version: build.log | cut -f 2 -d ' '` rm build.log if [ "$COMPUTED_VERSION" != "$3" ]; then