Skip to content
This repository was archived by the owner on Nov 23, 2018. It is now read-only.

Commit d9b4407

Browse files
committed
reworked image flow one more time
1 parent 362aedf commit d9b4407

File tree

1 file changed

+75
-50
lines changed

1 file changed

+75
-50
lines changed

build.xml

Lines changed: 75 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -971,27 +971,46 @@
971971
<var name="optipng.available" value="true"/>
972972
<var name="optipng.executable" value="${basedir}/${dir.build.tools}/${tool.optipng}"/>
973973
</then>
974-
<else>
975-
<if>
976-
<!-- Then check for availability if unix -->
977-
<available file="optipng" filepath="${ENV.PATH}"/>
978-
<var name="optipng.executable" value="optipng"/>
979-
<if>
980-
<equals arg1="${images.optipng.newer}" arg2="true"/>
981-
<var name="optipng.available" value="true"/>
982-
</if>
983-
<else>
984-
<var name="optipng.available.older" value="true"/>
985-
</else>
986-
</if>
987-
<else>
988-
<!-- Print out message if optipng is not available -->
989-
<echo message="*** optipng NOT INSTALLED. SKIPPING OPTIMIZATION OF PNGs." />
990-
<echo message="*** Install optipng to enable png optimization." />
991-
<echo message="*** For instructions see 'Dependencies' at: https://github.com/h5bp/ant-build-script/wiki/Platform" />
974+
</if>
975+
<if>
976+
<os family="unix"/>
977+
<then>
978+
<var name="optipng.executable" value="optipng"/>
979+
</then>
980+
</if>
981+
<if>
982+
<not>
983+
<available file="optipng" filepath="${ENV.PATH}"/>
984+
</not>
985+
<then>
986+
<var name="optipng.inpath" value="false"/>
987+
</then>
988+
<else>
989+
<var name="optipng.inpath" value="true"/>
992990
</else>
993-
</else>
994-
</if>
991+
</if>
992+
<if>
993+
<and>
994+
<equals arg1="${images.optipng.newer}" arg2="true"/>
995+
<os family="unix"/>
996+
<equals arg1="${optipng.inpath}" arg2="true"/>
997+
</and>
998+
<then>
999+
<var name="optipng.available" value="true"/>
1000+
</then>
1001+
<else>
1002+
<var name="optipng.available.older" value="true"/>
1003+
</else>
1004+
</if>
1005+
<if>
1006+
<equals arg1="${optipng.available}" arg2="false"/>
1007+
<then>
1008+
<!-- Print out message if optipng is not available -->
1009+
<echo message="*** optipng NOT INSTALLED. SKIPPING OPTIMIZATION OF PNGs." />
1010+
<echo message="*** Install optipng to enable png optimization." />
1011+
<echo message="*** For instructions see 'Dependencies' at: https://github.com/h5bp/ant-build-script/wiki/Platform" />
1012+
</then>
1013+
</if>
9951014

9961015
<if>
9971016
<equals arg1="${optipng.available}" arg2="true"/>
@@ -1043,6 +1062,9 @@
10431062
<else>
10441063
<if>
10451064
<equals arg1="optipng.available.older" arg2="true"/>
1065+
<and>
1066+
<equals arg1="${optipng.inpath}" arg2="true"/>
1067+
</and>
10461068
<then>
10471069
<!-- work around https://sourceforge.net/tracker/?func=detail&aid=2671422&group_id=151404&atid=780916 -->
10481070
<if>
@@ -1102,22 +1124,22 @@
11021124
<var name="advpng.available" value="true"/>
11031125
<var name="advpng.executable" value="${basedir}/${dir.build.tools}/${tool.advpng}"/>
11041126
</then>
1105-
<else>
1106-
<if>
1107-
<!-- Then check for availability if unix -->
1108-
<available file="advpng" filepath="${ENV.PATH}"/>
1109-
<then>
1110-
<var name="advpng.executable" value="advpng"/>
1111-
</then>
1112-
<else>
1113-
<var name="advpng.available" value="false"/>
1114-
</else>
1115-
</if>
1116-
</else>
1117-
</if>
1118-
1119-
1120-
<!-- Now check for availability -->
1127+
</if>
1128+
<if>
1129+
<os family="unix"/>
1130+
<then>
1131+
<var name="advpng.executable" value="advpng"/>
1132+
</then>
1133+
</if>
1134+
<if>
1135+
<not>
1136+
<available file="advpng" filepath="${ENV.PATH}"/>
1137+
</not>
1138+
<then>
1139+
<var name="advpng.available" value="false"/>
1140+
</then>
1141+
</if>
1142+
11211143
<if>
11221144
<equals arg1="${advpng.available}" arg2="true"/>
11231145
<then>
@@ -1175,20 +1197,23 @@
11751197
<var name="jpegtran.available" value="true"/>
11761198
<var name="jpegtran.executable" value="${basedir}/${dir.build.tools}/${tool.jpegtran}"/>
11771199
</then>
1178-
<else>
1179-
<var name="jpegtran.executable" value="jpegtran"/>
1180-
<if>
1181-
<not>
1182-
<available file="jpegtran" filepath="${ENV.PATH}"/>
1183-
</not>
1184-
<then>
1185-
<!-- Set it to unavailable -->
1186-
<var name="jpegtran.available" value="false"/>
1187-
</then>
1188-
</if>
1189-
</else>
1190-
</if>
1191-
1200+
</if>
1201+
<if>
1202+
<os family="unix"/>
1203+
<then>
1204+
<var name="jpegtran.executable" value="jpegtran"/>
1205+
</then>
1206+
</if>
1207+
<if>
1208+
<not>
1209+
<available file="jpegtran" filepath="${ENV.PATH}"/>
1210+
</not>
1211+
1212+
<then>
1213+
<var name="jpegtran.available" value="false"/>
1214+
</then>
1215+
</if>
1216+
11921217
<!-- If jpegtran is available, let's start it -->
11931218
<if>
11941219
<equals arg1="${jpegtran.available}" arg2="true"/>

0 commit comments

Comments
 (0)