HHH-8733 - General build cleanup
This commit is contained in:
parent
aabd904ec6
commit
d1023821b1
63
build.gradle
63
build.gradle
|
@ -44,9 +44,7 @@ ext {
|
|||
hibernateTargetVersion = '4.3.0-SNAPSHOT'
|
||||
javaLanguageLevel = '1.6'
|
||||
|
||||
// The OSGi manifest exported package versions need to be only the numerical release -- no "SNAPSHOT" or "Final"
|
||||
// todo : brett - what about Alpha, Beta, CR, SP, etc?
|
||||
osgiExportVersion = hibernateTargetVersion.replaceAll( "-SNAPSHOT", "" ).replaceAll( ".Final", "" );
|
||||
osgiExportVersion = hibernateTargetVersion.replaceAll( "-SNAPSHOT", ".SNAPSHOT" )
|
||||
}
|
||||
|
||||
idea {
|
||||
|
@ -78,6 +76,11 @@ def pomName() {
|
|||
def pomDescription() {
|
||||
return "A module of the Hibernate O/RM project"
|
||||
}
|
||||
// Used in MANIFEST.MF for OSGi Bundles
|
||||
def osgiDescription() {
|
||||
// by default just reuse the pomDescription
|
||||
return pomDescription()
|
||||
}
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
subprojects { subProject ->
|
||||
|
@ -210,35 +213,34 @@ subprojects { subProject ->
|
|||
task generateSources(type: Task)
|
||||
|
||||
jar {
|
||||
Set<String> exportPackages = new HashSet<String>()
|
||||
Set<String> privatePackages = new HashSet<String>()
|
||||
// internal packages that need to temporarily be exported
|
||||
final String[] temporaryExports = [
|
||||
// - org.hibernate.boot.registry.classloading.internal
|
||||
// until EntityManagerFactoryBuilderImpl no longer imports ClassLoaderServiceImpl
|
||||
'org.hibernate.boot.registry.classloading.internal',
|
||||
// - .util for external module use (especially envers)
|
||||
'org.hibernate.internal.util'
|
||||
]
|
||||
|
||||
// TODO: Could more of this be pulled into utilities.gradle?
|
||||
sourceSets.each { sourceSet ->
|
||||
// skip certain source sets
|
||||
if ( ! ['test','matrix'].contains( sourceSet.name ) ) {
|
||||
sourceSet.java.each { javaFile ->
|
||||
// - org.hibernate.boot.registry.classloading.internal
|
||||
// until EntityManagerFactoryBuilderImpl no longer imports ClassLoaderServiceImpl
|
||||
// - .util for external module use (especially envers)
|
||||
final String[] temporaryExports = [
|
||||
'org.hibernate.boot.registry.classloading.internal',
|
||||
'org.hibernate.internal.util' ]
|
||||
SortedSet<String> exportPackages = new TreeSet<String>()
|
||||
SortedSet<String> privatePackages = new TreeSet<String>()
|
||||
|
||||
final String packageName = determinePackageName( sourceSet.java, javaFile );
|
||||
if ( ! temporaryExports.contains( packageName )
|
||||
&& ( packageName.endsWith( ".internal" )
|
||||
|| packageName.contains( ".internal." )
|
||||
|| packageName.endsWith( ".test" )
|
||||
|| packageName.contains( ".test." ) ) ) {
|
||||
privatePackages.add( packageName );
|
||||
}
|
||||
else {
|
||||
exportPackages.add( packageName + ";version=\"" + exportPackageVersion + "\"" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sourceSets.main.java.each { javaFile ->
|
||||
if ( javaFile.name.endsWith( 'package-info.java' ) ) {
|
||||
return;
|
||||
}
|
||||
final String packageName = determinePackageName( sourceSets.main.java, javaFile );
|
||||
if ( ! temporaryExports.contains( packageName )
|
||||
&& ( packageName.endsWith( ".internal" )
|
||||
|| packageName.contains( ".internal." )
|
||||
|| packageName.endsWith( ".test" )
|
||||
|| packageName.contains( ".test." ) ) ) {
|
||||
privatePackages.add( packageName );
|
||||
}
|
||||
else {
|
||||
exportPackages.add( packageName + ";version=\"" + exportPackageVersion + "\"" );
|
||||
}
|
||||
}
|
||||
|
||||
manifest = osgiManifest {
|
||||
// GRADLE-1411: Even if we override Imports and Exports
|
||||
|
@ -260,6 +262,7 @@ subprojects { subProject ->
|
|||
instruction 'Private-Package', privatePackages.toArray(new String[0])
|
||||
|
||||
instruction 'Bundle-Vendor', 'Hibernate.org'
|
||||
instruction 'Bundle-Description', osgiDescription()
|
||||
instruction 'Implementation-Url', 'http://hibernate.org'
|
||||
instruction 'Implementation-Version', version
|
||||
instruction 'Implementation-Vendor', 'Hibernate.org'
|
||||
|
|
|
@ -17,9 +17,3 @@ def pomName() {
|
|||
def pomDescription() {
|
||||
return 'Integration for c3p0 Connection pooling into Hibernate O/RM'
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
instruction 'Bundle-Description', 'Hibernate ORM C3P0'
|
||||
}
|
||||
}
|
|
@ -53,8 +53,6 @@ jar {
|
|||
manifest {
|
||||
mainAttributes( 'Main-Class': 'org.hibernate.Version' )
|
||||
|
||||
instruction 'Bundle-Description', 'Hibernate ORM Core'
|
||||
|
||||
instructionFirst 'Import-Package',
|
||||
'javax.security.auth;resolution:=optional',
|
||||
'javax.security.jacc;resolution:=optional',
|
||||
|
@ -77,11 +75,11 @@ jar {
|
|||
'org.apache.tools.ant.taskdefs;resolution:=optional',
|
||||
'org.apache.tools.ant.types;resolution:=optional'
|
||||
|
||||
// TODO: Uncomment once EntityManagerFactoryBuilderImpl no longer
|
||||
// uses ClassLoaderServiceImpl.
|
||||
instruction 'Export-Package',
|
||||
'org.hibernate.boot.registry.classloading.internal',
|
||||
'*'
|
||||
// // TODO: Uncomment once EntityManagerFactoryBuilderImpl no longer
|
||||
// // uses ClassLoaderServiceImpl.
|
||||
// instruction 'Export-Package',
|
||||
// 'org.hibernate.boot.registry.classloading.internal',
|
||||
// '*'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,9 +12,3 @@ def pomName() {
|
|||
def pomDescription() {
|
||||
return 'Integration for Ehcache into Hibernate as a second-level caching service'
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
instruction 'Bundle-Description', 'Hibernate ORM EHCache'
|
||||
}
|
||||
}
|
|
@ -45,8 +45,6 @@ def pomDescription() {
|
|||
|
||||
jar {
|
||||
manifest {
|
||||
instruction 'Bundle-Description', 'Hibernate ORM JPA Entity Manager'
|
||||
|
||||
// A cdi-api OSGi bundle does not currently exist. For now, explicitly
|
||||
// ignore its packages. This will only cause issues if an app tries
|
||||
// to use the BeanManagerListenerFactory functionality.
|
||||
|
|
|
@ -56,8 +56,6 @@ compileJava {
|
|||
|
||||
jar {
|
||||
manifest {
|
||||
instruction 'Bundle-Description', 'Hibernate ORM Envers'
|
||||
|
||||
instructionFirst 'Import-Package',
|
||||
// TODO: Shouldn't have to explicitly list the JPA packages, but
|
||||
// the plugin generates them with [1.0,2) versions.
|
||||
|
|
|
@ -48,9 +48,3 @@ task sourcesTestJar(type: Jar, dependsOn:classes) {
|
|||
|
||||
artifacts.archives packageTests
|
||||
artifacts.archives sourcesTestJar
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
instruction 'Bundle-Description', 'Hibernate ORM Infinispan'
|
||||
}
|
||||
}
|
|
@ -72,7 +72,6 @@ def pomDescription() {
|
|||
jar {
|
||||
manifest {
|
||||
instruction 'Bundle-Activator', 'org.hibernate.osgi.HibernateBundleActivator'
|
||||
instruction 'Bundle-Description', 'Hibernate ORM OSGi'
|
||||
|
||||
instructionFirst 'Import-Package',
|
||||
// TODO: Shouldn't have to explicitly list this, but the plugin
|
||||
|
|
|
@ -11,9 +11,3 @@ def pomName() {
|
|||
def pomDescription() {
|
||||
return 'Integration for Proxool Connection pooling into Hibernate O/RM'
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
instruction 'Bundle-Description', 'Hibernate ORM Proxool'
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue