2018-01-10 16:06:58 -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
|
|
|
|
*/
|
|
|
|
|
|
|
|
apply from: rootProject.file( 'gradle/java-module.gradle' )
|
2018-01-22 12:43:16 -05:00
|
|
|
|
2018-01-22 12:28:24 -05:00
|
|
|
apply from: rootProject.file( 'gradle/publishing-repos.gradle' )
|
2018-06-13 05:45:41 -04:00
|
|
|
apply from: rootProject.file( 'gradle/publishing-pom.gradle' )
|
2018-01-22 12:28:24 -05:00
|
|
|
|
|
|
|
|
2018-02-01 15:00:37 -05:00
|
|
|
|
2018-01-10 17:52:28 -05:00
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// Jar
|
|
|
|
|
|
|
|
jar {
|
|
|
|
manifest = osgiManifest {
|
|
|
|
// GRADLE-1411: Even if we override Imports and Exports
|
|
|
|
// auto-generation with instructions, classesDir and classpath
|
|
|
|
// need to be here (temporarily).
|
|
|
|
|
|
|
|
if ( project.pluginManager.hasPlugin( 'groovy' ) ) {
|
|
|
|
classesDir = sourceSets.main.groovy.outputDir
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
classesDir = sourceSets.main.output.classesDir
|
|
|
|
}
|
|
|
|
classpath = configurations.runtime
|
|
|
|
|
|
|
|
|
|
|
|
// Java 9 module name
|
|
|
|
instruction 'Automatic-Module-Name', project.java9ModuleName
|
|
|
|
|
|
|
|
// the OSGi metadata
|
|
|
|
symbolicName project.java9ModuleName
|
|
|
|
vendor 'Hibernate.org'
|
|
|
|
description project.description
|
2018-04-30 11:38:09 -04:00
|
|
|
docURL "http://www.hibernate.org/orm/${project.ormVersion.family}"
|
2018-01-10 17:52:28 -05:00
|
|
|
|
|
|
|
instruction 'Import-Package',
|
|
|
|
// Temporarily support JTA 1.1 -- Karaf and other frameworks still
|
|
|
|
// use it. Without this, the plugin generates [1.2,2).
|
|
|
|
'javax.transaction;version="[1.1,2)"',
|
|
|
|
// Tell Gradle OSGi to still dynamically import the other packages.
|
|
|
|
// IMPORTANT: Do not include the * in the modules' .gradle files.
|
|
|
|
// If it exists more than once, the manifest will physically contain a *.
|
|
|
|
'*'
|
|
|
|
|
|
|
|
// Basic JAR manifest metadata
|
|
|
|
instruction 'Specification-Title', project.name
|
|
|
|
instruction 'Specification-Version', project.version
|
|
|
|
instruction 'Specification-Vendor', 'Hibernate.org'
|
|
|
|
instruction 'Implementation-Title', project.name
|
|
|
|
instruction 'Implementation-Version', project.version
|
|
|
|
instruction 'Implementation-Vendor', 'Hibernate.org'
|
|
|
|
instruction 'Implementation-Vendor-Id', 'org.hibernate'
|
|
|
|
instruction 'Implementation-Url', 'http://hibernate.org/orm'
|
|
|
|
|
2018-04-30 11:38:09 -04:00
|
|
|
instruction 'Hibernate-VersionFamily', project.ormVersion.family
|
2018-04-11 14:18:19 -04:00
|
|
|
instruction 'Hibernate-JpaVersion', project.jpaVersion.name
|
2018-01-10 17:52:28 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-22 12:28:24 -05:00
|
|
|
|
2018-01-10 16:06:58 -05:00
|
|
|
task sourcesJar(type: Jar) {
|
|
|
|
from project.sourceSets.main.allSource
|
|
|
|
manifest = project.tasks.jar.manifest
|
|
|
|
classifier = 'sources'
|
|
|
|
}
|
|
|
|
|
|
|
|
task javadocJar(type: Jar) {
|
|
|
|
from project.tasks.javadoc.outputs
|
|
|
|
manifest = project.tasks.jar.manifest
|
|
|
|
classifier = 'javadoc'
|
|
|
|
}
|
|
|
|
|
2018-01-10 17:52:28 -05:00
|
|
|
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// Javadoc
|
|
|
|
|
|
|
|
javadoc {
|
|
|
|
exclude( "**/internal/*" )
|
|
|
|
exclude( "**/generated-src/**" )
|
|
|
|
|
|
|
|
final int currentYear = new GregorianCalendar().get( Calendar.YEAR )
|
|
|
|
|
|
|
|
configure( options ) {
|
|
|
|
windowTitle = "$project.name JavaDocs"
|
|
|
|
docTitle = "$project.name JavaDocs ($project.version)"
|
|
|
|
bottom = "Copyright © 2001-$currentYear <a href=\"http://redhat.com\">Red Hat, Inc.</a> All Rights Reserved."
|
|
|
|
use = true
|
|
|
|
encoding = 'UTF-8'
|
|
|
|
links += [
|
|
|
|
'https://docs.oracle.com/javase/8/docs/api/',
|
|
|
|
'http://docs.jboss.org/hibernate/beanvalidation/spec/2.0/api/',
|
|
|
|
'http://docs.jboss.org/cdi/api/2.0/',
|
2018-06-13 14:35:45 -04:00
|
|
|
'https://javaee.github.io/javaee-spec/javadocs/'
|
2018-01-10 17:52:28 -05:00
|
|
|
]
|
2019-02-17 16:32:03 -05:00
|
|
|
//Workaround to get the JVM version while ignoring the Gradle Enums for versions,
|
|
|
|
//as they never support upcoming JVM versions (doesn't have a isJava12Compatible() yet )
|
2019-02-18 07:31:18 -05:00
|
|
|
if ( JavaVersion.current().isJava11Compatible() ) {
|
|
|
|
int majorJVMVersionInt = Integer.valueOf(JavaVersion.current().toString());
|
|
|
|
if (majorJVMVersionInt >= 12) {
|
|
|
|
//The need to set `--source 8` applies to all JVMs after 11, and also to 11
|
|
|
|
//but after excluding the first two builds; see also specific comments on
|
|
|
|
// https://bugs.openjdk.java.net/browse/JDK-8212233?focusedCommentId=14245762
|
|
|
|
System.out.println("Forcing Javadoc in Java 8 compatible mode");
|
|
|
|
options.addStringOption('-source', '8')
|
|
|
|
}
|
2019-02-17 16:32:03 -05:00
|
|
|
}
|
2018-01-10 17:52:28 -05:00
|
|
|
|
|
|
|
if ( JavaVersion.current().isJava8Compatible() ) {
|
|
|
|
options.addStringOption( 'Xdoclint:none', '-quiet' )
|
|
|
|
}
|
|
|
|
|
|
|
|
doFirst {
|
|
|
|
// ordering problems if we try to do this during config phase :(
|
|
|
|
classpath += project.sourceSets.main.output + project.sourceSets.main.compileClasspath + project.configurations.provided
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
// Publishing
|
|
|
|
|
2018-01-10 16:06:58 -05:00
|
|
|
publishing {
|
|
|
|
publications {
|
2018-02-01 15:00:37 -05:00
|
|
|
publishedArtifacts {
|
2018-01-10 16:06:58 -05:00
|
|
|
from components.java
|
|
|
|
|
|
|
|
artifact( sourcesJar ) {
|
|
|
|
// todo : do these really need to be specified twice?
|
|
|
|
classifier 'sources'
|
|
|
|
}
|
|
|
|
|
|
|
|
artifact( javadocJar ) {
|
|
|
|
// todo : do these really need to be specified twice?
|
|
|
|
classifier "javadoc"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-15 13:06:01 -05:00
|
|
|
task ciBuild( dependsOn: [test, publish] )
|
2018-02-01 14:19:08 -05:00
|
|
|
|
2018-02-15 13:06:01 -05:00
|
|
|
task release( dependsOn: [test, bintrayUpload] )
|
2018-02-01 14:19:08 -05:00
|
|
|
|