Kaynağa Gözat

Merge pull request #36 from Seedking/suppor-2024-1-EAP

Support 2024.1 EAP
ruki 1 yıl önce
ebeveyn
işleme
5fee56a443

+ 70 - 72
build.gradle.kts

@@ -1,82 +1,91 @@
+import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
+
 fun properties(key: String) = project.findProperty(key).toString()
 
+//read local workspace file to string
+val localChangeNotes: String = file("${projectDir}/change-notes.html").readText(Charsets.UTF_8)
+val localDescription: String = file("${projectDir}/description.html").readText(Charsets.UTF_8)
+
+//testing ide (true : clion , false : intellij)
+val testIde:String = if(properties("testInClion").toBoolean()) "CL" else "IC"
+
+
 plugins {
     id("java")
-    //gradle-intellij-plugin
-    id("org.jetbrains.intellij") version "1.16.1"
-    //kotlin
+    id("org.jetbrains.intellij") version "1.17.1"
     id("org.jetbrains.kotlin.jvm") version "1.9.21"
-
     id("org.jetbrains.changelog") version "2.2.0"
 }
 
-allprojects {
-    apply {
-        plugin("idea")
-        plugin("kotlin")
-        plugin("org.jetbrains.intellij")
-    }
+group = "io.xmake"
 
-    repositories {
-        mavenLocal()
-        mavenCentral()
-        gradlePluginPortal()
-        maven("https://maven.aliyun.com/repository/public/")
-        maven("https://oss.sonatype.org/content/repositories/snapshots/")
-        maven("https://cache-redirector.jetbrains.com/intellij-dependencies")
-    }
+repositories {
+    maven("https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository")
+    mavenLocal()
+    mavenCentral()
+    gradlePluginPortal()
+    maven("https://maven.aliyun.com/repository/public/")
+    maven("https://oss.sonatype.org/content/repositories/snapshots/")
+    maven("https://cache-redirector.jetbrains.com/intellij-dependencies")
+}
 
-    configurations {
-        all {
-            // Allows using project dependencies instead of IDE dependencies during compilation running
-            resolutionStrategy.sortArtifacts(ResolutionStrategy.SortOrder.DEPENDENCY_FIRST)
-        }
-    }
+intellij {
+    type.set(testIde)
+    version.set("2023.3.3")
+    downloadSources.set(true)
+    ideaDependencyCachePath.set(dependencyCachePath)
+    updateSinceUntilBuild.set(true)
+    /*
+    plugins.set(
+        listOf(
+            "com.intellij.clion",
+            "com.intellij.cidr.base",
+            "com.intellij.cidr.lang"
+        )
+    )
+     */
+}
 
-    // See https://github.com/JetBrains/gradle-intellij-plugin/
-    intellij {
-        pluginName.set(properties("pluginName"))
-        version.set(properties("baseVersion"))
-        //type.set(properties("platformType"))
-        downloadSources.set(properties("platformDownloadSources").toBoolean())
-        ideaDependencyCachePath.set(dependencyCachePath)
-        updateSinceUntilBuild.set(true)
-        plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
+tasks {
+    withType<JavaCompile> {
+        sourceCompatibility = "17"
+        targetCompatibility = "17"
+    }
+    withType<KotlinCompile> {
+        kotlinOptions.jvmTarget = "17"
     }
 
-    tasks {
-        withType<JavaCompile> {
-            sourceCompatibility = "17"
-            targetCompatibility = "17"
-        }
-        withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
-            kotlinOptions.jvmTarget = "17"
-        }
-
-        test {
-            useJUnitPlatform()
-        }
-        getByName("buildSearchableOptions").enabled = false
-
-        patchPluginXml {
-            version.set(properties("pluginVersion"))
-            sinceBuild.set(properties("pluginSinceBuild"))
-            untilBuild.set(properties("pluginUntilBuild"))
-        }
-
-        runPluginVerifier {
-            ideVersions.set(properties("pluginVerifierIdeVersions").split(',').map(String::trim).filter(String::isNotEmpty))
-        }
+    test {
+        useJUnitPlatform()
+    }
 
+    patchPluginXml {
+        version = properties("pluginVersion")
+        sinceBuild = properties("pluginSinceBuild")
+        untilBuild = properties("pluginUntilBuild")
+        changeNotes = localChangeNotes
+        description = localDescription
     }
 
-    dependencies {
-        implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.21")
-        testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.2")
-        testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.2")
+    runPluginVerifier {
+        ideVersions.set(
+            listOf(
+                "2022.3",
+                "2023.1",
+                "2023.2",
+                "2023.3",
+                "2024.1 EAP",
+            )
+        )
     }
 }
 
+dependencies {
+    implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.21")
+    testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.2")
+    testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.2")
+}
+
 
 
 val Project.dependencyCachePath
@@ -86,15 +95,4 @@ val Project.dependencyCachePath
             cachePath.mkdirs()
         }
         return cachePath.absolutePath
-    }
-
-
-project(":clion") {
-    intellij {
-        version.set(properties("clionVersion"))
-        plugins.set(properties("clionPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
-    }
-    dependencies {
-        implementation(project(":"))
-    }
-}
+    }

+ 116 - 0
change-notes.html

@@ -0,0 +1,116 @@
+<strong>1.3.3</strong>
+<ul>
+    <li>[FIX]: Update version</li>
+    <li>[FIX]: Upgrade ui api version</li>
+    <li>[FIX]: Refactoring ioRunv()</li>
+</ul>
+<strong>1.3.2</strong>
+<ul>
+    <li>[FIX]: Remove -w option</li>
+</ul>
+<strong>1.3.1</strong>
+<ul>
+    <li>[FIX]: Upgrade Kotlin UI DSL version 1 to 2</li>
+</ul>
+<strong>1.3.0</strong>
+<ul>
+    <li>[FIX]: Update version</li>
+</ul>
+<strong>1.2.3</strong>
+<ul>
+    <li>[FIX]: Update version</li>
+</ul>
+<strong>1.2.2</strong>
+<ul>
+    <li>[FIX]: Fix requires</li>
+</ul>
+<strong>1.2.1</strong>
+<ul>
+    <li>[FIX]: Update version</li>
+</ul>
+<strong>1.2.0</strong>
+<ul>
+    <li>[FIX]: Improve new progrect</li>
+</ul>
+<strong>1.1.9</strong>
+<ul>
+    <li>[FIX]: Support future Clion version</li>
+</ul>
+<strong>1.1.8</strong>
+<ul>
+    <li>[FIX]: Update Clion version</li>
+</ul>
+<strong>1.1.7</strong>
+<ul>
+    <li>[FIX]: Update Clion version</li>
+</ul>
+<strong>1.1.6</strong>
+<ul>
+    <li>[FIX]: Improve configuration</li>
+</ul>
+<strong>1.1.5</strong>
+<ul>
+    <li>[FIX]: Fix create project</li>
+</ul>
+<strong>1.1.4</strong>
+<ul>
+    <li>[FIX]: Fix deprecated api warning again</li>
+</ul>
+<strong>1.1.3</strong>
+<ul>
+    <li>[FIX]: Fix deprecated api warning</li>
+</ul>
+<strong>1.1.2</strong>
+<ul>
+    <li>[FIX]: Fix bug for windows</li>
+</ul>
+<strong>1.1.1</strong>
+<ul>
+    <li>[NEW]: Support Clion 213.x</li>
+</ul>
+<strong>1.1.0</strong>
+<ul>
+    <li>[NEW]: Add icon for CMakelists and compile_commands</li>
+</ul>
+<strong>1.0.9</strong>
+<ul>
+    <li>[NEW]: Support to generate CMakelists and compile_commands</li>
+</ul>
+<strong>1.0.8</strong>
+<ul>
+    <li>[FIX]: Improve compatibility to support more versions</li>
+</ul>
+<strong>1.0.7</strong>
+<ul>
+    <li>[FIX]: Improve compatibility and add usage instruction</li>
+</ul>
+<strong>1.0.6</strong>
+<ul>
+    <li>[NEW]: Support latest CLion and IDEA Intellij</li>
+</ul>
+<strong>1.0.5</strong>
+<ul>
+    <li>[FIX]: Fix conflict issues with java</li>
+</ul>
+<strong>1.0.4</strong>
+<ul>
+    <li>[NEW]: Modify rebuild icon</li>
+</ul>
+<strong>1.0.3</strong>
+<ul>
+    <li>[NEW]: Improve exit code</li>
+</ul>
+<strong>1.0.2</strong>
+<ul>
+    <li>[NEW]: Create project (c/c++/rust/go/dlang/swift/objc)</li>
+</ul>
+<strong>1.0.1</strong>
+<ul>
+    <li>[NEW]: Quickstart</li>
+    <li>[NEW]: Project configuration</li>
+    <li>[NEW]: Run configuration</li>
+    <li>[NEW]: Menu tools</li>
+    <li>[NEW]: Tool windows</li>
+    <li>[NEW]: Build and run</li>
+    <li>[NEW]: Goto error and waring problems</li>
+</ul>

+ 0 - 11
clion/src/main/resources/META-INF/clion-only.xml

@@ -1,11 +0,0 @@
-<idea-plugin xmlns:xi="http://www.w3.org/2001/XInclude" allow-bundled-update="true">
-    <depends>com.intellij.cidr.base</depends>
-    <depends>com.intellij.clion</depends>
-    <depends>com.intellij.modules.cidr.debugger</depends>
-
-    <!--<extensions defaultExtensionNs="cidr.debugger">
-        <languageSupport language="lua" implementationClass="io.xmake.debugger.CppDebuggerLanguageSupport"/>
-        <lineBreakpointFileTypesProvider implementation="io.xmake.debugger.CppLineBreakpointFileTypesProvider"/>
-    </extensions>-->
-
-</idea-plugin>

+ 34 - 0
description.html

@@ -0,0 +1,34 @@
+<br>A XMake integration plugin in Intellij Platform<br>
+<p><a href="https://github.com/xmake-io/xmake-idea">Source Code</a> | <a href="https://discord.gg/xmake">Discord</a> | <a href="https://xmake.io/#/about/sponsor">Donate</a> | <a href="https://xmake.io">XMake Homepage</a></p>
+Features:
+<ul>
+    <li>xmake</li>
+    <ul>
+        <li>C/C++/Objc/Swift/Rust/Dlang/Golang ... support</li>
+        <li>Cross-platform support</li>
+        <li>Lua syntax</li>
+        <li><a href="https://github.com/xmake-io/xmake">More features and info about xmake</a></li>
+    </ul>
+    <li>Quickstart</li>
+    <li>Create project</li>
+    <li>Project configuration</li>
+    <li>Run configuration</li>
+    <li>Menu tools</li>
+    <li>Tool windows</li>
+    <li>Build and run</li>
+    <li>Goto error and waring problems</li>
+</ul>
+Usage instruction:<br><br>
+1. New project<br>
+New -> Project -> Select Xmake -> Select project template<br>
+<br>
+2. Open existing project<br>
+Open -> Select project folder with xmake.lua<br>
+<br>
+3. Build project<br>
+Menu -> Xmake -> Click 'Build Project'<br>
+<br>
+4. Run Target<br>
+Add run configuration -> Select Xmake -> Add run target
+Menu -> Xmake -> Click 'Run Target'<br>
+<p>中国朋友可以加QQ群交流及反馈BUG: 343118190</p>

+ 5 - 15
gradle.properties

@@ -1,20 +1,7 @@
-pluginGroup=io.xmake
-pluginName=IntelliJ Xmake Plugin
-pluginVersion=1.3.2
+pluginVersion=1.3.3
 pluginSinceBuild=223.7571.182
-pluginUntilBuild=232.*
+pluginUntilBuild=241.*
 
-# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
-# See https://jb.gg/intellij-platform-builds-list for available build versions
-pluginVerifierIdeVersions=2022.2.5, 2022.3, 2023.1, 2023.2
-baseVersion=IC-2023.2
-clionVersion=CL-2023.2
-platformDownloadSources=true
-
-# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
-# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
-platformPlugins=com.intellij.java, org.jetbrains.kotlin
-clionPlugins=com.intellij.cidr.base, com.intellij.clion
 # Opt-out flag for bundling Kotlin standard library.
 # See https://kotlinlang.org/docs/reference/using-gradle.html#dependency-on-the-standard-library for details.
 kotlin.stdlib.default.dependency=false
@@ -25,6 +12,9 @@ kotlin.stdlib.default.dependency=false
 #systemProp.https.proxyHost=127.0.0.1
 #systemProp.https.proxyPort=7890
 
+# testing in clion
+testInClion=false
+
 
 org.gradle.warning.mode=all
 kotlin.daemon.jvmargs=-Xmx2048m

+ 1 - 11
settings.gradle.kts

@@ -1,11 +1 @@
-
-pluginManagement {
-    repositories {
-        maven {
-            url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
-        }
-        gradlePluginPortal()
-    }
-}
-rootProject.name = "xmake-idea"
-include("clion")
+rootProject.name = "xmake-idea"

+ 2 - 2
src/main/kotlin/io/xmake/project/XMakeDirectoryProjectGenerator.kt

@@ -1,6 +1,5 @@
 package io.xmake.project
 
-import com.intellij.facet.ui.ValidationResult
 import com.intellij.ide.util.projectWizard.AbstractNewProjectStep
 import com.intellij.ide.util.projectWizard.CustomStepProjectGenerator
 import com.intellij.openapi.module.Module
@@ -14,6 +13,7 @@ import io.xmake.icons.XMakeIcons
 import io.xmake.utils.SystemUtils
 import java.io.File
 import javax.swing.Icon
+import io.xmake.utils.ioRunv
 
 
 class XMakeDirectoryProjectGenerator : DirectoryProjectGeneratorBase<XMakeConfigData>(),
@@ -33,7 +33,7 @@ class XMakeDirectoryProjectGenerator : DirectoryProjectGeneratorBase<XMakeConfig
          * @note we muse use ioRunv instead of Runv to read all output, otherwise it will wait forever on windows
          */
         val tmpdir = "$contentEntryPath.dir"
-        SystemUtils.ioRunv(
+        ioRunv(
             listOf(
                 SystemUtils.xmakeProgram,
                 "create",

+ 2 - 1
src/main/kotlin/io/xmake/project/XMakeModuleBuilder.kt

@@ -10,6 +10,7 @@ import com.intellij.openapi.util.Disposer
 import com.intellij.openapi.util.io.FileUtil
 import com.intellij.openapi.vfs.LocalFileSystem
 import io.xmake.utils.SystemUtils
+import io.xmake.utils.ioRunv
 import java.io.File
 
 
@@ -37,7 +38,7 @@ class XMakeModuleBuilder : ModuleBuilder() {
          * @note we muse use ioRunv instead of Runv to read all output, otherwise it will wait forever on windows
          */
         val tmpdir = "$contentEntryPath.dir"
-        SystemUtils.ioRunv(
+        ioRunv(
             listOf(
                 SystemUtils.xmakeProgram,
                 "create",

+ 9 - 16
src/main/kotlin/io/xmake/run/XMakeRunConfigurationEditor.kt

@@ -6,8 +6,8 @@ import com.intellij.openapi.options.SettingsEditor
 import com.intellij.openapi.project.Project
 import com.intellij.openapi.ui.ComboBox
 import com.intellij.ui.RawCommandLineEditor
-import com.intellij.ui.layout.*
-import com.intellij.ui.components.Label
+import com.intellij.ui.dsl.builder.AlignX
+import com.intellij.ui.dsl.builder.panel
 import io.xmake.shared.xmakeConfiguration
 import java.awt.Dimension
 import javax.swing.JComponent
@@ -56,29 +56,22 @@ class XMakeRunConfigurationEditor(private val project: Project) : SettingsEditor
 
     // create editor
     override fun createEditor(): JComponent = panel {
-
-        labeledRow("Default target:", targetsComboBox) {
-            targetsComboBox(CCFlags.push)
+        row("Default target:") {
+            cell(targetsComboBox).align(AlignX.FILL)
         }
 
-        labeledRow("Run arguments:", runArguments) {
-            runArguments.apply {
-                makeWide()
-            }()
+        row("Environment variables:") {
+            cell(runArguments).align(AlignX.FILL)
+        }
+        row(environmentVariables.label) {
+            cell(environmentVariables).align(AlignX.FILL)
         }
-        row(environmentVariables.label) { environmentVariables.apply { makeWide() }() }
     }
 
     private fun JPanel.makeWide() {
         preferredSize = Dimension(1000, height)
     }
 
-    private fun LayoutBuilder.labeledRow(labelText: String, component: JComponent, init: Row.() -> Unit) {
-        val label = Label(labelText)
-        label.labelFor = component
-        row(label) { init() }
-    }
-
     companion object {
 
         // get log

+ 3 - 2
src/main/kotlin/io/xmake/shared/XMakeConfiguration.kt

@@ -8,6 +8,7 @@ import com.intellij.openapi.components.ProjectComponent
 import com.intellij.openapi.diagnostic.Logger
 import com.intellij.openapi.project.Project
 import io.xmake.utils.SystemUtils
+import io.xmake.utils.ioRunv
 
 @State(name = "XMakeProjectSettings")
 class XMakeConfiguration(// the project
@@ -132,7 +133,7 @@ class XMakeConfiguration(// the project
 
             // make targets
             var targets = arrayOf("default", "all")
-            val results = SystemUtils.ioRunv(
+            val results = ioRunv(
                 listOf(
                     SystemUtils.xmakeProgram,
                     "l",
@@ -140,7 +141,7 @@ class XMakeConfiguration(// the project
                     "import(\"core.project.config\"); import(\"core.project.project\"); config.load(); for name, _ in pairs((project.targets())) do print(name) end"
                 ), data.workingDirectory
             )
-            results.split("\n").forEach {
+            results.forEach {
                 if (it.trim() != "") {
                     targets += it
                 }

+ 75 - 0
src/main/kotlin/io/xmake/utils/Command.kt

@@ -0,0 +1,75 @@
+package io.xmake.utils
+
+import com.intellij.execution.configurations.GeneralCommandLine
+import com.intellij.execution.process.ProcessNotCreatedException
+import com.intellij.execution.util.ExecUtil
+import com.jetbrains.rd.util.Callable
+import io.xmake.utils.interact.kSystemEnv
+import io.xmake.utils.interact.kLineSeparator
+import java.io.FileNotFoundException
+import java.io.IOException
+import java.util.concurrent.Executors
+import java.util.concurrent.Future
+
+/**
+ * [ioRunv]
+ *
+ * @param argv the command arguments
+ * @param workDir the working directory
+ * @return a List<String>, the all output of the command
+ */
+fun ioRunv(argv: List<String>, workDir: String? = null): List<String> {
+    val call = Callable {
+        val ret: List<String> = listOf("")
+        try {
+            val commandLine: GeneralCommandLine = GeneralCommandLine(argv)
+                .withWorkDirectory(workDir)
+                .withCharset(Charsets.UTF_8)
+                .withEnvironment(kSystemEnv)
+                .withParentEnvironmentType(GeneralCommandLine.ParentEnvironmentType.CONSOLE)
+            commandLine.withEnvironment("COLORTERM", "nocolor")
+            val output = ExecUtil.execAndGetOutput(commandLine)
+            output.stdout.split(kLineSeparator)
+        } catch (e: Exception) {
+            ret
+        }
+    }
+
+    val executor = Executors.newSingleThreadExecutor()
+    val commandOutput: Future<List<String>> = executor.submit(call)
+    val result = commandOutput.get()
+    executor.shutdown()
+    return result
+}
+
+
+/**
+ * [runVOutLine]
+ *
+ * @param argv the command arguments
+ * @param minLine return begin line
+ * @param maxLine return end line
+ * @param workDir the working directory
+ * @return a string containing the lines of output from the command,
+ * starting from the line number specified by `minLine` and ending at the line number specified by `maxLine`.
+ * If the command produces fewer lines than `minLine`, the return will be an empty string.
+ * If the command produces lines but fewer than `maxLine`, all lines from `minLine` to the end of output will be returned.
+ * Lines are returned as a single string, with each line separated by the system's line separator.
+ */
+
+fun ioRunvOutLine(argv: List<String>, minLine: Int, maxLine: Int = minLine, workDir: String? = null): String {
+    TODO()
+}
+
+/**
+ * [vRunV]
+ *
+ * output on console
+ * @param console the console
+ * @param argv the command arguments
+ * @param workDir the working directory
+ * @return void
+ */
+inline fun vRunV(console: String/*TODO()*/, argv: List<String>, workDir: String? = null) {
+    TODO()
+}

+ 3 - 83
src/main/kotlin/io/xmake/utils/SystemUtils.kt

@@ -10,9 +10,7 @@ import com.intellij.openapi.project.Project
 import com.intellij.openapi.vfs.VirtualFile
 import io.xmake.project.*
 import io.xmake.shared.XMakeProblem
-import java.io.BufferedReader
-import java.io.IOException
-import java.io.InputStreamReader
+import io.xmake.utils.interact.kXMakeVersion
 import java.io.File
 import java.nio.file.Path
 import java.nio.file.Paths
@@ -63,9 +61,9 @@ object SystemUtils {
     var xmakeVersion: String
         get() {
             if (_xmakeVersion == "") {
-                val result = ioRunv(listOf(xmakeProgram, "--version")).split(',')
+                val result = kXMakeVersion
                 if (result.isNotEmpty()) {
-                    _xmakeVersion = result[0]
+                    _xmakeVersion = result
                 }
             }
             return _xmakeVersion
@@ -81,84 +79,6 @@ object SystemUtils {
         else -> "linux"
     }
 
-    // run command with arguments
-    fun Runv(argv: List<String>, workingDirectory: String? = null): Int {
-
-        var code = -1
-        try {
-
-            // init process builder
-            val processBuilder = ProcessBuilder(argv)
-
-            // init working directory
-            if (workingDirectory !== null) {
-                processBuilder.directory(File(workingDirectory))
-            }
-
-            // run process
-            val process = processBuilder.start()
-
-            // wait for process
-            code = process.waitFor()
-
-        } catch (e: IOException) {
-            e.printStackTrace()
-        } finally {
-        }
-        return code
-    }
-
-    // run command with arguments and return output
-    fun ioRunv(argv: List<String>, workingDirectory: String? = null): String {
-
-        var result = ""
-        var bufferReader: BufferedReader? = null
-        try {
-
-            // init process builder
-            val processBuilder = ProcessBuilder(argv)
-
-            // init working directory
-            if (workingDirectory !== null) {
-                processBuilder.directory(File(workingDirectory))
-            }
-
-            // disable color for xmake
-            processBuilder.environment().put("COLORTERM", "nocolor")
-
-            // run process
-            val process = processBuilder.start()
-
-            // get input buffer reader
-            bufferReader = BufferedReader(InputStreamReader(process.getInputStream()))
-
-            // get io output
-            var line: String? = bufferReader.readLine()
-            while (line != null) {
-                result += line + "\n"
-                line = bufferReader.readLine()
-            }
-
-            // wait for process
-            if (process.waitFor() != 0)
-                result = ""
-
-        } catch (e: IOException) {
-            e.printStackTrace()
-        } finally {
-
-            if (bufferReader != null) {
-                try {
-                    bufferReader.close()
-                } catch (e: Exception) {
-                    e.printStackTrace()
-                }
-
-            }
-        }
-        return result
-    }
-
     // parse problems for the given line
     private fun parseProblem(info: String): XMakeProblem? {
 

+ 8 - 0
src/main/kotlin/io/xmake/utils/interact/LocalData.kt

@@ -0,0 +1,8 @@
+package io.xmake.utils.interact
+
+
+val kSystemEnv: MutableMap<String, String>?
+    get() = System.getenv()
+
+val kLineSeparator: String
+    get() = System.lineSeparator()

+ 30 - 0
src/main/kotlin/io/xmake/utils/interact/XMakeData.kt

@@ -0,0 +1,30 @@
+package io.xmake.utils.interact
+
+import io.xmake.utils.SystemUtils
+import io.xmake.utils.ioRunv
+
+val kXMakeFind:Boolean
+    get() = TODO()
+
+val kXMakeVersion:String
+    get() {
+        val ioTemp: String = ioRunv(listOf(SystemUtils.xmakeProgram, "--version"))[0]
+        if (ioTemp.isNotEmpty()) {
+            val verTemp = ioTemp.split(' ')[1]
+            return verTemp.substring(1, verTemp.length - 1)
+
+        }
+        return ioTemp
+    }
+
+val kXMakeInstallDir:String
+    get() = TODO()
+
+val kArchList:List<String>
+    get() = TODO()
+
+val kPlatList:List<String>
+    get() = TODO()
+
+val kPlatArchMap:Map<String, List<String>>
+    get() = TODO()

+ 0 - 2
src/main/resources/META-INF/idea-only.xml

@@ -1,2 +0,0 @@
-<idea-plugin>
-</idea-plugin>

+ 18 - 163
src/main/resources/META-INF/plugin.xml

@@ -2,170 +2,22 @@
 <idea-plugin>
     <id>io.xmake</id>
     <name>XMake</name>
-    <version>1.3.0</version>
     <vendor email="[email protected]" url="https://xmake.io">xmake.io</vendor>
-    <description><![CDATA[
-    A XMake integration plugin in Intellij Platform<br>
-    <p><a href="https://github.com/xmake-io/xmake-idea">Source Code</a> | <a href="https://discord.gg/xmake">Discord</a> | <a href="https://xmake.io/#/about/sponsor">Donate</a> | <a href="https://xmake.io">XMake Homepage</a></p>
-    Features:
-    <ul>
-        <li>xmake</li>
-        <ul>
-            <li>C/C++/Objc/Swift/Rust/Dlang/Golang ... support</li>
-            <li>Cross-platform support</li>
-            <li>Lua syntax</li>
-            <li><a href="https://github.com/xmake-io/xmake">More features and info about xmake</a></li>
-        </ul>
-        <li>Quickstart</li>
-        <li>Create project</li>
-        <li>Project configuration</li>
-        <li>Run configuration</li>
-        <li>Menu tools</li>
-        <li>Tool windows</li>
-        <li>Build and run</li>
-        <li>Goto error and waring problems</li>
-    </ul>
-    Usage instruction:<br><br>
-    1. New project<br>
-    New -> Project -> Select Xmake -> Select project template<br>
-    <br>
-    2. Open existing project<br>
-    Open -> Select project folder with xmake.lua<br>
-    <br>
-    3. Build project<br>
-    Menu -> Xmake -> Click 'Build Project'<br>
-    <br>
-    4. Run Target<br>
-    Add run configuration -> Select Xmake -> Add run target
-    Menu -> Xmake -> Click 'Run Target'<br>
-    <p>中国朋友可以加QQ群交流及反馈BUG: 343118190</p>
-    ]]></description>
 
-    <change-notes><![CDATA[
-    <strong>1.3.2</strong>
-    <ul>
-        <li>[FIX]: Remove -w option </li>
-    </ul>
-    <strong>1.3.1</strong>
-    <ul>
-        <li>[FIX]: Upgrade Kotlin UI DSL version 1 to 2 </li>
-    </ul>
-    <strong>1.3.0</strong>
-    <ul>
-        <li>[FIX]: Update version </li>
-    </ul>
-    <strong>1.2.3</strong>
-    <ul>
-        <li>[FIX]: Update version </li>
-    </ul>
-    <strong>1.2.2</strong>
-    <ul>
-        <li>[FIX]: Fix requires </li>
-    </ul>
-    <strong>1.2.1</strong>
-    <ul>
-        <li>[FIX]: Update version </li>
-    </ul>
-    <strong>1.2.0</strong>
-    <ul>
-        <li>[FIX]: Improve new progrect </li>
-    </ul>
-    <strong>1.1.9</strong>
-    <ul>
-        <li>[FIX]: Support future Clion version </li>
-    </ul>
-    <strong>1.1.8</strong>
-    <ul>
-        <li>[FIX]: Update Clion version </li>
-    </ul>
-    <strong>1.1.7</strong>
-    <ul>
-        <li>[FIX]: Update Clion version </li>
-    </ul>
-    <strong>1.1.6</strong>
-    <ul>
-        <li>[FIX]: Improve configuration </li>
-    </ul>
-    <strong>1.1.5</strong>
-    <ul>
-        <li>[FIX]: Fix create project </li>
-    </ul>
-    <strong>1.1.4</strong>
-    <ul>
-        <li>[FIX]: Fix deprecated api warning again </li>
-    </ul>
-    <strong>1.1.3</strong>
-    <ul>
-        <li>[FIX]: Fix deprecated api warning </li>
-    </ul>
-    <strong>1.1.2</strong>
-    <ul>
-        <li>[FIX]: Fix bug for windows </li>
-    </ul>
-    <strong>1.1.1</strong>
-    <ul>
-        <li>[NEW]: Support Clion 213.x </li>
-    </ul>
-    <strong>1.1.0</strong>
-    <ul>
-        <li>[NEW]: Add icon for CMakelists and compile_commands </li>
-    </ul>
-    <strong>1.0.9</strong>
-    <ul>
-        <li>[NEW]: Support to generate CMakelists and compile_commands </li>
-    </ul>
-    <strong>1.0.8</strong>
-    <ul>
-        <li>[FIX]: Improve compatibility to support more versions</li>
-    </ul>
-    <strong>1.0.7</strong>
-    <ul>
-        <li>[FIX]: Improve compatibility and add usage instruction</li>
-    </ul>
-    <strong>1.0.6</strong>
-    <ul>
-        <li>[NEW]: Support latest CLion and IDEA Intellij</li>
-    </ul>
-    <strong>1.0.5</strong>
-    <ul>
-        <li>[FIX]: Fix conflict issues with java</li>
-    </ul>
-    <strong>1.0.4</strong>
-    <ul>
-        <li>[NEW]: Modify rebuild icon</li>
-    </ul>
-    <strong>1.0.3</strong>
-    <ul>
-        <li>[NEW]: Improve exit code</li>
-    </ul>
-    <strong>1.0.2</strong>
-    <ul>
-        <li>[NEW]: Create project (c/c++/rust/go/dlang/swift/objc)</li>
-    </ul>
-    <strong>1.0.1</strong>
-    <ul>
-        <li>[NEW]: Quickstart</li>
-        <li>[NEW]: Project configuration</li>
-        <li>[NEW]: Run configuration</li>
-        <li>[NEW]: Menu tools</li>
-        <li>[NEW]: Tool windows</li>
-        <li>[NEW]: Build and run</li>
-        <li>[NEW]: Goto error and waring problems</li>
-    </ul>
-    ]]>
-    </change-notes>
-
-    <!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
-    <idea-version since-build="223.7571.182" until-build="232.*"/>
-
-    <!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
-         on how to target different products -->
-    <!--    <depends>com.intellij.modules.java</depends>-->
-    <depends>com.intellij.modules.lang</depends>
+    <!--all-->
     <depends>com.intellij.modules.platform</depends>
-    <depends optional="true" config-file="../../../../clion/src/main/resources/META-INF/clion-only.xml">
-        com.intellij.modules.clion
-    </depends>
+    <depends>com.intellij.modules.lang</depends>
+    <depends>com.intellij.modules.xml</depends>
+    <depends>com.intellij.modules.vcs</depends>
+    <depends>com.intellij.modules.xdebugger</depends>
+    <!--clion and c/cpp language-->
+    <!--
+    <depends>com.intellij.clion</depends>
+    <depends>com.intellij.modules.cidr.ide</depends>
+    <depends>com.intellij.modules.cidr.lang</depends>
+    <depends>com.intellij.modules.cidr.modulemap.language</depends>
+    <depends>com.intellij.modules.cmake</depends>
+    -->
 
     <extensions defaultExtensionNs="com.intellij">
 
@@ -199,8 +51,11 @@
          https://github.com/centic9/IntelliJ-Action-IDs
     -->
     <actions>
-        <group id="XMake.Menu" text="XMake" description="XMake Menu">
-            <add-to-group group-id="MainMenu" anchor="after" relative-to-action="RunMenu"/>
+        <group id="XMake.Menu" text="XMake" popup="true" description="XMake Menu">
+            <add-to-group group-id="MainMenu"
+                          anchor="after"
+                          relative-to-action="RunMenu"
+            />
             <action id="XMake.Run" class="io.xmake.actions.RunAction" text="Run Target" icon="/icons/run.png"
                     description="Run the current target."/>
             <action id="XMake.Build" class="io.xmake.actions.BuildAction" text="Build Project"