Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compile with older version #93

Merged
merged 1 commit into from
Jan 24, 2024
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
9 changes: 6 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies {


group = "com.smallcloud"
version = getVersionString("1.2.11")
version = getVersionString("1.2.12")

repositories {
mavenCentral()
Expand All @@ -29,7 +29,10 @@ repositories {
// Configure Gradle IntelliJ Plugin
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij {
version.set("2023.2.1")
// version.set("2022.3.1.19")
// version.set("2023.3.2")
version.set("2022.3.1")
// type.set("AI") // Target IDE Platform
type.set("PC") // Target IDE Platform

plugins.set(listOf(
Expand All @@ -50,7 +53,7 @@ tasks {
}

patchPluginXml {
sinceBuild.set("232")
sinceBuild.set("223")
untilBuild.set("233.*")
}

Expand Down
10 changes: 7 additions & 3 deletions src/main/kotlin/com/smallcloud/refactai/Initializer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.project.Project
import com.intellij.openapi.roots.ProjectRootManager
import com.intellij.openapi.startup.ProjectActivity
import com.intellij.openapi.startup.StartupActivity
import com.smallcloud.refactai.account.LoginStateService
import com.smallcloud.refactai.account.login
import com.smallcloud.refactai.io.ConnectivityManager
Expand All @@ -23,8 +23,8 @@ import com.smallcloud.refactai.struct.DeploymentMode
import java.util.concurrent.atomic.AtomicBoolean


class Initializer : ProjectActivity, Disposable {
override suspend fun execute(project: Project) {
class Initializer : StartupActivity, Disposable {
private fun execute(project: Project) {
val shouldInitialize = !(initialized.getAndSet(true) || ApplicationManager.getApplication().isUnitTestMode)
if (shouldInitialize) {
Logger.getInstance("SMCInitializer").info("Bin prefix = ${Resources.binPrefix}")
Expand Down Expand Up @@ -62,4 +62,8 @@ class Initializer : ProjectActivity, Disposable {
companion object {
private val initialized = AtomicBoolean(false)
}

override fun runActivity(project: Project) {
execute(project)
}
}
11 changes: 5 additions & 6 deletions src/main/kotlin/com/smallcloud/refactai/Resources.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import com.intellij.openapi.extensions.PluginId
import com.intellij.openapi.util.IconLoader
import com.intellij.openapi.util.Key
import com.intellij.openapi.util.SystemInfo
import com.intellij.ui.NewUiValue
import com.intellij.util.IconUtil
import java.io.File
import java.net.URI
Expand Down Expand Up @@ -95,11 +94,11 @@ object Resources {
}

private fun resizeSquaredIcon(icon: Icon, width: Int): Icon {
return if (NewUiValue.isEnabled()) {
icon
} else {
IconUtil.resizeSquared(icon, width)
}
// return if (NewUiValue.isEnabled()) {
// icon
// } else {
return IconUtil.resizeSquared(icon, width)
// }
}

private fun makeIcon12(path: String): Icon {
Expand Down
Loading