Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- updates to examples

  • Loading branch information...
commit cd5d5fbddec26c71d2a8bc2393337265fa5cc6d4 1 parent 2ffe383
@kellyrob99 authored
View
25 build.gradle
@@ -14,14 +14,14 @@ repositories {
mavenCentral()
}
-def HAMCREST = ['org.hamcrest:hamcrest-core:latest.release', 'org.hamcrest:hamcrest-library:latest.release']
+//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'
+// 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
+// testCompile 'junit:junit:latest.release'
+// testCompile HAMCREST
}
idea {
@@ -56,11 +56,22 @@ idea {
defaultTasks 'clean', 'build'
-//ant.foo='NotBar'
+ant.foo='NotBar'
ant.importBuild('src/main/resources/build.xml')
+ant.'dist.dir' = buildDir
+ant.foo='NotBarAgain'
+/**
+ * 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 = ['clean', 'dist']
+ antBuild.tasks = ['all']
+}
+
+task importTasksRunInOrder(type: GradleBuild) { GradleBuild antBuild ->
+ antBuild.buildFile ='buildWithClean.gradle'
+ antBuild.tasks = ['dist', 'clean']
}
View
33 pom.xml
@@ -12,7 +12,33 @@
<version>1.6</version>
<executions>
<execution>
- <id>import</id>
+ <id>one</id>
+ <phase>install</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target>
+ <ant antfile="${basedir}/src/main/resources/build.xml">
+ <target name="all"/>
+ <property name="foo" value="NotBar"/>
+ </ant>
+ <ant antfile="${basedir}/src/main/resources/buildWithClean.xml">
+ <target name="clean"/>
+ <property name="foo" value="NotBarWithClean"/>
+ </ant>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.6</version>
+ <executions>
+ <execution>
+ <id>two</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
@@ -20,9 +46,8 @@
<configuration>
<tasks>
<ant antfile="${basedir}/src/main/resources/build.xml">
- <target name="clean"/>
- <target name="dist"/>
- <property name="foo" value="NotBar"/>
+ <target name="all"/>
+ <property name="foo" value="NotBar2"/>
</ant>
</tasks>
</configuration>
View
11 src/main/resources/build.xml
@@ -1,24 +1,15 @@
<?xml version="1.0"?>
-<project name="build" default="default">
-
+<project name="build" default="all">
<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>
View
12 src/main/resources/buildWithClean.xml
@@ -1,25 +1,19 @@
<?xml version="1.0"?>
-<project name="build" default="default">
-
+<project name="buildWithClean" default="all">
<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>
+ <echo>Called clean task in ant build with foo = ${foo}</echo>
</target>
+ <target name="all" description="Build everything" depends="dist,clean"/>
</project>
Please sign in to comment.
Something went wrong with that request. Please try again.