Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

optimize build process

Intermediate stages are stored in a new intermediate folder, and only
files that should be published are copied into the publish folder.

Files are not deleted at the beginning of every build, and files that
have already been processed will not be reprocessed unless the source
has changed.

Versioned files are referenced by a SHA-1 hash of the content rather
than a build number. This means that changing your HTML and rebuilding
will not cause your users to redownload the same CSS and Javascript, and
a reverted change may cause users to use a copy that was previously
downloaded. It may be better to use only part of the hash so the HTTP
request is shorter.

Cleaning must be done manually to delete unreferenced files, or you will
eventually fill your publish folder with unreferenced files. AFAIK this
is a very hard problem to solve properly with Ant because there's no
file dependency tree available to show which files are not products of
the current build. It's doable by creating a map from source to publish
and excluding those files while deleting everything from publish, but it
may be better to just delete the publish directory?

console.log statements are no longer commented out. The regular
expression responsible did not work properly if there were parenthesis
inside the console.log, and it put comments into the scripts that had
just been minimized, so they weren't really minimal anymore.
  • Loading branch information...
commit a0ac99a4d96453e68ff4e650fca3055767ec26aa 1 parent 96d7b26
@mdonoughe mdonoughe authored
Showing with 111 additions and 217 deletions.
  1. +1 −0  .gitignore
  2. +105 −213 build/build.xml
  3. +5 −4 build/config/default.properties
