[#2003] Generate a io.netty.util.Version class which holds the version
This commit is contained in:
parent
a01f246091
commit
75280ac6e3
2
.gitignore
vendored
2
.gitignore
vendored
@ -11,4 +11,6 @@
|
||||
/reports
|
||||
*/reports
|
||||
.DS_Store
|
||||
/common/src/main/java/io/netty/util/Version.java
|
||||
|
||||
|
||||
|
@ -74,6 +74,64 @@
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>write-version</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<tasks>
|
||||
<taskdef resource="net/sf/antcontrib/antlib.xml" />
|
||||
<exec executable="git" outputproperty="gitOutput" resultproperty="gitExitCode" failonerror="false" failifexecutionfails="false">
|
||||
<arg value="log" />
|
||||
<arg value="-1" />
|
||||
<arg value="--format=format:%h" />
|
||||
</exec>
|
||||
<if>
|
||||
<equals arg2="0" arg1="${gitExitCode}" />
|
||||
<then>
|
||||
<property name="buildNumber" value="${gitOutput}" />
|
||||
</then>
|
||||
<else>
|
||||
<property name="buildNumber" value="unknown" />
|
||||
</else>
|
||||
</if>
|
||||
<echo>Build number: ${buildNumber}</echo>
|
||||
<mkdir dir="${project.build.directory}" />
|
||||
<echo message="${project.version}" file="${project.build.directory}/version.txt" />
|
||||
<echo message="// DO NOT MODIFY - WILL BE OVERWRITTEN DURING THE BUILD PROCESS${line.separator}package io.netty.util;${line.separator}/**${line.separator} * Provides the version information of Netty.${line.separator} * @apiviz.landmark${line.separator} */${line.separator}@SuppressWarnings("all")${line.separator}public final class Version {${line.separator} /** The version identifier. */${line.separator} public static final String ID = "${project.version}-${buildNumber}";${line.separator} /** Prints out the version identifier to stdout. */${line.separator} public static void main(String[] args) { System.out.println(ID); }${line.separator} private Version() { }${line.separator}}${line.separator}" file="${basedir}/src/main/java/io/netty/util/Version.java" />
|
||||
</tasks>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.ant</groupId>
|
||||
<artifactId>ant</artifactId>
|
||||
<version>1.8.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.ant</groupId>
|
||||
<artifactId>ant-launcher</artifactId>
|
||||
<version>1.8.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ant-contrib</groupId>
|
||||
<artifactId>ant-contrib</artifactId>
|
||||
<version>1.0b3</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>ant</groupId>
|
||||
<artifactId>ant</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
13
pom.xml
13
pom.xml
@ -530,6 +530,19 @@
|
||||
<configuration>
|
||||
<lifecycleMappingMetadata>
|
||||
<pluginExecutions>
|
||||
<pluginExecution>
|
||||
<pluginExecutionFilter>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<versionRange>[1.7,)</versionRange>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</pluginExecutionFilter>
|
||||
<action>
|
||||
<ignore />
|
||||
</action>
|
||||
</pluginExecution>
|
||||
<pluginExecution>
|
||||
<pluginExecutionFilter>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
Loading…
Reference in New Issue
Block a user