Clean up system executables properties
This commit is contained in:
parent
0c722d8a12
commit
033b302d9f
5 changed files with 22 additions and 31 deletions
34
build.xml
34
build.xml
|
|
@ -7,28 +7,26 @@
|
|||
-->
|
||||
<property environment="env"/>
|
||||
|
||||
<condition property="os.win">
|
||||
<os family="windows"/>
|
||||
</condition>
|
||||
|
||||
<!-- system executables -->
|
||||
<condition property="exe.ext" value=".exe" else="">
|
||||
<equals arg1="${os.win}" arg2="true"/>
|
||||
<os family="windows"/>
|
||||
</condition>
|
||||
<condition property="executable.npm" value="npm.cmd" else="npm">
|
||||
<equals arg1="${os.win}" arg2="true"/>
|
||||
</condition>
|
||||
<condition property="executable.npx" value="npx.cmd" else="npx">
|
||||
<equals arg1="${os.win}" arg2="true"/>
|
||||
</condition>
|
||||
<condition property="executable.neu" value="neu.cmd" else="neu">
|
||||
<equals arg1="${os.win}" arg2="true"/>
|
||||
</condition>
|
||||
|
||||
<!-- Windows fails to execute "ng" unless it is invoked as "ng.cmd" -->
|
||||
<condition property="executable.suffix" value=".cmd">
|
||||
<os family="windows"/>
|
||||
</condition>
|
||||
<property name="executable.suffix" value=""/>
|
||||
<condition property="executable.npx" value="npx.cmd" else="npx">
|
||||
<os family="windows"/>
|
||||
</condition>
|
||||
<condition property="executable.neu" value="neu.cmd" else="neu">
|
||||
<os family="windows"/>
|
||||
</condition>
|
||||
|
||||
<condition property="executable.python" value="python3${exe.ext}" else="python${exe.ext}">
|
||||
<available file="python3${exe.ext}" filepath="${env.PATH}"/>
|
||||
</condition>
|
||||
<available property="python.present" file="${executable.python}" filepath="${env.PATH}"/>
|
||||
|
||||
|
||||
<property file="build.ant-private.properties"/>
|
||||
<property file="build.ant.properties"/>
|
||||
|
|
@ -95,10 +93,6 @@
|
|||
</tstamp>
|
||||
<property name="datetime" value="${date} ${time}"/>
|
||||
|
||||
<!-- check for some executables -->
|
||||
<available property="python.present" file="python${exe.ext}" filepath="${env.PATH}"/>
|
||||
<available property="python3.present" file="python3${exe.ext}" filepath="${env.PATH}"/>
|
||||
|
||||
|
||||
<!-- Ant sub-modules -->
|
||||
|
||||
|
|
|
|||
|
|
@ -690,7 +690,7 @@
|
|||
|
||||
|
||||
<target name="js-prepare-node">
|
||||
<exec executable="npm${executable.suffix}" failonerror="true">
|
||||
<exec executable="${executable.npm}" failonerror="true">
|
||||
<arg value="install"/>
|
||||
<arg value="--no-save"/>
|
||||
</exec>
|
||||
|
|
@ -698,7 +698,7 @@
|
|||
|
||||
|
||||
<target name="js-prepare-contribs" depends="js-prepare-node">
|
||||
<exec executable="npx${executable.suffix}" failonerror="true">
|
||||
<exec executable="${executable.npx}" failonerror="true">
|
||||
<arg value="showdown"/>
|
||||
<arg value="makehtml"/>
|
||||
<arg value="--input"/>
|
||||
|
|
@ -711,7 +711,7 @@
|
|||
|
||||
<!-- TODO: Do not write stendhal-compiled.js to the source directory tree but directly to the compiled directory tree -->
|
||||
<target name="js-invoke-compiler">
|
||||
<exec executable="npx${executable.suffix}" dir="${srcjs}/stendhal" failonerror="true">
|
||||
<exec executable="${executable.npx}" dir="${srcjs}/stendhal" failonerror="true">
|
||||
<arg value="tsc"/>
|
||||
</exec>
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@
|
|||
|
||||
|
||||
<target name="tsdocs" depends="clean_tsdocs,js-prepare-node">
|
||||
<exec executable="npx${executable.suffix}" dir="${srcjs}/stendhal" failonerror="true">
|
||||
<exec executable="${executable.npx}" dir="${srcjs}/stendhal" failonerror="true">
|
||||
<arg value="typedoc"/>
|
||||
<arg value="--entryPointStrategy"/>
|
||||
<arg value="expand"/>
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
message="Python unavailable, cannot run mkdocs"/>
|
||||
|
||||
<!-- NOTE: MkDocs create the top-level index.html -->
|
||||
<exec if:true="${python.present}" executable="python" failonerror="true"
|
||||
<exec executable="${executable.python}" if:true="${python.present}" failonerror="true"
|
||||
dir="./buildtools/mkdocs/">
|
||||
<arg value="-u"/>
|
||||
<arg value="build.py"/>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<target name="locale_build_template" description="Creates a template for translating.">
|
||||
<echo unless:true="${python.present}" message="Python unavailable, cannot build locale template"/>
|
||||
|
||||
<exec if:true="${python.present}" executable="python" failonerror="true" dir="${buildtools}">
|
||||
<exec executable="${executable.python}" if:true="${python.present}" failonerror="true">
|
||||
<arg value="-u"/>
|
||||
<arg value="./bin/locale-template.py"/>
|
||||
</exec>
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
<target name="locale_update" description="Update translation files from template.">
|
||||
<echo unless:true="${python.present}" message="Python unavailable, cannot update translations"/>
|
||||
|
||||
<exec if:true="${python.present}" executable="python" failonerror="true" dir="${buildtools}">
|
||||
<exec executable="${executable.python}" if:true="${python.present}" failonerror="true">
|
||||
<arg value="-u"/>
|
||||
<arg value="./bin/locale-template.py"/>
|
||||
<arg value="--update"/>
|
||||
|
|
|
|||
|
|
@ -59,13 +59,10 @@
|
|||
|
||||
|
||||
<target name="renderworldmap" description="Export world.tmx map to PNG image." depends="rendermaps">
|
||||
<property name="pycmd" value="python3" if:true="${python3.present}"/>
|
||||
<property name="pycmd" value="python" unless:true="${python3.present}" if:true="${python.present}"/>
|
||||
|
||||
<!-- embed area images with area name -->
|
||||
<!-- FIXME: need to detect the Python "PIL" module to ensure script can run or
|
||||
write Java class that can do this -->
|
||||
<exec executable="${pycmd}" if:set="pycmd">
|
||||
<exec executable="${executable.python}" if:true="${python.present}">
|
||||
<arg value="./data/maps/vampire_maplabel.py"/>
|
||||
<arg value="-world"/>
|
||||
</exec>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue