1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'jacoco'
sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '3.0.0'
description = 'Grengine is an engine for running and embedding Groovy in a Java VM.'
project.ext {
pkg = 'jar'
}
ext {
groovyVersion='2.5.5'
junitVersion='5.3.2'
hamcrestVersion='2.1'
ivyVersion='2.4.0'
commonsIoVersion='2.6'
}
jar {
manifest {
attributes 'Implementation-Title': 'grengine', 'Implementation-Version': version, 'provider': 'gradle'
}
}
dependencies {
compile "org.codehaus.groovy:groovy:$groovyVersion"
//testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
//testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
testCompile "junit:junit:4.x"
testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
testCompile "org.apache.ivy:ivy:$ivyVersion"
testCompile "commons-io:commons-io:$commonsIoVersion"
}
project.group = 'ch.artecat.grengine'
repositories {
mavenCentral()
}
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
javadoc {
configure(options) {
windowTitle = "Grengine - $project.version"
header = 'Grengine'
author = true
links = [ 'https://docs.oracle.com/javase/8/docs/api/', 'http://docs.groovy-lang.org/docs/groovy-' + groovyVersion + '/html/api/' ]
tags = [ 'grengine.scriptthrows:a:Throws (out of Groovy script):' ]
}
}
task javadocJar(type: Jar, dependsOn:javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
tasks.withType(JavaCompile) {
// treat warnings as errors
options.compilerArgs << "-Xlint:all" << "-Werror"
}
test {
testLogging.showStandardStreams = true
useJUnit()
}
artifacts {
archives sourcesJar
archives javadocJar
}
task jacoco(type:JacocoReport) {
executionData test
sourceSets sourceSets.main
}
task pom {
doLast {
pom {
project {
name 'grengine'
description project.description
url 'https://www.artecat.ch/grengine/'
packaging project.ext.pkg
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'https://www.apache.org/licenses/LICENSE-2.0'
distribution 'repo'
}
}
scm {
url 'https://gitlab.com/jexler/grengine'
connection 'https://gitlab.com/jexler/grengine.git'
developerConnection 'https://gitlab.com/jexler/grengine.git'
}
developers {
developer {
id 'jexler'
name 'Jex Jexler (Alain Stalder)'
email 'jexler@artecat.ch'
}
}
}
}.writeTo("$buildDir/libs/${project.name}-${project.version}.pom")
}
}
|