From c5b93e8e3149a0aecf11286c85a974502b5d056c Mon Sep 17 00:00:00 2001 From: Alexey Tsvetkov Date: Wed, 14 Apr 2021 10:29:30 +0300 Subject: [PATCH] Prepare Intellij plugin for publishing --- idea-plugin/build.gradle.kts | 14 +- .../preview/PreviewEntryPoint.kt | 2 +- .../{idea => ide}/preview/PreviewIcons.kt | 2 +- .../{idea => ide}/preview/PreviewMessages.kt | 2 +- .../PreviewRunConfigurationProducer.kt | 2 +- .../PreviewRunLineMarkerContributor.kt | 2 +- .../{idea => ide}/preview/locationUtils.kt | 2 +- .../src/main/resources/META-INF/plugin.xml | 21 ++- .../main/resources/META-INF/pluginIcon.svg | 177 ++++++++++++++++++ 9 files changed, 211 insertions(+), 13 deletions(-) rename idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/{idea => ide}/preview/PreviewEntryPoint.kt (97%) rename idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/{idea => ide}/preview/PreviewIcons.kt (88%) rename idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/{idea => ide}/preview/PreviewMessages.kt (84%) rename idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/{idea => ide}/preview/PreviewRunConfigurationProducer.kt (98%) rename idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/{idea => ide}/preview/PreviewRunLineMarkerContributor.kt (97%) rename idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/{idea => ide}/preview/locationUtils.kt (98%) create mode 100644 idea-plugin/src/main/resources/META-INF/pluginIcon.svg diff --git a/idea-plugin/build.gradle.kts b/idea-plugin/build.gradle.kts index 951d9a7e940..a924f370fb4 100644 --- a/idea-plugin/build.gradle.kts +++ b/idea-plugin/build.gradle.kts @@ -9,7 +9,7 @@ plugins { fun properties(key: String) = project.findProperty(key).toString() -group = "org.jetbrains.compose.desktop.ide.preview" +group = "org.jetbrains.compose.desktop.ide" version = properties("deploy.version") repositories { @@ -18,7 +18,7 @@ repositories { } intellij { - pluginName = "Compose Desktop Preview" + pluginName = "Compose for Desktop IDE Support" type = "IC" downloadSources = true updateSinceUntilBuild = true @@ -31,6 +31,11 @@ intellij { ) } +tasks.buildSearchableOptions { + // temporary workaround + enabled = false +} + tasks { // Set the compatibility versions to 1.8 withType { @@ -40,4 +45,9 @@ tasks { withType { kotlinOptions.jvmTarget = "1.8" } + + publishPlugin { + token(System.getenv("IDE_PLUGIN_PUBLISH_TOKEN")) + channels("Alpha") + } } diff --git a/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/PreviewEntryPoint.kt b/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewEntryPoint.kt similarity index 97% rename from idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/PreviewEntryPoint.kt rename to idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewEntryPoint.kt index 3d9f38567e1..3e50a589a0e 100644 --- a/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/PreviewEntryPoint.kt +++ b/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewEntryPoint.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.compose.desktop.idea.preview +package org.jetbrains.compose.desktop.ide.preview import com.intellij.codeInspection.reference.EntryPoint import com.intellij.codeInspection.reference.RefElement diff --git a/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/PreviewIcons.kt b/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewIcons.kt similarity index 88% rename from idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/PreviewIcons.kt rename to idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewIcons.kt index 30d102bcd60..6efc761aa30 100644 --- a/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/PreviewIcons.kt +++ b/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewIcons.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. */ -package org.jetbrains.compose.desktop.idea.preview +package org.jetbrains.compose.desktop.ide.preview import com.intellij.openapi.util.IconLoader diff --git a/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/PreviewMessages.kt b/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewMessages.kt similarity index 84% rename from idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/PreviewMessages.kt rename to idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewMessages.kt index e972342b82e..a7000c37c72 100644 --- a/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/PreviewMessages.kt +++ b/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewMessages.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. */ -package org.jetbrains.compose.desktop.idea.preview +package org.jetbrains.compose.desktop.ide.preview internal object PreviewMessages { fun runPreview(name: String): String = "Preview $name" diff --git a/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/PreviewRunConfigurationProducer.kt b/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewRunConfigurationProducer.kt similarity index 98% rename from idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/PreviewRunConfigurationProducer.kt rename to idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewRunConfigurationProducer.kt index 6e9153d0a7a..e0123b18f5a 100644 --- a/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/PreviewRunConfigurationProducer.kt +++ b/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewRunConfigurationProducer.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.compose.desktop.idea.preview +package org.jetbrains.compose.desktop.ide.preview import com.intellij.execution.actions.ConfigurationContext import com.intellij.execution.actions.LazyRunConfigurationProducer diff --git a/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/PreviewRunLineMarkerContributor.kt b/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewRunLineMarkerContributor.kt similarity index 97% rename from idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/PreviewRunLineMarkerContributor.kt rename to idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewRunLineMarkerContributor.kt index 471635ce1f6..064315f6618 100644 --- a/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/PreviewRunLineMarkerContributor.kt +++ b/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/PreviewRunLineMarkerContributor.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.compose.desktop.idea.preview +package org.jetbrains.compose.desktop.ide.preview import com.intellij.execution.lineMarker.ExecutorAction import com.intellij.execution.lineMarker.RunLineMarkerContributor diff --git a/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/locationUtils.kt b/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/locationUtils.kt similarity index 98% rename from idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/locationUtils.kt rename to idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/locationUtils.kt index b6d8766483c..43804abddc7 100644 --- a/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/idea/preview/locationUtils.kt +++ b/idea-plugin/src/main/kotlin/org/jetbrains/compose/desktop/ide/preview/locationUtils.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.compose.desktop.idea.preview +package org.jetbrains.compose.desktop.ide.preview import com.intellij.psi.util.parentOfType import org.jetbrains.kotlin.asJava.findFacadeClass diff --git a/idea-plugin/src/main/resources/META-INF/plugin.xml b/idea-plugin/src/main/resources/META-INF/plugin.xml index bda5eeaec9c..f48b5770ced 100644 --- a/idea-plugin/src/main/resources/META-INF/plugin.xml +++ b/idea-plugin/src/main/resources/META-INF/plugin.xml @@ -1,20 +1,31 @@ - org.jetbrains.compose.desktop.idea.preview - Compose Desktop Preview + org.jetbrains.compose.desktop.ide + Compose for Desktop IDE Support JetBrains + + Compose for Desktop + applications. + The main feature at the moment is IDE preview of composable functions + marked by @Preview annotation. + ]]> + + com.intellij.modules.platform + com.intellij.modules.java com.intellij.gradle org.jetbrains.kotlin + implementationClass="org.jetbrains.compose.desktop.ide.preview.PreviewRunLineMarkerContributor"/> - + implementation="org.jetbrains.compose.desktop.ide.preview.PreviewRunConfigurationProducer"/> + diff --git a/idea-plugin/src/main/resources/META-INF/pluginIcon.svg b/idea-plugin/src/main/resources/META-INF/pluginIcon.svg new file mode 100644 index 00000000000..ade7a818507 --- /dev/null +++ b/idea-plugin/src/main/resources/META-INF/pluginIcon.svg @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +