Giter Club home page Giter Club logo

xmlcalabash1-gradle's Introduction

XML Calabash 1.0 Gradle Plugins

This project provides two Gradle plugins to run XML Calbash. Simply include the dependencies in the buildscript:

buildscript {
  repositories {
    mavenCentral()
  }

  dependencies {
    classpath group: 'com.xmlcalabash', name: 'gradle', version: '0.0.2'
    classpath group: 'com.xmlcalabash', name: 'xmlcalabash', version: '1.1.7-96'
  }
}

And then create tasks of the appropriate type:

  • com.xmlcalabash.XMLCalabashExec is modeled after the standard JavaExec task. You can specify the classpath, heap size, and other VM parameters using the same properties as the JavaExec task. The XML Calabash options and parameters are specified using explicit properties. You cannot set the main class name or call the args() method.

  • com.xmlcalabash.XMLCalabashTask runs XML Calabash in the same JVM that gradle is using. Consequently, you can’t change any of the JVM parameters.

Task Properties

The following properties are supported:

pipeline

Filename of the pipeline to run (string, required).

debugPipeline

Enable debug mode (boolean)

safeMode

Enable safe mode (boolean)

profilePipeline

Name of the file to use for writing profile information (string)

saxonEdition

Saxon edition (string: “he”, “pe”, or “ee”; defaults to “he”)

schemaAware

Schema aware processing (boolean, requires “he” or “pe” edition)

entityResolver

Name of entity resolver class (string)

uriResolver

Name of URI resolver class (string)

configFile

Filename of the XML Calabash configuration file (string; defaults to $HOME/.calabash)

saxonConfigFile

Filename of the Saxon Configuration file (string)

library

Library to load (string)

step

Step to run (QName)

calabashExtensions

Extenions to enable (list of strings: “general-values”, “xpointer-on-text”, “transparent-json”, “json-flavor-???”, “allow-text-results”, “use-xslt-1.0”, “html-serializer”)

Task Methods

In addition, the following methods may be called:

namespaceBinding(String prefix, String uri)

Establish the namespace binding between prefix and uri for evaluating QNames specified in other properties and methods.

input(String port, String filename)

Send the XML document identified by filename to the port named port.

dataInput(String port, String filename)

Send the non-XML document identified by filename to the port named port.

dataInput(String port, String filename, String contentType)

Send the non-XML document identified by filename to the port named port with the explicit content type specified in contentType.

output(String port, String filename)

Send the output from the port named port to the filename identified by filename.

param(String qname, String value)

Send the qname parameter with the value value to the primary parameter input port on the pipeline.

param(String qname, String value, String port)

Send the qname parameter with the value value to the port parameter input port on the pipeline.

option(String qname, String value)

Send the option qname to the pipeline with the value value.

Examples

Using the XMLCalabashExec task type:

task doSomething(type: com.xmlcalabash.XMLCalabashExec) {
  classpath = configurations.runtime
  maxHeapSize = '1024m'
  pipeline = "pipe.xpl"
  safeMode = true
  parameter('styleParam', 'someValue')
  option('optName', 'optValue')
  input('source','filename.xml')
  input('alt','altname.xml')
  input('result','output.xml')
}

Or running in the same VM:

dependencies {
  compile (
    [group: 'com.xmlcalabash', name: 'xmlcalabash', version: '1.1.7-96'],
  )
}

task doSomething(type: com.xmlcalabash.XMLCalabashTask) {
  pipeline = "pipe.xpl"
  safeMode = true
  parameter('styleParam', 'someValue')
  option('optName', 'optValue')
  input('source','filename.xml')
  input('alt','altname.xml')
  input('result','output.xml')
}

Note that in the XMLCalabashTask case, you must put the XML Calabash dependencies in the compile configuration or they won’t be available to the task (which runs in the same VM).

(I don’t know why you have to fully qualify the types, in theory just XMLCalabashExec or XMLCalabashTask should work. But they don’t at the moment.)

xmlcalabash1-gradle's People

Contributors

ndw avatar greut avatar

Watchers

Robert Winslow Dalpe avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.