Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (64 sloc) 1.99 KB
/*
* Copyright (c) 2011.
* Author Kelly Robinson.
*/
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'maven'
group = 'org.kar'
version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
groovy 'org.codehaus.groovy:groovy:1.8.0'
}
idea {
module {
downloadJavadoc = true
}
}
sourceSets.main.resources.srcDirs = []
idea {
project {
ipr {
withXml { provider ->
def node = provider.asNode()
// Use git
def vcsConfig = node.component.find { it.'@name' == 'VcsDirectoryMappings' }
vcsConfig.mapping[0].'@vcs' = 'Git'
// Set gradle home
def gradleSettings = node.appendNode('component', [name: 'GradleSettings'])
gradleSettings.appendNode('option', [name: 'SDK_HOME', value: gradle.gradleHomeDir.absolutePath])
}
whenMerged { project ->
project.jdk.languageLevel = 'JDK_1_6'
project.jdk.projectJdkName = '1.6'
}
}
}
}
defaultTasks 'clean', 'build'
ant.foo='NotBarFromGradle'
ant.importBuild('src/main/resources/build.xml')
ant.foo='NotBarFromGradleAgain'
/**
* Due to http://issues.gradle.org/browse/GRADLE-427 the dependencies specifried for an Ant task will be executed
* in alphabetical order, instead of the order in which they are specified.
*/
task importTaskWithExistingName(type: GradleBuild) { GradleBuild antBuild ->
antBuild.buildFile ='buildWithClean.gradle'
antBuild.tasks = ['all']
}
task importTasksRunInOrder(type: GradleBuild) { GradleBuild antBuild ->
antBuild.buildFile ='buildWithClean.gradle'
antBuild.tasks = ['dist', 'clean']
}
tasks.addRule("Pattern: a-<target> will execute a single <target> in the ant build") { String taskName ->
if (taskName.startsWith("a-")) {
task(taskName, type: GradleBuild) {
buildFile = 'buildWithClean.gradle'
tasks = [taskName - 'a-']
}
}
}
Something went wrong with that request. Please try again.