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