Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions ant/jsdoc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<project name="jsdoc" default="build-jsdoc" basedir="..">
<property environment="env"/>
<import file="${basedir}/build.xml"/>

<target name="build-jsdoc" depends="init">

<!-- Working directory for jsdoc api -->
<property name="jsdoc.tmp" value="${java.io.tmpdir}/jsdoc"/>
<delete dir="${jsdoc.tmp}"/>
<mkdir dir="${jsdoc.tmp}"/>

<echo level="info">Copying jsdoc assets docs to ${jsdoc.tmp}</echo>

<copy todir="${jsdoc.tmp}">
<fileset file="${basedir}/js/qz-tray.js"/>
<fileset file="README.md"/>
</copy>

<!-- Allow templates via TEMPLATE_DIR if provided -->
<condition property="jsdoc.template" value="--template &quot;${env.TEMPLATE_DIR}&quot;">
<isset property="env.TEMPLATE_DIR"/>
</condition>
<property description="suppress-property-warning" name="jsdoc.template" value=""/>

<!-- Handle JSDOC_OUT_DIR if provided -->
<condition property="jsdoc.out" value="${env.JSDOC_OUT_DIR}">
<isset property="env.JSDOC_OUT_DIR"/>
</condition>
<property description="suppress-property-warning" name="jsdoc.out" value="${jsdoc.tmp}/api"/>
<delete dir="${jsdoc.out}"/>

<!-- Fix GitHub links -->
<replace file="${jsdoc.tmp}/README.md">
<replacefilter token="../../" value="https://github.com/qzind/tray/"/>
</replace>
<replace file="${jsdoc.tmp}/README.md">
<replacefilter token="https://github.com/qzind/tray/wiki/" value="../../docs/"/>
</replace>

<exec executable="jsdoc" failonerror="true">
<arg value="${jsdoc.tmp}/qz-tray.js"/>
<arg value="--readme"/>
<arg value="${jsdoc.tmp}/README.md"/>
<arg value="--destination"/>
<arg value="${jsdoc.out}"/>
<arg line="${jsdoc.template}"/>
</exec>

<tar destfile="${jsdoc.out}.tar" basedir="${jsdoc.out}"/>
<gzip destfile="${jsdoc.out}.tar.gz" src="${jsdoc.out}.tar"/>
<delete file="${jsdoc.out}.tar"/>
</target>
</project>
1 change: 1 addition & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<import file="ant/platform-detect.xml"/>
<import file="ant/javafx.xml"/>
<import file="ant/signing.xml"/>
<import file="ant/jsdoc.xml"/>
<import file="ant/apple/installer.xml"/>
<import file="ant/linux/installer.xml"/>
<import file="ant/windows/installer.xml"/>
Expand Down