| import org.apache.tools.ant.filters.FixCrLfFilter |
| import org.apache.tools.ant.filters.ReplaceTokens |
| |
| task copyGradleWrapper(type: Copy) { |
| ext.srcDir = file("$buildDir/wrapper") |
| |
| inputs.dir srcDir |
| outputs.dir file("$buildDir/resources/main/archetype-resources") |
| |
| from srcDir |
| into file("$buildDir/resources/main/archetype-resources") |
| |
| exclude '.gradle' |
| } |
| |
| task addGradleWrapper(type: Exec) { |
| workingDir "$buildDir/wrapper" |
| commandLine "${rootProject.projectDir}/gradlew", 'wrapper', '--gradle-version', '5.2' |
| |
| standardOutput = new ByteArrayOutputStream() |
| |
| ext.output = { |
| return standardOutput.toString() |
| } |
| |
| doFirst { |
| def wrapperDirectory = new File(buildDir, "wrapper") |
| wrapperDirectory.mkdirs() |
| |
| def settings = new File(wrapperDirectory, "settings.gradle") |
| new FileOutputStream(settings).close(); |
| } |
| |
| finalizedBy 'copyGradleWrapper' |
| } |
| |
| task addWrappers(dependsOn: [addGradleWrapper]) { |
| } |
| |
| task processFiltered(type: Copy) { |
| ext.srcDir = file('src/main/resources-filtered') |
| |
| inputs.dir srcDir |
| outputs.dir sourceSets.main.output.resourcesDir |
| |
| from srcDir |
| into sourceSets.main.output.resourcesDir |
| |
| filter(FixCrLfFilter) |
| filter(ReplaceTokens, tokens: [ |
| quickstartVersion: version, |
| tapestryVersion: version, |
| tapestryTestifyVersion: '1.0.4', |
| tapestryXpathVersion: '1.0.1', |
| gebVersion: '2.3.1', |
| groovyVersion: '2.5.6', |
| htmlunitDriverVersion: '2.33.3', |
| jacksonVersion: '2.9.6', |
| jsonVersion: '1.1.2', |
| seleniumVersion: '3.141.59', |
| servletApiVersion: '3.0.1', |
| spockVersion: '1.3-RC1-groovy-2.5', |
| springBootVersion: '2.1.3.RELEASE', |
| yassonVersion: '1.0.1' |
| ]) |
| } |
| |
| processResources.dependsOn([addWrappers, processFiltered]) |