View
1  .gitignore
@@ -28,6 +28,7 @@ dwsync.xml
# Folders to ignore
.hg
.svn
+intermediate
publish
.idea
View
318 build/build.xml
@@ -81,8 +81,7 @@
<antcall target="-text.production"/>
</else>
</if>
- <!-- funky order due to jpegtran being a jerk. See comment at top of imagesjpg task -->
- <antcall target="-jpgcopy"/>
+ <antcall target="-imgcopy"/>
</target>
@@ -165,6 +164,8 @@
</else>
</if>
</target>
+
+ <target name="clean" depends="-clean"/>
<!--
@@ -176,108 +177,84 @@
<!-- Target: basics -->
<target name="-basics.dev"
depends="-rev,
- -clean,
-copy"/>
<target name="-basics.test"
depends="-rev,
- -clean,
-copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
- -js.delete,
- -css,
- -html"/>
+ -css"/>
<target name="-basics.production"
depends="-rev,
- -clean,
-copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
- -js.delete,
- -strip-console.log,
- -css,
- -html"/>
+ -css"/>
<!-- Target: text -->
<target name="-text.dev"
depends="-rev,
- -clean,
-copy"/>
<target name="-text.test"
depends="-rev,
- -clean,
-copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
- -js.delete,
-css,
- -html,
-htmlclean"/>
<target name="-text.production"
depends="-rev,
- -clean,
-copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
- -js.delete,
- -strip-console.log,
-css,
- -html,
-htmlclean"/>
<!-- Target: buildkit -->
<target name="-buildkit.dev"
depends="-rev,
- -clean,
- -prodcopy,
+ -copy,
-imagespng,
-imagesjpg"/>
<target name="-buildkit.test"
depends="-rev,
- -clean,
- -prodcopy,
+ -copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
- -js.delete,
-css,
- -html,
-htmlbuildkit,
-imagespng,
-imagesjpg"/>
<target name="-buildkit.production"
depends="-rev,
- -clean,
- -prodcopy,
+ -copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
- -js.delete,
- -strip-console.log,
-css,
- -html,
-htmlbuildkit,
-imagespng,
-imagesjpg"/>
@@ -285,40 +262,32 @@
<!-- Target: build -->
<target name="-build.dev"
depends="-rev,
- -clean,
- -prodcopy,
+ -copy,
-imagespng,
-imagesjpg"/>
<target name="-build.test"
depends="-rev,
- -clean,
- -prodcopy,
+ -copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
- -js.delete,
-css,
- -html,
-htmlclean,
-imagespng,
-imagesjpg"/>
<target name="-build.production"
depends="-rev,
- -clean,
- -prodcopy,
+ -copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
- -js.delete,
- -strip-console.log,
-css,
- -html,
-htmlclean,
-imagespng,
-imagesjpg"/>
@@ -326,40 +295,32 @@
<!-- Target: minify -->
<target name="-minify.dev"
depends="-rev,
- -clean,
- -prodcopy,
+ -copy,
-imagespng,
-imagesjpg"/>
<target name="-minify.test"
depends="-rev,
- -clean,
- -prodcopy,
+ -copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
- -js.delete,
-css,
- -html,
-htmlcompress,
-imagespng,
-imagesjpg"/>
<target name="-minify.production"
depends="-rev,
- -clean,
- -prodcopy,
+ -copy,
-usemin,
-js.all.minify,
-js.main.concat,
-js.mylibs.concat,
-js.scripts.concat,
- -js.delete,
- -strip-console.log,
-css,
- -html,
-htmlcompress,
-imagespng,
-imagesjpg"/>
@@ -369,14 +330,11 @@
* FUNCTION TARGETS *
*************************************************
-->
- <target name="-load-build-info" description="(PRIVATE) Loads the build versioning information">
- <property file="./${dir.build}/config/${build.version.info}"/>
- </target>
-
<target name="-clean" description="(PRIVATE) Wipe the previous build (Deletes the dir.publish directory">
<!-- This is a private target -->
<echo message="Cleaning up previous build directory..."/>
+ <delete dir="./${dir.intermediate}/"/>
<delete dir="./${dir.publish}/"/>
</target>
@@ -397,100 +355,76 @@
<echo message=" "/>
<echo message=" "/>
-
- <echo message="Increasing the build number..."/>
- <propertyfile file="./${dir.build}/config/${build.version.info}" comment="Build Information File - DO NOT CHANGE">
- <entry key="build.number" type="int" default="0000" operation="+" pattern="0000"/>
- <entry key="build.date" type="date" value="now" pattern="dd.MM.yyyy HH:mm"/>
- </propertyfile>
- <property file="./${dir.build}/config/${build.version.info}"/>
- <echo>Creating build ${build.number}</echo>
</target>
- <target name="current-number" depends="-load-build-info" description="(PUBLIC) Returns the current build number">
- <echo>Current build number: ${build.number}</echo>
- </target>
-
-
- <target name="-copy" depends="-load-build-info">
+ <target name="-copy">
<!-- This is a private target -->
<echo message="Copying over new files..."/>
- <!-- combine the 2 exclude properties -->
- <var name="excluded-files" value="${file.default.exclude}, ${file.exclude}"/>
- <copy todir="./${dir.publish}">
- <fileset dir="${dir.source}/" excludes="${excluded-files}"/>
+ <copy todir="./${dir.publish}" includeEmptyDirs="true">
+ <fileset dir="${dir.source}/" excludes="${file.default.exclude}, ${file.img.exclude}, ${file.exclude}, ${file.js.exclude}, ${file.css.exclude} ${page-files}"/>
</copy>
-
- <echo message="A copy of all non-dev files are now in: ./${dir.publish}."/>
- </target>
-
- <target name="-prodcopy" depends="-load-build-info">
- <!-- This is a private target -->
-
- <echo message="Copying over new files..."/>
- <!-- combine the 2 exclude properties -->
- <var name="prod-excluded-files" value="${file.default.exclude}, ${file.img.exclude}, ${file.exclude}"/>
- <copy todir="./${dir.publish}">
- <fileset dir="${dir.source}/" excludes="${prod-excluded-files}"/>
- </copy>
+ <mkdir dir="${dir.intermediate}"/>
+ <copy todir="${dir.intermediate}" includeEmptyDirs="true">
+ <fileset dir="${dir.source}/" excludes="${file.default.exclude}">
+ <type type="dir"/>
+ </fileset>
+ </copy>
<echo message="A copy of all non-dev files are now in: ./${dir.publish}."/>
</target>
-
<!-- JAVASCRIPT -->
- <target name="-js.main.concat" depends="-load-build-info" description="(PRIVATE) Concatenates the JS files in dir.js">
+ <target name="-js.main.concat" depends="-js.all.minify" description="(PRIVATE) Concatenates the JS files in dir.js">
<echo message="Concatenating Main JS scripts..."/>
- <concat destfile="./${dir.publish}/${dir.js}/scripts-${build.number}.js">
- <fileset dir="./${dir.publish}/">
- <include name="**/${dir.js.main}/*.min.js"/>
- <exclude name="**/${dir.js.mylibs}/*.js"/>
- <exclude name="**/${dir.js.libs}/*.js"/>
+ <!-- overwrite=no here means not to overwrite if the target is newer than the sources -->
+ <concat destfile="./${dir.intermediate}/${dir.js}/scripts-concat.js" overwrite="no">
+ <fileset dir="./${dir.intermediate}/">
+ <include name="${dir.js.main}/*.min.js"/>
</fileset>
</concat>
</target>
- <target name="-js.mylibs.concat" depends="-load-build-info" description="(PRIVATE) Concatenates the JS files in dir.js.mylibs">
+ <target name="-js.mylibs.concat" depends="-js.all.minify" description="(PRIVATE) Concatenates the JS files in dir.js.mylibs">
<echo message="Concatenating JS libraries"/>
- <concat destfile="./${dir.publish}/${dir.js}/libs-${build.number}.js">
- <fileset dir="./${dir.publish}/${dir.js.mylibs}/">
+ <!-- overwrite=no here means not to overwrite if the target is newer than the sources -->
+ <concat destfile="./${dir.intermediate}/${dir.js}/libs-concat.js" overwrite="no">
+ <fileset dir="./${dir.intermediate}/${dir.js.mylibs}/">
<include name="**/*.min.js"/>
</fileset>
</concat>
</target>
- <target name="-js.scripts.concat" depends="-load-build-info" if="build.concat.scripts">
+ <target name="-js.scripts.concat" depends="-js.main.concat,-js.mylibs.concat" if="build.concat.scripts">
<echo message="Concatenating library file with main script file"/>
- <concat destfile="./${dir.publish}/${dir.js}/scripts-${build.number}.min.js">
- <fileset dir="./${dir.publish}/${dir.js}/">
- <include name="libs-${build.number}.js"/>
- <include name="scripts-${build.number}.js"/>
- </fileset>
- </concat>
-
- <echo message="Concatenating library file with main debug script file"/>
- <concat destfile="./${dir.publish}/${dir.js}/scripts-${build.number}-debug.min.js">
- <fileset dir="./${dir.publish}/${dir.js}/">
- <include name="libs-${build.number}.js"/>
- <include name="scripts-${build.number}-debug.js"/>
+ <!-- overwrite=no here means not to overwrite if the target is newer than the sources -->
+ <concat destfile="./${dir.intermediate}/${dir.js}/scripts-concat.min.js" overwrite="no">
+ <fileset dir="./${dir.intermediate}/${dir.js}/">
+ <include name="libs-concat.js"/>
+ <include name="scripts-concat.js"/>
</fileset>
</concat>
+
+ <checksum file="${dir.intermediate}/${dir.js}/scripts-concat.min.js" algorithm="sha" property="scripts.sha" />
+ <property name="scripts.js" value="${dir.js}/${scripts.sha}.js" />
+ <copy file="${dir.intermediate}/${dir.js}/scripts-concat.min.js" tofile="${dir.publish}/${scripts.js}" />
</target>
- <target name="-js.all.minify" depends="-js.libs.minify" description="(PRIVATE) Minifies the scripts.js files created by js.scripts.concat">
- <echo message="Minifying concatenated script- and library-file"/>
+ <target name="-js.all.minify" description="(PRIVATE) Minifies the scripts.js files created by js.scripts.concat">
+ <echo message="Minifying scripts"/>
+ <copy todir="${dir.intermediate}/${dir.js}">
+ <fileset dir="${dir.source}/${dir.js}" includes="**/*.min.js"/>
+ </copy>
<apply executable="java" parallel="false">
- <fileset dir="./${dir.publish}/${dir.js}">
+ <fileset dir="./${dir.source}/${dir.js}">
<include name="**/*.js"/>
<exclude name="**/*.min.js"/>
- <exclude name="**/${dir.js.libs}/*.js"/>
</fileset>
<arg line="-jar"/>
<arg path="./${dir.build.tools}/${tool.yuicompressor}"/>
@@ -498,118 +432,79 @@
<arg line="--line-break"/>
<arg line="4000"/>
<arg line="-o"/>
- <mapper type="glob" from="*.js" to="../${dir.publish}/${dir.js}/*.min.js"/>
+ <mapper type="glob" from="*.js" to="../${dir.intermediate}/${dir.js}/*.min.js"/>
<targetfile/>
</apply>
- </target>
-
-
- <target name="-js.libs.minify" depends="-load-build-info" description="(PRIVATE) Minifies the helper files in dir.js.libs">
- <echo message="Minifying helper JS files..."/>
-
- <apply executable="java" parallel="false">
- <fileset dir="./${dir.publish}/${dir.js.libs}/" includes="*.js" excludes="*.min.js"/>
- <arg line="-jar"/>
- <arg path="./${dir.build.tools}/${tool.yuicompressor}"/>
- <srcfile/>
- <arg line="-o"/>
- <mapper type="glob" from="*.js" to="../${dir.publish}/${dir.js.libs}/*-${build.number}.min.js"/>
- <targetfile/>
- </apply>
- </target>
-
-
- <target name="-js.delete" depends="-load-build-info" description="(PRIVATE) Deletes the unoptimized js files from build if set">
- <if>
- <equals arg1="${build.delete.unoptimized}" arg2="true"/>
- <then>
- <echo message="Deleting unoptimized files..."/>
- <delete file="./${dir.publish}/${dir.js}/scripts-${build.number}.js"/>
- <delete file="./${dir.publish}/${dir.js}/scripts-${build.number}-debug.js"/>
- <!--
- <delete dir="./${dir.publish}/${dir.js.lib}/"/>
- <delete file="./${dir.publish}/${dir.js}/libs-${build.number}.js"/>
- this guy probably COULD be on but I think it's better if we keep him off for now. ^pi
- <delete includeemptydirs="true">
- <fileset dir="./${dir.publish}/${dir.js.libs}/" includes="*.js" excludes="*.min.js"/>
- </delete>
- -->
- </then>
- </if>
-
- <if>
- <and>
- <equals arg1="${build.delete.unoptimized}" arg2="true"/>
- <equals arg1="${build.concat.scripts}" arg2="true"/>
- </and>
- <then>
- <delete file="./${dir.publish}/${dir.js}/libs-${build.number}.js"/>
- <delete file="./${dir.publish}/${dir.js}/scripts-${build.number}.js"/>
- </then>
- </if>
- </target>
-
-
- <target name="-strip-console.log" description="(PRIVATE)Comments out any console.log statements">
- <echo message="Commenting out console.log lines"/>
-
-
- <replaceregexp match="(console.log\(.*\))" replace="/\*\1\*/" flags="g" >
- <fileset dir="./${dir.publish}/${dir.js}/">
- <include name="**/*.js"/>
- <exclude name="**/*.min.js"/>
- </fileset>
- </replaceregexp>
+ <copy todir="${dir.publish}/${dir.js.libs}">
+ <fileset dir="${dir.intermediate}/${dir.js.libs}" includes="**/*.js"/>
+ </copy>
</target>
<!-- HTML -->
- <target name="-usemin" description="(PRIVATE) Replaces references to non-minified scripts">
+ <target name="-usemin" depends="-js.scripts.concat,-css" description="(PRIVATE) Replaces references to non-minified scripts">
<echo message="Switching to minified js files..."/>
+ <!-- Changes to style.css or scripts.js mean that the html must be updated, and it will be.
+ Unfortunately, the html we want to update may not have the tags we want to replace(because it was updated before).
+ This outofdate check ensures that the html files have the markers for us to replace. -->
+ <outofdate property="needhtmlrefresh">
+ <sourcefiles>
+ <fileset dir="${dir.publish}" includes="${style.css}, ${scripts.js}"/>
+ </sourcefiles>
+ <targetfiles>
+ <fileset dir="${dir.intermediate}" includes="${page-files}"/>
+ </targetfiles>
+ </outofdate>
+
+ <!-- force the files to be overwritten with older copies from source if needhtmlrefresh is set -->
+ <copy todir="${dir.intermediate}" overwrite="${needhtmlrefresh}">
+ <fileset dir="${dir.source}" includes="${page-files}"/>
+ </copy>
+
<!-- switch from a regular jquery to minified -->
<replaceregexp match="jquery-(\d|\d(\.\d)+)\.js" replace="jquery-\1.min.js" flags="g">
- <fileset dir="./${dir.publish}" includes="${page-files}"/>
+ <fileset dir="./${dir.intermediate}" includes="${page-files}"/>
</replaceregexp>
<!-- switch any google CDN reference to minified -->
<replaceregexp match="(\d|\d(\.\d)+)\/jquery\.js" replace="\1/jquery.min.js" flags="g">
- <fileset dir="./${dir.publish}" includes="${page-files}"/>
+ <fileset dir="./${dir.intermediate}" includes="${page-files}"/>
</replaceregexp>
<echo>Kill off those versioning flags: ?v=2</echo>
<replaceregexp match='\?v=\d+">' replace='">' flags="g">
- <fileset dir="./${dir.publish}" includes="${page-files}"/>
+ <fileset dir="./${dir.intermediate}" includes="${page-files}"/>
</replaceregexp>
<echo>Remove favicon.ico reference if it is pointing to the root</echo>
<replaceregexp match="&lt;link rel=&quot;shortcut icon&quot; href=&quot;/favicon\.ico&quot;&gt;" replace="">
- <fileset dir="./${dir.publish}" includes="${page-files}"/>
+ <fileset dir="./${dir.intermediate}" includes="${page-files}"/>
</replaceregexp>
<!-- we maintain the apple-touch-icon reference for Android 2.2 www.ravelrumba.com/blog/android-apple-touch-icon
<replace token="&lt;link rel=&quot;apple-touch-icon&quot; href=&quot;/apple-touch-icon.png&quot;>" value="">
- <fileset dir="./${dir.publish}" includes="${page-files}"/>
+ <fileset dir="./${dir.intermediate}" includes="${page-files}"/>
</replace>
-->
- </target>
-
-
- <target name="-html" depends="-load-build-info" description="(PRIVATE) Very basic clean up of the HTML">
- <echo message="Update the HTML to reference our concatenated script file: scripts-${build.number}.min.js"/>
+
+ <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]*?!-- end ((scripts)|(concatenated and minified scripts))--&gt;" replace="&lt;script src='${dir.js}/scripts-${build.number}.min.js\'&gt;&lt;/script&gt;" flags="m">
- <fileset dir="./${dir.publish}" includes="${page-files}"/>
+ <replaceregexp match="&lt;!-- scripts concatenated [\d\w\s\W]*?!-- end ((scripts)|(concatenated and minified scripts))--&gt;" replace="&lt;script src='${scripts.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}"/>
+ <replace token="href=&quot;${dir.css}/style.css&quot;" value="href=&quot;${style.css}&quot;" dir="${dir.intermediate}" includes="${page-files}"/>
</target>
- <target name="-htmlclean">
+ <target name="-htmlclean" depends="-usemin">
<echo message="Run htmlcompressor on the HTML"/>
<echo message=" - maintaining whitespace"/>
<echo message=" - removing html comments"/>
<echo message=" - compressing inline style/script tag contents"/>
- <apply executable="java" parallel="false" force="true" dest="./${dir.publish}/" >
- <fileset dir="./${dir.publish}/" includes="${page-files}"/>
+ <apply executable="java" parallel="false" dest="./${dir.publish}/" >
+ <fileset dir="./${dir.intermediate}/" includes="${page-files}"/>
<arg value="-jar"/>
<arg path="./${dir.build}/tools/${tool.htmlcompressor}"/>
<arg line="--type html"/>
@@ -625,13 +520,13 @@
</target>
- <target name="-htmlbuildkit">
+ <target name="-htmlbuildkit" depends="-usemin">
<echo message="Run htmlcompressor on the HTML"/>
<echo message=" - maintaining whitespace"/>
<echo message=" - retain html comments"/>
<echo message=" - compressing inline style/script tag contents"/>
- <apply executable="java" parallel="false" force="true" dest="./${dir.publish}/" >
- <fileset dir="./${dir.publish}/" includes="${page-files}"/>
+ <apply executable="java" parallel="false" dest="./${dir.publish}/" >
+ <fileset dir="./${dir.intermediate}/" includes="${page-files}"/>
<arg value="-jar"/>
<arg path="./${dir.build}/tools/${tool.htmlcompressor}"/>
<arg value="--preserve-comments"/>
@@ -647,13 +542,13 @@
</target>
- <target name="-htmlcompress">
+ <target name="-htmlcompress" depends="-usemin">
<echo message="Run htmlcompressor on the HTML"/>
<echo message=" - removing unnecessary whitespace"/>
<echo message=" - removing html comments"/>
<echo message=" - compressing inline style/script tag contents"/>
- <apply executable="java" parallel="false" force="true" dest="./${dir.publish}/" >
- <fileset dir="./${dir.publish}/" includes="${page-files}"/>
+ <apply executable="java" parallel="false" dest="./${dir.publish}/" >
+ <fileset dir="./${dir.intermediate}/" includes="${page-files}"/>
<arg value="-jar"/>
<arg path="./${dir.build}/tools/${tool.htmlcompressor}"/>
<arg line="--type html"/>
@@ -669,28 +564,29 @@
<!-- CSS -->
- <target name="-css" depends="-load-build-info" description="Concatenates and Minifies any stylesheets listed in the file.stylesheets property">
+ <target name="-css" description="Concatenates and Minifies any stylesheets listed in the file.stylesheets property">
<echo message="Concatenating css..."/>
- <concat destfile="./${dir.publish}/${dir.css}/style-${build.number}.css">
- <filelist dir="./${dir.publish}/${dir.css}" files="${stylesheet-files}"/>
+ <!-- overwrite=no here means not to overwrite if the target is newer than the sources -->
+ <concat destfile="./${dir.intermediate}/${dir.css}/style-concat.css" overwrite="no">
+ <filelist dir="./${dir.source}/${dir.css}" files="${stylesheet-files}"/>
</concat>
<echo message="Minifying css..."/>
<apply executable="java" parallel="false">
- <fileset dir="./${dir.publish}/${dir.css}/" includes="style-${build.number}.css"/>
+ <fileset dir="./${dir.intermediate}/${dir.css}/" includes="style-concat.css"/>
<arg line="-jar"/>
<arg path="./${dir.build.tools}/${tool.yuicompressor}"/>
<srcfile/>
<arg line="-o"/>
- <mapper type="glob" from="style-${build.number}.css" to="../${dir.publish}/${dir.css}/style-${build.number}.min.css"/>
+ <mapper type="merge" to="../${dir.intermediate}/${dir.css}/style-concat.min.css"/>
<targetfile/>
</apply>
-
- <echo message="Updating the HTML with the new css filename"/>
-
- <replace token="style.css" value="style-${build.number}.min.css" dir="${dir.publish}" includes="${page-files}"/>
+
+ <checksum file="${dir.intermediate}/${dir.css}/style-concat.min.css" algorithm="sha" property="css.sha" />
+ <property name="style.css" value="${dir.css}/${css.sha}.css" />
+ <copy file="${dir.intermediate}/${dir.css}/style-concat.min.css" tofile="${dir.publish}/${style.css}" />
</target>
@@ -746,10 +642,6 @@
<target name="-imagesjpg" description="(PRIVATE) Optimizes .jpg images using jpegtan">
<echo message="Now, we clean up those jpgs..."/>
- <!-- jpegtran is a little weird in that it assumes a pre-existing file means it's already optimized. -->
- <!-- why? good question. To combat this, we skipped copying over the ${dir.images}/*.jpg earlier in the -->
- <!-- copy task. Now, we're using jpegtran to copy the files over while we crunch 'em. -->
-
<if>
<equals arg1="${images.strip.metadata}" arg2="true"/>
<then>
@@ -802,11 +694,11 @@
</target>
- <target name="-jpgcopy">
- <echo message="Copying over the unmodified jpegs."/>
+ <target name="-imgcopy">
+ <echo message="Copying over the unmodified images."/>
<copy todir="./${dir.publish}/${dir.images}">
- <fileset dir="${dir.source}/${dir.images}" includes="*.jpg"/>
+ <fileset dir="${dir.source}/${dir.images}" includes="*.jpg *.png"/>
</copy>
</target>
View
9 build/config/default.properties
@@ -9,6 +9,7 @@
# Directory Paths
#
dir.source = .
+dir.intermediate = intermediate
dir.publish = publish
dir.build = build
dir.build.tools = ${dir.build}/tools
@@ -40,8 +41,10 @@ file.serverconfig = .htaccess
#
# Files not to be copied over by the script to the publish directory
#
-file.default.exclude = .gitignore, .project, .settings, README.markdown, README.md, **/.git/**, **/.svn/**, **/${dir.build}/**, **/${dir.test}/**, **/${dir.demo}/**
-file.img.exclude = ${dir.images}/*.jpg ${dir.images}/*.png
+file.default.exclude = .gitignore, .project, .settings, README.markdown, README.md, **/.git/**, **/.svn/**, ${dir.test}/**, ${dir.demo}/**, ${dir.intermediate}/**, ${dir.publish}/**, ${dir.build}/**
+file.img.exclude = ${dir.images}/*.jpg, ${dir.images}/*.png
+file.js.exclude = ${dir.js.main}/*.js, ${dir.js.libs}/**/*.js, ${dir.js.mylibs}/**/*.js
+file.css.exclude = ${dir.css}/**/*.css
# Declare the file.exclude property in your project.properties file if you want to exclude files / folders you have added
# Note: you cannot decalre an empty file.exclude property
@@ -56,8 +59,6 @@ file.default.stylesheets = style.css
#
# If set, concat libraries with main scripts file, producing single script file
build.concat.scripts = true
-# If set, delete minified but unconcatted files.
-build.delete.unoptimized = true
#
Please sign in to comment.
Something went wrong with that request. Please try again.