Skip to content

Commit

Permalink
Merge pull request #585 from nschonni/fix-theme-build-dependancy
Browse files Browse the repository at this point in the history
Fix theme build dependancy
  • Loading branch information
Paul Jackson authored and Paul Jackson committed Oct 19, 2012
2 parents 8ade229 + a42fec6 commit 01baa05
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 23 deletions.
7 changes: 6 additions & 1 deletion build/build-tasks.properties
Expand Up @@ -26,4 +26,9 @@ compass.gem=compass-0.12.1.gem
#JSLint
jshint.jar=${lib.dir}/ant-jshint-0.3.1-deps.jar
jshint.globals.file=${tasks.basedir}/jshint.globals.properties
jshint.failbuild=false
jshint.failbuild=false

#Core project paths
jssrc.dir=${tasks.basedir}/../src/js
gridsrc.dir=${tasks.basedir}/../src/grids
basesrc.dir=${tasks.basedir}/../src/base
31 changes: 31 additions & 0 deletions build/build-tasks.xml
Expand Up @@ -162,6 +162,37 @@
<var name="file.recurse" unset="true"/>
</target>

<target name="build-theme-deps" description="Initializes the Grid, JS and Base CSS projects so that the Sass has been compiled">
<if>
<available type="dir" file="${gridsrc.dir}/css"/>
<then />
<else>
<ant dir="${gridsrc.dir}" target="compile.sass" inheritAll="false"/>
</else>
</if>
<if>
<available type="dir" file="${basesrc.dir}/css"/>
<then />
<else>
<ant dir="${basesrc.dir}" target="compile.sass" inheritAll="false"/>
</else>
</if>
<if>
<available type="dir" file="${jssrc.dir}/css"/>
<then />
<else>
<ant dir="${jssrc.dir}" target="compile.sass" inheritAll="false"/>
</else>
</if>
</target>

<target name="clean-theme-deps" description="Clean the Grid, JS and Base CSS files. Used for after building an individual theme">
<ant dir="${gridsrc.dir}" target="clean-css" inheritAll="false"/>
<ant dir="${basesrc.dir}" target="clean-css" inheritAll="false"/>
<ant dir="${jssrc.dir}" target="clean-css" inheritAll="false"/>
<antcall target="clean-css" inheritAll="false"/>
</target>

<target name="clean-css">
<delete dir="${src.dir}/css" />
</target>
Expand Down
4 changes: 2 additions & 2 deletions src/grids/build.xml
Expand Up @@ -9,14 +9,14 @@

<target name="build" depends="-init, -minify" />

<target name="-minify" depends="compile.sass, -merge-css">
<target name="-minify" depends="-merge-css">
<yui-compressor warn="false" munge="true" preserveAllSemiColons="false" fromDir="${build.dir}/premin" toDir="${build.dir}">
<include name="css/*.*" />
</yui-compressor>
<delete dir="${build.dir}/premin"/>
</target>

<target name="-merge-css">
<target name="-merge-css" depends="compile.sass">
<copy todir="${build.dir}/premerge/css">
<fileset dir="${src.dir}/css">
<include name="util*.css"/>
Expand Down
12 changes: 6 additions & 6 deletions src/js/build.xml
Expand Up @@ -9,7 +9,7 @@

<target name="build" depends="-init, -minify" />

<target name = "-minify" depends="compile.sass, build-js, -base64-encode">
<target name = "-minify" depends="-merge-css, -base64-encode, build-js">
<yui-compressor warn="false" munge="true" preserveAllSemiColons="false" fromDir="${build.dir}/premin" toDir="${build.dir}">
<include name="*.*" />
<include name="i18n/*.*" />
Expand Down Expand Up @@ -112,19 +112,19 @@
<replaceregexp flags="gis" file="${build.dir}/workers.js" match="/\*.*?\*/" replace="" encoding="utf8" />
</target>
<!--Build CSS Tasks -->
<target name="-base64-encode" depends="-merge-css">
<target name="-base64-encode">
<copy todir="${build.dir}/images">
<fileset dir="${src.dir}/images"/>
</copy>
<property name="image.dir" location="${build.dir}/images"/>

