Files
spring-batch/spring-batch-core/build.gradle
Gunnar Hillert f1d71a06f4 BATCH-2144 Convert Spring Batch to use Gradle
* Use Gradle 1.11
* Remove SpringSource references
* Update JavaDoc overview
* Update Jacoco conf + Add license/manifest files
* Addresses also BATCH-2187
* Update a number of unit tests to not be ignored

Jira: https://jira.springsource.org/browse/BATCH-2144
2014-04-24 12:16:17 -05:00

46 lines
1.4 KiB
Groovy

/**
* Generate schema creation and drop scripts for various databases
* supported by Spring Batch.
*
* @author David Syer (original Ant/Maven work)
* @author Chris Beams (port to Gradle)
*/
task generateSql {
group = "Build"
description = "Generates schema creation and drop scripts for supported databases."
configurations { vpp }
dependencies { vpp 'foundrylogic.vpp:vpp:2.2.1' }
def generatedResourcesDir = new File('src/main/resources/org/springframework/batch/core')
outputs.dir generatedResourcesDir
ant.typedef(resource: 'foundrylogic/vpp/typedef.properties',
classpath: configurations.vpp.asPath)
ant.taskdef(resource: 'foundrylogic/vpp/taskdef.properties',
classpath: configurations.vpp.asPath)
doLast {
['db2', 'derby', 'h2', 'hsqldb', 'mysql',
'oracle10g', 'postgresql', 'sqlf', 'sqlserver', 'sybase'].each { dbType ->
ant.vppcopy(todir: generatedResourcesDir, overwrite: 'true') {
config {
context {
property key: 'includes', value: 'src/main/sql'
property file: "src/main/sql/${dbType}.properties"
}
engine {
property key: 'velocimacro.library', value: "src/main/sql/${dbType}.vpp"
}
}
fileset dir: 'src/main/sql', includes: 'schema*.sql.vpp'
mapper type: 'glob', from: '*.sql.vpp', to: "*-${dbType}.sql"
}
}
}
}
// tie schema generation to the build lifecycle
//compileJava.dependsOn generateSql