-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathbuild.gradle
More file actions
116 lines (94 loc) · 3.35 KB
/
build.gradle
File metadata and controls
116 lines (94 loc) · 3.35 KB
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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.commonmark:commonmark:0.21.0'
}
}
plugins {
id 'java'
id "org.jetbrains.intellij" version "1.17.4"
id 'org.jetbrains.kotlin.jvm' version '1.7.20'
// Gradle Changelog Plugin
id 'org.jetbrains.changelog' version "1.3.1"
}
import org.commonmark.parser.Parser
import org.commonmark.renderer.html.HtmlRenderer
apply plugin: 'org.jetbrains.changelog'
String properties(String key) {
return project.findProperty(key).toString()
}
group = properties("pluginGroup")
version = properties("pluginVersion")
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
testImplementation "org.mockito:mockito-core:4.8.0"
testImplementation "org.mockito:mockito-inline:4.8.0"
}
// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
pluginName = properties("pluginName")
version = properties("platformVersion")
type = properties("platformType")
downloadSources = properties("platformDownloadSources").toBoolean()
updateSinceUntilBuild = true
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
plugins = properties("platformPlugins").split(',').toList()
}
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
version = properties("pluginVersion")
path = "${project.projectDir}/doc/CHANGELOG.md"
// header = "[${-> version.get()}] - ${new SimpleDateFormat("yyyy-MM-dd").format(new Date())}"
// headerParserRegex = ~/(\d+\.\d+)/
// itemPrefix = "-"
keepUnreleasedSection = true
unreleasedTerm = "[Unreleased]"
groups = ["Added", "Changed", "Deprecated", "Removed", "Fixed", "Security"]
}
runIde {
// Absolute path to installed target 3.5 Android Studio to use as
// IDE Development Instance (the "Contents" directory is macOS specific):
// ideDir.set(file("/Applications/Android Studio.app/Contents"))
}
patchPluginXml {
version = properties("pluginVersion")
sinceBuild = properties("pluginSinceBuild")
untilBuild = properties("pluginUntilBuild")
// Load plugin description from dedicated file and convert to HTML
// This follows JetBrains recommended practice for plugin descriptions
pluginDescription = provider {
def descriptionFile = project.file("doc/PLUGIN_DESCRIPTION.md")
def descriptionContent = descriptionFile.exists() ? descriptionFile.text : ""
// Convert to HTML using CommonMark
def parser = Parser.builder().build()
def renderer = HtmlRenderer.builder().build()
def document = parser.parse(descriptionContent)
renderer.render(document)
}
// Get the latest available change notes from the changelog file
changeNotes = provider {
changelog.getOrNull("3.0.0")?.toHTML() ?: changelog.getUnreleased().toHTML()
}
}
runPluginVerifier {
ideVersions = properties("pluginVerifierIdeVersions").split(',').toList()
}
test {
testLogging {
// 展示测试的输出信息
showStandardStreams = true
// 展示具体的测试事件
events "passed", "skipped", "failed"
}
}