Skip to content

Commit

Permalink
Addressing mike's comment
Browse files Browse the repository at this point in the history
  • Loading branch information
David Marginian committed May 23, 2020
1 parent a11f0b6 commit d542039
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,9 @@

<!-- Get build number from Github CI -->
<property environment="envgithub"/>

<!-- Updates version-properties with a build number if this is a CI run -->
<target name="updateVersionPropertiesWithBuildNumber">
<if>
<isset property="envgithub.GITHUB_RUN_ID" />
<then>
<propertyfile file="${target.root}/classes/main/dwr-version.properties">
<entry key="build.number" value="${envgithub.GITHUB_RUN_ID}" />
</propertyfile>
</then>
</if>
</target>
<condition property="build.number" value="${envgithub.GITHUB_RUN_ID}">
<isset property="envgithub.GITHUB_RUN_ID" />
</condition>

<target name="init">
<mkdir dir="${build}" />
Expand Down Expand Up @@ -90,10 +81,23 @@
<replace casesensitive="false" file="target/pom.xml" token="{version}" value="${version}" />
</target>

<!-- Updates the build number in dwr-version.properties with the build number from CI -->
<target name="updateVersionPropertiesWithBuildNumber" description="Update dwr-version.properties with CI build number.">
<if>
<isset property="build.number" />
<then>
<propertyfile file="${target.root}/classes/main/dwr-version.properties">
<entry key="build.number" value="${build.number}" />
</propertyfile>
</then>
</if>
</target>

<!--=======================================================================-->
<target name="jar" depends="prepare, source" description="Create dwr.jar">
<build target="${target.root}" include="" modules="${modules}" />
<antcall target="setVersionInPom" />
<antcall target="updateVersionPropertiesWithBuildNumber" />
<jar destfile="${target.root}/dwr.jar" compress="true">
<fileset dir="${target.root}/classes/main" />
</jar>
Expand Down

0 comments on commit d542039

Please sign in to comment.