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
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- ============================================================================ | |
(C) Copyright Schalk W. Cronjé 2013 | |
This code snippet is licensed under the Apache License 2.0 | |
See http://www.apache.org/licenses/LICENSE-2.0 for license details | |
============================================================================ --> | |
<xsl:transform | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1" |
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
// Create the task | |
// The declare the task and adds a body that will be executed everytime the tasks is executed | |
// Variables pushed in as configuration can be referenced here | |
// | |
// This simple tasks will write a text file containing a list of files | |
// in a source set. It will also only update the output file, if at least one | |
// source file has changed. | |
task myTask << { | |
outputs.file.singleFile.withWriter { out -> | |
inputs.sourceFiles.each { |
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
// FOR THE IMPATIENT: Final solution at the end | |
// Classic Ivy style to publish to Bintray. | |
// This requires the package to be pre-created, possibly by manual process on website | |
// or via call such as https://github.com/ysb33r/Gradle/blob/master/buildSrc/src/main/groovy/BintrayPackage.groovy | |
uploadArchives { | |
repositories { | |
ivy { | |
url 'http://api.bintray.com/ysb33r/grysb33r/gnumake-gradle-plugin/0.0.3' | |
credentials { |
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
class GnuMake extends DefaultTask { | |
@Input | |
@Optional | |
List<String> targets | |
@Input | |
@Optional | |
Map<String,Object> flags = [:] | |
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
println ((0..<100).step(7).collect{it*it}.sum()) |
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
// Not quite sure if this will work as expected, but probably | |
// worth a trying if you want xi:include documents to be inlucdd. | |
def spf = javax.xml.parsers.SAXParserFactory.newInstance() | |
spf.namespaceAware = true | |
spf.setXIncludeAware ( true ) | |
def parser = new XmlSlurper(spf.newSAXParser()) |
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
// A minimum Gradle file to get you started with asciidoctor-packt | |
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath 'org.ysb33r.gradle:vfs-gradle-plugin:1.0-beta1' | |
classpath 'commons-httpclient:commons-httpclient:3.1' |
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
buildscript { | |
repositories { | |
jcenter() | |
mavenLocal() | |
} | |
dependencies { | |
classpath 'com.github.jruby-gradle:jruby-gradle-plugin:0.1.2-SNAPSHOT' | |
classpath 'org.ysb33r.gradle:vfs-gradle-plugin:0.5' |
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 is a first stab at trying to convert the asciidoctorj pom.xml to build.gradle | |
// Note the WORKAROUND. These are to work around problems with erubis. Gradle is much stricter | |
// about broken POMs that Maven. | |
// | |
// This had been done using some code which is is based on the current version of jruby-gradle-plugin, | |
// but with updates to fix shortcomings in the release 2.2.0 | |
// | |
// This requires Gradle 2.0 or better. | |
// | |
buildscript { |
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
// You will need the VFS plugin | |
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
// Set your | |
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:0.7.0' | |
classpath 'org.ysb33r.gradle:vfs-gradle-plugin:0.5' |