import org.gradle.api.tasks.javadoc.Groovydoc.Link
import java.text.SimpleDateFormat
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'idea'
defaultTasks 'clean', 'build', 'install'
sourceCompatibility = 1.6
group = 'com.goldin'
version = '0.6-SNAPSHOT'
groovyVersion = '1.8.0-beta-4'
antVersion = '1.8.2'
springVersion = '3.0.5.RELEASE'
junitVersion = '4.8.2'
truezipVersion = '6.8.2'
repositories {
mavenRepo urls: 'http://evgeny-goldin.org/artifactory/repo/'
}
dependencies {
groovy "org.codehaus.groovy:groovy-all:$groovyVersion"
compile "org.codehaus.groovy:groovy-all:$groovyVersion",
"org.springframework:spring-context:$springVersion",
"de.schlichtherle:truezip:$truezipVersion",
"org.apache.ant:ant:$antVersion",
"org.apache.ant:ant-commons-net:$antVersion",
"commons-net:commons-net:2.2",
"org.slf4j:slf4j-api:1.6.1",
"ch.qos.logback:logback-classic:0.9.28"
testCompile "org.springframework:spring-test:$springVersion",
"junit:junit:$junitVersion"
}
/**
* http://gradle.org/0.9.2/docs/dsl/org.gradle.plugins.idea.IdeaModule.html
*/
ideaProject.javaVersion = '1.6.0_23'
ideaModule {
javaVersion = ideaProject.javaVersion
downloadSources = true
downloadJavadoc = false
outputDir = new File( project.buildDir, 'idea' )
testOutputDir = new File( project.buildDir, 'idea/test' )
}
/**
* http://gradle.org/0.9.2/docs/dsl/org.gradle.api.tasks.testing.Test.html
* http://gradle.org/0.9.2/docs/javadoc/org/gradle/api/tasks/testing/Test.html
*/
test {
test.testReportDir = new File(( File ) project.buildDir, 'test/reports' )
test.testResultsDir = new File(( File ) project.buildDir, 'test/results' )
test.systemProperties = System.properties.containsKey( 'slowTests' ) ? [ slowTests : 'true' ] : [:]
test.setDebug( System.properties.containsKey( 'debug' ))
}
/**
* http://gradle.org/0.9.2/docs/dsl/org.gradle.api.tasks.javadoc.Groovydoc.html
*/
def time = new SimpleDateFormat( '' ).format( new Date())
def date = new SimpleDateFormat( '' ).format( new Date())
groovydoc {
destinationDir = new File(( System.getProperty( 'groovydocDir' ) ?: project.buildDir.path + '/groovydoc' ),
( version.contains( '-SNAPSHOT' ) ? '' : version ))
header = '<a href="http://evgeny-goldin.com/wiki/GCommons">evgeny-goldin.com/wiki/GCommons</a>'
footer = '<a href="http://evgeny-goldin.com/">Evgeny Goldin</a>. GrovyDoc is generated at [$time] on []'
links = [ new Link( 'http://static.springsource.org/spring/docs/3.0.x/javadoc-api/', 'org.springframework' ),
new Link( 'http://download.oracle.com/javase/6/docs/api/', 'java' ),
new Link( 'http://groovy.codehaus.org/api/', 'groovy', 'org.codehaus.groovy' ),
new Link( 'http://commons.apache.org/net/apidocs/', 'org.apache.commons.net' ),
new Link( 'http://evgeny-goldin.org/javadoc/truezip/', 'de.schlichtherle' )] as Set
}
/**
* Adding sources artifact
* http://gradle.1045684.n5.nabble.com/javadoc-and-source-jars-td3246213.html
*/
task sourcesJar( type: Jar, dependsOn: classes ) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts { archives sourcesJar }