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