Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

-initial commit with examples for direct import and import using Grad…

…leBuild
  • Loading branch information...
commit 9b475b9887918971b513de2e3e7d1a5c41131c34 0 parents
@kellyrob99 authored
65 build.gradle
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2011.
+ * Author Kelly Robinson.
+ */
+
+apply plugin: 'groovy'
+apply plugin: 'idea'
+apply plugin: 'maven'
+
+group = 'org.kar'
+version = '0.1-SNAPSHOT'
+
+repositories {
+ mavenCentral()
+}
+
+def HAMCREST = ['org.hamcrest:hamcrest-core:latest.release', 'org.hamcrest:hamcrest-library:latest.release']
+
+dependencies {
+ compile gradleApi()
+ compile 'org.slf4j:slf4j-simple:1.6.1'
+ groovy 'org.codehaus.groovy:groovy:1.8.0'
+ testCompile 'junit:junit:latest.release'
+ testCompile HAMCREST
+}
+
+idea {
+ module {
+ gradleCacheVariable = 'GRADLE_CACHE'
+ downloadJavadoc = true
+ outputDir = "$rootProject.projectDir/intellij/out" as File
+ testOutputDir = "$rootProject.projectDir/intellij/testOut" as File
+ }
+}
+
+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.importBuild('src/main/resources/build.xml')
+
+task importTaskWithExistingName(type: GradleBuild) { GradleBuild antBuild ->
+ antBuild.buildFile ='buildWithClean.gradle'
+ antBuild.tasks = ['clean', 'dist']
+}
+
2  buildWithClean.gradle
@@ -0,0 +1,2 @@
+//ant.foo = 'notBar'
+ant.importBuild('src/main/resources/buildWithClean.xml')
1  src/main/resources/build.properties
@@ -0,0 +1 @@
+foo=bar
24 src/main/resources/build.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<project name="build" default="default">
+
+ <echo>Building ${ant.file}</echo>
+
+ <property file="build.properties"/>
+ <property name="root.dir" location="."/>
+
+ <target name="default" depends="all"
+ description="default: build 'all'"/>
+
+ <target name="dist" description="Build the distribution">
+ <property name="dist.dir" location="dist"/>
+ <echo>in ${basedir}</echo>
+ <echo>dist.dir=${dist.dir}</echo>
+ <echo>foo=${foo}</echo>
+ </target>
+
+ <target name="all" description="Build everything" depends="dist"/>
+
+ <!-- clashes with Gradle base-plugin 'clean' task -->
+ <!--<target name="clean" description="clean up"/>-->
+
+</project>
25 src/main/resources/buildWithClean.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<project name="build" default="default">
+
+ <echo>Building ${ant.file}</echo>
+
+ <property file="build.properties"/>
+ <property name="root.dir" location="."/>
+
+ <target name="default" depends="all"
+ description="default: build 'all'"/>
+
+ <target name="dist" description="Build the distribution">
+ <property name="dist.dir" location="dist"/>
+ <echo>in ${basedir}</echo>
+ <echo>dist.dir=${dist.dir}</echo>
+ <echo>foo=${foo}</echo>
+ </target>
+
+ <target name="all" description="Build everything" depends="dist"/>
+
+ <target name="clean" description="clean up">
+ <echo>Called clean task in ant build</echo>
+ </target>
+
+</project>
Please sign in to comment.
Something went wrong with that request. Please try again.