forked from intellij-dlanguage/intellij-dub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
138 lines (120 loc) · 4.12 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
buildscript {
repositories {
mavenCentral()
maven { url 'http://dl.bintray.com/jetbrains/intellij-plugin-service' }
//maven { url 'https://jitpack.io' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id 'org.jetbrains.intellij' version '0.4.15'
id 'org.jetbrains.kotlin.jvm' version '1.3.60'
}
sourceSets {
main {
java.srcDirs 'src/main/java', 'src/main/kotlin'
resources.srcDirs 'src/main/resources'
}
test {
java.srcDirs 'src/test/java', 'src/test/kotlin'
}
}
version = "${version}"
jar.archiveName "intellij-dub-${version}.jar"
allprojects {
apply plugin: 'kotlin'
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.lifecycle("\t✔ {}", descriptor.name)
break
case TestResult.ResultType.SKIPPED.name():
logger.lifecycle("\t- {}", descriptor.name)
break
case TestResult.ResultType.FAILURE.name():
logger.lifecycle("\t✘ {}", descriptor.name)
break
default:
logger.lifecycle("\t? {} {}", 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-dub'
version ideaVersion
updateSinceUntilBuild false
plugins 'net.masterthought.dlanguage:1.24.1' //, 'terminal' // can specify built in Intellij plugins that our plugin relies on such as 'copyright', 'coverage', or 'yaml'
// runIde {
// jbrVersion null
// }
publishPlugin {
token System.getenv('JETBRAINS_TOKEN')
channels publishChannels
}
}
task testCompilation(type: Test, group: 'Verification', dependsOn: [classes, testClasses]) {
testLogging {
exceptionFormat = 'full'
}
}
}
repositories {
mavenCentral()
}
dependencies {
// testCompile 'io.kotlintest:kotlintest:1.3.3'
}
apply plugin: 'idea'
idea {
project {
jdkName = javaVersion
languageLevel = javaVersion
vcs = 'Git'
}
}
compileKotlin {
kotlinOptions {
suppressWarnings = true
apiVersion = "1.3"
languageVersion = "1.3"
jvmTarget = "1.8"
}
}