Skip to content

Commit

Permalink
Merge pull request h5bp#832 from adrienkohlbecker/master
Browse files Browse the repository at this point in the history
Fixed PNG optimization on unix & macos
  • Loading branch information
paulirish committed Oct 30, 2011
2 parents d32dfb7 + b0fd587 commit fb6d938
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions build/build.xml
Expand Up @@ -538,7 +538,7 @@
<srcfile/>
<arg line="--compilation_level" />
<arg value="${scripts.compilation.level}" />
<arg line="--warning_level" />
<arg line="--warning_level" />
<arg value="${scripts.compilation.warninglevel}" />
<arg line="--js_output_file" />
<mapper type="glob" from="*.js" to="${basedir}/${dir.intermediate}/*.js"/>
Expand Down Expand Up @@ -612,15 +612,15 @@

<echo message="Update the HTML to reference our concatenated script file: ${scripts.js}"/>
<!-- style.css replacement handled as a replacetoken above -->
<replaceregexp match="&lt;!-- scripts concatenated [\d\w\s\W]*&lt;script.*src=['&quot;]?(.*)/${file.root.script}(?:\?.*)?['&quot;]?\s*&gt;\s*&lt;/script&gt;[\d\w\s\W]*&lt;!-- end ((scripts)|(concatenated and minified scripts))\s*--&gt;"
<replaceregexp match="&lt;!-- scripts concatenated [\d\w\s\W]*&lt;script.*src=['&quot;]?(.*)/${file.root.script}(?:\?.*)?['&quot;]?\s*&gt;\s*&lt;/script&gt;[\d\w\s\W]*&lt;!-- end ((scripts)|(concatenated and minified scripts))\s*--&gt;"
replace="&lt;script defer src='\1/${scripts.sha}.js\'&gt;&lt;/script&gt;" flags="m">
<fileset dir="${dir.intermediate}" includes="${page-files}"/>
</replaceregexp>
<!--[! use comments like this one to avoid having them get minified -->

<echo message="Updating the HTML with the new css filename: ${style.css}"/>

<replaceregexp match="&lt;link rel=['&quot;]?stylesheet['&quot;]?\s+href=['&quot;]?(.*)/${file.root.stylesheet}(?:\?.*)?['&quot;]?\s*&gt;"
<replaceregexp match="&lt;link rel=['&quot;]?stylesheet['&quot;]?\s+href=['&quot;]?(.*)/${file.root.stylesheet}(?:\?.*)?['&quot;]?\s*&gt;"
replace="&lt;link rel='stylesheet' href='\1/${css.sha}.css'&gt;" flags="m">
<fileset dir="${dir.intermediate}" includes="${page-files}"/>
</replaceregexp>
Expand Down Expand Up @@ -970,23 +970,25 @@
<echo message="*** For instructions see 'Dependencies' at: http://html5boilerplate.com/docs/#Build-script#dependencies" />
</then>
</elseif>
<elseif>
<os family="windows" />
<!-- work around https://sourceforge.net/tracker/?func=detail&aid=2671422&group_id=151404&atid=780916 -->
<delete>
<fileset dir="./${dir.publish}/${dir.images}/">
<include name="**/*.png"/>
</fileset>
</delete>
<apply executable="${basedir}/${dir.build.tools}/optipng-0.6.4-exe/optipng.exe" dest="./${dir.publish}/${dir.images}/" osfamily="windows">
<fileset dir="./${dir.source}/${dir.images}/" includes="**/*.png" excludes="${images.bypass}, ${images.default.bypass}"/>
<arg value="-quiet"/>
<arg value="-o7"/>
<arg value="-out"/>
<targetfile/>
<srcfile/>
<mapper type="identity"/>
</apply>
</elseif>
</if>

<!-- work around https://sourceforge.net/tracker/?func=detail&aid=2671422&group_id=151404&atid=780916 -->
<delete>
<fileset dir="./${dir.publish}/${dir.images}/">
<include name="**/*.png"/>
</fileset>
</delete>
<apply executable="${basedir}/${dir.build.tools}/optipng-0.6.4-exe/optipng.exe" dest="./${dir.publish}/${dir.images}/" osfamily="windows">
<fileset dir="./${dir.source}/${dir.images}/" includes="**/*.png" excludes="${images.bypass}, ${images.default.bypass}"/>
<arg value="-quiet"/>
<arg value="-o7"/>
<arg value="-out"/>
<targetfile/>
<srcfile/>
<mapper type="identity"/>
</apply>
</target>


Expand Down

0 comments on commit fb6d938

Please sign in to comment.