Skip to content

Commit

Permalink
bumped jbake version to 2.3.2. Extended Readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
ancho committed Oct 14, 2014
1 parent 7b7cf11 commit fad1555
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 17 deletions.
47 changes: 35 additions & 12 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,13 @@ buildscript {
dependencies {
classpath 'me.champeau.gradle:jbake-gradle-plugin:0.2'
// optional, if you use asciidoctor markup
classpath 'org.asciidoctor:asciidoctor-java-integration:0.1.4'
// optional, if you use markdown markup
classpath 'org.pegdown:pegdown:1.4.2'
// optional, if you use freemarker template engine
classpath 'org.freemarker:freemarker:2.3.19'
}
}
apply plugin: 'me.champeau.jbake'
----

This will add a `bake` task to your build, which will search for a standard http://www.jbake.org[JBake] source tree in
This will add a `jbake` task to your build, which will search for a standard http://www.jbake.org[JBake] source tree in
`src/jbake` and generate content into `$buildDir/jbake` (typically `build/jbake`).

== Configuration
Expand All @@ -41,11 +32,43 @@ The default input and output directories can be changed using the `jbake` config
[source,groovy]
----
jbake {
input = file('jbake-sources')
output = file("$buildDir/output")
srcDirName = 'jbake-sources'
destDirName = 'output'
}
----
The generated output can then be found at `$buildDir/output`.

The Version could be changed too:

[source,groovy]
----
jbake {
version = '2.3.0'
}
----

The default is 2.3.2.

=== Render Engine configuration

Jbake uses three engines. The library versions could be changed too:

[source,groovy]
----
jbake {
pegdownVersion = '1.4.2'
freemarkerVersion = '2.3.19'
asciidoctorJavaIntegrationVersion = '0.1.4'
asciidoctorjVersion = '1.5.1'
}
----

Notice the `asciidoctorJavaIntegrationVersion` and `asciidoctorjVersion`. Since Version 2.3.1 jbake has changed
to the asciidoctorj library.

This plugin handles this change internally. If you use a Version > 2.3.0 of jbake, the dependency switch to the new one.

=== JBake configuration
There are several options to configure http://www.jbake.org[JBake]. One is to have the regular `jbake.properties` file
into the source directory. The other is to use the plugin configuration block:
Expand Down
2 changes: 1 addition & 1 deletion src/main/groovy/me/champeau/gradle/JBakeExtension.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package me.champeau.gradle
*/
class JBakeExtension {

String version = '2.3.0'
String version = '2.3.2'
String pegdownVersion = '1.4.2'
String freemarkerVersion = '2.3.19'
String asciidoctorJavaIntegrationVersion = '0.1.4'
Expand Down
25 changes: 21 additions & 4 deletions src/test/groovy/me/champeau/gradle/JBakePluginSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,24 @@ class JBakePluginSpec extends Specification {

where:
group | name | version
'org.jbake' | 'jbake-core' | '2.3.0'
'org.jbake' | 'jbake-core' | '2.3.2'
'org.freemarker' | 'freemarker' | '2.3.19'
'org.pegdown' | 'pegdown' | '1.4.2'
'org.asciidoctor' | 'asciidoctor-java-integration' | '0.1.4'
'org.asciidoctor' | 'asciidoctorj' | '1.5.1'

}

def "set dependency version by extension"(){

given:
project.jbake.version = '2.3.2'
project.jbake.version = '2.3.0'

when:
project.evaluate()

then:
project.configurations.jbake.dependencies.find {
it.name == 'jbake-core' && it.version == '2.3.2'
it.name == 'jbake-core' && it.version == '2.3.0'
}

}
Expand All @@ -88,6 +88,23 @@ class JBakePluginSpec extends Specification {
}
}

def "use asciidoctor-java-integration if version < 2.3.1"(){

given:
project.jbake.version = '2.3.0'

when:
project.evaluate()

then:
project.configurations.jbake.dependencies.find {
it.group == 'org.asciidoctor' &&
it.name == 'asciidoctor-java-integration' &&
it.version == '0.1.4'
}

}

def "input dir should be configured by extension"(){
given:
def srcDirName = "src/jbake-project"
Expand Down

0 comments on commit fad1555

Please sign in to comment.