Skip to content

Commit

Permalink
Merge pull request #611 from nschonni/remove-recuse
Browse files Browse the repository at this point in the history
Remove recursing import statements
  • Loading branch information
LaurentGoderre committed Oct 24, 2012
2 parents f3fcd5b + 5170c0f commit 32ebbd5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 97 deletions.
54 changes: 1 addition & 53 deletions build/build-tasks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,59 +111,7 @@
<exclude name="**/*.min.js"/>
</jshint>
</target>

<target name="-resolve-css-imports">
<antcall target="-recurse" inheritAll="false">
<param name="file.recurse" value="${file}"/>
<param name="topfile" value="${topfile}"/>
</antcall>
</target>

<target name="-recurse">
<property name="charset_regexp" value="@charset\s*?['&quot;]utf-8['&quot;]\s*?;" />
<property name="url_regexp" value="url\(\s*?['&quot;]\s*?(.*)?['&quot;]\s*?\s*?\)" />
<property name="import_regexp" value="@import\s*?${url_regexp}\s*?;?" />
<fixcrlf file="${file.recurse}"/>
<!-- Removes the charset directive if not in a core file -->
<if>
<not>
<equals arg1="${topfile}" arg2="true"/>
</not>
<then>
<replaceregexp file="${file.recurse}" match="${charset_regexp}" replace=""/>
</then>
</if>

<loadfile property="src" srcfile="${file.recurse}" encoding="utf8"/>
<!--Merge imported stylesheets-->
<for delimiter="${line.separator}" param="currline" list="${src}">
<sequential>
<propertyregex regexp="${import_regexp}" property="import" select="\0" input="@{currline}" global="true" casesensitive="true" override="true"/>
<if>
<isset property="import"/>
<then>
<propertyregex regexp="${import_regexp}" property="import.file.name" select="\1" input="${import}" casesensitive="true" override="true"/>
<dirname property="import.file.root" file="${file.recurse}"/>
<property name="import.file" value="${import.file.root}/${import.file.name}"/>
<antcall target="-resolve-css-imports" inheritAll="false">
<param name="file" value="${import.file}"/>
<param name="topfile" value="false"/>
</antcall>
<loadfile property="imported" srcfile="${import.file}"/>
<replace file="${file.recurse}" token="${import}" value="${imported}"/>
<var name="import.file.root" unset="true"/>
<var name="import.file.name" unset="true"/>
<var name="import.file" unset="true"/>
<var name="imported" unset="true"/>
<var name="import" unset="true"/>
</then>
</if>
</sequential>
</for>
<var name="src" unset="true"/>
<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"/>
Expand Down
12 changes: 1 addition & 11 deletions src/grids/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,7 @@
<file name="util.css"/>
<file name="util-ie.css"/>
</filelist>
<for param="css-file">
<path>
<filelist refid="corefiles"/>
</path>
<sequential>
<antcall target="-resolve-css-imports" inheritAll="false">
<param name="file" value="@{css-file}"/>
<param name="topfile" value="true"/>
</antcall>
</sequential>
</for>

<copy todir="${build.dir}/premin/css">
<filelist dir="${build.dir}/premerge/css">
<file name="util.css"/>
Expand Down
12 changes: 1 addition & 11 deletions src/theme-clf2-nsi2/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,7 @@
<file name="theme-serv-ie.css"/>
<file name="theme-ns.css"/>
</filelist>
<for param="css-file">
<path>
<filelist refid="corefiles"/>
</path>
<sequential>
<antcall target="-resolve-css-imports" inheritAll="false">
<param name="file" value="@{css-file}"/>
<param name="topfile" value="true"/>
</antcall>
</sequential>
</for>

<copy todir="${build.dir}/css">
<filelist dir="${build.dir}/pre/merge/css">
<file name="theme.css"/>
Expand Down
12 changes: 1 addition & 11 deletions src/theme-gcwu-fegc/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,7 @@
<file name="theme-serv-ie.css"/>
<file name="theme-ns.css"/>
</filelist>
<for param="css-file">
<path>
<filelist refid="corefiles"/>
</path>
<sequential>
<antcall target="-resolve-css-imports" inheritAll="false">
<param name="file" value="@{css-file}"/>
<param name="topfile" value="true"/>
</antcall>
</sequential>
</for>

<copy todir="${build.dir}/css">
<filelist dir="${build.dir}/pre/merge/css">
<file name="theme.css"/>
Expand Down
12 changes: 1 addition & 11 deletions src/theme-gcwu-intranet/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,7 @@
<file name="theme-serv-ie.css"/>
<file name="theme-ns.css"/>
</filelist>
<for param="css-file">
<path>
<filelist refid="corefiles"/>
</path>
<sequential>
<antcall target="-resolve-css-imports" inheritAll="false">
<param name="file" value="@{css-file}"/>
<param name="topfile" value="true"/>
</antcall>
</sequential>
</for>

<copy todir="${build.dir}/css">
<filelist dir="${build.dir}/pre/merge/css">
<file name="theme.css"/>
Expand Down

0 comments on commit 32ebbd5

Please sign in to comment.