Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

datatype component builds with Ant 1.8.1

Ant 1.8.1 doesn't allow you to reset the value of
subant properties once you set them.

Nested rollups now set different subant property
names which are renamed back to the original names
in module.xml. [fixes #2528957]
  • Loading branch information...
commit 61b67a5bb65f4f797879d95120a9e826d14538a5 1 parent 7e26762
Reid Burke reid authored
Showing with 41 additions and 10 deletions.
  1. +14 −2 componentbuild/3.x/module.xml
  2. +27 −8 componentbuild/3.x/rollup.xml
16 componentbuild/3.x/module.xml
View
@@ -41,7 +41,19 @@
</target>
<target name="-rollupjs" if="rollup">
- <echo level="info">Rolling up ${component.basefilename}-debug.js into ${rollup.component.basefilename}-debug.js</echo>
+ <if>
+ <isset property="rollup.sub"/>
+ <then>
+ <echo level="info">Module: Build a rollup of a rollup; moving rollup.sub properties into rollup properties.</echo>
+ <var name="rollup.builddir" unset="true"/>
+ <var name="rollup.component" unset="true"/>
+ <var name="rollup.component.basefilename" unset="true"/>
+ <propertycopy name="rollup.builddir" from="rollup.sub.builddir"/>
+ <propertycopy name="rollup.component" from="rollup.sub.component"/>
+ <propertycopy name="rollup.component.basefilename" from="rollup.sub.component.basefilename"/>
+ </then>
+ </if>
+ <echo level="info">Module: Rolling up ${component.basefilename}-debug.js into ${rollup.component.basefilename}-debug.js</echo>
<concat destfile="${rollup.builddir}/${rollup.component.basefilename}.js" append="true" fixlastline="true">
<filelist dir="${component.builddir}" files="${component.basefilename}.js" />
</concat>
@@ -93,4 +105,4 @@
</concat>
</target>
-</project>
+</project>
35 componentbuild/3.x/rollup.xml
View
@@ -12,17 +12,36 @@
</target>
<target name="-buildmodules">
- <subant target="${component.rollup.target}" inheritall="false" >
- <filelist dir="${buildfile.dir}" files="${component.rollup.modules.buildfiles}" />
- <property name="rollup" value="true" />
- <property name="rollup.builddir" value="${component.builddir}" />
- <property name="rollup.component" value="${component}" />
- <property name="rollup.component.basefilename" value="${component.basefilename}" />
- </subant>
+ <!-- Since Ant 1.8, properties defined in subant tasks can never, ever be set again.
+ In order for datatype's rollups of rollups to work, we must use new property
+ names for the nested rollup task. module.xml then renames rollup.sub to rollup. -->
+ <if>
+ <isset property="rollup"/>
+ <then>
+ <fail if="rollup.sub">You're trying to build a rollup of a rollup of a rollup. Are you sure that's what you want?</fail>
+ <echo level="info">Rollup of rollup detected; setting rollup.sub properties.</echo>
+ <subant target="${component.rollup.target}" inheritall="false" >
+ <filelist dir="${buildfile.dir}" files="${component.rollup.modules.buildfiles}" />
+ <property name="rollup.sub" value="true" />
+ <property name="rollup.sub.builddir" value="${component.builddir}" />
+ <property name="rollup.sub.component" value="${component}" />
+ <property name="rollup.sub.component.basefilename" value="${component.basefilename}" />
+ </subant>
+ </then>
+ <else>
+ <subant target="${component.rollup.target}" inheritall="false" >
+ <filelist dir="${buildfile.dir}" files="${component.rollup.modules.buildfiles}" />
+ <property name="rollup" value="true" />
+ <property name="rollup.builddir" value="${component.builddir}" />
+ <property name="rollup.component" value="${component}" />
+ <property name="rollup.component.basefilename" value="${component.basefilename}" />
+ </subant>
+ </else>
+ </if>
</target>
<target name="-rollupjs" if="rollup">
- <echo level="info">Rolling up ${component.basefilename}-debug.js into ${rollup.component.basefilename}-debug.js</echo>
+ <echo level="info">Rollup: Rolling up ${component.basefilename}-debug.js into ${rollup.component.basefilename}-debug.js</echo>
<concat destfile="${rollup.builddir}/${rollup.component.basefilename}.js" append="true" fixlastline="true" >
<filelist dir="${component.builddir}" files="${component.basefilename}.js" />
</concat>
Please sign in to comment.
Something went wrong with that request. Please try again.