This repository was archived by the owner on Apr 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
92 lines (71 loc) · 2.11 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
plugins {
id 'java'
id 'org.jetbrains.intellij' version '1.5.2'
id 'org.kordamp.gradle.markdown' version '2.2.0'
}
group 'club.gclmit'
version '1.3.6'
repositories {
mavenLocal()
maven { url 'https://repo.huaweicloud.com/repository/maven/' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
mavenCentral()
}
dependencies {
implementation 'club.gclmit:chaos-core:2.4.4'
}
// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
type = "IU"
version = '2022.1'
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.incremental = true
options.fork = true
}
buildSearchableOptions {
enabled = false
}
patchPluginXml {
version = project.version
def changelogPath = "$projectDir/build/html/CHANGELOG.html" as String
def readmePath = "$projectDir/build/html/README.html" as String
if (file(changelogPath).exists()) {
changeNotes.set(provider {
file(changelogPath).text
})
}
if (file(readmePath).exists()) {
pluginDescription.set(provider {
file(readmePath).text
})
}
}
publishPlugin {
token.set(System.getenv('intellijPublishToken'))
}
// 第三方
markdownToHtml() {
sourceDir = new File("$projectDir/docs/md")
outputDir = new File("$projectDir/build/html")
tables = false
}
task copyMarkdown() {
def fromReadmePath = "$projectDir/README.md" as String
def toReadmePath = "$projectDir/docs/md/README.md" as String
def formChangelogPath = "$projectDir/CHANGELOG.md" as String
def toChangelogPath = "$projectDir/docs/md/CHANGELOG.md" as String
if (file(fromReadmePath).exists()) {
def fromFile = new File(fromReadmePath)
def toFile = new File(toReadmePath)
toFile.text = fromFile.text.replace("# Git-Commit-guide", " ")
}
if (file(formChangelogPath).exists()) {
def fromFile = new File(formChangelogPath)
def toFile = new File(toChangelogPath)
toFile.text = fromFile.text
}
}
tasks.markdownToHtml.dependsOn("copyMarkdown")
tasks.patchPluginXml.dependsOn("markdownToHtml")