-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle.kts
125 lines (106 loc) · 3.33 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.intellij.platform.gradle.tasks.RunIdeTask
import java.io.FileInputStream
import java.util.Properties
plugins {
id("org.jetbrains.intellij.platform") version "2.1.0"
kotlin("jvm") version "1.9.25"
}
group = "com.ruben"
version = "0.4.5"
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
}
}
dependencies {
intellijPlatform {
create(
providers.gradleProperty("platformType"),
providers.gradleProperty("platformVersion")
)
bundledPlugins(
"com.intellij.java",
"org.jetbrains.kotlin"
)
instrumentationTools()
pluginVerifier()
zipSigner()
testFramework(TestFrameworkType.Platform)
}
testImplementation("junit:junit:4.13.2")
testImplementation("org.opentest4j:opentest4j:1.3.0")
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
intellijPlatform {
pluginConfiguration {
changeNotes.set(
"""
<br><b>v0.4.5: </b></br>
The plugin is now compatible with K2 compiler.
<br></br>
<br><b>v0.4.3: </b></br>
Now the plugin has a setting using which the users can specify which packages need inspection.
This is specially useful in large projects which have multiple modules.
If no packages are provided then the plugin will continue to inspect all the data classes.
<br></br>
<br><b>v0.3.2: </b></br>
Fix inner class not detecting required annotation
<br></br>
<br><b>v0.3.1: </b></br>
Added support for <b>Json (Moshi)</b> and <b>SerialName (Kotlinx-Serialization)</b> annotations
<br></br>
<br><b>Initial Release v0.2.3: </b></br>
Inspect kotlin data classes for missing <b>SerializedName</b> annotations
""".trimIndent()
)
ideaVersion {
sinceBuild = providers.gradleProperty("sinceBuild")
untilBuild = provider { null }
}
}
signing {
val file = File("local.properties")
val prop = Properties()
prop.load(FileInputStream(file))
privateKeyFile = file("${prop["privateKeyPath"]}")
password = "${prop["signingPass"]}"
certificateChainFile = file("${prop["certificateChainPath"]}")
}
pluginVerification {
ides {
recommended()
}
}
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = "21"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "21"
}
test {
isScanForTestClasses = false
// Only run tests from classes that end with "Test"
include("**/*Test.class")
systemProperty("idea.force.use.core.classloader", "true")
}
signPlugin {
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
privateKey.set(System.getenv("PRIVATE_KEY"))
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
}
publishPlugin {
token.set(System.getenv("PUBLISH_TOKEN"))
}
}
tasks.named<RunIdeTask>("runIde") {
jvmArgumentProviders += CommandLineArgumentProvider {
listOf("-Didea.kotlin.plugin.use.k2=true")
}
}