<cssurlembed skipMissing="true" root="${image.dir}">
<fileset dir="${build.dir}/premin/css">
<include name="pe-ap.css"/>
</fileset>
</cssurlembed>
<copy todir="${build.dir}/images">
<fileset dir="${src.dir}/images"/>
</copy>
</target>
<target name="-merge-css">
<target name="-merge-css" depends="compile.sass">
<copy todir="${build.dir}/premerge/css">
<fileset dir="${src.dir}/css"/>
</copy>
Expand Down
12 changes: 6 additions & 6 deletions src/theme-clf2-nsi2/build.xml
Expand Up @@ -9,7 +9,7 @@

<target name="build" description="" depends="-init, -minify" />

<target name="-minify" depends="compile.sass, -base64-encode">
<target name="-minify" depends="-merge-css, -base64-encode">
<move todir="${build.dir}/css/premin">
<fileset dir="${build.dir}/css"/>
</move>
Expand All @@ -34,7 +34,10 @@
</target>

<!--Build CSS Tasks -->
<target name="-base64-encode" depends="-merge-css">
<target name="-base64-encode">
<copy todir="${build.dir}/images">
<fileset dir="${src.dir}/images" />
</copy>
<copy todir="${build.dir}/encode/css">
<fileset dir="${build.dir}/css">
<include name="theme.css"/>
Expand All @@ -59,14 +62,11 @@
<delete dir="${build.dir}/encode"/>
</target>

<target name="-merge-css">
<target name="-merge-css" depends="compile.sass, build-theme-deps">
<copy todir="${build.dir}/pre/merge/css">
<fileset dir="${src.dir}/css"/>
</copy>
<replace dir="${build.dir}/pre/merge/css" token="@charset &quot;utf-8&quot;;" value=" "/>
<copy todir="${build.dir}/images">
<fileset dir="${src.dir}/images" />
</copy>
<copy todir="${build.dir}/pre/merge/../css">
<fileset dir="${src.dir}/../base/css"/>
</copy>
Expand Down
6 changes: 3 additions & 3 deletions src/theme-gcwu-fegc/build.xml
Expand Up @@ -9,7 +9,7 @@

<target name="build" depends="-init, -minify" />

<target name="-minify" depends="compile.sass, -base64-encode">
<target name="-minify" depends="-merge-css, -base64-encode">
<move todir="${build.dir}/css/premin">
<fileset dir="${build.dir}/css"/>
</move>
Expand All @@ -34,7 +34,7 @@
</target>

<!--Build CSS Tasks -->
<target name="-base64-encode" depends="-merge-css">
<target name="-base64-encode">
<copy todir="${build.dir}/images">
<fileset dir="${src.dir}/images"/>
</copy>
Expand Down Expand Up @@ -71,7 +71,7 @@
<delete dir="${build.dir}/encode"/>
</target>

<target name="-merge-css">
<target name="-merge-css" depends="compile.sass, build-theme-deps">
<copy todir="${build.dir}/pre/merge/jquerymobile">
<fileset dir="${src.dir}/jquerymobile">
<include name="*.css"/>
Expand Down
15 changes: 10 additions & 5 deletions src/theme-gcwu-intranet/build.xml
Expand Up @@ -9,7 +9,7 @@

<target name="build" depends="-init, -minify" />

<target name="-minify" depends="compile.sass, build-css">
<target name="-minify" depends="-merge-css, -base64-encode">
<move todir="${build.dir}/css/premin">
<fileset dir="${build.dir}/css"/>
</move>
Expand All @@ -32,11 +32,9 @@
<delete dir="${build.dir}/css/premin"/>
<delete dir="${build.dir}/js/premin"/>
</target>

<target name="build-css" depends="-base64-encode" />

<!--Build CSS Tasks -->
<target name="-base64-encode" depends="-merge-css">
<target name="-base64-encode">
<copy todir="${build.dir}/images">
<fileset dir="${src.dir}/../theme-gcwu-fegc/images"/>
<fileset dir="${src.dir}/images"/>
Expand Down Expand Up @@ -74,7 +72,14 @@
<delete dir="${build.dir}/encode"/>
</target>

<target name="-merge-css">
<target name="-merge-css" depends="compile.sass, build-theme-deps">
<if>
<available type="dir" file="${src.dir}/../theme-gcwu-fegc/css"/>
<then/>
<else>
<ant dir="${src.dir}/../theme-gcwu-fegc" target="compile.sass" inheritAll="false"/>
</else>
</if>
<copy todir="${build.dir}/pre/merge/jquerymobile">
<fileset dir="${src.dir}/jquerymobile">
<include name="*.css"/>
Expand Down

0 comments on commit 01baa05

Please sign in to comment.