Skip to content

Commit

Permalink
add projectName
Browse files Browse the repository at this point in the history
  • Loading branch information
ar committed May 15, 2022
1 parent e4e5a68 commit 2fed21e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions jpos-app.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,12 @@ class GitRevisionTask extends DefaultTask

@InputFile @Optional
File getRefFile() {
File rf = new File(gitHead.parent,gitHead.text.replace('ref: ', '').trim())
return rf.exists() ? rf : gitHead
if (gitHead != null) {
File rf = new File(gitHead.parent,gitHead.text.replace('ref: ', '').trim())
return rf.exists() ? rf : gitHead
} else {
return gitHead
}
}

@OutputFile
Expand Down Expand Up @@ -229,6 +233,7 @@ class BuildTimestampTask extends DefaultTask {
public void writeFile() {
new File(outputFile.parent).mkdirs()
Properties props=new Properties()
props.put("projectName", project.name);
props.put("version", project.version);
props.put("buildTimestamp", new Date().format("yyyy-MM-dd HH:mm:ss z"));
props.store(new FileOutputStream(outputFile),"Revision Properties")
Expand Down

0 comments on commit 2fed21e

Please sign in to comment.