Skip to content

Commit aea73e1

Browse files
committed
Update references from 0.4 to 1.0
1 parent 7a8473d commit aea73e1

File tree

2 files changed

+28
-27
lines changed

2 files changed

+28
-27
lines changed

README.md

+26-25
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ gradle-rocker-plugin
66
# Overview
77

88
[Gradle](http://www.gradle.org) plugin that integrates the Rocker template engine. For each named rocker configuration declared
9-
in the build, the plugin adds a task to generate the Java sources from the specified Rocker templates and includes the
10-
generated Java sources in the matching source set, if existing. The code generation tasks participate in incremental builds and
9+
in the build, the plugin adds a task to generate the Java sources from the specified Rocker templates and includes the
10+
generated Java sources in the matching source set, if existing. The code generation tasks participate in incremental builds and
1111
in task output caching by the [Gradle build cache](https://docs.gradle.org/current/userguide/build_cache.html). Additionally,
12-
the compile task itself is incremental, meaning it is optimized so that only templates which have changed are regenerated.
12+
the compile task itself is incremental, meaning it is optimized so that only templates which have changed are regenerated.
1313
The plugin can be applied on both Java projects and Android projects.
1414

1515
You can find out more details about the actual Rocker source code generation in the [Rocker documentation](https://github.com/fizzed).
1616

1717
The rocker plugin is hosted at [Bintray's JCenter](https://bintray.com/etienne/gradle-plugins/gradle-rocker-plugin).
18-
18+
1919
## Build scan
2020

2121
Recent build scan: https://scans.gradle.com/s/nrhggndytzjze
@@ -25,22 +25,22 @@ Find out more about build scans for Gradle and Maven at https://scans.gradle.com
2525
# Functionality
2626

2727
The following functionality is provided by the rocker plugin:
28-
28+
2929
* Generate Java sources from a given set of Rocker templates
3030
* Add the generated Java sources to the name-matching source set, if existing
31-
* Wire task dependencies such that the Java sources are generated before the Java compile task of the name-matching source set compiles them, if existing
31+
* Wire task dependencies such that the Java sources are generated before the Java compile task of the name-matching source set compiles them, if existing
3232

3333
The following Gradle configuration changes are contributed by the rocker plugin:
34-
35-
* Add the `com.fizzed:rocker-compiler` dependency needed to execute the Rocker template engine to the new `rockerCompiler` configuration
34+
35+
* Add the `com.fizzed:rocker-compiler` dependency needed to execute the Rocker template engine to the new `rockerCompiler` configuration
3636
* Add the `com.fizzed:rocker-runtime` dependency to the name-matching `implementation` configuration to successfully compile the Java sources generated from the Rocker templates
3737
* Use the customizable Rocker version across all `com.fizzed:rocker-*` dependencies
3838

3939
The following Gradle features are supported by the rocker plugin:
40-
41-
* `RockerCompile` task instances are themselves incremental
42-
* `RockerCompile` task instances participate in incremental builds
43-
* `RockerCompile` task instances participate in task output caching (if the rocker hot reload feature is disabled)
40+
41+
* `RockerCompile` task instances are themselves incremental
42+
* `RockerCompile` task instances participate in incremental builds
43+
* `RockerCompile` task instances participate in task output caching (if the rocker hot reload feature is disabled)
4444

4545
# Configuration
4646

@@ -56,7 +56,7 @@ buildscript {
5656
jcenter()
5757
}
5858
dependencies {
59-
classpath 'nu.studer:gradle-rocker-plugin:0.4'
59+
classpath 'nu.studer:gradle-rocker-plugin:1.0'
6060
}
6161
}
6262
@@ -67,20 +67,20 @@ apply plugin: 'nu.studer.rocker'
6767

6868
```groovy
6969
plugins {
70-
id 'nu.studer.rocker' version '0.4'
70+
id 'nu.studer.rocker' version '1.0'
7171
}
7272
```
7373

74-
Please refer to the [Gradle DSL PluginDependenciesSpec](http://www.gradle.org/docs/current/dsl/org.gradle.plugin.use.PluginDependenciesSpec.html) to
74+
Please refer to the [Gradle DSL PluginDependenciesSpec](http://www.gradle.org/docs/current/dsl/org.gradle.plugin.use.PluginDependenciesSpec.html) to
7575
understand the behavior and limitations when using the new syntax to declare plugin dependencies.
7676

7777
## Define rocker configurations
7878

7979
This is a sample configuration:
80-
80+
8181
```groovy
8282
plugins {
83-
id 'nu.studer.rocker' version '0.4'
83+
id 'nu.studer.rocker' version '1.0'
8484
id 'java'
8585
}
8686
@@ -99,23 +99,23 @@ rocker {
9999
rockerVersion = '1.2.2' // optional
100100
```
101101

102-
The rocker _main_ configuration declares that the Rocker templates are in _src/rocker_ and the generated Java sources need to end up in _src/generated/rocker_. It further
103-
declares via the _optimize_ property that the generated Java sources should be optimized to not contain any code that allows for hot reload via Rocker. Since the name
102+
The rocker _main_ configuration declares that the Rocker templates are in _src/rocker_ and the generated Java sources need to end up in _src/generated/rocker_. It further
103+
declares via the _optimize_ property that the generated Java sources should be optimized to not contain any code that allows for hot reload via Rocker. Since the name
104104
of the configuration is `main`, the generated sources are added to the `main` source set contributed by the applied `java` plugin.
105105

106106
Given the configuration above, you can invoke the Rocker template engine by issuing `./gradlew compileRocker`. You can also directly call `./gradlew compileJava` which first
107-
generates the Java sources from the Rocker templates, and then compiles these Java sources as part of compiling all sources in the _main_ source set.
107+
generates the Java sources from the Rocker templates, and then compiles these Java sources as part of compiling all sources in the _main_ source set.
108108

109-
Since we declared to use version _1.2.2_ of the Rocker template engine, all Rocker dependencies of all Gradle configurations will be of that given version.
109+
Since we declared to use version _1.2.2_ of the Rocker template engine, all Rocker dependencies of all Gradle configurations will be of that given version.
110110

111111
> I suggest you use the [Continuous build](https://docs.gradle.org/current/userguide/continuous_build.html) feature of Gradle instead of using the Rocker hot reload feature.
112-
> Declare `optimize = true` in the rocker configuration of your Gradle build, and then run your build with the `-t` command line option. In addition, deactivating the hot
112+
> Declare `optimize = true` in the rocker configuration of your Gradle build, and then run your build with the `-t` command line option. In addition, deactivating the hot
113113
> reload feature of Rocker will enable the rocker tasks for task output caching by the [Gradle build cache](https://docs.gradle.org/current/userguide/build_cache.html).
114114
115115
## Complete rocker configuration options
116116

117117
For each named configuration, the following options can be configured:
118-
118+
119119
* `optimize` (boolean): if _true_, hot reload support is removed from the generated templates, task output becomes cacheable
120120
* `extendsClass` (String): the class that all template implementations should extend
121121
* `extendsModelClass` (String): the class that all template models should extend
@@ -125,8 +125,8 @@ For each named configuration, the following options can be configured:
125125
* `outputDir` (Path): the directory where rocker will generate the Java sources into
126126
* `classDir` (Path): the directory where the hot reload feature will compile classes to at runtime
127127

128-
> Warning: do not configure any of `templateDir`, `outputDir`, and `classDir` to point to the same directory or to a directory that also contains other content.
129-
128+
> Warning: do not configure any of `templateDir`, `outputDir`, and `classDir` to point to the same directory or to a directory that also contains other content.
129+
130130
# Invocation
131131

132132
## Invoke rocker task
@@ -140,6 +140,7 @@ You can find a self-contained example build script [here](example).
140140

141141
# Changelog
142142

143+
+ 1.0 - Made Gradle 5.0 the minimum compatible version and replaced usage of deprecated APIs.
143144
+ 0.4 - Removed wiring between `clean` task and deleting generated Rocker sources, uses Rocker 1.2.0 by default.
144145
+ 0.3.1 - Fixed incremental template compilation.
145146
+ 0.3 - Incremental template compilation, i.e. only the modified templates are compiled.

example/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
plugins {
2-
id 'nu.studer.rocker' version '0.4'
2+
id 'nu.studer.rocker' version '1.0'
33
id 'java'
44
}
55

66
repositories {
77
jcenter()
88
}
99

10-
rockerVersion = '0.20.0'
10+
rockerVersion = '1.2.2'
1111

1212
rocker {
1313
main {

0 commit comments

Comments
 (0)