Ticket #2102414 (closed enhancement)

Reporter


sfbugs
Opened: 09/9/08
Last modified: 12/12/12
Status: closed
Type: enhancement
Resolution: wontfix

Owner


Satyen Desai
Target Release: FUTURE
Priority: P3 (normal)
Summary: Ant Task for compressing javascript and CSS
Description:

Create an Ant task for integrating YUI Compressor, so deployed javascript and css files (packaged in WAR or EAR files, presumably) can be compressed as part of the build.

Attached is a draft implementation I made without changing any YUICompressor code, so there is some copy and paste that can be eliminated by pulling code out of YUICompressor's main and having the
task call those common methods.

Below is a sample taskdef and target.

<target name="use.init" description="Taskdef the YuiCompressor" depends="jar">
<taskdef name="yuicompress" classname="com.yahoo.platform.yui.compressor.YUICompressorAntTask">
<classpath refid="task.classpath" />
</taskdef>
</target>

<target name="runcompress" depends="use.init">
<yuicompress replace="false" destination="classes">
<fileset dir="${test.js.dir}">
<include name="*.js" />
</fileset>
<fileset dir="${test.js.dir}">
<include name="*.css" />
</fileset>
</yuicompress>
</target>

Type: enhancement Observed in Version: 2.4.2
Component: YUICompressor Severity: S3 (normal)
Assigned To: Satyen Desai Target Release: FUTURE
Location: Library Code Priority: P3 (normal)
Tags: Relates To:
Browsers: N/A
URL:
Test Information:

Attachments

Attachment #1: 292780_YUICompressorAntTask.java (download)

Change History

George

YUI Developer

Posted: 09/24/08

Forwarding to component owner for consideration.

George

YUI Developer

Posted: 10/22/08
  • summary changed from Ant Task for compressing javascript and CSS to [#2300399] Ant Task for compressing javascript and CSS

sfbugs

Posted: 01/7/09

This ticket was imported from Source Forge.

Orginially submitted by: kcacciatore

George

YUI Developer

Posted: 04/30/09

George

YUI Developer

Posted: 09/23/09

Chris Burroughs

YUI Contributor

Posted: 10/2/09
  • browser changed to N/A
  • version changed from None to 2.4.2

Isaac Z. Schlueter

YUI Contributor

Posted: 11/4/09
  • resolution changed from None to wontfix
  • status changed from assigned to closed

I'd recommend taking a look at yuibuilder or some other build tools out there. The compressor's job is just compression, nothing more. Writing build scripts is out of scope.

Damien Lebrun

Posted: 12/6/09
  • resolution changed from wontfix
  • status changed from closed to reopened

Sorry to reopen this ticket, but there have been no mention of efficiency. Having to spawn an new process for each file to compress can be too slow:

- compressing yui3's JavaScript files (69 files) using a macro, like yuibuilder does, takes 55 seconds.
- It takes only 3 seconds using an Ant task.

Can you please reconsider the resolution. An Ant task is just a trivial alternative user interface.

George

YUI Developer

Posted: 01/30/10

Adam Moore

YUI Contributor

Posted: 02/3/10

Satyen, if there is anything in builder that is generic enough, maybe it is something we should package with yuicompressor.

Satyen Desai

YUI Developer

Posted: 03/18/10
  • location changed to Library Code
  • milestone changed to FUTURE
  • status changed from assigned to accepted

Although we have the Macro right now, which can be broken out, I think Damien's point is valid too - the spawning of the Java process for each file is a little excessive. Maybe worth writing up a custom ANT Task to perform a little better. I'll look into this.

Jenny Donnelly

YUI Developer

Posted: 12/12/12
  • resolution changed to wontfix
  • status changed from accepted to closed

Thank you for your bug report. We are deprecating YUI Compressor in favor of yuglify. Please see our announcement for more information: http://www.yuiblog.com/blog/2012/10/16/state-of-yui-compressor/. We will consider migrating these legacy tickets to GitHub if there are community maintainers willing to step up and own them.