Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 59 additions & 84 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
plugins {
id("org.jetbrains.kotlin.jvm") version "1.8.21"
id("org.jetbrains.intellij") version "1.13.3"
id("org.jetbrains.kotlin.jvm") version "1.9.0-RC"
id("org.jetbrains.intellij") version "1.15.0"
id("org.jetbrains.kotlin.plugin.serialization") version "1.8.21"
}
group = "shop.itbug"
version = "3.3.3.as"
version = "3.5.0.eap"
repositories {
mavenCentral()
google()
Expand All @@ -16,15 +17,15 @@ repositories {


intellij {
version.set("2022.2.1.18")
type.set("AI")
version.set("LATEST-EAP-SNAPSHOT")
type.set("IC")
plugins.set(
listOf(
"yaml",
"Dart:222.4582",
"io.flutter:73.0.2",
"Dart:232.8660.129",
"io.flutter:74.0.5",
"org.intellij.plugins.markdown",
"terminal", "java"
"terminal", "java", "maven"
)
)
}
Expand All @@ -35,102 +36,81 @@ kotlin {
languageVersion = "2.0"
}
}


}

///
dependencies {
implementation("com.squareup.retrofit2:retrofit:2.9.0") {
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
exclude(group = "org.jetbrains.kotlin")
}
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:converter-gson:2.9.0")
{
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
exclude(group = "org.jetbrains.kotlin")
}
implementation("com.github.ben-manes.caffeine:caffeine:3.1.5")
{
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
exclude(group = "org.jetbrains.kotlin")
}
implementation("cn.hutool:hutool-all:5.8.15") {
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
exclude(group = "org.jetbrains.kotlin")
}
implementation("org.smartboot.socket:aio-core:1.6.3") {
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
exclude(group = "org.jetbrains.kotlin")
}
implementation("cn.hutool:hutool-all:5.8.15")
implementation("org.smartboot.socket:aio-core:1.6.3")
implementation("com.alibaba.fastjson2:fastjson2:2.0.25")
{
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
exclude(group = "org.jetbrains.kotlin")
}
implementation("com.alibaba.fastjson2:fastjson2-kotlin:2.0.25")
{
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
exclude(group = "org.jetbrains.kotlin")
}
implementation("org.apache.commons:commons-lang3:3.12.0")
{
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
exclude(group = "org.jetbrains.kotlin")
}
implementation("com.google.code.gson:gson:2.10.1") {
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
exclude(group = "org.jetbrains.kotlin")
}
implementation("com.fasterxml.jackson.core:jackson-databind:2.14.2") {
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
exclude(group = "org.jetbrains.kotlin")
}
implementation("org.xerial:sqlite-jdbc:3.40.1.0") {
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
exclude(group = "org.jetbrains.kotlin")
}
implementation("com.aallam.openai:openai-client:3.2.0") {
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
exclude(group = "org.jetbrains.kotlin")
}
implementation("io.ktor:ktor-client-cio-jvm:2.2.4") {
exclude(group = "org.jetbrains.kotlinx")
exclude(group = "org.slf4j")
exclude(group = "org.jetbrains.kotlin")
}
implementation("com.google.code.gson:gson:2.10.1")
implementation("com.fasterxml.jackson.core:jackson-databind:2.14.2")
implementation("org.xerial:sqlite-jdbc:3.40.1.0")
implementation("io.ktor:ktor-client-cio-jvm:2.2.4")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")
}





var javaVersion = "17"
tasks {
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = javaVersion
}

withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = javaVersion
kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
compilerOptions.languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9)
compilerOptions {

}
}

listProductsReleases {
}

