forked from kirill-gr/m3uparser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
104 lines (83 loc) · 2.48 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
plugins {
id "org.jetbrains.kotlin.jvm" version "1.3.21"
id "com.gradle.build-scan" version "2.2.1"
}
group "ru.grushetsky"
version "NEXT-SNAPSHOT"
ext.kotlin_version = "1.3.21"
ext.junitPlatformVersion = "1.4.1"
ext.junitJupiterVersion = "5.4.1"
ext.antlrVersion = "4.7.2"
ext.assertJVersion = "3.12.2"
ext.javaVersion = JavaVersion.VERSION_1_8
test {
useJUnitPlatform()
}
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
apply plugin: "kotlin"
apply plugin: "antlr"
apply plugin: "idea"
apply plugin: "maven-publish"
apply plugin: "jacoco"
task sourceJar(type: Jar) {
from sourceSets.main.allSource
}
publishing {
publications {
maven(MavenPublication) {
from components.java
artifact sourceJar {
classifier "sources"
}
}
}
}
model {
tasks.generatePomFileForMavenPublication {
destination = file("${jar.archivePath.parentFile}/${project.name}-${version}.pom")
}
}
repositories {
jcenter()
}
dependencies {
antlr("org.antlr:antlr4:$antlrVersion")
implementation("org.antlr:antlr4-runtime:$antlrVersion")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitJupiterVersion")
testImplementation("org.assertj:assertj-core:$assertJVersion")
testRuntime("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
testRuntime("org.junit.platform:junit-platform-launcher:$junitPlatformVersion")
}
sourceCompatibility = ext.javaVersion
targetCompatibility = ext.javaVersion
compileKotlin {
kotlinOptions.jvmTarget = javaVersion.toString()
}
compileTestKotlin {
kotlinOptions.jvmTarget = javaVersion.toString()
}
generateGrammarSource {
maxHeapSize = "64m"
arguments += ["-package", "ru.grushetsky.m3uparser"]
outputDirectory = new File("${project.buildDir}/generated-src/antlr/main/ru/grushetsky/${project.name}")
}
compileKotlin.dependsOn generateGrammarSource
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = false
}
afterEvaluate {
getClassDirectories().setFrom(classDirectories.files.collect {
fileTree(dir: it, exclude:
['**/M3uParserBaseListener.*',
'**/M3uParser$*.*'])
})
}
}
check.dependsOn jacocoTestReport