Update to Gradle 7.2

This commit is contained in:
Christian Beikov 2021-10-13 10:24:56 +02:00
parent 8a0e4a9cdd
commit 9fa2671cbc
5 changed files with 37 additions and 54 deletions

View File

@ -228,7 +228,7 @@ convention.findPlugin( JavaPluginConvention.class ).sourceSets.each { sourceSet
final File toolsJar = file("${System.getProperty('java.home')}/../lib/tools.jar")
if ( toolsJar.exists() ) {
dependencies{
testCompile files( toolsJar )
testImplementation files( toolsJar )
}
}
@ -254,17 +254,12 @@ if ( gradle.ext.javaToolchainEnabled ) {
}
}
class HeapDumpPathProvider implements CommandLineArgumentProvider {
// @InputFile
@OutputDirectory
@PathSensitive(PathSensitivity.RELATIVE)
// @Optional
Provider<Directory> path
// File path
@Override
Iterable<String> asArguments() {
["-XX:HeapDumpPath=${path.get().asFile.absolutePath}"]
// ["-XX:HeapDumpPath=${path.absolutePath}"]
}
}
@ -280,7 +275,6 @@ tasks.withType( Test.class ).each { test ->
test.jvmArgumentProviders.add(
new HeapDumpPathProvider( path: project.layout.buildDirectory.dir("OOM-dump") )
// new HeapDumpPathProvider( path: project.file( "${buildDir}/OOM-dump.hprof" ) )
)
test.jvmArgs += [
@ -327,6 +321,7 @@ sourceSets {
processTestResources {
duplicatesStrategy DuplicatesStrategy.INCLUDE
inputs.property( "db", db )
doLast {
copy {

View File

@ -33,7 +33,7 @@ publishing {
from components.java
}
relocationArtifacts( MavenPublication ) {
relocationPom( MavenPublication ) {
pom {
name = project.name + ' - relocation'
groupId = 'org.hibernate'

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -14,26 +14,26 @@ apply plugin: 'org.hibernate.matrix-test'
dependencies {
compile project(':hibernate-core')
compile libraries.geolatte
api project(':hibernate-core')
api libraries.geolatte
compileOnly libraries.postgresql
testCompile project(':hibernate-testing')
testCompile project(':hibernate-ant')
testCompile project( path: ':hibernate-core', configuration: 'tests' )
testImplementation project(':hibernate-testing')
testImplementation project(':hibernate-ant')
testImplementation project( path: ':hibernate-core', configuration: 'tests' )
testCompile libraries.jakarta_validation
testCompile libraries.jandex
testCompile libraries.classmate
testCompile libraries.jakarta_validator
testCompile libraries.dom4j
testImplementation libraries.jakarta_validation
testImplementation libraries.jandex
testImplementation libraries.classmate
testImplementation libraries.jakarta_validator
testImplementation libraries.dom4j
testImplementation libraries.postgresql
testRuntime libraries.jakarta_el
testRuntime 'jaxen:jaxen:1.1'
testRuntime libraries.byteBuddy
testRuntimeOnly libraries.jakarta_el
testRuntimeOnly 'jaxen:jaxen:1.1'
testRuntimeOnly libraries.byteBuddy
}
sourceSets.test.resources {

View File

@ -7,7 +7,7 @@
description = 'Enhance Plugin of the Hibernate project for use with Maven build system.'
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
apply plugin: 'maven'
apply plugin: 'maven-publish'
import org.apache.tools.ant.filters.ReplaceTokens
@ -69,40 +69,28 @@ def generateMavenDependency(String gradleDependency) {
}
// Writes pom.xml using merged Gradle dependency and MavenPom configuration.
processResources.doLast {
ext.pomDefinition = pom {
configurations {
// avoiding test dependencies in generated pom
compile
runtime
}
project {
groupId project.group
packaging 'maven-plugin'
name 'Hibernate Enhance Maven Plugin'
description 'Enhance Plugin of the Hibernate project for use with Maven build system.'
properties {
'project.build.sourceEncoding' 'UTF-8'
tasks.named('generatePomFileForPublishedArtifactsPublication') {
pom.with {
packaging 'maven-plugin'
name.set('Hibernate Enhance Maven Plugin')
description 'Enhance Plugin of the Hibernate project for use with Maven build system.'
properties.put(
'project.build.sourceEncoding', 'UTF-8'
)
// HHH-9679 --- build in pom{} conflicts with FactoryBuilderSupport#build so we write that portion of XML by hand
withXml {
asNode().appendNode('build').appendNode('plugins').appendNode('plugin').with {
appendNode('groupId', 'org.apache.maven.plugins')
appendNode('artifactId', 'maven-plugin-plugin')
appendNode('version', '3.2')
appendNode('configuration').appendNode('skipErrorNoDescriptorsFound', 'true')
appendNode('executions').appendNode('execution').with {
appendNode('id', 'mojo-descriptor')
appendNode('goals').appendNode('goal', 'descriptor')
}
}
}
}
// HHH-9679 --- build in pom{} conflicts with FactoryBuilderSupport#build so we write that portion of XML by hand
ext.pomDefinition.withXml {
asNode().appendNode('build').appendNode('plugins').appendNode('plugin').with {
appendNode('groupId', 'org.apache.maven.plugins')
appendNode('artifactId', 'maven-plugin-plugin')
appendNode('version', '3.2')
appendNode('configuration').appendNode('skipErrorNoDescriptorsFound', 'true')
appendNode('executions').appendNode('execution').with {
appendNode('id', 'mojo-descriptor')
appendNode('goals').appendNode('goal', 'descriptor')
}
}
}
ext.pomDefinition.writeTo("$processResources.destinationDir/pom.xml")
}
processResources.dependsOn processPluginXml