forked from crystal-lang-tools/intellij-crystal-lang
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
144 lines (125 loc) · 4.35 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
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.3.4'
}
sourceSets {
main {
java.srcDirs 'src/main/java', 'src/main/gen'
resources.srcDirs 'src/main/resources'
}
test {
java.srcDirs 'src/test/java'
resources.srcDirs 'src/test/resources'
}
}
version = "${version}"
//version = "1.14-SNAPSHOT"
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-crystal'
version ideaVersion
plugins ['PsiViewer:3.28.93']
intellij.updateSinceUntilBuild false //Disables updating since-build attribute in plugin.xml
publishPlugin {
username System.getenv('JETBRAINS_USERNAME')
password System.getenv('JETBRAINS_PASSWORD')
channels publishChannels
}
ideaDependencyCachePath './distros'
prepareSandbox {
copy {
from './PsiViewer.jar'
into './build/idea-sandbox/plugins/'
}
}
}
task testCompilation(type: Test, group: 'Verification', dependsOn: [classes, testClasses]) {
useJUnit {
include 'net/kenro/ji/jin/crystal/build/**/**/*'
}
testLogging {
exceptionFormat = 'full'
}
}
}
repositories {
mavenCentral()
}
dependencies {
// compile project('jps-shared')
// compile project('jps-plugin')
// compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
// compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
// testCompile 'io.kotlintest:kotlintest:1.3.3'
}
apply plugin: 'idea'
idea {
project {
jdkName = javaVersion
languageLevel = javaVersion
}
module {
generatedSourceDirs += file('src/main/gen')
}
}