-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
executable file
·105 lines (92 loc) · 2.51 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
plugins {
id "com.jfrog.bintray" version "1.5"
}
apply plugin: "scala"
apply plugin: "maven-publish"
sourceCompatibility = 1.7
version = "0.9.0-SNAPSHOT"
def bintrayVersion = {
if (version.endsWith('-SNAPSHOT')) {
java.text.SimpleDateFormat format = new java.text.SimpleDateFormat('yyMMddHHmm')
format.setCalendar(Calendar.getInstance(TimeZone.getTimeZone('UTC')))
return version.replace('SNAPSHOT', format.format(new Date()))
} else {
return version
}
}()
task wrapper(type: Wrapper) {
gradleVersion = "2.11"
}
repositories {
mavenCentral()
maven {
url "http://dl.bintray.com/nilskp/maven"
}
}
jar {
baseName = "mongolia_2.11"
manifest {
attributes "Implementation-Title": "mongolia", "Implementation-Version": version
}
}
task sourceJar(type: Jar) {
baseName "mongolia_2.11"
classifier "sources"
from sourceSets.main.allScala
}
task docsJar(type: Jar, dependsOn: scaladoc) {
baseName "mongolia_2.11"
classifier "docs"
from scaladoc.destinationDir
}
publishing {
publications {
maven(MavenPublication) {
groupId 'nilskp'
artifactId jar.baseName
version bintrayVersion
from components.java
artifact sourceJar
artifact docsJar
pom.withXml { xml ->
xml.asNode().dependencies.dependency.findAll{ ! ['scuff'].contains(it.artifactId.text()) }.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 = "Mongolia"
version {
name = bintrayVersion
}
}
}
dependencies {
testCompile "junit:junit:4.11"
compile "org.scala-lang:scala-library:2.11.7"
compile "nilskp:scuff_2.11:0.1.5-b1602191540"
compile "org.mongodb:mongo-java-driver:2.14.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",
]
}