Skip to content
Snippets Groups Projects
Commit 2e2dfc10 authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

switch to jar task

parent 287d64a1
No related branches found
No related tags found
1 merge request!266Report Version
import groovy.json.JsonOutput
plugins { plugins {
id "com.diffplug.spotless" id "com.diffplug.spotless"
id "com.github.spotbugs" id "com.github.spotbugs"
...@@ -40,6 +42,15 @@ java { ...@@ -40,6 +42,15 @@ java {
withSourcesJar() withSourcesJar()
} }
jar {
doFirst {
def versionPath = "/resources/main/version.json"
def versionFile = new File(project.buildDir.toString() + versionPath)
def details = versionDetails()
versionFile.write(JsonOutput.prettyPrint(JsonOutput.toJson(details)))
}
}
javadoc { javadoc {
def docTitle = "<a href=\"https://code.usgs.gov/ghsc/nshmp/nshmp-lib.git\">${project.name}</a>" def docTitle = "<a href=\"https://code.usgs.gov/ghsc/nshmp/nshmp-lib.git\">${project.name}</a>"
options.setUse(true) options.setUse(true)
...@@ -60,10 +71,6 @@ javadoc { ...@@ -60,10 +71,6 @@ javadoc {
exclude "gov/usgs/earthquake/nshmp/internal/**" exclude "gov/usgs/earthquake/nshmp/internal/**"
} }
jar {
finalizedBy("version")
}
// temporary task to support local running of lib while developing // temporary task to support local running of lib while developing
// model parsing classes; TODO remove when parser is stable // model parsing classes; TODO remove when parser is stable
task fatJar(type: Jar) { task fatJar(type: Jar) {
......
import groovy.json.JsonOutput
apply plugin: "com.palantir.git-version"
task version() {
doLast {
def versionPath = "/resources/main/version.json"
def versionFile = new File(project.buildDir.toString() + versionPath)
def details = versionDetails()
versionFile.write(JsonOutput.prettyPrint(JsonOutput.toJson(details)))
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment