HHH-8733 removed sourceSet handling in OSGi manifest generation

This commit is contained in:
Brett Meyer 2013-11-26 13:03:51 -05:00
parent d1023821b1
commit ee5f5b3c69
1 changed files with 1 additions and 33 deletions

View File

@ -213,36 +213,7 @@ subprojects { subProject ->
task generateSources(type: Task)
jar {
// 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'
]
SortedSet<String> exportPackages = new TreeSet<String>()
SortedSet<String> privatePackages = new TreeSet<String>()
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 {
manifest = osgiManifest {
// GRADLE-1411: Even if we override Imports and Exports
// auto-generation with instructions, classesDir and classpath
// need to be here (temporarily).
@ -258,9 +229,6 @@ subprojects { subProject ->
// If it exists more than once, the manifest will physically contain a *.
'*'
instruction 'Export-Package', exportPackages.toArray(new String[0])
instruction 'Private-Package', privatePackages.toArray(new String[0])
instruction 'Bundle-Vendor', 'Hibernate.org'
instruction 'Bundle-Description', osgiDescription()
instruction 'Implementation-Url', 'http://hibernate.org'