Skip to content
Snippets Groups Projects
Commit 666c06eb authored by Powers, Peter M.'s avatar Powers, Peter M.
Browse files

build edits

parent c91e7477
No related branches found
No related tags found
1 merge request!242To gradle build 240
......@@ -2,7 +2,11 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="classes"/>
</classpath>
.settings
.gradle
bin
build
classes
dist
docs
tmp
build
curves*/
eq-prob*/
eq-rate*/
Scratch*.java
nshmp-haz-log*
src/META-INF
cobertura.ser
......@@ -5,6 +5,11 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
......@@ -15,9 +20,16 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
</natures>
</projectDescription>
......@@ -40,6 +40,7 @@ ext {
projectName = 'nshmp-haz'
gitTag = 'git describe --tags'.execute().text.replace('\n', '') ?: 'unknown'
gitLink = '<a href="https://github.com/usgs/nshmp-haz">' + gitTag +'</a>'
propsPath = '/resources/main/app.properties'
docTitle = projectName + ': ' + gitLink
docFooter = '<div style="float: left; font-size: 16px; text-align: right; ' +
'padding: 10px; width: 100%; box-sizing: border-box; background-color: #f9f9f9">' +
......@@ -89,27 +90,26 @@ javadoc {
}
/*
* Enhance the jar task to build a fat jar and add application
* version to a properties file. Note that 'git describe' only
* works when running gradle from the command line.
* Enhance the jar task to build a fat jar if running the build
* directly and add application version to a properties file.
* Note that 'git describe' only works when running gradle from
* the command line.
*/
jar {
doFirst {
/* fat jar */
from {
configurations.compile.collect {
/* possible fat jar */
if (rootProject.name == projectName) {
from { configurations.compile.collect {
it.isDirectory() ? it : zipTree(it).matching {
exclude {
it.path.contains('META-INF')
}
exclude { it.path.contains('META-INF') }
}
}
}}
}
/* record app version */
def props = new Properties()
def propsFile = new File(project.buildDir.toString() + '/resources/main/app.properties')
def propsFile = new File(project.buildDir.toString() + propsPath)
propsFile.createNewFile()
props.setProperty('app.version', gitTag)
props.store(propsFile.newWriter(), null)
......
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