Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
18ed7c0
Update wro4j version to 1.8.0 and change gson scope to compile
Jun 7, 2025
e0476b2
Refactor RunnerJsHintProcessor to enhance resource file handling and …
Jun 7, 2025
5ccd1ee
Refactor debug logging in RunnerJsHintProcessor for clarity and consi…
Jun 7, 2025
c0ba261
Refactor RunnerJsHintProcessor for improved error handling and logging
Jun 7, 2025
65e8d57
Refactor RunnerJsHintProcessor to accept context folder as a paramete…
Jun 7, 2025
04a8175
Refactor error handling in RunnerJsHintProcessor to improve logging o…
Jun 7, 2025
fbdc8ab
Update README.md to enhance usage instructions and provide detailed e…
Jun 7, 2025
5f68963
Update README.md to expand usage instructions and include additional …
Jun 8, 2025
72c462a
Update README.md to improve usage instructions and clarify command li…
Jun 8, 2025
c63279f
Fix formatting in README.md for usage instructions of wro4j-runner
Jun 8, 2025
c6fc6fe
Update README.md to clarify usage instructions and enhance .jshintrc …
Jun 8, 2025
c8aec3b
Enhance CSV options serialization to fix 'globals' bug in RunnerJsHin…
Jun 8, 2025
9363008
Add JSHint configuration and test files; enhance processing logic for…
Jun 8, 2025
1fb3bd8
Refactor RunnerJsHintProcessor: clean up code, improve global variabl…
Jun 8, 2025
4ca5a2f
Update wro4j version to 1.8.2 in pom.xml and add wro4j-core dependency
Jun 11, 2025
de2edd1
Refactor RunnerJsHintProcessor: generalize CSV options serialization,…
Jun 11, 2025
7425816
Update wro4j-runner version to 1.7.8 in pom.xml
Jun 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 117 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,122 @@
wro4j-runner
============
# wro4j-runner


Command line runner for wro4j

Building
============
# Building
```
$ git clone [email protected]:wro4j/wro4j-runner.git
$ mvn clean install
```

The compiled file will be saved at:
target/wro4j-runner-1.7.6.jar

# How to Use wro4j-runner

To use `wro4j-runner`, you need to provide a configuration file (`wro.xml`), a properties file (`wro.properties`), and optionally a `.jshintrc` file for JavaScript linting.

```
$ git clone [email protected]:wro4j/wro4j-runner.git
$ mvn clean install
=======================================
USAGE
=======================================
--contextFolder PATH : Folder used as a root of the context relative
resources. By default this is the user current
folder.
--destinationFolder PATH : Where to store the processed result. By default
uses the folder named [wro].
--parallel : Turns on the parallel preProcessing of resources.
This value is false by default.
--postProcessors POST_PROCESSOR : Comma separated list of post-processors
--targetGroups GROUPS : Comma separated value of the group names from
wro.xml to process. If none is provided, all
groups will be processed.
--wroConfigurationFile PATH_TO_WRO_PROPERTIES : The path to the wro.properties file. By default
the configuration file is searched inse the user
current folder.
--wroFile PATH_TO_WRO_XML : The path to the wro model file. By default the
model is searched inse the user current folder.
-c (--compressor, --preProcessors) COMPRESSOR : Comma separated list of pre-processors
-i (--ignoreMissingResources) : Ignores missing resources
-m (--minimize) : Turns on the minimization by applying compressor
```

### 1. Create `wro.xml`

This XML file defines your resource groups and the resources (JS/CSS files) to process. Example:

```xml
<groups xmlns="http://www.isdc.ro/wro">
<group name="all">
<js>/js/script1.js</js>
<js>/js/script2.js</js>
<js>/js/**.js</js>
<css>/css/style1.css</css>
</group>
</groups>
```

For a complete explanation on how to use wro.xml please visit:
https://wro4j.readthedocs.io/en/stable/WroFileFormat/

### 2. Create `wro.properties`

This file configures wro4j options, such as pre-processors and output directories. Example:

```properties
preProcessors=cssUrlRewriting,cssMinJawr,semicolonAppender,jsMin
targetGroups=all
destinationFolder=dist
```

For a complete list of available Configuration options please visit:
https://wro4j.readthedocs.io/en/stable/ConfigurationOptions/

### 3. Create `.jshintrc` (Optional)

If you want to enable JS linting, add a `.jshintrc` file with your linting rules:

```json
{
"esnext": true,
"strict": true,
"undef": true,
"unused": true,
"eqeqeq": true,
"curly": true,
"browser": true,
"node": true,
"devel": true,
"asi": false,
"maxerr": 50,
"latedef": true,
"noarg": true,
"nonew": true,
"camelcase": true,
"quotmark": true,
"trailing": true,
"freeze": true,
"futurehostile": true,
"nocomma": true,
"varstmt": true
}
```

For a complete list of available options please visit:
https://jshint.com/docs/options/

### 4. Run wro4j-runner

Run the tool from the command line, specifying the configuration files:

```sh
java -jar ../wro4j-runner-1.7.6.jar \
--wroFile wro.xml \
--contextFolder test_code_dir \
--postProcessors jsMin \
--wroConfigurationFile wro.properties \
--destinationFolder test_jshint_reports \
--minimize
```

Adjust the paths as needed for your project structure.
17 changes: 14 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@
<version>1.7.5</version>
</parent>
<artifactId>wro4j-runner</artifactId>
<version>1.7.6</version>
<version>1.7.8</version>
<packaging>jar</packaging>
<name>wro4j runner</name>
<properties>
<wro4j.version>1.7.7</wro4j.version>
<wro4j.version>1.8.2</wro4j.version>
<wro4j.runner.mainClass>ro.isdc.wro.runner.Wro4jCommandLineRunner</wro4j.runner.mainClass>
</properties>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>wro4j-core</artifactId>
<version>${wro4j.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>wro4j-extensions</artifactId>
Expand All @@ -29,7 +34,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<scope>provided</scope>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jruby</groupId>
Expand Down Expand Up @@ -83,6 +88,12 @@
<artifactId>slf4j-log4j12</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.1.6</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
Loading