Skip to content

Commit

Permalink
Create a commit hash for local builds as well (#2673) (#2674)
Browse files Browse the repository at this point in the history
(cherry picked from commit fbbc756)

Co-authored-by: Christoph Läubrich <[email protected]>
  • Loading branch information
github-actions[bot] and laeubi authored Jul 29, 2023
1 parent 28e50ee commit 0745514
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 0745514

Please sign in to comment.