forked from jbake-org/jbake
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request jbake-org#7 from ancho/feature/configurable-jbake-…
…version Configurable jbake version
- Loading branch information
Showing
13 changed files
with
531 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Adds a configuration named 'provided'. 'Provided' dependencies | ||
* are incoming compile dependencies that aren't outgoing | ||
* dependencies. In other words, they have no effect on transitive | ||
* dependency management. | ||
*/ | ||
|
||
configurations { | ||
provided | ||
providedPlusCompile.extendsFrom(compile, provided) | ||
testCompile.extendsFrom(providedPlusCompile) | ||
} | ||
|
||
sourceSets.main { | ||
compileClasspath = configurations.providedPlusCompile | ||
} | ||
|
||
plugins.withType(IdeaPlugin) { | ||
idea.module.scopes.PROVIDED.plus = [ configurations.provided ] | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Tue Jan 28 21:49:48 CET 2014 | ||
#Fri Oct 03 18:00:04 CEST 2014 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-all.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package me.champeau.gradle | ||
|
||
/** | ||
* Created by frank on 12.10.14. | ||
*/ | ||
class JBakeExtension { | ||
|
||
String version = '2.3.2' | ||
String pegdownVersion = '1.4.2' | ||
String freemarkerVersion = '2.3.19' | ||
String asciidoctorJavaIntegrationVersion = '0.1.4' | ||
String asciidoctorjVersion = '1.5.1' | ||
String srcDirName = 'src/jbake' | ||
String destDirName = 'jbake' | ||
boolean clearCache = false | ||
Map<String, Object> configuration = [:] | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package me.champeau.gradle | ||
|
||
/** | ||
* Created by frank on 12.10.14. | ||
*/ | ||
public interface JBakeProxy { | ||
|
||
def jbake() | ||
def prepare() | ||
def getConfig() | ||
def setConfig(Object config) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package me.champeau.gradle | ||
|
||
import groovy.transform.Field | ||
import org.apache.commons.configuration.CompositeConfiguration | ||
import org.apache.commons.configuration.MapConfiguration | ||
|
||
import java.lang.reflect.Constructor | ||
|
||
|
||
/** | ||
* Created by frank on 12.10.14. | ||
*/ | ||
class JBakeProxyImpl implements JBakeProxy{ | ||
|
||
Class delegate | ||
def input | ||
def output | ||
def clearCache | ||
|
||
def jbake | ||
|
||
def jbake() { | ||
if(jbake) { | ||
jbake.bake() | ||
} | ||
} | ||
|
||
def prepare() { | ||
Constructor constructor = delegate.getConstructor(File.class,File.class,boolean) | ||
|
||
jbake = constructor.newInstance(input, output, clearCache) | ||
jbake.setupPaths() | ||
} | ||
|
||
def getConfig(){ | ||
jbake.config | ||
} | ||
|
||
def setConfig(Object config) { | ||
jbake.config = config | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package me.champeau.gradle | ||
|
||
/** | ||
* Created by frank on 13.10.14. | ||
*/ | ||
class Version implements Comparable { | ||
|
||
Integer major | ||
Integer minor | ||
Integer bugfix | ||
|
||
Version(String version) { | ||
def tokens = version.tokenize('.') | ||
|
||
this.major = (tokens.size>=1)?tokens.get(0).toInteger():0 | ||
this.minor = (tokens.size>=2)?tokens.get(1)?.toInteger():0 | ||
this.bugfix = (tokens.size>=3)?tokens.get(2)?.toInteger():0 | ||
} | ||
|
||
@Override | ||
int compareTo(Object other) { | ||
|
||
def ret = 0 | ||
|
||
if ( this.major == other.major && this.minor == other.minor && this.bugfix == other.bugfix ){ | ||
return 0 | ||
} | ||
|
||
if ( this.major <= other.major ) { | ||
if ( this.minor < other.minor ) { | ||
ret = -1 | ||
} | ||
if ( this.bugfix < other.bugfix ) { | ||
ret = -1 | ||
} | ||
} | ||
|
||
if ( this.major >= other.major ) { | ||
if ( this.minor > other.minor ) { | ||
ret = 1 | ||
} | ||
if ( this.bugfix > other.bugfix ) { | ||
ret = 1 | ||
} | ||
} | ||
|
||
return ret | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.