-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle
85 lines (72 loc) · 2.07 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
buildscript {
ext.kotlin_version = '1.0.6'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id "com.github.hierynomus.license" version "0.13.1"
}
repositories {
mavenCentral()
jcenter()
}
allprojects {
String tag ='git describe --tags'.execute().text.trim()
Boolean isTag = !tag.contains('-')
version = isTag ? tag : 'git rev-parse HEAD'.execute().text.trim() + '-SNAPSHOT'
}
subprojects {
apply plugin: 'java'
apply plugin: 'kotlin'
sourceCompatibility = 1.7
ext.sharedManifest = manifest {
attributes 'Implementation-Version': version
attributes 'Project': 'Qabel Core'
attributes 'Built-From-Revision': "git rev-parse HEAD".execute().text.trim()
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
testCompile 'org.hamcrest:java-hamcrest:2.0.0.0'
testCompile 'com.natpryce:hamkrest:1.2.3.0'
testCompile 'junit:junit:4.+'
testCompile 'org.meanbean:meanbean:2.+'
testCompile 'org.mockito:mockito-core:2.6.0'
testCompile 'com.nhaarman:mockito-kotlin:1.1.0'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource + sourceSets.test.allSource
}
task testJar(type: Jar) {
classifier = 'tests'
from(sourceSets.test.output) {
include "**"
}
manifest {
from sharedManifest
attributes 'Implementation-Title': 'Qabel Core - Test artifact'
}
}
sourceSets {
main {
resources.srcDirs += ['src/resources/config/']
}
test {
resources.srcDirs += ['src/resources/config/']
}
}
jar.manifest.writeTo("$buildDir/manifest.mf")
testJar.manifest.writeTo("$buildDir/test-manifest.mf")
artifacts {
archives sourcesJar
archives testJar
}
}