hibernate-orm/build.gradle

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

147 lines
3.9 KiB
Groovy
Raw Normal View History

/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
buildscript {
// repositories {
// mavenCentral()
// }
dependencies {
2024-07-15 19:27:12 +02:00
// classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.7'
classpath buildscriptLibs.forbiddenapis
2019-05-21 16:29:57 -05:00
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.1'
}
2010-10-08 20:20:10 -05:00
}
plugins {
id 'org.hibernate.build.xjc-jakarta' version '2.0.3' apply false
2024-06-17 01:58:58 -05:00
id "org.hibernate.build.version-injection" version "2.0.0" apply false
id 'org.hibernate.matrix-test' version '3.1.1' apply false
id 'org.hibernate.orm.database-service' apply false
2024-06-17 01:58:58 -05:00
id 'biz.aQute.bnd' version '7.0.0' apply false
2024-09-14 19:10:26 +02:00
id 'com.diffplug.spotless' version '6.25.0'
id 'org.checkerframework' version '0.6.40'
2023-08-07 20:05:47 -05:00
id 'org.hibernate.orm.build.jdks'
2024-06-17 01:58:58 -05:00
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
id 'idea'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.0'
id 'eclipse'
id "com.dorongold.task-tree" version "2.1.1"
}
apply from: file( 'gradle/module.gradle' )
2024-12-05 00:51:07 -06:00
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Release Task
2010-10-08 20:20:10 -05:00
task release {
description = "The task performed when we are performing a release build. Relies on " +
"the fact that subprojects will appropriately define a release task " +
"themselves if they have any release-related activities to perform"
doFirst {
2023-08-07 20:05:47 -05:00
def javaVersionsInUse = jdkVersions.allVersions
if ( javaVersionsInUse != [JavaLanguageVersion.of( 11 )].toSet() ) {
throw new IllegalStateException( "Please use JDK 11 to perform the release. Currently using: ${javaVersionsInUse}" )
}
}
}
2017-08-17 13:04:39 +02:00
2018-02-01 13:19:08 -06:00
task publish {
description = "The task performed when we want to just publish maven artifacts. Relies on " +
"the fact that subprojects will appropriately define a release task " +
"themselves if they have any publish-related activities to perform"
2018-02-01 13:19:08 -06:00
}
2024-12-05 00:51:07 -06:00
def ossrhUsername = extractPropertyOrSetting( "OSSRH_USER" )
def ossrhPassword = extractPropertyOrSetting( "OSSRH_PASSWORD" )
String extractPropertyOrSetting(String name) {
if ( project.hasProperty( name) ) {
return project.property( name )
}
2024-12-05 01:14:46 -06:00
def sysProp = System.getProperty( name )
if ( sysProp != null ) {
return sysProp
}
def envProp = System.getenv( name )
if ( envProp != null ) {
return envProp
}
return null
2021-05-14 16:47:30 -05:00
}
2021-05-14 16:47:30 -05:00
nexusPublishing {
repositories {
sonatype {
2024-12-05 00:51:07 -06:00
username = ossrhUsername
password = ossrhPassword
2021-05-14 16:47:30 -05:00
}
}
}
gradle.taskGraph.addTaskExecutionGraphListener(
new TaskExecutionGraphListener() {
@Override
void graphPopulated(TaskExecutionGraph graph) {
2024-12-05 00:51:07 -06:00
for ( final def task in graph.allTasks ) {
if ( task instanceof PublishToMavenRepository ) {
if ( ossrhUsername == null ) {
throw new RuntimeException( "OSSRH username not specified, but publishing was requested" )
2021-05-14 16:47:30 -05:00
}
2024-12-05 00:51:07 -06:00
if ( ossrhPassword == null ) {
throw new RuntimeException( "OSSRH password not specified, but publishing was requested" )
2021-05-14 16:47:30 -05:00
}
2024-12-05 00:51:07 -06:00
break
}
}
}
}
)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CI Build Task
task ciBuild {
description = "The task performed when one of the 'main' jobs are triggered on the " +
"CI server. Just as above, relies on the fact that subprojects will " +
"appropriately define a release task themselves if they have any tasks " +
"which should be performed from these CI jobs"
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Misc...
wrapper {
2019-10-21 18:48:17 +02:00
// To upgrade the version of gradle used in the wrapper, run:
// ./gradlew wrapper --gradle-version NEW_VERSION
// uncomment locally if you need to debug build scripts.
// in such cases, having the sources helps
//distributionType = Wrapper.DistributionType.ALL
}
2013-12-02 20:53:19 -06:00
2019-05-21 16:29:57 -05:00
idea {
module {
name = "hibernate-orm"
}
}