Score
0
Watch 9 Star 47 Fork 8

tuchg / ChinesePinyin-CodeCompletionHelperKotlinGPL-3.0

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
Clone or download
build.gradle.kts 4.23 KB
Copy Edit Web IDE Raw Blame History
不知 authored 2020-12-22 01:01 . :green_heart: #17 避免 [unspecified]
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.21"
// 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 "0.6.2"
}
// Import variables from gradle.properties file
val pluginGroup: String by project
val pluginName_: String by project
val pluginVersion: String by project
val pluginSinceBuild: String by project
val pluginUntilBuild: String by project
val platformType: String by project
val platformVersion: String by project
val platformDownloadSources: String by project
val platformPlugins: String by project
val pluginVerifierIdeVersions: String by project
version = pluginVersion
// Configure project's dependencies
repositories {
mavenCentral()
mavenLocal()
jcenter()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
}
// 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:
// https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
setPlugins(*platformPlugins.split(',').map(String::trim).filter(String::isNotEmpty).toTypedArray())
}
tasks {
// Set the compatibility versions to 1.8
withType<JavaCompile> {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}
listOf("compileKotlin", "compileTestKotlin").forEach {
getByName<KotlinCompile>(it) {
kotlinOptions.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 {
subList(indexOf("<!-- Plugin description -->") + 1, indexOf("<!-- Plugin description end -->"))
}.joinToString("\n").run {
val last = this.replaceFirst(
"<!-- E -->",
// language=HTML
"""
<h3>English</h3>
> The original intention is that for some businesses that are not suitable for expression in English, you can use a straightforward native language instead of pinyin, and then call what is expressed in your native language as you usually write code to solve some naming difficulties 🤔
Let your IDE support Chinese programming, and enjoy the Chinese intelligent coding experience consistent with the English environment
* Input pinyin completion. Chinese identifier will be shown below. Input `zw` and prompt 中文 [**Z**hong **W**en].
* Polyphonic words complete without difference
* Support all identifiers, including variable names, function names, and class names
Compatible with all the Intellij Platform product, indiscriminate Chinese programming, Java, Kotlin, JavaScript, C#,Golang, or Haskell all support...
> 为啥这里会有一段不符合插件受众的别扭英文介绍💬 <a href="https://github.com/tuchg/ChinesePinyin-CodeCompletionHelper/issues/5">#issues-5</a>
<h3>中文</h3>
"""
)
markdownToHTML(last)
}
})
// 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"))
channels(pluginVersion.split('-').getOrElse(1) { "default" }.split('.').first())
}
}

Comment ( 0 )

Sign in for post a comment