|
971 | 971 | <var name="optipng.available" value="true"/> |
972 | 972 | <var name="optipng.executable" value="${basedir}/${dir.build.tools}/${tool.optipng}"/> |
973 | 973 | </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"/> |
992 | 990 | </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> |
995 | 1014 |
|
996 | 1015 | <if> |
997 | 1016 | <equals arg1="${optipng.available}" arg2="true"/> |
|
1043 | 1062 | <else> |
1044 | 1063 | <if> |
1045 | 1064 | <equals arg1="optipng.available.older" arg2="true"/> |
| 1065 | + <and> |
| 1066 | + <equals arg1="${optipng.inpath}" arg2="true"/> |
| 1067 | + </and> |
1046 | 1068 | <then> |
1047 | 1069 | <!-- work around https://sourceforge.net/tracker/?func=detail&aid=2671422&group_id=151404&atid=780916 --> |
1048 | 1070 | <if> |
|
1102 | 1124 | <var name="advpng.available" value="true"/> |
1103 | 1125 | <var name="advpng.executable" value="${basedir}/${dir.build.tools}/${tool.advpng}"/> |
1104 | 1126 | </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 | + |
1121 | 1143 | <if> |
1122 | 1144 | <equals arg1="${advpng.available}" arg2="true"/> |
1123 | 1145 | <then> |
|
1175 | 1197 | <var name="jpegtran.available" value="true"/> |
1176 | 1198 | <var name="jpegtran.executable" value="${basedir}/${dir.build.tools}/${tool.jpegtran}"/> |
1177 | 1199 | </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 | + |
1192 | 1217 | <!-- If jpegtran is available, let's start it --> |
1193 | 1218 | <if> |
1194 | 1219 | <equals arg1="${jpegtran.available}" arg2="true"/> |
|
0 commit comments