Skip to content
This repository has been archived by the owner on Jan 15, 2020. It is now read-only.

Commit

Permalink
Code examples, first pass
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmccullough committed Mar 18, 2011
0 parents commit 774b37e
Show file tree
Hide file tree
Showing 20 changed files with 96 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
build
.gradle
output
13 changes: 13 additions & 0 deletions maven-gradle-comparison-configinstall/build.gradle
@@ -0,0 +1,13 @@
apply plugin: 'java'
apply plugin: 'maven'

defaultTasks = ['install']

configure(install.repositories.mavenInstaller) {
pom.project {
groupId 'com.gradleware.samples'
artifactId 'sample02-barestbones'
version '0.0.1-SNAPSHOT'
description ='A sample project these uses the Maven plugin and defines many attributes.'
}
}
2 changes: 2 additions & 0 deletions maven-gradle-comparison-configinstall/run-example.bsh
@@ -0,0 +1,2 @@
#!/bin/bash
gradle
7 changes: 7 additions & 0 deletions maven-gradle-comparison-configinstall/src/main/java/Main.java
@@ -0,0 +1,7 @@
public class Main
{
public static void main( String[] args )
{
System.out.println( "This is a Java main." );
}
}
1 change: 1 addition & 0 deletions maven-gradle-comparison-simple/build.gradle
@@ -0,0 +1 @@
apply plugin: 'java'
2 changes: 2 additions & 0 deletions maven-gradle-comparison-simple/run-example.bsh
@@ -0,0 +1,2 @@
#!/bin/bash
gradle
7 changes: 7 additions & 0 deletions maven-gradle-comparison-simple/src/main/java/Main.java
@@ -0,0 +1,7 @@
public class Main
{
public static void main( String[] args )
{
System.out.println( "This is a Java main." );
}
}
11 changes: 11 additions & 0 deletions maven-gradle-comparison-withallattrs/build.gradle
@@ -0,0 +1,11 @@
apply plugin: 'java'
apply plugin: 'maven'

group = 'com.gradleware.samples'

//archivesBaseName is ultimately setting artifactId for the Maven POM generation
archivesBaseName = 'sample01-barestbones'
version = '0.0.1-SNAPSHOT'
description ="A sample project these uses the Maven plugin and defines many attributes."

defaultTasks = ['install']
2 changes: 2 additions & 0 deletions maven-gradle-comparison-withallattrs/run-example.bsh
@@ -0,0 +1,2 @@
#!/bin/bash
gradle
7 changes: 7 additions & 0 deletions maven-gradle-comparison-withallattrs/src/main/java/Main.java
@@ -0,0 +1,7 @@
public class Main
{
public static void main( String[] args )
{
System.out.println( "This is a Java main." );
}
}
5 changes: 5 additions & 0 deletions maven-gradle-comparison-withattrs/build.gradle
@@ -0,0 +1,5 @@
apply plugin: 'java'

version = '0.0.1-SNAPSHOT'

defaultTasks 'build'
2 changes: 2 additions & 0 deletions maven-gradle-comparison-withattrs/run-example.bsh
@@ -0,0 +1,2 @@
#!/bin/bash
gradle
7 changes: 7 additions & 0 deletions maven-gradle-comparison-withattrs/src/main/java/Main.java
@@ -0,0 +1,7 @@
public class Main
{
public static void main( String[] args )
{
System.out.println( "This is a Java main." );
}
}
3 changes: 3 additions & 0 deletions minimal-build-file/build.gradle
@@ -0,0 +1,3 @@
task 'helloWorld' << {
println 'hello, world'
}
2 changes: 2 additions & 0 deletions minimal-build-file/run-example.bsh
@@ -0,0 +1,2 @@
#!/bin/bash
gradle helloWorld
Empty file.
2 changes: 2 additions & 0 deletions minimal-java-build-file/run-example.bsh
@@ -0,0 +1,2 @@
#!/bin/bash
gradle
18 changes: 18 additions & 0 deletions test-all-builds.bsh
@@ -0,0 +1,18 @@
#!/bin/bash

for i in `find . ! -iname ".git" -type d -depth 1`; do
pushd $i
run-example.bsh

# Test for failure
BUILD_RESULT="$?"
echo Build result: $BUILD_RESULT
if test "$BUILD_RESULT" = "1"
then
echo **********************************************************************
echo ************* A sub-build has failed. Build is halting. **************
exit 1
fi

popd
done
Empty file.
2 changes: 2 additions & 0 deletions two-task-trivial-build-file/run-example.bsh
@@ -0,0 +1,2 @@
#!/bin/bash
gradle

0 comments on commit 774b37e

Please sign in to comment.