I configured my JVx application for using reactUI and saw that there are nightly builds. I want to update my application automatically with latest nightly build. Is there an ant task for this use-case? I’m using ant to build my application.
>Solution :
With some help of ChatGPT:
<target name="start.updateReactUI.nightly" description="Updates reactUI with nightly build">
<tstamp>
<format property="datepattern" pattern="dd_MM_yyyy"/>
<!--
one day earlier
<format property="datepattern" pattern="dd_MM_yyyy" offset="-1" unit="day" />
-->
</tstamp>
<get src="https://github.com/sibvisions/reactUI/releases/download/build-${datepattern}/reactBuild_${datepattern}.zip" dest="${build}/nightly.zip" usetimestamp="true"/>
<delete file="${build}/nightly" />
<unzip src="${build}/nightly.zip" dest="${build}/nightly">
<!-- extract sub directory -->
<patternset>
<include name="build/*"/>
</patternset>
<mapper>
<globmapper from="build/*" to="*"/>
</mapper>
</unzip>
<!-- Delete old files -->
<delete includeEmptyDirs="true">
<fileset dir="${based}/WebContent/ui">
<!-- keep css of project -->
<exclude name="*.css"/>
<exclude name="favicon.ico"/>
</fileset>
</delete>
<!-- Copy new files -->
<copy todir="${based}/WebContent/ui">
<fileset dir="${build}/nightly">
<!-- ignore css of build -->
<exclude name="*.css" />
<exclude name="favicon.ico" />
</fileset>
</copy>
</target>
But be careful, because there are no nightly builds on Saturday or Sunday, but the date is one day ahead! Saturday build is with source code of Friday. No build on Sunday and Monday. The Tuesday build is with source code of Monday. Looks like they build after midnight.