Skip to content

Commit

Permalink
Create a commit hash for local builds as well (#2673)
Browse files Browse the repository at this point in the history
  • Loading branch information
laeubi committed Jul 28, 2023
1 parent 713fe84 commit fbbc756
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
17 changes: 17 additions & 0 deletions tycho-spi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,23 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public class TychoVersion {

private static final String TYCHO_SCM = readVersion("scm");

private static final String TYCHO_BUILDNUMBER = readVersion("buildNumber");

private static final String BND_VERSION = readVersion("bnd");

private static Properties PROPERTIES;
Expand All @@ -36,7 +38,11 @@ public static String getBndVersion() {

public static String getSCMInfo() {
if ("${env.GIT_COMMIT}".equals(TYCHO_SCM)) {
return "local build";
if ("${buildNumber}".equals(TYCHO_BUILDNUMBER)) {
//no way then...
return "local build";
}
return TYCHO_BUILDNUMBER;
}
return TYCHO_SCM;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ version=${project.version}
bnd=${bnd.version}
scm=${env.GIT_COMMIT}
url=${env.GIT_URL}
branch=${env.GIT_BRANCH}
branch=${env.GIT_BRANCH}
scmBranch=${scmBranch}
buildNumber=${buildNumber}

0 comments on commit fbbc756

Please sign in to comment.