Skip to content

d10xa/gradle-download-xml-plugin

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 

Gradle Download Xml Plugin

Build Status Download

Apply plugin

Gradle >= 2.1

plugins {
    id 'ru.d10xa.download-xml' version '0.0.4'
}

Gradle < 2.1

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'ru.d10xa:gradle-download-xml-plugin:0.0.4'
    }
}

apply plugin: 'ru.d10xa.download-xml'

Usage

task downloadWsdl << {
    println 'Downloading...'
    
    downloadXml {
        src(['http://www.predic8.com:8080/crm/CustomerService?wsdl'])
        dest buildDir
        namespaceToFile([
                'http://predic8.com/wsdl/crm/CRMService/1/': 'service.wsdl',
                'http://predic8.com/crm/1/'                : 'a/b/c/schema-crm.xsd',
                'http://predic8.com/common/1/'             : 'x/y/z/schema-common.xsd'
        ])
        // username 'foo' // optional
        // password 'bar' // optional
        // locations {
        //      malformedLocationHandler { 
        //          "http://localhost:8080/$it" // optional
        //      } 
        // }
    }
    
    println 'Download Complete...'
}

schema locations will be overwritten by the relative

<!--in a/b/c/schema-crm.xsd-->
<xsd:import schemaLocation="../../../x/y/z/schema-common.xsd"
    namespace="http://predic8.com/common/1/"></xsd:import>

Malformed schema locations

You can handle local schema locations with malformedLocationHandler

locations { 
    malformedLocationHandler { "http://localhost:8080/$it" }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages