Permalink
Browse files

Only define Compressor tasks if yuicompressor.jar is set.

  • Loading branch information...
1 parent 244a549 commit d1d67b67c919eb82add198dc6bf05dbbbc1f5ab0 @reid reid committed Jan 13, 2011
Showing with 24 additions and 16 deletions.
  1. +24 −16 componentbuild/shared/macrolib.xml
@@ -70,22 +70,30 @@
</sequential>
</macrodef>
- <taskdef name="yuicompressor"
- classname="com.yahoo.platform.yui.compressor.CompressorTask"
- classpath="${yuicompressor.jar}"/>
-
- <!-- Maps the legacy yuicompress task into a yuicompressor task. -->
- <macrodef name="yuicompress">
- <attribute name="src" />
- <attribute name="dest" />
- <attribute name="args" />
- <!-- Unused. Type is detected automatically from the @{src} filename. -->
- <attribute name="type" default="?"/>
- <!-- If you had to override this, use the type option in args instead. -->
- <sequential>
- <yuicompressor input="@{src}" output="@{dest}" options="@{args}"/>
- </sequential>
- </macrodef>
+ <if>
+ <!-- The yui2 builder-integration script embeds macrolib.xml
+ by itself for other macros, which leaves yuicompressor.jar
+ unset. If that's the case, don't define the compressor tasks. -->
+ <isset property="yuicompressor.jar"/>
+ <then>
+ <taskdef name="yuicompressor"
+ classname="com.yahoo.platform.yui.compressor.CompressorTask"
+ classpath="${yuicompressor.jar}"/>
+
+ <!-- Maps the legacy yuicompress task into a yuicompressor task. -->
+ <macrodef name="yuicompress">
+ <attribute name="src" />
+ <attribute name="dest" />
+ <attribute name="args" />
+ <!-- Unused. Type is detected automatically from the @{src} filename. -->
+ <attribute name="type" default="?"/>
+ <!-- If you had to override this, use the type option in args instead. -->
+ <sequential>
+ <yuicompressor input="@{src}" output="@{dest}" options="@{args}"/>
+ </sequential>
+ </macrodef>
+ </then>
+ </if>
<macrodef name="concatsource">
<attribute name="destfile" />

0 comments on commit d1d67b6

Please sign in to comment.