Add version information.
This commit is contained in:
parent
e1b52da239
commit
7a3ae1d381
3 changed files with 26 additions and 4 deletions
|
|
@ -2,13 +2,11 @@ buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
}
|
}
|
||||||
dependencies {
|
|
||||||
classpath 'org.ajoberstar.grgit:grgit-gradle:4.1.0'
|
|
||||||
classpath 'org.ajoberstar:gradle-git-publish:3.0.0'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
|
id 'org.ajoberstar.grgit' version '5.2.0'
|
||||||
|
id 'org.ajoberstar.git-publish' version '4.2.0'
|
||||||
id 'pl.allegro.tech.build.axion-release' version '1.15.0' apply false
|
id 'pl.allegro.tech.build.axion-release' version '1.15.0' apply false
|
||||||
id 'org.jdrupes.vmoperator.java-doc-conventions'
|
id 'org.jdrupes.vmoperator.java-doc-conventions'
|
||||||
id 'eclipse'
|
id 'eclipse'
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,9 @@ plugins {
|
||||||
|
|
||||||
// Apply eclipse plugin
|
// Apply eclipse plugin
|
||||||
id 'eclipse'
|
id 'eclipse'
|
||||||
|
|
||||||
|
// Access to git information
|
||||||
|
id 'org.ajoberstar.grgit'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|
@ -66,6 +69,22 @@ scmVersion {
|
||||||
version = scmVersion.version
|
version = scmVersion.version
|
||||||
ext.isSnapshot = version.endsWith('-SNAPSHOT')
|
ext.isSnapshot = version.endsWith('-SNAPSHOT')
|
||||||
|
|
||||||
|
jar {
|
||||||
|
manifest {
|
||||||
|
inputs.property("gitDescriptor", { grgit.describe(always: true) })
|
||||||
|
|
||||||
|
// Set Git revision information in the manifests of built bundles
|
||||||
|
attributes([
|
||||||
|
"Implementation-Title": project.name,
|
||||||
|
"Implementation-Version": "$project.version (${grgit.describe(always: true)})",
|
||||||
|
"Implementation-Vendor": grgit.repository.jgit.repository.config.getString("user", null, "name")
|
||||||
|
+ " (" + grgit.repository.jgit.repository.config.getString("user", null, "email") + ")",
|
||||||
|
"Git-Descriptor": grgit.describe(always: true),
|
||||||
|
"Git-SHA": grgit.head().id,
|
||||||
|
])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
eclipse {
|
eclipse {
|
||||||
|
|
||||||
project {
|
project {
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,8 @@ import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.util.logging.LogManager;
|
import java.util.logging.LogManager;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.apache.commons.cli.CommandLine;
|
import org.apache.commons.cli.CommandLine;
|
||||||
import org.apache.commons.cli.CommandLineParser;
|
import org.apache.commons.cli.CommandLineParser;
|
||||||
import org.apache.commons.cli.DefaultParser;
|
import org.apache.commons.cli.DefaultParser;
|
||||||
|
|
@ -106,6 +108,9 @@ public class Operator extends Component {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
|
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
Logger.getLogger(Operator.class.getName())
|
||||||
|
.fine(() -> "Version: "
|
||||||
|
+ Operator.class.getPackage().getImplementationVersion());
|
||||||
CommandLineParser parser = new DefaultParser();
|
CommandLineParser parser = new DefaultParser();
|
||||||
// parse the command line arguments
|
// parse the command line arguments
|
||||||
final Options options = new Options();
|
final Options options = new Options();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue