-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
executable file
·112 lines (98 loc) · 2.82 KB
/
build.gradle
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
plugins {
id "com.jfrog.bintray" version "1.1"
}
apply plugin: "scala"
apply plugin: "maven-publish"
sourceCompatibility = 1.7
version = "4.0.0-SNAPSHOT"
def scalaVersion = "2.11.6"
def bintrayVersion = {
if (version.endsWith('-SNAPSHOT')) {
java.text.SimpleDateFormat format = new java.text.SimpleDateFormat('yyyyMMddHHmm')
format.setCalendar(Calendar.getInstance(TimeZone.getTimeZone('UTC')))
return version.replace('SNAPSHOT', format.format(new Date()))
} else {
return version
}
}()
task wrapper(type: Wrapper) {
gradleVersion = "2.3"
}
repositories {
mavenCentral()
}
jar {
baseName = "orbroker_2.11"
manifest {
attributes "Implementation-Title": "orbroker", "Implementation-Version": version
}
}
task sourceJar(type: Jar) {
classifier "sources"
from sourceSets.main.allScala
}
task docsJar(type: Jar, dependsOn: scaladoc) {
classifier "docs"
from scaladoc.destinationDir
}
publishing {
publications {
maven(MavenPublication) {
groupId 'org.orbroker'
artifactId jar.baseName
version bintrayVersion
from components.java
artifact sourceJar
artifact docsJar
pom.withXml { xml ->
xml.asNode().dependencies.dependency.each { dep ->
dep.scope[0].value = "provided"
}
}
}
}
}
bintray {
user = System.properties.bintrayUser ?: "n/a"
key = System.properties.bintrayApiKey ?: "n/a"
dryRun = (user == "n/a" || key == "n/a")
publish = !dryRun
publications = ['maven']
pkg {
repo = "maven"
name = "ORBroker"
version {
name = bintrayVersion
}
}
}
dependencies {
testCompile "junit:junit:4.11"
compile "org.scala-lang:scala-library:$scalaVersion"
compile "org.freemarker:freemarker:2.3.22"
compile "joda-time:joda-time:2.7"
compile "org.apache.velocity:velocity:1.7"
compile "org.apache.derby:derby:10.11.1.1"
}
compileScala {
scalaCompileOptions.additionalParameters = [
"-feature", "-optimise","–unchecked", "-deprecation","–explaintypes",
"–Xdisable-assertions", //"-Xfatal-warnings",
"-Ybackend:GenBCode", "-Yclosure-elim",
]
}
compileTestScala {
scalaCompileOptions.additionalParameters = [
"-nowarn",
"-Xcheckinit", "-optimise",
"-Ybackend:GenBCode", "-Yclosure-elim",
]
}
scaladoc {
def javaLib = new java.io.File("${System.properties['java.home']}/lib/rt.jar")
def scalaLib = classpath.find {
it.name.startsWith("scala-library")
}
def extDocParm = "-doc-external-doc:$scalaLib#www.scala-lang.org/api/$scalaVersion/,$javaLib#docs.oracle.com/javase/7/docs/api/"
scalaDocOptions.additionalParameters = [extDocParm,]
}