Skip to content

Commit c97c9cd

Browse files
marko-bekhtasebersole
authored andcommitted
#137 Add automatic module name to the manifest
1 parent abdcefc commit c97c9cd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

buildSrc/src/main/groovy/published-java-module.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ java {
1616
withSourcesJar()
1717
}
1818

19+
def moduleNameBase = project.name.startsWith( 'hibernate-' ) ? name.drop( 'hibernate-'.length() ): name
20+
def moduleName = "org.hibernate.$moduleNameBase".replace('-','.')
21+
22+
tasks.named("jar") {
23+
manifest {
24+
attributes(
25+
'Automatic-Module-Name': moduleName
26+
)
27+
}
28+
}
29+
1930
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2031
// Javadoc
2132
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)