Letractively / wro4j

Automatically exported from code.google.com/p/wro4j
0 stars 0 forks source link

Wro4jCommandLineRunner not governed by wro.properties #785

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run Wro4jCommandLineRunner with no wro.properties, e.g. from Ant build.xml 
(see below).
2. Wro4jCommandLineRunner warns: C:\Pole\trunk\apps\poleui\wro.properties does 
not exist. Using default configuration.
3. Create a wro.properties at that location. Run Wro4jCommandLineRunner again. 
Warning goes away but Wro4jCommandLineRunner seems to pay no attention to the 
contents of the wro.properties file (see contents below).

What is the expected output? What do you see instead?
Now that Wro4jCommandLineRunner has detected wro.properties I would expect it 
to influence the behaviour. Instead, none of the wro.properties properties have 
any effect. The bundles are generated just the same when wro.properties is 
empty.

What version of the product are you using? On what operating system?
1.6.3 on Windows 7

Please provide any additional information below.

I need the generated bundles to be named according to a namingStrategy (for 
far-future expiry headers). The bundle files are not being renamed. Neither are 
any of the other wro.properties having any influence on the way 
Wro4jCommandLineRunner operates.

wro.properties:
managerFactoryClassName=ro.isdc.wro.manager.factory.ConfigurableWroManagerFactor
y
preProcessors=cssUrlRewriting,cssImport,cssMin,cssVariables,semicolonAppender,be
autifyJs
postProcessors=
uriLocators=servletContext,uri,classpath
# Configurable options available since 1.4.7 (not mandatory)
hashStrategy=MD5
namingStrategy=hashEncoder-CRC32

Ant script snippet:

  <macrodef name="wro4j">
    <attribute name="target-groups"/>
    <!-- Note: We use beautifyJs rather than uglifyJs since we still want readable js (just with comments removed).
         (Wanted to just remove comments but haven't found a way to do that without beatifying.) -->
    <attribute name="pre-processors" default="cssUrlRewriting,cssImport,cssMin,cssVariables,semicolonAppender,beautifyJs"/>
    <!-- attribute name="post-processors" default=""/ -->
    <attribute name="wro-file" default="${webapp}/WEB-INF/wro.xml"/>
    <attribute name="context-dir" default="${webapp}"/>
    <attribute name="output-dir" default="${webapp}/wro"/>
    <sequential>
       <exec executable="java" failonerror="true">
         <arg value="-cp"/>
         <arg value="${poleui.lib}/wro4j/buildtime-only/wro4j-runner-1.6.3-jar-with-dependencies.jar;${poleui.lib}/wro4j/buildtime-only/hamcrest-core-1.3.jar;${poleui.lib}/wro4j/buildtime-only/groovy-all-minimal-1.0.jar"/>
         <arg value="ro.isdc.wro.runner.Wro4jCommandLineRunner"/>
         <arg value="--wroFile"/>
         <arg value="@{wro-file}"/>
         <arg value="--contextFolder"/>
         <arg value="@{context-dir}"/>
         <arg value="--targetGroups"/>
         <arg value="@{target-groups}"/>
         <arg value="--destinationFolder"/>
         <arg value="@{output-dir}"/>
         <arg value="-m"/>
       </exec>
    </sequential>
  </macrodef>

  <target name="minify" depends="init" description="Minifies and aggregates static resources such as JS and CSS files.">
    <delete dir="${webapp}/wro" />
    <wro4j target-groups="appPv"/>
    <echo>Minification completed successfully</echo>
  </target>

I am aiming to use wro4j in conjunction with the "wro4j-tag" tag library. 
Haven't got to that stage yet though.

PS. Is there some way I can choose the location for wro.properties rather?

Original issue reported on code.google.com by easle...@gmail.com on 19 Sep 2013 at 3:30

GoogleCodeExporter commented 9 years ago
Have you tried using latest version (1.7.1)?

Original comment by alex.obj...@gmail.com on 23 Sep 2013 at 3:11

GoogleCodeExporter commented 9 years ago
Choosing the location of wro.properties is possible only by extending wro4j 
(using maven plugin or runtime solution). It is harder to achieve using 
wro4j-runner..

Original comment by alex.obj...@gmail.com on 23 Sep 2013 at 3:13

GoogleCodeExporter commented 9 years ago
I can confirm that wro.properties is ignored in latest version (1.7.1). 
Will fix it for next release.

Original comment by alex.obj...@gmail.com on 23 Sep 2013 at 5:24

GoogleCodeExporter commented 9 years ago
I have created a new issue (issue787) which will allow configuration of the 
wro.properties file location.

Original comment by alex.obj...@gmail.com on 23 Sep 2013 at 8:56

GoogleCodeExporter commented 9 years ago
More updates about this task: 

the wro.properties is being used, but until now only the configurations (ex: 
ignoreMissingResources, ignoreFailingProcessor, etc...) were considered. The 
processors configurations were ignored, since it was possible to provide 
processors as command line parameters.

Original comment by alex.obj...@gmail.com on 23 Sep 2013 at 9:00

GoogleCodeExporter commented 9 years ago
Sounds good! Just to be clear, the most important thing for me in the short 
term is to have some means of being able to specify naming strategy, whether 
this be via cmd line args or wro.properties.

Original comment by easle...@gmail.com on 24 Sep 2013 at 8:08

GoogleCodeExporter commented 9 years ago
Fixed in branch 1.7.x.
Now it is possible to configure naming strategy in wro.properties which is 
loaded by the runner.

Original comment by alex.obj...@gmail.com on 1 Nov 2013 at 12:04