Skip to content
Snippets Groups Projects
Commit 37711073 authored by anttil's avatar anttil
Browse files

SWE-22 / SP-641: default build settings for java projects

SVN: 28922
parent ccb376ff
No related branches found
No related tags found
No related merge requests found
apply plugin: 'java'
sourceCompatibility='1.6'
targetCompatibility='1.6'
sourceSets {
main {
java {
srcDirs = ['source/java']
}
resources {
srcDirs = ['resource']
}
}
test {
java {
srcDirs = ['sourceTest/java']
}
}
}
buildDir = 'out'
repositories {
ivy {
url '../ivy-repository'
layout "pattern", {
artifact "[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
ivy "[organisation]/[module]/[revision]/ivy.xml"
}
}
}
test {
useTestNG()
options { suites(file('sourceTest/java/tests.xml')) }
jvmArgs '-Xmx2048m', '-XX:MaxPermSize=256m'
testLogging.showStandardStreams = true
}
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
configurations {
ecj
}
dependencies {
ecj "eclipse:ecj:3.8.1"
}
compileJava {
options.encoding = 'utf-8'
options.fork = true
doFirst {
options.forkOptions.with {
executable = 'java'
jvmArgs = [ '-cp', configurations.ecj.asPath, 'org.eclipse.jdt.internal.compiler.batch.Main', '-source', '1.6' ]
}
}
}
compileTestJava {
options.encoding = 'utf-8'
options.fork = true
doFirst {
options.forkOptions.with {
executable = 'java'
jvmArgs = [ '-cp', configurations.ecj.asPath, 'org.eclipse.jdt.internal.compiler.batch.Main', '-source', '1.6' ]
}
}
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'hours'
}
apply plugin: 'eclipse'
eclipse {
classpath {
downloadSources=true
defaultOutputDir = file('targets')
}
}
eclipse.classpath.file {
whenMerged{ classpath ->
def projectRefs = classpath.entries.findAll{entry -> entry.kind =='src' && entry.path.startsWith('/')}
classpath.entries.removeAll(projectRefs)
classpath.entries.addAll(projectRefs)
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment