Ant: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(7 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
</source> | </source> | ||
==Checksum== | |||
<source lang="xml"> | <source lang="xml"> | ||
<checksum file="${build.dir}/${jarname}.jar" algorithm="md5" property="jarname.jar.md5" /> | <checksum file="${build.dir}/${jarname}.jar" algorithm="md5" property="jarname.jar.md5" /> | ||
Line 11: | Line 12: | ||
<checksum file="${build.dir}/${jarname}.jar" algorithm="md5" fileext="md5" /> | <checksum file="${build.dir}/${jarname}.jar" algorithm="md5" fileext="md5" /> | ||
<checksum file="${build.dir}/${jarname}.jar" algorithm="sha1" fileext="sha1"/> | <checksum file="${build.dir}/${jarname}.jar" algorithm="sha1" fileext="sha1"/> | ||
</source> | |||
==DateTime== | |||
<source lang="xml"> | |||
<tstamp> | |||
<format property="built.on" pattern="EEE, MMM dd yyyy, HH:mm Z" locale="en,GB"/> | |||
</tstamp> | |||
</source> | |||
==Filtering== | |||
<source lang="xml"> | |||
<filter token="built.on" value="${built.on}"/> | |||
<copy todir="${target.vendor.antrun.dir}" filtering="true"> | |||
<filelist dir="${ext.app.vendor.antrun.dir}"> | |||
<file name="header.js"/> | |||
</filelist> | |||
</copy> | |||
</source> | |||
==Replace== | |||
<source lang="xml"> | |||
<replace dir="${src}" value="["app.js","d41e83413e1a73b46c799124dadab883"]"> | |||
<include name="service-worker.js"/> | |||
<replacetoken><![CDATA["app.js","d41e83413e1a73b46c799124dadab883"]]></replacetoken> | |||
</replace> | |||
</source> | |||
==Replace RexExp== | |||
<source lang="xml"> | |||
<replaceregexp match="\s+" replace=" " flags="g" byline="true"> | |||
<fileset dir="${ext.app.build.dir}" includes="**/*.html"/> | |||
</replaceregexp> | |||
</source> | |||
<source lang="xml"> | |||
<replaceregexp match="((\["app.js","){1}([a-z0-9]{32})("\]){1})" | |||
replace="["app.js","c9ce971e28fa90ec960ef343ef10e754"]" flags="g" byline="true"> | |||
<fileset dir="${target.classes.meta.static.dir}" includes="service-worker.js"/> | |||
</replaceregexp> | |||
</source> | |||
<source lang="xml"> | |||
<replaceregexp byline="true"> | |||
<regexp pattern="((\["app.js","){1}([a-z0-9]{32})("\]){1})"/> | |||
<substitution expression="["app.js","c9ce971e28fa90ec960ef343ef10e754"]"/> | |||
<fileset dir="${target.classes.meta.static.dir}"> | |||
<include name="service-worker.js"/> | |||
</fileset> | |||
</replaceregexp> | |||
</source> | </source> | ||
==References== | ==References== | ||
{| | |||
| valign="top" | | |||
* [https://alvinalexander.com/blog/post/java/how-build-executable-jar-file-reference-dependencies Build an executable JAR with dependencies] | * [https://alvinalexander.com/blog/post/java/how-build-executable-jar-file-reference-dependencies Build an executable JAR with dependencies] | ||
* [https://ant.apache.org/manual/running.html Running Apache Ant Command Line] | * [https://ant.apache.org/manual/running.html Running Apache Ant Command Line] | ||
Line 23: | Line 74: | ||
* [https://ant.apache.org/manual/Tasks/checksum.html Checksum] | * [https://ant.apache.org/manual/Tasks/checksum.html Checksum] | ||
* [https://ant.apache.org/manual/Tasks/replace.html Replace] | * [https://ant.apache.org/manual/Tasks/replace.html Replace] | ||
| valign="top" | | |||
| valign="top" | | |||
|- | |||
| colspan="3" | | |||
---- | |||
|- | |||
| valign="top" | | |||
* [[CocoaPods]] | |||
* [[Maven]] | |||
* [[Conan]] | |||
* [[Bazel]] | |||
* [[NPM]] | |||
* [[Ivy]] | |||
| valign="top" | | |||
| valign="top" | | |||
|} |
Latest revision as of 20:57, 18 January 2024
Running Ant via Java If you have installed Ant in the do-it-yourself way, Ant can be started from one of two entry points:
java -Dant.home=c:\ant org.apache.tools.ant.Main [options] [target]
java -Dant.home=c:\ant org.apache.tools.ant.launch.Launcher [options] [target]
Checksum
<checksum file="${build.dir}/${jarname}.jar" algorithm="md5" property="jarname.jar.md5" />
<checksum file="${build.dir}/${jarname}.jar" algorithm="sha1" property="jarname.jar.sha1"/>
<checksum file="${build.dir}/${jarname}.jar" algorithm="md5" fileext="md5" />
<checksum file="${build.dir}/${jarname}.jar" algorithm="sha1" fileext="sha1"/>
DateTime
<tstamp>
<format property="built.on" pattern="EEE, MMM dd yyyy, HH:mm Z" locale="en,GB"/>
</tstamp>
Filtering
<filter token="built.on" value="${built.on}"/>
<copy todir="${target.vendor.antrun.dir}" filtering="true">
<filelist dir="${ext.app.vendor.antrun.dir}">
<file name="header.js"/>
</filelist>
</copy>
Replace
<replace dir="${src}" value="["app.js","d41e83413e1a73b46c799124dadab883"]">
<include name="service-worker.js"/>
<replacetoken><![CDATA["app.js","d41e83413e1a73b46c799124dadab883"]]></replacetoken>
</replace>
Replace RexExp
<replaceregexp match="\s+" replace=" " flags="g" byline="true">
<fileset dir="${ext.app.build.dir}" includes="**/*.html"/>
</replaceregexp>
<replaceregexp match="((\["app.js","){1}([a-z0-9]{32})("\]){1})"
replace="["app.js","c9ce971e28fa90ec960ef343ef10e754"]" flags="g" byline="true">
<fileset dir="${target.classes.meta.static.dir}" includes="service-worker.js"/>
</replaceregexp>
<replaceregexp byline="true">
<regexp pattern="((\["app.js","){1}([a-z0-9]{32})("\]){1})"/>
<substitution expression="["app.js","c9ce971e28fa90ec960ef343ef10e754"]"/>
<fileset dir="${target.classes.meta.static.dir}">
<include name="service-worker.js"/>
</fileset>
</replaceregexp>
References
| ||