forked from d-plaindoux/parsec.kotlin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
151 lines (127 loc) · 3.45 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
mavenCentral()
maven {
url 'https://dl.bintray.com/kotlin/kotlin-eap'
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'net.saliman:gradle-cobertura-plugin:2.0.0'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.3.1'
}
}
plugins {
id "com.jfrog.bintray" version "1.7.3"
id 'net.saliman.cobertura' version '3.0.0'
id 'com.github.kt3k.coveralls' version '2.8.1'
id 'maven-publish'
}
apply plugin: 'kotlin'
apply plugin: 'jacoco'
apply plugin: 'maven' // deprecated in Gradle 7.0
apply plugin: 'maven-publish'
apply plugin: 'cobertura'
apply plugin: 'com.github.kt3k.coveralls'
kotlin_version = '1.3.72'
sourceSets {
test.kotlin.srcDirs += 'src/examples/kotlin'
}
jacoco {
toolVersion = '0.7.9'
}
cobertura.coverageFormats = ['html', 'xml']
cobertura.coverageSourceDirs = ['src/main/kotlin', 'src/examples/kotlin']
repositories {
mavenCentral()
maven {
url 'https://dl.bintray.com/kotlin/kotlin-eap'
}
}
jacocoTestReport {
reports {
xml.enabled true
}
}
coveralls {
sourceDirs = files(sourceSets.main.allSource.srcDirs).files.absolutePath
jacocoReportPath = "${buildDir}/reports/jacoco/test/jacocoRootReport.xml"
}
//task jacocoRootReport(type: JacocoReport) {
// dependsOn = subprojects.test
// sourceDirectories = files(sourceSets.main.allSource.srcDirs)
// classDirectories = files(sourceSets.main.output)
// executionData = files(jacocoTestReport.executionData)
// reports {
// html.enabled = true
// xml.enabled = true
// csv.enabled = false
// xml.destination = "${buildDir}/reports/jacoco/test/jacocoRootReport.xml"
// }
//}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
testImplementation 'junit:junit:4.12'
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
}
test {
testLogging {
events "passed", "skipped", "failed"
}
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
task sourceJar(type: Jar) {
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
publishing {
repositories {
maven {
// change to point to your repo, e.g. http://my.org/repo
url = "$buildDir/repo"
}
}
publications {
mavenJava(MavenPublication) {
from components.java
groupId = 'lambdada'
artifactId = 'parsec'
version = '1.0'
artifact sourceJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
}
}
}
task deployJar(type: Jar)
configurations {
deployerJars
}
dependencies {
deployerJars "org.apache.maven.wagon:wagon-ssh:2.9"
}
uploadArchives {
repositories.mavenDeployer {
configuration = configurations.deployerJars
repository(url: "scp://n-195-169-89-50.diginfra.net/data/html/repository") {
authentication(userName: System.getenv("USER"), privateKey: System.getenv("PRIVATE_KEY"))
}
}
}