Skip to content
This repository has been archived by the owner on Mar 24, 2020. It is now read-only.

Commit

Permalink
build script works with latest gradle release 6.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
miho committed Mar 15, 2020
1 parent b257600 commit a90ce28
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 73 deletions.
66 changes: 13 additions & 53 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ plugins {
// id 'org.gradle.java.experimental-jigsaw' version '0.1.1'
}

apply from: 'gradle/publishing.gradle'
ext.mainClassName = 'eu.mihosoft.freerouting.gui.MainApplication'

wrapper {
gradleVersion = '6.2'
Expand All @@ -46,10 +46,6 @@ if (JavaVersion.current().isJava8Compatible()) {
}
}


mainClassName = 'eu.mihosoft.freerouting.gui.MainApplication'


repositories {
mavenCentral()
jcenter()
Expand All @@ -61,64 +57,30 @@ dependencies {
// https://mvnrepository.com/artifact/javax.help/javahelp
compile group: 'javax.help', name: 'javahelp', version: '2.0.05'

// compile files("./lib/eu.mihosoft.freerouting.deps.jh.jar")

compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.13.0'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.13.0'
}

// ext.moduleName = 'eu.mihosoft.freerouting'
// javaModule.name = 'eu.mihosoft.freerouting'
//
//compileJava {
// inputs.property("moduleName", moduleName)
// doFirst {
//
// System.err.println(": modulepath-jar: " + classpath.asPath)
//
// options.compilerArgs = [
// '--module-path', classpath.asPath,
// ]
// classpath = files()
// }
//}

Date buildTimeAndDate = new Date()
ext {
buildDate = new java.text.SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
buildTime = new java.text.SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
}

// create a fat-jar (class files plus dependencies
// excludes VRL.jar (plugin jar files must not start with 'vrl-\\d+')
jar {


// TODO add switch for fat-jar generation
// dependencies except VRL
// from configurations.runtime.asFileTree.
// filter({file->return !file.name.startsWith("vrl-0")}).
// files.collect { zipTree(it) }
//
// from configurations.runtime.asFileTree.files.collect { zipTree(it) }

// // project class files compiled from source
// from files(sourceSets.main.output)

manifest {

attributes(
'Automatic-Module-Name': 'eu.mihosoft.freerouting',
'Built-By': System.properties['user.name'],
'Created-By': System.properties['java.version'] + " (" + System.properties['java.vendor'] + " " + System.properties['java.vm.version'] + ")",
'Build-Date': project.buildDate,
'Build-Time': project.buildTime,
'Build-Revision': versioning.info.commit,
'Specification-Title': project.name,
'Specification-Version': project.version,
'Implementation-Title': project.name,
'Implementation-Version': project.version
// ,'Main-Class': mainClass
'Automatic-Module-Name': 'eu.mihosoft.freerouting',
'Built-By': System.properties['user.name'],
'Created-By': System.properties['java.version'] + " (" + System.properties['java.vendor'] + " " + System.properties['java.vm.version'] + ")",
'Build-Date': project.buildDate,
'Build-Time': project.buildTime,
'Build-Revision': versioning.info.commit,
'Specification-Title': project.name,
'Specification-Version': project.version,
'Implementation-Title': project.name,
'Implementation-Version': project.version
)
}
}
Expand Down Expand Up @@ -148,9 +110,7 @@ task executableJar(type: Jar) {
}
}

artifacts {
archives executableJar
}
apply from: 'gradle/publishing.gradle'


//license {
Expand All @@ -171,7 +131,7 @@ artifacts {
task run(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath

main = mainClass
main = mainClassName

// arguments to pass to the application
// args 'appArg1'
Expand Down
27 changes: 7 additions & 20 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,19 @@ task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
}

artifacts {
archives jar
archives javadocJar
archives sourcesJar
}

Date buildTimeAndDate = new Date()
ext {
buildDate = new java.text.SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
buildTime = new java.text.SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
}

jar {
manifest {
attributes(
'Built-By': System.properties['user.name'],
'Created-By': System.properties['java.version'] + " (" + System.properties['java.vendor'] + " " + System.properties['java.vm.version'] + ")",
'Build-Date': project.buildDate,
'Build-Time': project.buildTime,
'Build-Revision': versioning.info.commit,
'Specification-Title': project.name,
'Specification-Version': project.version,
'Implementation-Title': project.name,
'Implementation-Version': project.version
)
}

artifacts {
archives jar
archives javadocJar
archives sourcesJar

archives executableJar
}


Expand Down

0 comments on commit a90ce28

Please sign in to comment.