-
1. Re: Compress custom-dependencies.js
abelevich Jan 28, 2010 8:56 AM (in response to apanag)Hi Andreas,
Unfortunally Richfaces RD plugin doesn't support compress feature. I think it will be great if you contribute this necessary feature. As form me I think this is should be a goal "compressed". Thanks for participation!
-
2. Re: Compress custom-dependencies.js
apanag Jan 28, 2010 9:42 AM (in response to abelevich)Thanks Anton,
I implement at the moment compression as a goal.
As soon as its ready, I will submit the code and notify you.
-
3. Re: Compress custom-dependencies.js
abelevich Jan 28, 2010 9:51 AM (in response to apanag)apanag wrote:
Thanks Anton,
I implement at the moment compression as a goal.
As soon as its ready, I will submit the code and notify you.
ok
-
4. Re: Compress custom-dependencies.js
apanag Jan 28, 2010 10:54 AM (in response to abelevich)Is it possible or do you know how to: define the execution order of goals in maven?
I have built the "compress" goal.
I just want for validation and easy of use to make sure that the component should always call first the assembly and then compile.
Otherwise in case the user set the followin: (meaningless but possible from a user):
<goals>
<goal>compress</goal>
<goal>assembly-resources</goal>
</goals>I get an exception, since naturally the packages do not exist.
-
5. Re: Compress custom-dependencies.js
abelevich Jan 28, 2010 12:15 PM (in response to apanag)1 of 1 people found this helpfulapanag wrote:
Is it possible or do you know how to: define the execution order of goals in maven?
I have built the "compress" goal.
I just want for validation and easy of use to make sure that the component should always call first the assembly and then compile.
Otherwise in case the user set the followin: (meaningless but possible from a user):
<goals>
<goal>compress</goal>
<goal>assembly-resources</goal>
</goals>I get an exception, since naturally the packages do not exist.
Goal may be bound to the different build phases. "assembly-resources" goal runs on "generate-resources" phase so "compress" goal could be run on "process-resources" which invoke right after it.
-
6. Re: Compress custom-dependencies.js
ilya_shaikovsky Mar 29, 2010 5:29 AM (in response to apanag)thread moved to development in order to discuss possible contribution.
-
7. Re: Compress custom-dependencies.js
apanag Mar 29, 2010 8:21 AM (in response to ilya_shaikovsky)Current plugin:
The maven-resource-dependency-plugin creates two files: custom-dependencies.js and custom-dependencies.xcss
I guess you already know that those are the project's javascript and css files packaged together.
My goal:
Compress (minify) those "packaged files" : (the custom-dependencies.js and custom-dependencies.xcss)
What I did:
1. Copied the YuiCompressorMojo.java in the org.richfaces.cdk.rd.mojo, renamed it to YuiCompressorMojoPackage
2. Adapted the YuiCompressorMojoPackage, so it reads and minifies the custom-dependencies.js and custom-dependencies.xcss
/**
* Apply compression on JS and CSS (using YUI Compressor).
*
* @goal compress
* @phase process-resources
*/
public class YuiCompressorMojoPackage extends AbstractMojo {....
}
Now, my pom that uses the maven-resource-dependency-plugin looks like:
<executions>
<execution>
<configuration><webSourceDirectory>${basedir}/WebContent/</webSourceDirectory>
<outputResourceDirectory>${project.build.outputDirectory}</outputResourceDirectory>
<afterScriptIncludes> ... </afterScriptIncludes>
<afterStyleIncludes>..... </afterStyleIncludes>
<gzip>false</gzip>
<nosuffix>true</nosuffix>
<nomunge>false</nomunge></configuration>
<goals>
<goal>assembly-resources</goal>
<goal>compress</goal>
</goals>
</execution>So, after the execution the assemblied resources get compressed.
What do you think?
-
8. Re: Compress custom-dependencies.js
jbalunas Mar 29, 2010 9:09 AM (in response to apanag)Hi Andreas,
I'll take a look for your contributor agreement. We get many random contributor requests, and if I'm not aware of a developer with a contribution I do not approve them. Moving this to development thread was a good idea.
Your update seems interesting, and I have some comments and questions.
What is the license of YuiCompressorMojo.java? Depending on license we can not just rename and include in our distribution.
I like the feature though, and the idea so well just need to figure that out.
I would recommend creating a RF jira to cover this feature request and contribution. We'll be able to track it easier, and work through the questions.
Thanks so much for taking the time and effort to create this!!
Jay
-
9. Re: Compress custom-dependencies.js
apanag Mar 30, 2010 5:08 AM (in response to jbalunas)Hi Jay,
the CSSCompressor is part of the YUI package and it is already included in RichFaces. It is GNU 2.1 (Lesser).
It is no problem to change it, according to the license.
Adding the feature to Jira:
I could not see any component that matches the scope of this feature.
For example:
build: it is about building RF , so not in here
CDK: the feature is not part of CDK
In which Jira component do you think I should add it?
andreas
-
10. Re: Compress custom-dependencies.js
jbalunas Mar 30, 2010 4:42 PM (in response to apanag)Andreas Panagiotidis wrote:
Adding the feature to Jira:
I could not see any component that matches the scope of this feature.
For example:
build: it is about building RF , so not in here
CDK: the feature is not part of CDK
In which Jira component do you think I should add it?
andreas
I would use "core" for now, we can adjust as needed. I take a look in more detail when I can.
-
11. Re: Compress custom-dependencies.js
apanag Apr 9, 2010 7:32 AM (in response to jbalunas)https://jira.jboss.org/jira/browse/RF-8588
I made an entry for this feature in Jira. Could you please read the description and add your comments ?
-
12. Re: Compress custom-dependencies.js
jbalunas Apr 12, 2010 9:59 AM (in response to apanag)Thanks!!
We are about to release 3.3.3.F, and will then be-able to focus on new ideas and plans for 4.0.0. This one included.