2016-01-25 10:08:54 -06:00
|
|
|
/*
|
|
|
|
* 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>.
|
|
|
|
*/
|
|
|
|
|
2015-04-09 11:36:04 -05:00
|
|
|
buildscript {
|
2022-04-22 18:40:06 -05:00
|
|
|
// repositories {
|
|
|
|
// mavenCentral()
|
|
|
|
// }
|
2020-10-15 17:20:30 -05:00
|
|
|
|
2015-04-09 11:36:04 -05:00
|
|
|
dependencies {
|
|
|
|
classpath 'org.hibernate.build.gradle:version-injection-plugin:1.0.0'
|
2018-06-25 17:48:18 +02:00
|
|
|
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.7'
|
2021-12-02 10:50:31 +00:00
|
|
|
classpath 'de.thetaphi:forbiddenapis:3.2'
|
2019-05-21 16:29:57 -05:00
|
|
|
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.1'
|
2015-04-09 11:36:04 -05:00
|
|
|
}
|
2010-10-08 20:20:10 -05:00
|
|
|
}
|
|
|
|
|
2021-05-14 14:59:59 -05:00
|
|
|
|
2016-09-26 17:33:20 -05:00
|
|
|
plugins {
|
2021-09-22 17:52:06 -05:00
|
|
|
id 'org.hibernate.build.xjc-jakarta' version '1.0.2' apply false
|
|
|
|
id 'org.hibernate.matrix-test' version '3.1.1' apply false
|
2022-04-22 18:40:06 -05:00
|
|
|
id 'org.hibernate.orm.database-service' apply false
|
2022-10-24 09:00:44 +00:00
|
|
|
id 'biz.aQute.bnd' version '6.3.1' apply false
|
2021-09-22 17:52:06 -05:00
|
|
|
|
2021-05-14 14:59:59 -05:00
|
|
|
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
|
|
|
|
id 'nu.studer.credentials' version '2.1'
|
|
|
|
|
|
|
|
id 'idea'
|
2021-06-26 08:46:09 -05:00
|
|
|
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.0'
|
2021-05-14 14:59:59 -05:00
|
|
|
id 'eclipse'
|
2016-09-26 17:33:20 -05:00
|
|
|
}
|
|
|
|
|
2022-03-15 09:39:07 -05:00
|
|
|
apply from: file( 'gradle/module.gradle' )
|
2012-07-19 08:56:31 -05:00
|
|
|
|
2013-12-02 20:53:19 -06:00
|
|
|
|
2018-01-10 15:06:58 -06:00
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2018-01-22 11:28:24 -06:00
|
|
|
// Release Task
|
2010-10-08 20:20:10 -05:00
|
|
|
|
2018-01-10 15:06:58 -06:00
|
|
|
task release {
|
2018-01-22 11:28:24 -06:00
|
|
|
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"
|
2018-07-15 15:03:40 +02:00
|
|
|
|
|
|
|
doFirst {
|
2020-11-09 10:13:34 +01:00
|
|
|
def javaVersionsInUse = [gradle.ext.javaVersions.main.compiler, gradle.ext.javaVersions.main.release,
|
|
|
|
gradle.ext.javaVersions.test.compiler, gradle.ext.javaVersions.test.release,
|
|
|
|
gradle.ext.javaVersions.test.launcher].toSet()
|
2021-11-26 16:24:34 +00:00
|
|
|
if ( javaVersionsInUse != [JavaLanguageVersion.of( 11 )].toSet() ) {
|
|
|
|
throw new IllegalStateException( "Please use JDK 11 to perform the release. Currently using: ${javaVersionsInUse}" )
|
2018-07-15 15:03:40 +02:00
|
|
|
}
|
|
|
|
}
|
2018-01-10 15:06:58 -06:00
|
|
|
}
|
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 " +
|
2020-01-29 16:17:57 +04:00
|
|
|
"the fact that subprojects will appropriately define a release task " +
|
2022-03-15 09:39:07 -05:00
|
|
|
"themselves if they have any publish-related activities to perform"
|
2018-02-01 13:19:08 -06:00
|
|
|
}
|
|
|
|
|
2021-05-14 14:59:59 -05:00
|
|
|
ext {
|
|
|
|
// look for command-line overrides of the username/password pairs for publishing
|
|
|
|
if ( project.hasProperty( 'hibernatePublishUsername' ) ) {
|
2021-05-24 15:44:21 -05:00
|
|
|
if ( ! project.hasProperty( 'hibernatePublishPassword' ) ) {
|
|
|
|
throw new GradleException( "Should specify both `hibernatePublishUsername` and `hibernatePublishPassword` as project properties" );
|
|
|
|
}
|
2021-05-14 14:59:59 -05:00
|
|
|
credentials.hibernatePublishUsername = project.property( 'hibernatePublishUsername' )
|
|
|
|
credentials.hibernatePublishPassword = project.property( 'hibernatePublishPassword' )
|
|
|
|
}
|
2021-05-24 15:44:21 -05:00
|
|
|
else if ( System.properties.hibernatePublishUsername != null ) {
|
|
|
|
if ( System.properties.hibernatePublishPassword == null ) {
|
|
|
|
throw new GradleException( "Should specify both `hibernatePublishUsername` and `hibernatePublishPassword` as system properties" );
|
|
|
|
}
|
|
|
|
credentials.hibernatePublishUsername = System.properties.hibernatePublishUsername
|
|
|
|
credentials.hibernatePublishPassword = System.properties.hibernatePublishPassword
|
|
|
|
}
|
2021-05-14 16:47:30 -05:00
|
|
|
}
|
2021-05-14 14:59:59 -05:00
|
|
|
|
2021-05-14 16:47:30 -05:00
|
|
|
nexusPublishing {
|
|
|
|
repositories {
|
|
|
|
sonatype {
|
2021-05-24 15:44:21 -05:00
|
|
|
username = credentials.hibernatePublishUsername
|
|
|
|
password = credentials.hibernatePublishPassword
|
2021-05-14 16:47:30 -05:00
|
|
|
}
|
2021-05-14 14:59:59 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gradle.taskGraph.addTaskExecutionGraphListener(
|
|
|
|
new TaskExecutionGraphListener() {
|
|
|
|
@Override
|
|
|
|
void graphPopulated(TaskExecutionGraph graph) {
|
2021-05-14 16:47:30 -05:00
|
|
|
String[] tasksToLookFor = [
|
|
|
|
'publish',
|
|
|
|
'publishToSonatype',
|
|
|
|
'publishAllPublicationsToSonatype',
|
|
|
|
'publishPublishedArtifactsPublicationToSonatypeRepository',
|
|
|
|
'publishRelocationArtifactsPublicationToSonatypeRepository',
|
|
|
|
]
|
|
|
|
|
|
|
|
for ( String taskToLookFor : tasksToLookFor ) {
|
|
|
|
if ( graph.hasTask( taskToLookFor ) ) {
|
2021-05-24 15:44:21 -05:00
|
|
|
// trying to publish - make sure the needed credentials are available
|
2021-05-14 16:47:30 -05:00
|
|
|
|
2021-05-24 15:44:21 -05:00
|
|
|
if ( credentials.hibernatePublishUsername == null ) {
|
2021-05-14 16:47:30 -05:00
|
|
|
throw new GradleException( "Publishing credentials not specified" );
|
|
|
|
}
|
2021-05-24 15:44:21 -05:00
|
|
|
if ( credentials.hibernatePublishPassword == null ) {
|
2021-05-14 16:47:30 -05:00
|
|
|
throw new GradleException( "Publishing credentials not specified" );
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
2021-05-14 14:59:59 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2016-03-31 12:04:10 -05:00
|
|
|
|
2018-01-22 11:28:24 -06:00
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// 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"
|
2018-01-19 09:56:35 -06:00
|
|
|
}
|
2017-10-23 11:40:23 +01:00
|
|
|
|
2018-01-22 11:28:24 -06:00
|
|
|
|
2021-05-14 14:59:59 -05:00
|
|
|
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// Misc...
|
|
|
|
|
2018-06-11 16:40:09 +01:00
|
|
|
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
|
2022-03-16 08:27:57 -05:00
|
|
|
|
|
|
|
// uncomment locally if you need to debug build scripts.
|
|
|
|
// in such cases, having the sources helps
|
|
|
|
//distributionType = Wrapper.DistributionType.ALL
|
2018-01-10 15:06:58 -06:00
|
|
|
}
|
2013-12-02 20:53:19 -06:00
|
|
|
|
|
|
|
|
2019-05-21 16:29:57 -05:00
|
|
|
idea {
|
|
|
|
module {
|
|
|
|
name = "hibernate-orm"
|
|
|
|
}
|
|
|
|
}
|
2013-05-16 18:51:53 -05:00
|
|
|
|
2013-11-21 13:46:03 -06:00
|
|
|
|
2015-05-18 16:48:10 +01:00
|
|
|
|