patchPluginXml {
sinceBuild.set("222")
untilBuild.set("222.*")
changeNotes.set(
"""
<div>
<h1>3.5.0.eap (2023-07-25)</h1>
<ul>
<li>添加freezed快捷操作菜单</li>
<li>新增韩语,日语,繁体等多国语言</li>
<li>其他若干细节优化</li>
</ul>
<ul>
<li>freezedショートカットメニューの追加</li>
<li>韓国語、日本語、繁体字など多言語を追加</li>
<li>その他の詳細の最適化</li>
</ul>
<ul>
<li>freezed 바로 가기 메뉴 추가</li>
<li>한국어, 일본어, 번체 등 다국어 추가</li>
<li>기타 몇 가지 세부 최적화</li>
</ul>
</div>
<div>
<h1>3.4.1.221</h1>
<ul>
<li>Fix bug that cannot be enabled in version 3.4.0.221</li>
</ul>
</div>
<div>
<h1>3.4.0.221</h1>
<ul>
<li>Adaptation 221</li>
<li>New: Flutter version detection</li>
<li>New: Community Link Entry</li>
</ul>
</div>
<div>
<h1>3.3.3.as</h1>
<ul>
Expand Down Expand Up @@ -328,9 +308,4 @@ tasks {
}
}

configurations.all {
exclude(group = "io.ktor", module = "kotlinx-coroutines-jdk8")
exclude(group = "io.ktor", module = "kotlinx-coroutines-core")
exclude(group = "com.aallam.openai", module = "kotlinx-coroutines-jdk8")
exclude(group = "com.aallam.openai", module = "kotlinx-coroutines-core")
}

3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
kotlin.stdlib.default.dependency = true
kotlin.incremental.useClasspathSnapshot=false
kotlin.incremental.useClasspathSnapshot=false
kotlin.experimental.tryK2=true
4 changes: 4 additions & 0 deletions src/main/kotlin/icons/MyIcons.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ object MyImages {
@JvmField
val test : Icon = load("/images/test.png")





@JvmStatic
fun load(path: String): Icon {
return IconLoader.getIcon(path, MyImages::class.java)
Expand Down
12 changes: 0 additions & 12 deletions src/main/kotlin/note/jdbc/FlutterCollectService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,4 @@ object FlutterCollectService {

}




///禁用检查
fun disableCheckPlugin( pluginName: String,check: Boolean) {
check {
val sql = """

""".trimIndent()
}
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package note.setting

import com.intellij.execution.filters.TextConsoleBuilderFactory
import com.intellij.execution.ui.ConsoleViewContentType
import com.intellij.openapi.project.Project
import com.intellij.ui.dsl.builder.panel
import note.jdbc.SqliteConnectManager
Expand All @@ -13,6 +15,7 @@ class InitFlutterPluginSettingDialog( override val project: Project) : MyDialogW
init {
super.init()
title = "插件收藏"

}

override fun createCenterPanel(): JComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import shop.itbug.fluttercheckversionx.document.copyTextToClipboard

class ApiCopyAll:MyAction({"Copy All"}) {
override fun actionPerformed(e: AnActionEvent) {



val api = e.api()!!
val dataMap = mutableMapOf(
"url" to api.url,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
package shop.itbug.fluttercheckversionx.actions

import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.progress.ProgressIndicator
import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.progress.Task
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.DialogPanel
import com.intellij.openapi.ui.DialogWrapper
import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.openapi.vfs.VfsUtilCore
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.vfs.VirtualFileVisitor
import com.intellij.ui.dsl.builder.bindSelected
import com.intellij.ui.dsl.builder.bindText
import com.intellij.ui.dsl.builder.panel
import shop.itbug.fluttercheckversionx.document.copyTextToClipboard
import shop.itbug.fluttercheckversionx.util.toast
import shop.itbug.fluttercheckversionx.util.toastWithError
import javax.swing.JComponent


class IosFrameworkScanActionDialog(val project: Project, val e: AnActionEvent) : DialogWrapper(project) {

data class ModelProperties(var scanDirectionPath: String, var extension: String, var isDirection: Boolean)

val model = ModelProperties(scanDirectionPath = "/Framework", extension = "framework", isDirection = false)

private lateinit var dialogPanel: DialogPanel

init {
super.init()
title = "Flutter IOS Framework Util"
}

override fun createCenterPanel(): JComponent {
dialogPanel = panel {
row("扫描目录") {
textField().bindText(model::scanDirectionPath)
}
row("模块后缀") {
textField().bindText(model::extension)
}

row("是否目录") {
checkBox("是否为目录").bindSelected({ model.isDirection }, { model.isDirection = it })
}

}
return dialogPanel
}


override fun doOKAction() {
dialogPanel.apply()
startTask()
super.doOKAction()
}

private fun startTask() {
val task = object : Task.Backgroundable(project, "正在扫描中ios Framework") {
override fun run(indicator: ProgressIndicator) {
startTask(project, e)
}
}
ProgressManager.getInstance().run(task)
}

//开始任务
fun startTask(project: Project, e: AnActionEvent) {
val file = e.getData(CommonDataKeys.VIRTUAL_FILE)
if (file != null) {
val frameworkDirection = LocalFileSystem.getInstance().findFileByPath(file.path + model.scanDirectionPath)
if (frameworkDirection != null && frameworkDirection.isDirectory) {
val sb = StringBuffer()
VfsUtilCore.visitChildrenRecursively(frameworkDirection, object : VirtualFileVisitor<Void>() {
override fun visitFile(file: VirtualFile): Boolean {
if (file.extension == model.extension) {
val path = file.path.replace(project.basePath + "/ios/", "")
sb.append("\"$path\",")
}
if (model.isDirection && file.name.endsWith(model.extension)) {
val path = file.path.replace(project.basePath + "/ios/", "")
sb.append("\"$path\",")
}
return super.visitFile(file)
}

})

val finalString = sb.toString().removeSuffix(",")
finalString.copyTextToClipboard()
project.toast(finalString)
} else {
project.toastWithError("Framework directory not found")
}
}
}

}


///扫描ios插件包的Framework
class IosFrameworkScanAction : AnAction() {
override fun actionPerformed(e: AnActionEvent) {
e.project?.let {
IosFrameworkScanActionDialog(it, e).show()
}
}


override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.BGT
}
}
Loading