forked from intellij-dlanguage/intellij-dlanguage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
154 lines (132 loc) · 4.91 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
152
153
154
import org.apache.tools.ant.taskdefs.condition.Os
buildscript {
repositories {
mavenCentral()
maven { url 'http://dl.bintray.com/jetbrains/intellij-plugin-service' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id 'org.jetbrains.intellij' version '0.2.18'
id 'net.saliman.cobertura' version '2.5.1'
id 'com.github.kt3k.coveralls' version '2.8.1'
}
sourceSets {
main {
java.srcDirs 'src/main/java', 'src/main/kotlin', 'gen'
resources.srcDirs 'src/main/resources'
}
test {
java.srcDirs 'src/test/java', 'src/test/kotlin'
}
}
version = "${version}"
apply plugin: 'kotlin'
apply plugin: 'cobertura'
cobertura.coverageFormats = ['html', 'xml'] // coveralls plugin depends on xml format report
cobertura.coverageSourceDirs = [sourceSets.main.java.srcDirs, sourceSets.main.kotlin.srcDirs, 'gen']
cobertura.coverageEncoding = 'UTF-8'
cobertura.coverageExcludes = [ '.*de.halirutan.mathematica.*', '.*uk.co.cwspencer.*' ]
allprojects {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs << "-Xlint:deprecation"
}
tasks.withType(Test) {
useJUnit {
include '**/**/*Test.*' // any Java or Kotlin class that ends with 'Test'
}
testLogging {
beforeSuite { suite ->
if (!suite.parent) { // will match the outermost suite
logger.lifecycle ' ----------- Building Tests -----------'
} else if (suite.className != null) {
logger.lifecycle "${suite.className}:"
}
}
afterTest { descriptor, result ->
switch (result.resultType) {
case 'SUCCESS':
case 'PASSED':
logger.info(" {} {}", Os.isFamily(Os.FAMILY_WINDOWS)? "√":"✔", descriptor.name)
break
case TestResult.ResultType.SKIPPED.name():
logger.warn(" {} {}", Os.isFamily(Os.FAMILY_WINDOWS)? "!":"⛔", descriptor.name)
break
case TestResult.ResultType.FAILURE.name():
logger.error(" {} {}", Os.isFamily(Os.FAMILY_WINDOWS)? "×":"✘", descriptor.name)
break
default:
logger.lifecycle(" ? {} {}", descriptor.name, result.resultType)
}
}
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength) + '\n')
}
}
}
}
// take the version number defined in gradle build and use that in plugin.xml
task initConfig(type: Copy) {
from('src/main/resources') {
include '**/plugin.xml'
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [version: version])
}
}
apply plugin: 'org.jetbrains.intellij'
intellij {
pluginName 'intellij-dlanguage'
version ideaVersion
updateSinceUntilBuild false
publishPlugin {
username System.getenv('SB_JETBRAINS_USERNAME')
password System.getenv('SB_JETBRAINS_PASSWORD')
channels publishChannels
}
}
task testCompilation(type: Test, group: 'Verification', dependsOn: [classes, testClasses]) {
useJUnit {
include 'io/github/intellij/dlanguage/build/**'
}
testLogging {
exceptionFormat = 'full'
}
}
}
repositories {
mavenCentral()
}
dependencies {
// According to https://www.jetbrains.org/intellij/sdk/docs/tutorials/kotlin.html
// we should not include kotlin-runtime and kotlin-stdlib jars with your plugin
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compileOnly "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile 'org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5'
compile ('io.sentry:sentry:1.6.1'){
exclude group: 'org.slf4j'
}
testCompile 'io.kotlintest:kotlintest:2+'
}
apply plugin: 'idea'
idea {
project {
jdkName = javaVersion
languageLevel = javaVersion
}
module {
generatedSourceDirs += file('gen')
}
}
compileKotlin {
kotlinOptions {
apiVersion = "1.2"
}
}