forked from redhat-developer/intellij-tekton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
154 lines (135 loc) · 5.1 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
buildscript {
/*
* for more complex conversion ideaVersion -> sinceIdeaBuild
* see https://github.com/rhdunn/xquery-intellij-plugin/blob/master/build.gradle#L1-L47
*/
def since = ideaVersion =~ /I.-20(\d\d)\.([1-3])(\.\d+)?$/
if (since.matches()) {
ext.sinceIdeaBuild = "${since.group(1)}${since.group(2)}".toInteger()
} else {
ext.sinceIdeaBuild = 0
}
if (ext.sinceIdeaBuild.toInteger() >= 223) {
ext.java_version = "17"
} else {
ext.java_version = "11"
}
}
plugins {
id "org.jetbrains.intellij" version "1.16.0"
id "idea"
id "java"
id "jacoco"
id "org.openapi.generator" version "4.3.1"
}
repositories {
mavenCentral()
mavenLocal()
maven { url 'https://repository.jboss.org' }
maven { url 'https://jitpack.io' }
}
configurations {
compileOptions {
sourceCompatibility = java_version
targetCompatibility = java_version
}
}
def versionsMap = ['IU-2022.1':'221.5080.1', 'IU-2022.2':'222.3345.16', 'IU-2022.3':'223.7571.175', 'IU-2023.1':'231.8109.91', 'IU-2023.2':'232.8660.158', 'IU-2023.3':'233.11799.296']
intellij {
version = ideaVersion //for a full list of IntelliJ IDEA releases please see https://www.jetbrains.com/intellij-repository/releases
pluginName = 'com.redhat.devtools.intellij.tekton'
// use '<git repo clone>/build/idea-sandbox/plugins/Telemetry by Red Hat' if working from source
plugins = [
'terminal',
'yaml',
'markdown',
'com.redhat.devtools.intellij.telemetry:1.1.0.52',
'com.intellij.kubernetes:' + versionsMap[ideaVersion],
'com.redhat.devtools.intellij.kubernetes:1.2.3.294'
]
updateSinceUntilBuild = false
}
runIde {
systemProperties['com.redhat.devtools.intellij.telemetry.mode'] = 'debug'
}
runIdeForUiTests {
systemProperties['com.redhat.devtools.intellij.telemetry.mode'] = 'debug'
}
//with this option enabled, build will fail about IDEA expiration builds
buildSearchableOptions.enabled = false
dependencies {
implementation 'io.fabric8:openshift-client:6.4.1'
implementation 'io.fabric8:tekton-client:6.4.1'
implementation 'com.redhat.devtools.intellij:intellij-common:1.9.3'
implementation 'com.redhat.devtools.alizer:alizer-api:0.1.0'
implementation 'com.github.vlsi.mxgraph:jgraphx:4.2.2'
testImplementation 'org.mockito:mockito-inline:4.6.1'
//Tekton Hub client dependencies
implementation 'io.swagger:swagger-annotations:1.6.11'
implementation 'io.gsonfire:gson-fire:1.8.5'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
//IntelliJ Kubernetes plugin brings old okio so we need
//to explicitly declare it here. If the Tekton F8 is
//updated check the version
implementation 'com.squareup.okio:okio:3.1.0'
// telemetry contributes annotations 13.0.0, so we need to declare newer version
implementation 'org.jetbrains:annotations:23.0.0'
testImplementation 'com.redhat.devtools.intellij:intellij-common:1.9.3:test'
}
configurations {
runtimeClasspath {
exclude group: 'org.slf4j', module: 'slf4j-api'
}
integrationTestImplementation.extendsFrom testImplementation
integrationTestRuntimeOnly.extendsFrom testRuntimeOnly
}
test {
// Discover and execute JUnit4-based tests
useJUnit()
jvmArgs "-Djava.awt.headless=true"
}
sourceSets {
integrationTest {
java.srcDir file('src/it/java')
resources.srcDir file('src/it/resources')
compileClasspath += sourceSets.main.output + sourceSets.test.output + configurations.testRuntimeClasspath
runtimeClasspath += output + compileClasspath
}
main {
java.srcDirs += file("$buildDir/hubapi-java/src/main/java")
}
}
tasks.register('integrationTest', Test) {
description = 'Runs the integration tests.'
group = 'verification'
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false }
jvmArgs "-Djava.awt.headless=true"
}
publishPlugin {
token = jetBrainsToken
channels = [jetBrainsChannel]
}
openApiGenerate {
generatorName = "java"
inputSpec = "https://raw.githubusercontent.com/tektoncd/hub/v1.3.0/api/gen/http/openapi3.yaml".toString()
outputDir = "$buildDir/hubapi-java".toString()
apiPackage = "com.redhat.devtools.intellij.tektoncd.hub.api"
invokerPackage = "com.redhat.devtools.intellij.tektoncd.hub.invoker"
modelPackage = "com.redhat.devtools.intellij.tektoncd.hub.model"
configOptions = [
dateLibrary: "java8"
]
skipValidateSpec = true
logToStderr = true
generateAliasAsModel = false
// set to true and set environment variable {LANG}_POST_PROCESS_FILE
// (e.g. SCALA_POST_PROCESS_FILE) to the linter/formatter to be processed.
// This command will be passed one file at a time for most supported post processors.
enablePostProcessFile = false
typeMappings = [ OffsetDateTime: "String"]
}
compileJava.dependsOn tasks.openApiGenerate
group 'com.redhat.devtools.intellij'
version projectVersion // Plugin version