Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 6 commits
  • 8 files changed
  • 0 comments
  • 1 contributor
1  .gitignore
@@ -3,3 +3,4 @@ build/*
3 3 build
4 4 hello-world/build
5 5 .gradle
  6 +*.swp
46 misc/build.gradle
... ... @@ -0,0 +1,46 @@
  1 +apply plugin: 'java'
  2 +
  3 +FileTree tree = project.fileTree(".")
  4 +
  5 +if (hasProperty('showOutput')) {
  6 + // println "You set showoutput to true" + "-" * 50
  7 +}
  8 +
  9 +compileTestJava {
  10 + source "src"
  11 +}
  12 +
  13 +compileJava {
  14 + source "src"
  15 +}
  16 +
  17 +// http://docs.codehaus.org/display/GRADLE/Cookbook
  18 +// Example of the "too lazy to create dirs"
  19 +
  20 +task "create-dirs" << {
  21 + sourceSets*.java.srcDirs*.each { it.mkdirs() }
  22 + sourceSets*.resources.srcDirs*.each { it.mkdirs() }
  23 +}
  24 +
  25 +task 'mainFiles' << {
  26 + tree.each {
  27 + println it.getName()
  28 + }
  29 +
  30 +}
  31 +
  32 +task sourceSetJavaProperties << {
  33 + sourceSets {
  34 + main {
  35 + println "java.srcDirs = ${java.srcDirs}"
  36 + println "resources.srcDirs = ${resources.srcDirs}"
  37 + println "java.files = ${java.files.name}"
  38 + println "allJava.files = ${allJava.files.name}"
  39 + println "resources.files = ${resources.files.name}"
  40 + println "allSource.files = ${allSource.files.name}"
  41 + println "output.classesDir = ${output.classesDir}"
  42 + println "output.resourcesDir = ${output.resourcesDir}"
  43 + println "output.files = ${output.files}"
  44 + } }
  45 + }
  46 +
1  misc/gradle.properties
... ... @@ -0,0 +1 @@
  1 +showOutput=true
5 misc/src/Misc.java
... ... @@ -0,0 +1,5 @@
  1 +public class Misc {
  2 + public static void main(String[] args) {
  3 + System.out.println("Hello World");
  4 + }
  5 +}
4 misc/src/com/nateneff/something/Something.java
... ... @@ -0,0 +1,4 @@
  1 +public class Something {
  2 + String firstThing;
  3 + String nextThing;
  4 +}
15 testwithvim/build.gradle
... ... @@ -1,5 +1,7 @@
1 1 apply plugin: "java"
2 2
  3 +FileTree tree = project.fileTree(".")
  4 +
3 5 repositories {
4 6 mavenCentral()
5 7 }
@@ -8,8 +10,14 @@ dependencies {
8 10 compile 'junit:junit:4.8.2'
9 11 }
10 12
  13 +compileJava {
  14 + source 'src'
  15 +}
  16 +
11 17 compileTestJava {
12   - source "."
  18 + source '.'
  19 + source 'test'
  20 + source 'src'
13 21 }
14 22
15 23 test {
@@ -27,7 +35,10 @@ test {
27 35 it.getStackTrace().each { el ->
28 36 if (el.getFileName() && !(el.getClassName() =~
29 37 /^(java.lang|java.util|junit.framework|org.gradle|org.junit|sun.reflect)/)) {
30   - testresults << el.getFileName() + ":" + el.getLineNumber() + ":"
  38 + def f = tree.find {
  39 + it.getName() == el.getFileName()
  40 + }
  41 + testresults << f.getAbsolutePath() + ":" + el.getLineNumber() + ":"
31 42 }
32 43 }
33 44 testresults << it.toString() + "\n"
2  testwithvim/src/Bar.java
... ... @@ -0,0 +1,2 @@
  1 +class Bar {
  2 +}
14 testwithvim/test/TestBaz.java
... ... @@ -0,0 +1,14 @@
  1 +import junit.framework.*;
  2 +
  3 +public class TestBaz extends TestCase
  4 +{
  5 + public TestBaz(String name)
  6 + {
  7 + super(name);
  8 + }
  9 +
  10 + public void testFoo()
  11 + {
  12 + assertEquals("Test Description", "TestDe");
  13 + }
  14 +}

No commit comments for this range

Something went wrong with that request. Please try again.