1 Star 0 Fork 2

huaieli/flow-chart

forked from 紫竹修/flow-chart 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle.kts 6.20 KB
一键复制 编辑 原始数据 按行查看 历史
wangzhikun 提交于 2022-05-18 17:32 . 解析加生成思维导图功能
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.changelog.closure
import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
// Java support
id("java")
// Kotlin support
id("org.jetbrains.kotlin.jvm") version "1.4.30"
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
id("org.jetbrains.intellij") version "0.6.5"
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
id("org.jetbrains.changelog") version "1.1.1"
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
id("io.gitlab.arturbosch.detekt") version "1.15.0"
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
id("org.jlleitschuh.gradle.ktlint") version "9.4.1"
}
// Import variables from gradle.properties file
val pluginGroup: String by project
// `pluginName_` variable ends with `_` because of the collision with Kotlin magic getter in the `intellij` closure.
// Read more about the issue: https://github.com/JetBrains/intellij-platform-plugin-template/issues/29
val pluginName: String by project
val pluginVersion: String by project
val pluginSinceBuild: String by project
val pluginUntilBuild: String by project
val pluginVerifierIdeVersions: String by project
val platformType: String by project
val platformVersion: String by project
val platformPlugins: String by project
val platformDownloadSources: String by project
group = pluginGroup
version = pluginVersion
// Configure project's dependencies
repositories {
//首先去本地仓库找
mavenLocal()
//然后去阿里仓库找
// build.gradle:
// maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
// build.gradle.kts:
maven { url = uri("https://repo.spring.io/release") }
maven {
isAllowInsecureProtocol = true
setUrl("http://maven.aliyun.com/nexus/content/groups/public/")
}
maven {
isAllowInsecureProtocol = true
url = uri("https://maven.aliyun.com/repository/public") }
maven {
isAllowInsecureProtocol = true
url = uri("https://maven.aliyun.com/repository/google") }
maven {
isAllowInsecureProtocol = true
url = uri("https://maven.aliyun.com/repository/gradle-plugin") }
maven {
isAllowInsecureProtocol = true
url = uri("https://maven.aliyun.com/repository/spring-plugin") }
maven {
isAllowInsecureProtocol = true
url = uri("https://maven.aliyun.com/repository/apache-snapshots") }
maven {
isAllowInsecureProtocol = true
url = uri("http://oss.jfrog.org/artifactory/oss-snapshot-local/") }
google()
jcenter()
//最后从maven中央仓库找
mavenCentral()
}
dependencies {
implementation("org.jetbrains:annotations:20.1.0")
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.15.0")
implementation("org.projectlombok:lombok:1.18.20")
implementation("com.alibaba:fastjson:1.2.76")
implementation("org.dom4j:dom4j:2.1.1")
implementation("cn.hutool:hutool-core:5.7.16")
implementation("cn.hutool:hutool-all:5.7.16")
implementation("cn.hutool:hutool-http:5.7.16")
implementation("cn.hutool:hutool-json:5.7.16")
implementation("com.github.eljah:xmindjbehaveplugin:0.8")
}
// Configure gradle-intellij-plugin plugin.
// Read more: https://github.com/JetBrains/gradle-intellij-plugin
intellij {
pluginName = pluginName
version = platformVersion
type = platformType
downloadSources = platformDownloadSources.toBoolean()
updateSinceUntilBuild = true
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
setPlugins(*platformPlugins.split(',').map(String::trim).filter(String::isNotEmpty).toTypedArray())
}
// Configure gradle-changelog-plugin plugin.
// Read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
version = pluginVersion
}
// Configure detekt plugin.
// Read more: https://detekt.github.io/detekt/kotlindsl.html
detekt {
config = files("./detekt-config.yml")
buildUponDefaultConfig = true
reports {
html.enabled = false
xml.enabled = false
txt.enabled = false
}
}
tasks {
// Set the compatibility versions to 1.8
withType<JavaCompile> {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
withType<Detekt> {
jvmTarget = "1.8"
}
patchPluginXml {
version(pluginVersion)
sinceBuild(pluginSinceBuild)
untilBuild(pluginUntilBuild)
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
pluginDescription(
closure {
File("./README.md").readText().lines().run {
val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->"
if (!containsAll(listOf(start, end))) {
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
}
subList(indexOf(start) + 1, indexOf(end))
}.joinToString("\n").run { markdownToHTML(this) }
}
)
// Get the latest available change notes from the changelog file
changeNotes(
closure {
changelog.getLatest().toHTML()
}
)
}
runPluginVerifier {
ideVersions(pluginVerifierIdeVersions)
}
publishPlugin {
dependsOn("patchChangelog")
token(System.getenv("PUBLISH_TOKEN"))
// pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
channels(pluginVersion.split('-').getOrElse(1) { "default" }.split('.').first())
}
runIde {
jvmArgs("-Xmx4096m","-XX:ReservedCodeCacheSize=512m","-Xms128m")
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/huaieli/flow-chart.git
[email protected]:huaieli/flow-chart.git
huaieli
flow-chart
flow-chart
master

搜索帮助