Skip to content

Commit 5c71003

Browse files
committed
feat: add version format placeholder for dirty flag
1 parent 4c27543 commit 5c71003

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ gitVersioning.apply {
171171
- The `HEAD` commit timestamp formatted as `yyyyMMdd.HHmmss`
172172
- e.g. '20190616.161442'
173173

174+
- `${dirty}`
175+
- A dirty flag indicator
176+
- resolves to '-DIRTY' if repo is in dirty state, empty string otherwise
177+
174178
- `Pattern Groups`
175179
- Contents of group in the regex pattern can be addressed by `group name` or `group index` e.g.
176180
- Named Group Example

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ plugins {
1212
}
1313

1414
group 'me.qoomon'
15-
version '2.0.0'
15+
version '2.1.0'
1616

1717
sourceCompatibility = JavaVersion.VERSION_1_8
1818
targetCompatibility = JavaVersion.VERSION_1_8
@@ -22,7 +22,7 @@ repositories {
2222
}
2323

2424
dependencies {
25-
implementation 'me.qoomon:git-versioning:0.1.0'
25+
implementation 'me.qoomon:git-versioning:0.2.0'
2626
implementation 'org.apache.maven:maven-artifact:3.6.0'
2727
implementation 'me.qoomon:unchecked-exceptions:1.0.0'
2828
implementation 'com.google.guava:guava:27.0.1-jre'

src/main/java/me/qoomon/gradle/gitversioning/GitVersioningPluginExtension.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public void apply(GitVersioningPluginConfig config) {
9292
extraProperties.set("git.commit.timestamp.datetime", toTimestampDateTime(gitVersionDetails.getCommitTimestamp()));
9393
extraProperties.set("git.ref", gitVersionDetails.getCommitRefName());
9494
extraProperties.set("git." + gitVersionDetails.getCommitRefType(), gitVersionDetails.getCommitRefName());
95+
extraProperties.set("git.dirty", Boolean.toString(!gitVersionDetails.isClean()));
9596
});
9697
}
9798

0 commit comments

Comments
 (0)