diff --git a/.github/workflows/publish-eap.yml b/.github/workflows/publish-eap.yml deleted file mode 100644 index 351678fd..00000000 --- a/.github/workflows/publish-eap.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Publish EAP to the Marketplace - -on: -# # only works on 'master' branch as it is a default branch -# workflow_run: -# workflows: [ Check ] -# types: -# - completed -# branches: -# - master - release: - types: [prereleased] - -jobs: -# check-for-tests-success: -# runs-on: ubuntu-latest -# permissions: -# actions: write -# -# steps: -# - name: Early exit if tests wasn't successful -# if: ${{ github.event.workflow_run.conclusion != 'success' }} -# run: | -# gh run cancel ${{ github.run_id }} -# gh run watch ${{ github.run_id }} -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - publish-eap-channel: -# needs: [ check-for-tests-success ] - strategy: - matrix: - gradle-properties-version: [ 242, 243 ] - - runs-on: ubuntu-latest - env: - ORG_GRADLE_PROJECT_shortPlatformVersion: ${{ matrix.gradle-properties-version }} - JB_PUB_TOKEN: ${{ secrets.JB_PUB_TOKEN }} - JB_PUB_CHANNEL: eap - - steps: - - uses: actions/checkout@v4 - - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - distribution: 'corretto' - java-version: 21 - - - name: Setup Gradle and dependencies - uses: gradle/actions/setup-gradle@v3 - with: - gradle-version: wrapper - cache-read-only: false - arguments: ":resolveDependencies -Pkotlin.incremental=false --no-daemon" - gradle-home-cache-excludes: | - caches/modules-2/files-2.1/com.jetbrains.intellij.pycharm - caches/modules-2/files-2.1/com.jetbrains.intellij.idea - caches/modules-2/files-2.1/com.jetbrains.intellij.clion - - - name: Build - uses: gradle/actions/setup-gradle@v3 - with: - gradle-version: wrapper - arguments: "assemble testClasses -Pkotlin.incremental=false --no-daemon --stacktrace" - gradle-home-cache-excludes: | - caches/modules-2/files-2.1/com.jetbrains.intellij.pycharm - caches/modules-2/files-2.1/com.jetbrains.intellij.idea - caches/modules-2/files-2.1/com.jetbrains.intellij.clion - - - name: Publish to EAP channel - uses: gradle/actions/setup-gradle@v3 - with: - gradle-version: wrapper - arguments: ":publishPlugin -Pkotlin.incremental=false --no-daemon --stacktrace" - gradle-home-cache-excludes: | - caches/modules-2/files-2.1/com.jetbrains.intellij.pycharm - caches/modules-2/files-2.1/com.jetbrains.intellij.idea - caches/modules-2/files-2.1/com.jetbrains.intellij.clion - - - - diff --git a/build.gradle.kts b/build.gradle.kts index 31ae017a..21989e18 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,11 +4,10 @@ import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask import org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 import org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0 import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -import java.io.ByteArrayOutputStream import java.util.* +@Suppress("USELESS_ELVIS_RIGHT_IS_NULL") val publishingToken = System.getenv("JB_PUB_TOKEN") ?: null -val publishingChannel = System.getenv("JB_PUB_CHANNEL") ?: "default" // set by default in Github Actions val isCI = System.getenv("CI") != null @@ -17,51 +16,16 @@ fun prop(name: String): String = extra.properties[name] as? String ?: error("Property `$name` is not defined in gradle.properties for environment `$shortPlatformVersion`") -fun propOrNull(name: String): String? = extra.properties[name] as? String - -fun gitCommitHash(): String { - val byteOut = ByteArrayOutputStream() - project.exec { - commandLine = "git rev-parse --short HEAD".split(" ") -// commandLine = "git rev-parse --abbrev-ref HEAD".split(" ") - standardOutput = byteOut - } - return String(byteOut.toByteArray()).trim().also { - if (it == "HEAD") - logger.warn("Unable to determine current branch: Project is checked out with detached head!") - } -} - -fun gitTimestamp(): String { - val byteOut = ByteArrayOutputStream() - project.exec { - commandLine = "git show --no-patch --format=%at HEAD".split(" ") -// commandLine = "git rev-parse --abbrev-ref HEAD".split(" ") - standardOutput = byteOut - } - return String(byteOut.toByteArray()).trim().also { - if (it == "HEAD") - logger.warn("Unable to determine current branch: Project is checked out with detached head!") - } -} - val shortPlatformVersion = prop("shortPlatformVersion") val useInstaller = prop("useInstaller").toBooleanStrict() -val codeVersion = "1.40.0" - -var pluginVersion = "$codeVersion.$shortPlatformVersion" -if (publishingChannel != "default") { - // timestamp of the commit with this eaps addition - val start = 1714498465 - val commitTimestamp = gitTimestamp().toInt() - start - pluginVersion = "$pluginVersion-$publishingChannel.$commitTimestamp" -} +val codeVersion = "1.41.0" +val pluginVersion = "$codeVersion.$shortPlatformVersion" val pluginGroup = "org.move" val pluginName = "intellij-move" val kotlinReflectVersion = "2.0.21" -val aptosVersion = "4.4.0" +val aptosVersion = "4.5.0" group = pluginGroup version = pluginVersion @@ -158,7 +122,6 @@ allprojects { publishing { token.set(publishingToken) - channels.set(listOf(publishingChannel)) } pluginVerification { @@ -252,6 +215,7 @@ allprojects { } } + @Suppress("unused") val runIdeWithPlugins by intellijPlatformTesting.runIde.registering { plugins { plugin("com.google.ide-perf:1.3.2") @@ -330,14 +294,3 @@ fun copyDownloadedAptosBinaries(copyTask: AbstractCopyTask) { } } -val Project.dependencyCachePath - get(): String { - val cachePath = file("${rootProject.projectDir}/deps") - // If cache path doesn't exist, we need to create it manually - // because otherwise gradle-intellij-plugin will ignore it - if (!cachePath.exists()) { - cachePath.mkdirs() - } - return cachePath.absolutePath - } - diff --git a/src/main/kotlin/org/move/cli/externalFormatter/MovefmtConfigurable.kt b/src/main/kotlin/org/move/cli/externalFormatter/MovefmtConfigurable.kt index cd3b4c96..0e0faf13 100644 --- a/src/main/kotlin/org/move/cli/externalFormatter/MovefmtConfigurable.kt +++ b/src/main/kotlin/org/move/cli/externalFormatter/MovefmtConfigurable.kt @@ -17,31 +17,29 @@ import org.move.cli.settings.VersionLabel import org.move.openapiext.pathField class MovefmtConfigurable(val project: Project): BoundConfigurable("Movefmt") { - private val innerDisposable = - Disposer.newCheckedDisposable("Internal checked disposable for MovefmtConfigurable") - - private val movefmtPathField = - pathField( - FileChooserDescriptorFactory.createSingleFileOrExecutableAppDescriptor(), - innerDisposable, - "Movefmt location", - onTextChanged = { it -> - val path = it.toNioPathOrNull() ?: return@pathField - versionLabel.update(path) - }) - private val versionLabel = VersionLabel( - innerDisposable, - envs = EnvironmentVariablesData.create(mapOf("MOVEFMT_LOG" to "error"), true) - ) - - private val additionalArguments: RawCommandLineEditor = RawCommandLineEditor() - private val environmentVariables: EnvironmentVariablesComponent = EnvironmentVariablesComponent() - - override fun createPanel(): DialogPanel { + val innerDisposable = + Disposer.newCheckedDisposable("MovefmtConfigurable.innerDisposable") this.disposable?.let { Disposer.register(it, innerDisposable) } + + val versionLabel = VersionLabel( + innerDisposable, + envs = EnvironmentVariablesData.create(mapOf("MOVEFMT_LOG" to "error"), true) + ) + val movefmtPathField = + pathField( + FileChooserDescriptorFactory.createSingleFileOrExecutableAppDescriptor(), + innerDisposable, + "Movefmt location", + onTextChanged = { it -> + val path = it.toNioPathOrNull() ?: return@pathField + versionLabel.update(path) + }) + val additionalArguments: RawCommandLineEditor = RawCommandLineEditor() + val environmentVariables: EnvironmentVariablesComponent = EnvironmentVariablesComponent() + return panel { val settings = project.movefmtSettings val state = settings.state.copy() diff --git a/src/main/kotlin/org/move/cli/settings/aptos/ChooseAptosCliPanel.kt b/src/main/kotlin/org/move/cli/settings/aptos/ChooseAptosCliPanel.kt index eae31fe8..af0dba5d 100644 --- a/src/main/kotlin/org/move/cli/settings/aptos/ChooseAptosCliPanel.kt +++ b/src/main/kotlin/org/move/cli/settings/aptos/ChooseAptosCliPanel.kt @@ -63,7 +63,7 @@ enum class AptosExecType { class ChooseAptosCliPanel(versionUpdateListener: (() -> Unit)?): Disposable { private val innerDisposable = - Disposer.newCheckedDisposable("Internal checked disposable for ChooseAptosCliPanel") + Disposer.newCheckedDisposable("ChooseAptosCliPanel.innerDisposable") init { Disposer.register(this, innerDisposable) diff --git a/src/main/kotlin/org/move/openapiext/ui.kt b/src/main/kotlin/org/move/openapiext/ui.kt index 4b9f9747..c0ef00d4 100644 --- a/src/main/kotlin/org/move/openapiext/ui.kt +++ b/src/main/kotlin/org/move/openapiext/ui.kt @@ -3,21 +3,16 @@ package org.move.openapiext import com.intellij.openapi.Disposable import com.intellij.openapi.application.ModalityState import com.intellij.openapi.application.invokeLater -import com.intellij.openapi.editor.Editor -import com.intellij.openapi.editor.ScrollType import com.intellij.openapi.fileChooser.FileChooserDescriptor import com.intellij.openapi.ui.TextComponentAccessor import com.intellij.openapi.ui.TextFieldWithBrowseButton import com.intellij.openapi.util.CheckedDisposable -import com.intellij.openapi.util.Disposer import com.intellij.openapi.util.NlsContexts.DialogTitle import com.intellij.ui.DocumentAdapter -import com.intellij.ui.components.JBTextField import com.intellij.ui.dsl.builder.AlignX import com.intellij.ui.dsl.builder.Cell import com.intellij.ui.dsl.builder.Row import com.intellij.util.Alarm -import org.move.lang.core.psi.MvElement import javax.swing.JComponent import javax.swing.JTextField import javax.swing.event.DocumentEvent @@ -48,11 +43,11 @@ class UiDebouncer( fun pathField( fileChooserDescriptor: FileChooserDescriptor, - disposable: Disposable, + parentDisposable: Disposable, @DialogTitle dialogTitle: String, onTextChanged: (String) -> Unit = {} ): TextFieldWithBrowseButton { - val component = TextFieldWithBrowseButton(null, disposable) + val component = TextFieldWithBrowseButton(null, parentDisposable) component.addBrowseFolderListener( dialogTitle, null, null, fileChooserDescriptor,