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

Update the build version information file. #237

Merged
merged 1 commit into from
Jan 17, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
package com.unboundid.scim2.common.utils;


import com.unboundid.scim2.common.annotations.NotNull;
import com.unboundid.scim2.common.annotations.Nullable;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;



/**
* This class provides information about the current set of version definitions.
* This class provides information about the build version.
*/
public final class Version
{
Expand All @@ -32,15 +31,13 @@ public final class Version
public static final String PRODUCT_NAME = "@PRODUCT_NAME@";



/**
* The short product name for the @SHORT_NAME@ library. This will not have
* any spaces. For this build, the value is "@SHORT_NAME@".
* The short product name for the @SHORT_NAME@ library. This will not
* have any spaces. For this build, the value is "@SHORT_NAME@".
*/
public static final String SHORT_NAME = "@SHORT_NAME@";



/**
* The version string for the @SHORT_NAME@ library.
* For this build, the value is "@VERSION@".
Expand All @@ -56,37 +53,35 @@ public final class Version


/**
* The Subversion path associated with the build root directory from which
* this build of the @SHORT_NAME@ was generated. It may be an absolute local
* filesystem path if the Subversion path isn't available at build time.
* For this build, the value is "@GIT_PATH@".
* The Git branch associated with the build root directory from which this
* build of the @SHORT_NAME@ was generated. For this build, the value is
* "@GIT_PATH@".
*/
public static final String REPOSITORY_PATH = "@GIT_PATH@";


/**
* The source revision number from which this build of the @SHORT_NAME@ was
* generated. It may be -1 if the Subversion revision isn't available at
* build time. For this build, the value is @GIT_REVISION@.
* The source revision number from which this build of the @SHORT_NAME@
* was generated. For this build, the value is
* "@GIT_REVISION@".
*/
public static final String REVISION_NUMBER = "@GIT_REVISION@";
public static final String REVISION_NUMBER =
"@GIT_REVISION@";


/**
* The full version string for the @SHORT_NAME@ library. For this build,
* the value is "@PRODUCT_NAME@ @VERSION@".
*/
public static final String FULL_VERSION_STRING =
PRODUCT_NAME + ' ' + VERSION;

public static final String FULL_VERSION_STRING = PRODUCT_NAME + ' ' + VERSION;


/**
* The short version string for the @SHORT_NAME@ library. This will not
* have any spaces. For this build, the value is "@SHORT_NAME@-@VERSION@".
* have any spaces. For this build, the value is
* "@SHORT_NAME@-@VERSION@".
*/
public static final String SHORT_VERSION_STRING =
SHORT_NAME + '-' + VERSION;
public static final String SHORT_VERSION_STRING = SHORT_NAME + '-' + VERSION;



Expand All @@ -103,14 +98,11 @@ public final class Version
/**
* Prints version information from this class to standard output.
*
* @param args The command-line arguments provided to this program.
* @param args The command-line arguments provided to this program.
*/
public static void main(final String... args)
public static void main(@Nullable final String... args)
{
for (final String line : getVersionLines())
{
System.out.println(line);
}
getVersionLines().forEach(System.out::println);
}


Expand All @@ -119,22 +111,20 @@ public final class Version
* Retrieves a list of lines containing information about the @SHORT_NAME@
* library version.
*
* @return A list of lines containing information about the @SHORT_NAME@
* library version.
* @return The list of product information lines.
*/
@NotNull
public static List<String> getVersionLines()
{
final ArrayList<String> versionLines = new ArrayList<String>(11);

versionLines.add("Full Version String: " + FULL_VERSION_STRING);
versionLines.add("Short Version String: " + SHORT_VERSION_STRING);
versionLines.add("Product Name: " + PRODUCT_NAME);
versionLines.add("Short Name: " + SHORT_NAME);
versionLines.add("Version: " + VERSION);
versionLines.add("Timestamp: " + BUILD_TIMESTAMP);
versionLines.add("Repository Path: " + REPOSITORY_PATH);
versionLines.add("Revision Number: " + REVISION_NUMBER);

return Collections.unmodifiableList(versionLines);
return List.of(
"Full Version String: " + FULL_VERSION_STRING,
"Short Version String: " + SHORT_VERSION_STRING,
"Product Name: " + PRODUCT_NAME,
"Short Name: " + SHORT_NAME,
"Version: " + VERSION,
"Timestamp: " + BUILD_TIMESTAMP,
"Repository Path: " + REPOSITORY_PATH,
"Revision Number: " + REVISION_NUMBER
);
}
}
Loading