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
//Copying a file with keyword expansion | |
versionId = '1.6' | |
task copyProductionConfig(type: Copy) { | |
from 'source' | |
include 'config.properties' | |
into 'build/war/WEB-INF/config' | |
expand([ | |
databaseHostname: 'db.company.com', | |
version: versionId, |
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
//Trying to set the destinationDir property of a Jar task with a string | |
jar { | |
destinationDir = 'build/jar' | |
} | |
//Trying to set the destinationDir property of a Jar task with a string | |
jar { | |
destinationDir = new File('build/jar') | |
} | |
//Setting the destinationDir property of a Jar task using the file() method | |
jar { |
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
//Printing out all of the compile-time dependencies of the build as a path-like string | |
println configurations.compile.asPath |
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
//Creating an intersection of two FileCollections | |
def poems = fileTree(dir: 'src/main/resources', include: '*.txt') | |
def romantics = fileTree(dir: 'src/main/resources', include: 'shelley*') | |
def goodPoems = poems - romantics |
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
//Using FileCollection addition to create a runtime classpath | |
task run(type: JavaExec) { | |
main = 'org.gradle.example.PoetryEmitter' | |
classpath = configurations.compile + sourceSets.main.output | |
} |
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
import org.gradle.api.NamedDomainObjectContainer | |
import org.gradle.api.Plugin | |
import org.gradle.api.Project | |
import org.gradle.api.DefaultTask | |
import org.gradle.api.tasks.TaskAction | |
import liquibase.integration.commandline.Main | |
apply plugin: LiquibasePlugin | |
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
#The contents of the liquibase.properties meta file | |
implementation-class=com.augusttechgroup.gradle.liquibase.LiquibasePlugin | |
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 simplified plug-in build file | |
apply plugin: 'groovy' | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
groovy 'org.codehaus.groovy:groovy:1.8.6' | |
compile gradleApi() |
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
artifacts { | |
archives file: 'A.jar', name: 'A', type: 'jar' | |
archives file: 'B.jar', name: 'B', type: 'jar' | |
} | |
uploadArchives { | |
repositories { | |
mavenDeployer { | |
configuration = configurations.deployerJars | |
repository(url: "dav:https://myRepo.com/release/") { |
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
apply plugin:'java' | |
apply plugin:'maven' | |
import org.gradle.api.internal.artifacts.publish.DefaultPublishArtifact | |
version = "6.1.1" | |
group = "com.oahu" | |
ant.importBuild "$projectDir/tools/ant/package.xml" |