2016-01-25 11:08:54 -05: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 12:36:04 -04:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
jcenter()
|
2018-05-24 06:55:51 -04:00
|
|
|
mavenCentral()
|
2015-04-09 12:36:04 -04:00
|
|
|
}
|
|
|
|
dependencies {
|
2019-10-21 12:49:41 -04:00
|
|
|
classpath 'org.hibernate.build.gradle:hibernate-matrix-testing:3.0.0.Final'
|
2015-04-09 12:36:04 -04:00
|
|
|
classpath 'org.hibernate.build.gradle:version-injection-plugin:1.0.0'
|
2019-10-25 10:59:15 -04:00
|
|
|
classpath 'gradle.plugin.com.github.lburgazzoli:gradle-karaf-plugin:0.5.1'
|
2018-06-25 11:48:18 -04:00
|
|
|
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.7'
|
2020-07-17 07:07:29 -04:00
|
|
|
classpath 'de.thetaphi:forbiddenapis:3.0.1'
|
2015-04-09 12:36:04 -04:00
|
|
|
}
|
2010-10-08 21:20:10 -04:00
|
|
|
}
|
|
|
|
|
2016-09-26 18:33:20 -04:00
|
|
|
plugins {
|
2018-09-04 17:42:36 -04:00
|
|
|
id 'me.champeau.buildscan-recipes' version '0.2.3'
|
2021-04-29 14:17:45 -04:00
|
|
|
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
|
2021-04-29 09:50:25 -04:00
|
|
|
id 'nu.studer.credentials' version '2.1'
|
2019-10-22 13:03:58 -04:00
|
|
|
id 'org.hibernate.build.xjc' version '2.0.1' apply false
|
2020-08-18 10:12:45 -04:00
|
|
|
id 'org.hibernate.build.maven-repo-auth' version '3.0.3' apply false
|
2020-07-17 06:57:35 -04:00
|
|
|
id 'biz.aQute.bnd' version '5.1.1' apply false
|
2016-09-26 18:33:20 -04:00
|
|
|
}
|
|
|
|
|
2021-04-29 05:05:55 -04:00
|
|
|
ext {
|
|
|
|
sonatypeOssrhUser = project.findProperty( 'SONATYPE_OSSRH_USER' )
|
|
|
|
sonatypeOssrhPassword = project.findProperty( 'SONATYPE_OSSRH_PASSWORD' )
|
|
|
|
}
|
|
|
|
|
2021-04-29 09:50:25 -04:00
|
|
|
File versionFile = file( "${rootProject.projectDir}/gradle/version.properties" )
|
|
|
|
|
|
|
|
ext {
|
|
|
|
ormVersionFile = versionFile
|
|
|
|
ormVersion = HibernateVersion.fromFile( versionFile, project )
|
|
|
|
// Override during releases
|
|
|
|
if ( project.hasProperty( 'releaseVersion' ) ) {
|
|
|
|
ormVersion = new HibernateVersion( project.releaseVersion, project )
|
|
|
|
}
|
|
|
|
jpaVersion = new JpaVersion('2.2')
|
2021-04-22 12:15:45 -04:00
|
|
|
jakartaJpaVersion = new JpaVersion('3.0.0')
|
2021-04-29 09:50:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// The Gradle Nexus Publish Plugin must be applied to the root project and requires group and version
|
|
|
|
|
|
|
|
group = 'org.hibernate'
|
|
|
|
version = project.ormVersion.fullName
|
2021-04-29 05:05:55 -04:00
|
|
|
|
|
|
|
nexusPublishing {
|
|
|
|
repositories {
|
|
|
|
sonatype {
|
|
|
|
username = project.sonatypeOssrhUser
|
|
|
|
password = project.sonatypeOssrhPassword
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-09 12:36:04 -04:00
|
|
|
allprojects {
|
2018-01-10 16:06:58 -05:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
2018-08-10 11:00:15 -04:00
|
|
|
//Allow loading additional dependencies from a local path;
|
2018-08-09 07:33:41 -04:00
|
|
|
//useful to load JDBC drivers which can not be distributed in public.
|
|
|
|
if (System.env['ADDITIONAL_REPO'] != null) {
|
|
|
|
flatDir {
|
|
|
|
dirs "${System.env.ADDITIONAL_REPO}"
|
|
|
|
}
|
|
|
|
}
|
2018-01-10 16:06:58 -05:00
|
|
|
}
|
2018-06-21 11:26:52 -04:00
|
|
|
apply plugin: 'idea'
|
2018-01-02 14:47:29 -05:00
|
|
|
|
|
|
|
// minimize changes, at least for now (gradle uses 'build' by default)..
|
|
|
|
buildDir = "target"
|
2016-08-05 11:08:35 -04:00
|
|
|
|
2021-04-29 09:50:25 -04:00
|
|
|
group = 'org.hibernate'
|
|
|
|
version = project.ormVersion.fullName
|
2013-11-21 14:46:03 -05:00
|
|
|
}
|
2012-07-19 09:56:31 -04:00
|
|
|
|
2013-12-02 21:53:19 -05:00
|
|
|
|
2018-01-10 16:06:58 -05:00
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2018-01-22 12:28:24 -05:00
|
|
|
// Release Task
|
2010-10-08 21:20:10 -04:00
|
|
|
|
2018-01-10 16:06:58 -05:00
|
|
|
task release {
|
2018-01-22 12:28:24 -05: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 09:03:40 -04:00
|
|
|
|
|
|
|
doFirst {
|
2020-11-09 04:13:34 -05: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()
|
|
|
|
// Force to release with JDK 8. It used to not work on JDK11 because of the hibernate-orm-modules module,
|
|
|
|
// but this limitation might be resolved now that this module has been deleted?
|
|
|
|
if ( javaVersionsInUse != [JavaLanguageVersion.of( 8 )].toSet() ) {
|
|
|
|
throw new IllegalStateException( "Please use JDK 8 to perform the release. Currently using: ${javaVersionsInUse}" )
|
2018-07-15 09:03:40 -04:00
|
|
|
}
|
|
|
|
}
|
2018-01-10 16:06:58 -05:00
|
|
|
}
|
2017-08-17 07:04:39 -04:00
|
|
|
|
2018-02-01 14:19:08 -05:00
|
|
|
task publish {
|
|
|
|
description = "The task performed when we want to just publish maven artifacts. Relies on " +
|
2020-01-29 07:17:57 -05:00
|
|
|
"the fact that subprojects will appropriately define a release task " +
|
2018-02-01 14:19:08 -05:00
|
|
|
"themselves if they have any release-related activities to perform"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-03-31 13:04:10 -04:00
|
|
|
|
2018-01-22 12:28:24 -05: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 10:56:35 -05:00
|
|
|
}
|
2017-10-23 06:40:23 -04:00
|
|
|
|
2018-01-22 12:28:24 -05:00
|
|
|
|
2018-06-11 11:40:09 -04:00
|
|
|
wrapper {
|
2019-10-21 12:48:17 -04:00
|
|
|
// To upgrade the version of gradle used in the wrapper, run:
|
|
|
|
// ./gradlew wrapper --gradle-version NEW_VERSION
|
2018-06-11 11:40:09 -04:00
|
|
|
distributionType = Wrapper.DistributionType.ALL
|
2018-01-10 16:06:58 -05:00
|
|
|
}
|
2013-12-02 21:53:19 -05:00
|
|
|
|
|
|
|
|
2018-01-10 16:06:58 -05:00
|
|
|
buildScan {
|
2019-10-21 12:53:36 -04:00
|
|
|
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
|
|
|
|
termsOfServiceAgree = 'yes'
|
2018-09-04 17:42:36 -04:00
|
|
|
}
|
2017-09-21 15:59:05 -04:00
|
|
|
|
2018-09-04 17:42:36 -04:00
|
|
|
buildScanRecipes {
|
2018-01-10 16:06:58 -05:00
|
|
|
recipe 'git-commit', baseUrl: 'https://github.com/hibernate/hibernate-orm/tree'
|
|
|
|
}
|
2013-12-02 21:53:19 -05:00
|
|
|
|
2021-04-29 09:50:25 -04:00
|
|
|
class JpaVersion {
|
|
|
|
/** The *normal* name (1.0, 2.0, ..) */
|
|
|
|
final String name;
|
|
|
|
|
|
|
|
final String osgiName
|
|
|
|
|
|
|
|
JpaVersion(String version){
|
|
|
|
this.name = version
|
|
|
|
this.osgiName = version + ".0"
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
String toString() {
|
|
|
|
return name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class HibernateVersion {
|
|
|
|
final String fullName
|
|
|
|
final String majorVersion
|
|
|
|
final String family
|
|
|
|
|
|
|
|
final String osgiVersion
|
|
|
|
|
|
|
|
final boolean isSnapshot
|
|
|
|
|
|
|
|
HibernateVersion(String fullName, Project project) {
|
|
|
|
this.fullName = fullName
|
|
|
|
|
|
|
|
final String[] hibernateVersionComponents = fullName.split( '\\.' )
|
|
|
|
this.majorVersion = hibernateVersionComponents[0]
|
|
|
|
this.family = hibernateVersionComponents[0] + '.' + hibernateVersionComponents[1]
|
|
|
|
|
|
|
|
this.isSnapshot = fullName.endsWith( '-SNAPSHOT' )
|
|
|
|
|
|
|
|
this.osgiVersion = isSnapshot ? family + '.' + hibernateVersionComponents[2] + '.SNAPSHOT' : fullName
|
|
|
|
}
|
|
|
|
|
|
|
|
static HibernateVersion fromFile(File file, Project project){
|
|
|
|
def fullName = readVersionProperties(file)
|
|
|
|
return new HibernateVersion(fullName, project)
|
|
|
|
}
|
|
|
|
|
|
|
|
private static String readVersionProperties(File file) {
|
|
|
|
if ( !file.exists() ) {
|
|
|
|
throw new GradleException( "Version file $file.canonicalPath does not exists" )
|
|
|
|
}
|
|
|
|
Properties versionProperties = new Properties()
|
|
|
|
file.withInputStream {
|
|
|
|
stream -> versionProperties.load( stream )
|
|
|
|
}
|
|
|
|
return versionProperties.hibernateVersion
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
String toString() {
|
|
|
|
return this.fullName
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-10 16:06:58 -05:00
|
|
|
//idea {
|
|
|
|
// project {
|
2020-11-09 04:13:34 -05:00
|
|
|
// jdkName = gradle.ext.baselineJavaVersion
|
|
|
|
// languageLevel = gradle.ext.baselineJavaVersion
|
2018-01-10 16:06:58 -05:00
|
|
|
//
|
|
|
|
// vcs = 'Git'
|
|
|
|
// }
|
|
|
|
// module {
|
|
|
|
// name = "hibernate-orm"
|
|
|
|
// }
|
|
|
|
//}
|
2013-05-16 19:51:53 -04:00
|
|
|
|
2013-11-21 14:46:03 -05:00
|
|
|
|
2015-05-18 11:48:10 -04:00
|
|
|
|