From 04463991cada6d245b8be442074e2900295c6ece Mon Sep 17 00:00:00 2001
From: Nikolaus Krismer <niko@krismer.de>
Date: Fri, 21 Feb 2014 20:43:25 +0100
Subject: [PATCH] fixed some deployment issues on development system

---
 .gitignore   |  1 +
 build.gradle | 10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 23c08a2b..71608bec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,5 +4,6 @@
 /.settings
 /.vagrant
 /bin
+/bin-test
 /build
 /test-output
diff --git a/build.gradle b/build.gradle
index 8342a02f..418a6c46 100644
--- a/build.gradle
+++ b/build.gradle
@@ -80,6 +80,7 @@ dependencies {
 	compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.3.0'
 	compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.3.0'
 	compile group: 'com.google.code.findbugs', name: 'annotations', version: '2.0.3'
+	compile group: 'com.tngtech.java', name: 'config-builder', version: '1.1'
 	compile(group: 'org.postgis', name: 'postgis-jdbc', version:'1.3+') {
 		exclude(module: 'postgis-stubs')
 	}
@@ -163,12 +164,19 @@ eclipse {
 
 eclipse.classpath.file {
 	// See: http://stackoverflow.com/questions/12836089/why-is-eclipse-not-attaching-3rd-party-libs-source-files-to-a-wtp-faceted-gradle
-	// Classpath entry for Eclipse which changes the order of classpathentries; otherwise no sources for 3rd party jars are shown
+	// Chnanges eclipse classpath entries; otherwise no sources for 3rd party jars are shown
 	withXml { xml ->
 		def node = xml.asNode()
 		node.remove( node.find { it.@path == 'org.eclipse.jst.j2ee.internal.web.container' } )
 		node.appendNode( 'classpathentry', [ kind: 'con', path: 'org.eclipse.jst.j2ee.internal.web.container', exported: 'true'])
 	}
+
+	// See: http://forums.gradle.org/gradle/topics/eclipse_wtp_deploys_testcode_to_server_example_provided
+	// Sets output folders for compiled classes and resources... otherwise test classes/resources would be deployed to wtp server
+	whenMerged { cp ->
+	    cp.entries.findAll { it.path.startsWith("src/main/") }*.output = "bin"
+	    cp.entries.findAll { it.path.startsWith("src/test/") }*.output = "bin-test"
+	}
 }
 
 findbugs {
-- 
GitLab