mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-07 11:48:18 +00:00
77 lines
1.8 KiB
Groovy
77 lines
1.8 KiB
Groovy
/*
|
|
* 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
|
|
*/
|
|
|
|
apply plugin: 'base'
|
|
|
|
ext {
|
|
ormVersion = new HibernateVersion( '5.5.0-SNAPSHOT', project )
|
|
baselineJavaVersion = '1.8'
|
|
jpaVersion = new JpaVersion('2.2')
|
|
}
|
|
|
|
if ( JavaVersion.current() == JavaVersion.VERSION_HIGHER ) {
|
|
// This JDK is not supported by Gradle.
|
|
// Use a hack to retrieve the major as a string.
|
|
|
|
// This only works for Java 9+ (we're at least on Java 13 here).
|
|
def major = System.getProperty( 'java.specification.version' )
|
|
logger.warn( "[WARN] The Java version '$major' is not supported by gradle." )
|
|
|
|
ext.testedJavaVersion = major
|
|
}
|
|
else {
|
|
// This JDK is supported by Gradle.
|
|
ext.testedJavaVersion = JavaVersion.current()
|
|
}
|
|
|
|
group = 'org.hibernate'
|
|
version = project.ormVersion.fullName
|
|
|
|
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
|
|
}
|
|
|
|
@Override
|
|
String toString() {
|
|
return this.fullName
|
|
}
|
|
}
|