changed gradle to insert automatic module name into manifest file and to link generated javadoc to java se 8

pull/11/head
Stefan Feuerhahn 6 years ago
parent 9aa85d1a90
commit 7c4961db5f

@ -32,7 +32,7 @@ configure(javaProjects) {
if (!project.properties.containsKey('cfgJavaVersion')) { if (!project.properties.containsKey('cfgJavaVersion')) {
project.ext { project.ext {
cfgJavaVersion = '1.8' cfgJavaVersion = '8'
} }
} }
@ -60,8 +60,10 @@ configure(javaProjects) {
} }
jar { jar {
inputs.property("moduleName", moduleName)
manifest { manifest {
version = project.version.replace("-", ".") version = project.version.replace("-", ".")
attributes('Automatic-Module-Name': moduleName)
} }
} }
@ -73,7 +75,7 @@ configure(javaProjects) {
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
doFirst { doFirst {
if (sourceCompatibility == '1.7' && System.env.JDK7_HOME != null) { if (sourceCompatibility == '7' && System.env.JDK7_HOME != null) {
options.fork = true options.fork = true
options.bootstrapClasspath = files("$System.env.JDK7_HOME/jre/lib/rt.jar") options.bootstrapClasspath = files("$System.env.JDK7_HOME/jre/lib/rt.jar")
} }
@ -127,6 +129,7 @@ configure(javaProjects) {
exclude "**/internal/**" exclude "**/internal/**"
exclude "**/java-gen/**" exclude "**/java-gen/**"
exclude "**/app/**" exclude "**/app/**"
options.links "https://docs.oracle.com/javase/$cfgJavaVersion/docs/api/"
} }
} }
@ -206,6 +209,8 @@ task javadocAll(type: Javadoc) {
classpath += files(distributionProjects.collect { project -> classpath += files(distributionProjects.collect { project ->
project.sourceSets.main.output project.sourceSets.main.output
}) })
options.links "https://docs.oracle.com/javase/$cfgJavaVersion/docs/api/"
} }
tasks.withType(Tar) { tasks.withType(Tar) {

@ -76,6 +76,8 @@ dependencies {
runtimeOnly group: "ch.qos.logback", name: "logback-classic", version: "1.2.3" runtimeOnly group: "ch.qos.logback", name: "logback-classic", version: "1.2.3"
} }
ext.moduleName = 'com.beanit.openiec61850'
jar { jar {
bnd("Bundle-Name": "OpenIEC61850", bnd("Bundle-Name": "OpenIEC61850",
"Bundle-SymbolicName": "com.beanit.openiec61850", "Bundle-SymbolicName": "com.beanit.openiec61850",

Loading…
Cancel
Save