-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathbuild.gradle.kts
101 lines (86 loc) · 2.95 KB
/
build.gradle.kts
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
import utils.configureTests
import utils.projectVersion
import utils.publicationChannels
// Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
plugins {
scala
id("org.jetbrains.intellij") version "1.3.0"
}
group = "com.intellij.plugins"
version = projectVersion
allprojects {
repositories {
mavenCentral()
}
pluginManager.withPlugin("org.jetbrains.intellij") {
val ideaVersion: String by project
val scalaPluginVersion: String by project
val pythonCoreVersion: String by project
intellij {
type.set("IC")
version.set(ideaVersion)
plugins.set(listOf(
"com.intellij.properties",
"org.intellij.groovy",
"com.intellij.gradle",
"com.intellij.java",
"PythonCore:$pythonCoreVersion",
"indexing-shared",
"org.intellij.scala:$scalaPluginVersion",
"JUnit")
)
}
}
tasks {
withType<JavaCompile> {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}
}
}
dependencies {
val scalaVersion: String by project
implementation(project(":common"))
compileOnly("org.scala-lang:scala-library:$scalaVersion")
testImplementation(project(":testFramework"))
testCompileOnly("org.scala-lang:scala-library:$scalaVersion")
}
tasks {
patchPluginXml {
val pluginSinceBuild: String by project
val pluginUntilBuild: String by project
sinceBuild.set(pluginSinceBuild)
untilBuild.set(pluginUntilBuild)
}
val separateTests by registering(Test::class) {
// Those tests have to run separately due to the reuse of the project between tests
group = "verification"
configureTests()
setForkEvery(1)
isScanForTestClasses = false
include("**/*PantsProjectCacheTest.class")
}
test {
configureTests()
doFirst {
// For tests/com/twitter/intellij/pants/integration/WholeRepoIntegrationTest.java
file(".cache/dummy_repo").takeIf { it.exists() }?.deleteRecursively()
file("src/test/resources/testData/dummy_repo").copyRecursively(file(".cache/dummy_repo"), overwrite = true)
file(".cache/dummy_repo/pants").setExecutable(true)
// Remove IntelliJ index cache.
file(".cache/intellij/*/idea-dist/system/caches/").takeIf { it.exists() }?.deleteRecursively()
}
isScanForTestClasses = false
include("**/*Test.class")
exclude("**/*PantsProjectCacheTest.class")
exclude("**/*NotUsedTest.class")
finalizedBy(separateTests)
}
publishPlugin {
channels.set(publicationChannels)
System.getenv("TOKEN")?.takeIf { it.isNotBlank() }?.let {
token.set(it)
}
}
}