Skip to content

Commit

Permalink
Merge branch '2.x' into 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SimY4 committed May 23, 2024
2 parents 7c79ac1 + bb17bfe commit 2c73248
Show file tree
Hide file tree
Showing 15 changed files with 106 additions and 134 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'com.diffplug.spotless' version '6.25.0' apply false
id 'info.solidsoft.pitest' version '1.15.0' apply false
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
id 'me.champeau.jmh' version '0.7.2' apply false
id 'net.ltgt.errorprone' version '3.1.0' apply false
id 'net.researchgate.release' version '3.0.2'
Expand Down Expand Up @@ -87,5 +87,5 @@ release {
}

wrapper {
gradleVersion = '8.6'
gradleVersion = '8.7'
}
4 changes: 2 additions & 2 deletions gradle/check-mutationcoverage.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apply plugin: 'info.solidsoft.pitest'

pitest {
junit5PluginVersion = '1.2.0'
pitestVersion = '1.15.0'
junit5PluginVersion = '1.2.1'
pitestVersion = '1.15.8'
targetClasses = ['com.github.simy4.xpath.*']
threads = 4
outputFormats = project.hasProperty('reports') ? ['HTML'] : ['XML']
Expand Down
37 changes: 11 additions & 26 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,51 +1,36 @@
[versions]
errorprone = '2.26.1'
jackson = '2.17.0'
errorprone = '2.27.1'
jackson = '2.17.1'
scala212 = '2.12.19'
scala213 = '2.13.13'
scala213 = '2.13.14'
scala3 = '3.3.3'
scalatest = '3.2.18'
scalatestplus = '3.2.18.0'
scala-xml = '2.2.0'
wartremover = '3.1.6'

[libraries]
assertj = 'org.assertj:assertj-core:3.25.3'
dom4j = 'org.dom4j:dom4j:2.1.4'
errorprone = { module = 'com.google.errorprone:error_prone_core', version.ref = 'errorprone' }
gson = 'com.google.code.gson:gson:2.10.1'
gson = 'com.google.code.gson:gson:2.11.0'
jackson-databind = { module = 'com.fasterxml.jackson.core:jackson-databind', version.ref = 'jackson' }
jackson-dataformat-yaml = { module = 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml', version.ref = 'jackson' }
jaxen = 'jaxen:jaxen:2.0.0'
jdom2 = 'org.jdom:jdom2:2.0.6.1'
json-api = 'jakarta.json:jakarta.json-api:2.1.3'
json-impl = 'org.glassfish:jakarta.json:2.0.1'
junit-jupiter = 'org.junit.jupiter:junit-jupiter:5.10.2'
mockito = 'org.mockito:mockito-junit-jupiter:5.11.0'
mockito = 'org.mockito:mockito-junit-jupiter:5.12.0'
scala-library-v212 = { module = 'org.scala-lang:scala-library', version.ref = 'scala212' }
scala-library-v213 = { module = 'org.scala-lang:scala-library', version.ref = 'scala213' }
scala-library-v3 = { module = 'org.scala-lang:scala3-library_3', version.ref = 'scala3' }
scala-reflect-v212 = { module = 'org.scala-lang:scala-reflect', version.ref = 'scala212' }
scala-reflect-v213 = { module = 'org.scala-lang:scala-reflect', version.ref = 'scala213' }
scala-xml-v212 = { module = 'org.scala-lang.modules:scala-xml_2.12', version.ref = 'scala-xml' }
scala-xml-v213 = { module = 'org.scala-lang.modules:scala-xml_2.13', version.ref = 'scala-xml' }
scala-xml-v3 = { module = 'org.scala-lang.modules:scala-xml_3', version.ref = 'scala-xml' }
scalatest-funspec-v212 = { module = 'org.scalatest:scalatest-funspec_2.12', version.ref = 'scalatest' }
scalatest-funspec-v213 = { module = 'org.scalatest:scalatest-funspec_2.13', version.ref = 'scalatest' }
scalatest-funspec-v3 = { module = 'org.scalatest:scalatest-funspec_3', version.ref = 'scalatest' }
scalatest-shouldmatchers-v212 = { module = 'org.scalatest:scalatest-shouldmatchers_2.12', version.ref = 'scalatest' }
scalatest-shouldmatchers-v213 = { module = 'org.scalatest:scalatest-shouldmatchers_2.13', version.ref = 'scalatest' }
scalatest-shouldmatchers-v3 = { module = 'org.scalatest:scalatest-shouldmatchers_3', version.ref = 'scalatest' }
scalatest-junit-runner-v212 = { module = 'org.scalatestplus:junit-5-10_2.12', version.ref = 'scalatestplus' }
scalatest-junit-runner-v213 = { module = 'org.scalatestplus:junit-5-10_2.13', version.ref = 'scalatestplus' }
scalatest-junit-runner-v3 = { module = 'org.scalatestplus:junit-5-10_3', version.ref = 'scalatestplus' }
wartremover-v212 = { module = 'org.wartremover:wartremover_2.12', version.ref = 'wartremover' }
wartremover-v213 = { module = 'org.wartremover:wartremover_2.13', version.ref = 'wartremover' }
wartremover-v3 = { module = 'org.wartremover:wartremover_3', version.ref = 'wartremover' }
scala-xml = 'org.scala-lang.modules:scala-xml_%%:2.3.0'
scalatest-funspec = { module = 'org.scalatest:scalatest-funspec_%%', version.ref = 'scalatest' }
scalatest-shouldmatchers = { module = 'org.scalatest:scalatest-shouldmatchers_%%', version.ref = 'scalatest' }
scalatest-junit-runner = 'org.scalatestplus:junit-5-10_%%:3.2.18.0'
wartremover = 'org.wartremover:wartremover_%%:3.1.6'
xom = 'xom:xom:1.3.9'

[bundles]
junit = ["junit-jupiter", "assertj"]
scalatest-v212 = ["scalatest-funspec-v212", "scalatest-shouldmatchers-v212", "scalatest-junit-runner-v212"]
scalatest-v213 = ["scalatest-funspec-v213", "scalatest-shouldmatchers-v213", "scalatest-junit-runner-v213"]
scalatest-v3 = ["scalatest-funspec-v3", "scalatest-shouldmatchers-v3", "scalatest-junit-runner-v3"]
scalatest = ["scalatest-funspec", "scalatest-shouldmatchers", "scalatest-junit-runner"]
8 changes: 8 additions & 0 deletions gradle/publish-maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ publishing {
publications {
mavenJava(MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionResult()
}
usage('java-runtime') {
fromResolutionResult()
}
}
afterEvaluate {
artifactId = project.name
pom {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
2 changes: 1 addition & 1 deletion xpath-to-json-jackson/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ dependencies {
implementation libs.jackson.databind

testImplementation project(':xpath-to-xml-test')
testImplementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
testImplementation libs.jackson.dataformat.yaml
testImplementation libs.bundles.junit
}
2 changes: 1 addition & 1 deletion xpath-to-xml-scala/.scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.8.0"
version = "3.8.1"
runner.dialect = Scala213Source3
maxColumn = 120
align.preset = more
Expand Down
37 changes: 6 additions & 31 deletions xpath-to-xml-scala/build-2.12.gradle
Original file line number Diff line number Diff line change
@@ -1,44 +1,25 @@
apply plugin: 'scala'

buildDir = 'build-2.12'

clean {
delete 'build-2.12'
ext {
scalaCompiler = '2.12'
}

apply from: 'shared.gradle'

sourceSets {
main.scala.srcDirs += [file('src/main/scala-2-'), file('src/main/scala-2.12-')]
}

dependencies {
api project(':xpath-to-xml-core')

implementation libs.scala.library.v212
implementation libs.scala.reflect.v212
implementation libs.scala.xml.v212

scalaCompilerPlugins libs.wartremover.v212

testImplementation project(':xpath-to-xml-test')
testImplementation libs.bundles.scalatest.v212
}

javadocJar {
dependsOn scaladoc
from scaladoc
compileOnly libs.scala.reflect.v212
}

spotless {
scala {
scalafmt('3.8.0').configFile('.scalafmt.conf')
scalafmt('3.8.1').configFile('.scalafmt.conf')
licenseHeaderFile rootProject.file('gradle/license.header'), 'package '
}
}

scala {
zincVersion = '1.9.6'
}

scaladoc {
scalaDocOptions.with {
additionalParameters = [
Expand Down Expand Up @@ -91,9 +72,3 @@ tasks.withType(ScalaCompile).configureEach {
]
}
}

test {
useJUnitPlatform {
includeEngines 'scalatest'
}
}
33 changes: 6 additions & 27 deletions xpath-to-xml-scala/build-2.13.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
apply plugin: 'scala'

buildDir = 'build-2.13'

clean {
delete 'build-2.13'
ext {
scalaCompiler = '2.13'
}

apply from: 'shared.gradle'

sourceSets {
main.scala.srcDirs += [file('src/main/scala-2-'), file('src/main/scala-2.13+')]
}
Expand All @@ -14,31 +12,18 @@ dependencies {
api project(':xpath-to-xml-core')

implementation libs.scala.library.v213
implementation libs.scala.reflect.v213
implementation libs.scala.xml.v213

scalaCompilerPlugins libs.wartremover.v213
compileOnly libs.scala.reflect.v213

testImplementation project(':xpath-to-xml-test')
testImplementation libs.bundles.scalatest.v213
}

javadocJar {
dependsOn scaladoc
from scaladoc
}

spotless {
scala {
scalafmt('3.8.0').configFile('.scalafmt.conf')
scalafmt('3.8.1').configFile('.scalafmt.conf')
licenseHeaderFile rootProject.file('gradle/license.header'), 'package '
}
}

scala {
zincVersion = '1.9.6'
}

scaladoc {
scalaDocOptions.with {
additionalParameters = [
Expand Down Expand Up @@ -89,9 +74,3 @@ tasks.withType(ScalaCompile).configureEach {
]
}
}

test {
useJUnitPlatform {
includeEngines 'scalatest'
}
}
31 changes: 5 additions & 26 deletions xpath-to-xml-scala/build-3.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
apply plugin: 'scala'
apply from: rootProject.file('gradle/benchmark-jmh.gradle')

buildDir = 'build-3'

clean {
delete 'build-3'
ext {
scalaCompiler = '3'
}

apply from: 'shared.gradle'
apply from: rootProject.file('gradle/benchmark-jmh.gradle')

sourceSets {
main.scala.srcDirs += [file('src/main/scala-2.13+'), file('src/main/scala-3+')]
}
Expand All @@ -15,33 +13,20 @@ dependencies {
api project(':xpath-to-xml-core')

implementation libs.scala.library.v3
implementation libs.scala.xml.v3

scalaCompilerPlugins libs.wartremover.v3

testImplementation project(':xpath-to-xml-test')
testImplementation libs.bundles.scalatest.v3
}

moduleConfig {
moduleInfoPath = 'src/main/module-3/module-info.java'
}

javadocJar {
dependsOn scaladoc
from scaladoc
}

spotless {
scala {
licenseHeaderFile rootProject.file('gradle/license.header'), 'package '
}
}

scala {
zincVersion = '1.9.6'
}

tasks.withType(ScalaCompile).configureEach {
scalaCompileOptions.with {
deprecation = true
Expand All @@ -61,9 +46,3 @@ tasks.withType(ScalaCompile).configureEach {
]
}
}

test {
useJUnitPlatform {
includeEngines 'scalatest'
}
}
43 changes: 43 additions & 0 deletions xpath-to-xml-scala/shared.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apply plugin: 'scala'

layout.buildDirectory = file("build-${scalaCompiler}")

clean {
delete "build-${scalaCompiler}"
}

configurations.configureEach {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def module = details.requested.module
if (module.name.endsWith('_%%')) {
details.useTarget "${module.group}:${module.name.replace('_%%', "_${scalaCompiler}" as CharSequence)}:${details.requested.version}"
details.because "Scala compiler resolution"
}
}
}

dependencies {
api project(':xpath-to-xml-core')

implementation libs.scala.xml

scalaCompilerPlugins libs.wartremover

testImplementation project(':xpath-to-xml-test')
testImplementation libs.bundles.scalatest
}

javadocJar {
dependsOn scaladoc
from scaladoc
}

scala {
zincVersion = '1.10.0'
}

test {
useJUnitPlatform {
includeEngines 'scalatest'
}
}
Loading

0 comments on commit 2c73248

Please sign in to comment.