pom.xml | 222 +++++++++++++++++----------------------------------------------- 1 file changed, 60 insertions(+), 162 deletions(-)
New commits: commit d117801bace88188e1110aa01b42143a19fcd8e0 Author: Simeon Pinder spinder@redhat.com Date: Mon Nov 7 11:04:10 2011 -0500
moving build number logic out of profiles and back into core build since brew now supports access to git exe.
diff --git a/pom.xml b/pom.xml index 1a37703..07d4984 100644 --- a/pom.xml +++ b/pom.xml @@ -912,11 +912,49 @@ </plugin> -->
- <plugin> + <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> + <execution> + <id>write-build-properties-file</id> + <goals> + <goal>run</goal> + </goals> + <phase>generate-sources</phase> + <configuration> + <tasks> + <mkdir dir="target" /> + + <tstamp> + <format property="buildTime" pattern="MM/dd/yy hh:mm aa z" locale="en,US" timezone="GMT" /> + </tstamp> + <echo file="target/build.properties">buildTime = ${buildTime}${line.separator}</echo> + + <exec executable="git" outputproperty="buildNumber" failonerror="false" failifexecutionfails="false"> + <arg value="log"/> + <arg value="--pretty=format:%h"/> + <arg value="-n1"/> + </exec> + <echo file="target/build.properties" append="true">buildNumber = ${buildNumber}${line.separator}</echo> + </tasks> + </configuration> + </execution>
- <execution> + <execution> + <id>echo-build-properties</id> + <phase>compile</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <tasks> + <echo level="debug">buildTime = ${buildTime}</echo> + <echo level="debug">buildNumber = ${buildNumber}</echo> + </tasks> + </configuration> + </execution> + + <execution> <id>javadoc-dist</id> <phase>site</phase> <inherited>false</inherited> @@ -931,9 +969,28 @@ <goal>run</goal> </goals> </execution> + </executions> + </plugin>
+ <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>properties-maven-plugin</artifactId> + <executions> + <execution> + <id>read-build-properties-file</id> + <phase>process-sources</phase> + <goals> + <goal>read-project-properties</goal> + </goals> + <configuration> + <files> + <file>${project.build.directory}/build.properties</file> + </files> + <quiet>true</quiet> + </configuration> + </execution> </executions> - </plugin> + </plugin>
</plugins>
@@ -1181,165 +1238,6 @@ </build> </profile>
- <!-- These plugins i)need to be active by default - ii)need to be in a profile so that deactivation is possible for brew builds - - Profile activation for 'build-properties' and 'brew-generate-build-number' need to be mutually exclusive. - --> - <profile> - <id>build-properties</id> - <activation> - <file> - <exists>.git</exists> - </file> - </activation> - <build> - <plugins> - <plugin> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <id>write-build-properties-file</id> - <goals> - <goal>run</goal> - </goals> - <phase>generate-sources</phase> - <configuration> - <tasks> - <mkdir dir="target" /> - - <tstamp> - <format property="buildTime" pattern="MM/dd/yy hh:mm aa z" locale="en,US" timezone="GMT" /> - </tstamp> - <echo file="${product.buildPropertiesFile}">buildTime = ${buildTime}${line.separator}</echo> - - <exec executable="git" outputproperty="buildNumber" failonerror="false" failifexecutionfails="false"> - <arg value="log" /> - <arg value="--pretty=format:%h" /> - <arg value="-n1" /> - </exec> - <echo file="${product.buildPropertiesFile}" append="true">buildNumber = ${buildNumber}${line.separator}</echo> - </tasks> - </configuration> - </execution> - - <execution> - <id>echo-build-properties</id> - <phase>compile</phase> - <goals> - <goal>run</goal> - </goals> - <configuration> - <tasks> - <echo level="debug">buildTime = ${buildTime}</echo> - <echo level="debug">buildNumber = ${buildNumber}</echo> - </tasks> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <!-- NOTE: Version 1.2 of this plugin appears to be broken, so do not - upgrade to that version. --> - <version>1.1</version> - </plugin> - - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>properties-maven-plugin</artifactId> - <executions> - <execution> - <id>read-build-properties-file</id> - <phase>process-sources</phase> - <goals> - <goal>read-project-properties</goal> - </goals> - <configuration> - <files> - <file>${product.buildPropertiesFile}</file> - </files> - <quiet>true</quiet> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - - <!-- Profile activated when -Dbrew=true passed in. Profile activation for 'build-properties' and 'brew-generate-build-number' - need to be mutually exclusive. --> - <profile> - <id>brew-generate-build-number</id> - <activation> - <property> - <name>brew</name> - </property> - </activation> - <build> - <plugins> - <plugin> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <id>write-build-properties-file</id> - <goals> - <goal>run</goal> - </goals> - <phase>generate-sources</phase> - <configuration> - <tasks> - <tstamp> - <format property="buildTime" pattern="MM/dd/yy hh:mm aa z" locale="en,US" - timezone="GMT"/> - </tstamp> - <mkdir dir="target"/> - <echo file="${product.buildPropertiesFile}">buildTime = ${buildTime}${line.separator}</echo> - <echo file="${product.buildPropertiesFile}" append="true">buildNumber = ${rhq.build.number}${line.separator}</echo> - </tasks> - </configuration> - </execution> - - <execution> - <id>echo-build-properties</id> - <phase>compile</phase> - <inherited>false</inherited> - <goals> - <goal>run</goal> - </goals> - <configuration> - <tasks> - <echo level="debug">buildTime = ${buildTime}</echo> - <echo level="debug">buildNumber = ${rhq.build.number}</echo> - </tasks> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>properties-maven-plugin</artifactId> - <executions> - <execution> - <id>read-build-properties</id> - <phase>process-sources</phase> - <goals> - <goal>read-project-properties</goal> - </goals> - <configuration> - <files> - <file>${product.buildPropertiesFile}</file> - </files> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - </profiles>
rhq-commits@lists.fedorahosted.org