Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a commit hash for local builds as well #2673

Merged
merged 1 commit into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}
Loading