From 2b6409279b4da04e80e976a57f577d2436317915 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 12 Jun 2023 09:44:45 +0200 Subject: [PATCH 001/347] `snapshotVersion=2.0` --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 002093d41e..5eb8b8ba87 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ version=1.15.0 -snapshotVersion=1.15.1 +snapshotVersion=2.0 snapshot=false group=org.jetbrains.intellij.plugins artifactId=gradle-intellij-plugin From 2a370b561e2de783c72848ee1d988e96482f1906 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 12 Jun 2023 10:39:54 +0200 Subject: [PATCH 002/347] New project name: IntelliJ Platform Gradle Plugin --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- ...svg => intellij-platform-gradle-plugin-dark.svg} | 0 ...vg => intellij-platform-gradle-plugin-light.svg} | 0 ...ugin.png => intellij-platform-gradle-plugin.png} | Bin CHANGELOG.md | 1 + CONTRIBUTING.md | 8 ++++---- INTEGRATION_TESTS.md | 12 ++++++------ README.md | 12 ++++++------ gradle.properties | 6 +++--- .../intellij/IntelliJPlatformIntegrationTestBase.kt | 2 +- .../intellij/JarManifestFileIntegrationTest.kt | 2 +- .../kotlin/org/jetbrains/intellij/IntelliJPlugin.kt | 2 +- .../jetbrains/intellij/IntelliJPluginConstants.kt | 2 +- .../jetbrains/intellij/IntelliJPluginExtension.kt | 2 +- .../intellij/tasks/InitializeIntelliJPluginTask.kt | 4 ++-- .../intellij/tasks/SetupDependenciesTask.kt | 2 +- .../intellij/tasks/VerifyPluginConfigurationTask.kt | 2 +- src/main/kotlin/org/jetbrains/intellij/utils.kt | 2 +- .../org/jetbrains/intellij/IntelliJPluginSpec.kt | 4 ++-- 19 files changed, 33 insertions(+), 32 deletions(-) rename .github/readme/{gradle-intellij-plugin-dark.svg => intellij-platform-gradle-plugin-dark.svg} (100%) rename .github/readme/{gradle-intellij-plugin-light.svg => intellij-platform-gradle-plugin-light.svg} (100%) rename .github/readme/{gradle-intellij-plugin.png => intellij-platform-gradle-plugin.png} (100%) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index f438c9ba66..0c8b54d5fe 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -20,7 +20,7 @@ A clear and concise description of what you expected to happen. **Environment:** - OS: [e.g. macOS] - - Gradle IntelliJ Plugin Version [e.g. 1.6.0] + - IntelliJ Platform Gradle Plugin Version [e.g. 2.0] - Gradle Version [e.g. 7.4.2] **Additional context** diff --git a/.github/readme/gradle-intellij-plugin-dark.svg b/.github/readme/intellij-platform-gradle-plugin-dark.svg similarity index 100% rename from .github/readme/gradle-intellij-plugin-dark.svg rename to .github/readme/intellij-platform-gradle-plugin-dark.svg diff --git a/.github/readme/gradle-intellij-plugin-light.svg b/.github/readme/intellij-platform-gradle-plugin-light.svg similarity index 100% rename from .github/readme/gradle-intellij-plugin-light.svg rename to .github/readme/intellij-platform-gradle-plugin-light.svg diff --git a/.github/readme/gradle-intellij-plugin.png b/.github/readme/intellij-platform-gradle-plugin.png similarity index 100% rename from .github/readme/gradle-intellij-plugin.png rename to .github/readme/intellij-platform-gradle-plugin.png diff --git a/CHANGELOG.md b/CHANGELOG.md index ff8632e4d1..6c84ce5472 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Configure all tasks that extend task classes instead of just those created by the plugin ### Changed +- New project name: IntelliJ Platform Gradle Plugin - Disabled caching for `BuildPluginTask` ## [1.15.0] - 2023-07-07 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d30df55d9b..d13e940b3f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ -# Contributing to the Gradle IntelliJ Plugin +# Contributing to the IntelliJ Platform Gradle Plugin -There are many ways to contribute to the Gradle IntelliJ Plugin project, and each of them is valuable to us. +There are many ways to contribute to the IntelliJ Platform Gradle Plugin project, and each of them is valuable to us. Every submitted feedback, issue, or pull request is highly appreciated. ## Issue Tracker @@ -11,10 +11,10 @@ If you find your problem unique, and it wasn't yet reported to us, [file an issu ## Run Integration Tests The project provides Unit Tests and Integration Tests to verify if nothing is broken with the real-life project examples. [Integration Tests](https://github.com/JetBrains/gradle-intellij-plugin/tree/master/integration-tests) provide various different test cases with a dedicated verification scenarios available in `verify.main.kts` files. -Read the [Gradle IntelliJ Plugin Integration Tests](https://github.com/JetBrains/gradle-intellij-plugin/tree/master/integration-tests) document to find more about this kind of test and find out how to create new scenarios. +Read the [IntelliJ Platform Gradle Plugin Integration Tests](https://github.com/JetBrains/gradle-intellij-plugin/tree/master/integration-tests) document to find more about this kind of test and find out how to create new scenarios. ## Link With Your Project -It is possible to link your plugin project with the Gradle IntelliJ Plugin project, so it'll be loaded and built as a module. +It is possible to link your plugin project with the IntelliJ Platform Gradle Plugin project, so it'll be loaded and built as a module. To integrate it with another consumer-like project, add the following line in the Gradle settings file and refresh your Gradle configuration: ```kotlin diff --git a/INTEGRATION_TESTS.md b/INTEGRATION_TESTS.md index 3e051cf3df..6e6a3ef9d9 100644 --- a/INTEGRATION_TESTS.md +++ b/INTEGRATION_TESTS.md @@ -1,10 +1,10 @@ -# Gradle IntelliJ Plugin Integration Tests +# IntelliJ Platform Gradle Plugin Integration Tests ## Purpose of running Integration Tests -The Gradle IntelliJ Plugin already contains a set of unit tests, but in some cases, it is not enough when a more complex configuration is used. +The IntelliJ Platform Gradle Plugin already contains a set of unit tests, but in some cases, it is not enough when a more complex configuration is used. -Integration Tests are supposed to build the Gradle IntelliJ Plugin from the sources held in the currently used branch (i.e., for specific commits, pull request) and use it against the curated list of subprojects. +Integration Tests are supposed to build the IntelliJ Platform Gradle Plugin from the sources held in the currently used branch (i.e., for specific commits, pull request) and use it against the curated list of subprojects. Each of the Integration Tests is a standalone project that focuses on a specific use-case, like patching the `plugin.xml` file, running one of the small IDEs with extra dependencies and feature implemented, etc. @@ -24,7 +24,7 @@ Each matrix variation is used to run the Integration Tests projects as a separat The Integration Tests workflow is stored in the [`integration-tests.yml`](../.github/workflows/integration-tests.yml) file. It defines a couple of triggers: -- `workflow_dispatch` – manual trigger via the [Actions](https://github.com/JetBrains/gradle-intellij-plugin/actions) tab of the Gradle IntelliJ Plugin GitHub repository. +- `workflow_dispatch` – manual trigger via the [Actions](https://github.com/JetBrains/gradle-intellij-plugin/actions) tab of the IntelliJ Platform Gradle Plugin GitHub repository. - `schedule` (WIP) – CRON job - `push` (WIP) – trigger any push to the main branch - `pull_request` (WIP) – trigger on any push to pull requests @@ -47,14 +47,14 @@ The Gradle task execution is performed via the `runGradleTask()` function, which │ │ ├── build.gradle.kts custom project configuration │ │ ├── src module sources, like Java/Kotlin implementation, plugin.xml, other resources │ │ └── verify.main.kts custom verification script containing assertions against build output, artifact, and Gradle output -│ ├── settings.gradle.kts combines subprojects, loads Gradle IntelliJ Plugin +│ ├── settings.gradle.kts combines subprojects, loads IntelliJ Platform Gradle Plugin │ └── verify.utils.kts util methods for verify.main.kts scripts which are located in modules └── ... ``` To introduce a new subproject to the Integration Tests set, it is required to create a new directory within the `integration-tests` folder and provide at least `build.gradle.kts` and `verify.main.kts` scripts. -The `build.gradle.kts` should apply the Gradle IntelliJ Plugin without specifying its version and define dependencies of the `integrationTest` task: +The `build.gradle.kts` should apply the IntelliJ Platform Gradle Plugin without specifying its version and define dependencies of the `integrationTest` task: ```kotlin plugins { diff --git a/README.md b/README.md index c9f3090235..2745ac30b9 100644 --- a/README.md +++ b/README.md @@ -5,19 +5,19 @@ [![Twitter Follow](https://img.shields.io/badge/follow-%40JBPlatform-1DA1F2?logo=twitter)][jb:twitter] [![Slack](https://img.shields.io/badge/Slack-%23gradle--intellij--plugin-blue?style=flat-square&logo=Slack)][jb:slack] -![Gradle IntelliJ Plugin](.github/readme/gradle-intellij-plugin-dark.svg#gh-dark-mode-only) -![Gradle IntelliJ Plugin](.github/readme/gradle-intellij-plugin-light.svg#gh-light-mode-only) +![IntelliJ Platform Gradle Plugin](.github/readme/intellij-platform-gradle-plugin-dark.svg#gh-dark-mode-only) +![IntelliJ Platform Gradle Plugin](.github/readme/intellij-platform-gradle-plugin-light.svg#gh-light-mode-only) -# Gradle IntelliJ Plugin -The Gradle IntelliJ Plugin is a plugin for the Gradle build system to help configuring your environment for building, testing, verifying, and publishing plugins for IntelliJ-based IDEs. +# IntelliJ Platform Gradle Plugin +The IntelliJ Platform Gradle Plugin is a plugin for the Gradle build system to help configuring your environment for building, testing, verifying, and publishing plugins for IntelliJ-based IDEs. ## Documentation -The documentation of the Gradle IntelliJ Plugin has moved to the IntelliJ Platform Plugin SDK Documentation: +The documentation of the IntelliJ Platform Gradle Plugin has moved to the IntelliJ Platform Plugin SDK Documentation: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html ### Installation -To install the Gradle IntelliJ Plugin in your project, follow [Usage](https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#usage) section of the plugin documentation. +To install the IntelliJ Platform Gradle Plugin in your project, follow [Usage](https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#usage) section of the plugin documentation. There's also a [Snapshot Release](https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#snapshot-release) available built nightly form the main branch containing the always-latest version of the plugin. ## Changelog diff --git a/gradle.properties b/gradle.properties index 5eb8b8ba87..c2416e89d1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,10 +4,10 @@ snapshot=false group=org.jetbrains.intellij.plugins artifactId=gradle-intellij-plugin pluginId=org.jetbrains.intellij -description=The Gradle IntelliJ Plugin is a plugin for the Gradle build system to help configure your environment for building, testing, verifying, and publishing plugins for IntelliJ-based IDEs.\ - For more information, see [Gradle IntelliJ Plugin documentation](https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html). +description=The IntelliJ Platform Gradle Plugin is a plugin for the Gradle build system to help configure your environment for building, testing, verifying, and publishing plugins for IntelliJ-based IDEs.\ + For more information, see [IntelliJ Platform Gradle Plugin documentation](https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html). -pluginDisplayName=Gradle IntelliJ Plugin +pluginDisplayName=IntelliJ Platform Gradle Plugin pluginImplementationClass=org.jetbrains.intellij.IntelliJPlugin website=https://github.com/JetBrains/gradle-intellij-plugin diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/IntelliJPlatformIntegrationTestBase.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/IntelliJPlatformIntegrationTestBase.kt index 6415faf4cc..398aef683a 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/IntelliJPlatformIntegrationTestBase.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/IntelliJPlatformIntegrationTestBase.kt @@ -70,7 +70,7 @@ open class IntelliJPlatformIntegrationTestBase( // get() = projectDirectory.parent // // /** -// * Path to the Gradle IntelliJ Plugin root directory, +// * Path to the IntelliJ Platform Gradle Plugin root directory, // * e.g., `/Users/hsz/Projects/JetBrains/gradle-intellij-plugin/`. // */ // val Path.rootDirectory diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/JarManifestFileIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/JarManifestFileIntegrationTest.kt index 1757ccdb10..116c5804ac 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/JarManifestFileIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/JarManifestFileIntegrationTest.kt @@ -14,7 +14,7 @@ class JarManifestFileIntegrationTest : IntelliJPlatformIntegrationTestBase( pluginJar containsFileInArchive "META-INF/MANIFEST.MF" with(pluginJar readEntry "META-INF/MANIFEST.MF") { this containsText "Version: 1.0.0" - this containsText "Build-Plugin: Gradle IntelliJ Plugin" + this containsText "Build-Plugin: IntelliJ Platform Gradle Plugin" this containsText "Build-Plugin-Version:" this containsText "Build-OS:" this containsText "Build-SDK: IC-2022.1.4" diff --git a/src/main/kotlin/org/jetbrains/intellij/IntelliJPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/IntelliJPlugin.kt index 116d973ba6..8f7f446ad0 100644 --- a/src/main/kotlin/org/jetbrains/intellij/IntelliJPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/IntelliJPlugin.kt @@ -1549,7 +1549,7 @@ abstract class IntelliJPlugin : Plugin { } private fun configureInitializeGradleIntelliJPluginTask(project: Project) { - info(context, "Initializing Gradle IntelliJ Plugin") + info(context, "Initializing IntelliJ Platform Gradle Plugin") project.tasks.register(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) project.tasks.withType { diff --git a/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginConstants.kt index 97d86ffd96..94b867ca92 100644 --- a/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginConstants.kt @@ -3,7 +3,7 @@ package org.jetbrains.intellij object IntelliJPluginConstants { - const val PLUGIN_NAME = "Gradle IntelliJ Plugin" + const val PLUGIN_NAME = "IntelliJ Platform Gradle Plugin" const val PLUGIN_ID = "org.jetbrains.intellij" const val PLUGIN_GROUP_NAME = "intellij" const val EXTENSION_NAME = "intellij" diff --git a/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginExtension.kt b/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginExtension.kt index 5657bc5fdb..8a99e85354 100644 --- a/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginExtension.kt +++ b/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginExtension.kt @@ -18,7 +18,7 @@ import org.jetbrains.intellij.utils.DependenciesDownloader import javax.inject.Inject /** - * After the Gradle IntelliJ Plugin is applied, the `intellij` extension can be used to configure the plugin and common settings of the provided tasks. + * After the IntelliJ Platform Gradle Plugin is applied, the `intellij` extension can be used to configure the plugin and common settings of the provided tasks. * * It is mandatory to specify at least the [version] property. */ diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/InitializeIntelliJPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/tasks/InitializeIntelliJPluginTask.kt index 08fff07759..2094d41c0b 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/InitializeIntelliJPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/tasks/InitializeIntelliJPluginTask.kt @@ -17,7 +17,7 @@ import org.jetbrains.intellij.utils.LatestVersionResolver import java.io.File /** - * Initializes the Gradle IntelliJ Plugin and performs various checks, like if the plugin is up to date. + * Initializes the IntelliJ Platform Gradle Plugin and performs various checks, like if the plugin is up to date. */ @UntrackedTask(because = "Should always be run to initialize the plugin") abstract class InitializeIntelliJPluginTask : DefaultTask() { @@ -33,7 +33,7 @@ abstract class InitializeIntelliJPluginTask : DefaultTask() { init { group = PLUGIN_GROUP_NAME - description = "Initializes the Gradle IntelliJ Plugin" + description = "Initializes the IntelliJ Platform Gradle Plugin" } private val context = logCategory() diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/SetupDependenciesTask.kt b/src/main/kotlin/org/jetbrains/intellij/tasks/SetupDependenciesTask.kt index 985aa6cc95..589dcc1887 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/SetupDependenciesTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/tasks/SetupDependenciesTask.kt @@ -17,7 +17,7 @@ import org.jetbrains.intellij.logCategory * * This task is automatically added to the ["After Sync" Gradle trigger](https://www.jetbrains.com/help/idea/work-with-gradle-tasks.html#config_triggers_gradle) to make the IntelliJ SDK dependency available for IntelliJ IDEA right after the Gradle synchronization. * - * > After removing the Gradle IntelliJ Plugin from your project, the `Task 'setupDependencies' not found in root project` exception may occur. + * > After removing the IntelliJ Platform Gradle Plugin from your project, the `Task 'setupDependencies' not found in root project` exception may occur. * * @see Frequently Asked Questions */ diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/VerifyPluginConfigurationTask.kt b/src/main/kotlin/org/jetbrains/intellij/tasks/VerifyPluginConfigurationTask.kt index 6e41651a8b..d717aaa548 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/VerifyPluginConfigurationTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/tasks/VerifyPluginConfigurationTask.kt @@ -188,7 +188,7 @@ abstract class VerifyPluginConfigurationTask @Inject constructor( yield("The dependency on the Kotlin Standard Library (stdlib) is automatically added when using the Gradle Kotlin plugin and may conflict with the version provided with the IntelliJ Platform, see: https://jb.gg/intellij-platform-kotlin-stdlib") } if (kotlinPluginAvailable.get() && kotlinVersion >= Version(1, 8, 20) && kotlinVersion < Version(1, 9) && kotlinIncrementalUseClasspathSnapshot.orNull == null) { - yield("The Kotlin plugin in version $kotlinVersion used with the Gradle IntelliJ Plugin leads to the 'java.lang.OutOfMemoryError: Java heap space' exception, see: https://jb.gg/intellij-platform-kotlin-oom") + yield("The Kotlin plugin in version $kotlinVersion used with the IntelliJ Platform Gradle Plugin leads to the 'java.lang.OutOfMemoryError: Java heap space' exception, see: https://jb.gg/intellij-platform-kotlin-oom") } }.joinToString("\n") { "- $it" }.takeIf(String::isNotEmpty)?.let { warn( diff --git a/src/main/kotlin/org/jetbrains/intellij/utils.kt b/src/main/kotlin/org/jetbrains/intellij/utils.kt index 7a79693085..576ccfec34 100755 --- a/src/main/kotlin/org/jetbrains/intellij/utils.kt +++ b/src/main/kotlin/org/jetbrains/intellij/utils.kt @@ -307,7 +307,7 @@ internal fun getCurrentPluginVersion() = IntelliJPlugin::class.java else -> return@runCatching null } }.run { substring(0, lastIndexOf("!") + 1) } + "/META-INF/MANIFEST.MF" - info(null, "Resolving Gradle IntelliJ Plugin version with: $manifestPath") + info(null, "Resolving IntelliJ Platform Gradle Plugin version with: $manifestPath") URL(manifestPath).openStream().use { Manifest(it).mainAttributes.getValue("Version") } diff --git a/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpec.kt b/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpec.kt index 9ff0256fff..882e7bafd7 100644 --- a/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpec.kt @@ -522,7 +522,7 @@ class IntelliJPluginSpec : IntelliJPluginSpecBase() { assertValidConfigurationCache = true, "help", ).apply { - assertContains("Gradle IntelliJ Plugin requires Gradle", output) + assertContains("IntelliJ Platform Gradle Plugin requires Gradle", output) assertContains("FAILURE: Build failed with an exception", output) } } @@ -538,7 +538,7 @@ class IntelliJPluginSpec : IntelliJPluginSpecBase() { ) assertContains("BUILD SUCCESSFUL", buildResult.output) - assertNotContains("Gradle IntelliJ Plugin requires Gradle", buildResult.output) + assertNotContains("IntelliJ Platform Gradle Plugin requires Gradle", buildResult.output) } @SuppressWarnings("GrEqualsBetweenInconvertibleTypes") From 548f09731878d814d62cdaa220b9534bc3141ac4 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 12 Jun 2023 11:14:35 +0200 Subject: [PATCH 003/347] New project ID: `org.jetbrains.intellij.platform` --- CHANGELOG.md | 1 + INTEGRATION_TESTS.md | 2 +- gradle.properties | 4 ++-- .../attaching-plugin-bundled-sources/build.gradle.kts | 2 +- .../attaching-plugin-sources-from-ide-dist/build.gradle.kts | 2 +- .../resources/build-features/build.gradle.kts | 2 +- src/integrationTest/resources/classpath/build.gradle.kts | 2 +- .../instrumentation-task-disabled/build.gradle.kts | 2 +- .../resources/instrumentation-task/build.gradle.kts | 2 +- .../instrumentation-task/submodule/build.gradle.kts | 2 +- .../resources/jar-manifest-file/build.gradle.kts | 2 +- .../resources/plugin-xml-patching/build.gradle.kts | 2 +- .../test-classpath-project-resources/build.gradle.kts | 2 +- .../resources/throwing-exceptions/build.gradle.kts | 2 +- .../resources/verify-plugin-configuration/build.gradle.kts | 2 +- .../org/jetbrains/intellij/IntelliJPluginConstants.kt | 2 +- .../kotlin/org/jetbrains/intellij/IntelliJPluginSpec.kt | 6 +++--- .../kotlin/org/jetbrains/intellij/IntelliJPluginSpecBase.kt | 2 +- .../org/jetbrains/intellij/tasks/PrepareSandboxTaskSpec.kt | 4 ++-- 19 files changed, 23 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c84ce5472..81cc115089 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Changed - New project name: IntelliJ Platform Gradle Plugin +- New project ID: `org.jetbrains.intellij.platform` - Disabled caching for `BuildPluginTask` ## [1.15.0] - 2023-07-07 diff --git a/INTEGRATION_TESTS.md b/INTEGRATION_TESTS.md index 6e6a3ef9d9..d9886e4abe 100644 --- a/INTEGRATION_TESTS.md +++ b/INTEGRATION_TESTS.md @@ -58,7 +58,7 @@ The `build.gradle.kts` should apply the IntelliJ Platform Gradle Plugin without ```kotlin plugins { - id("org.jetbrains.intellij") + id("org.jetbrains.intellij.platform") } // ... diff --git a/gradle.properties b/gradle.properties index c2416e89d1..4735876711 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,8 +2,8 @@ version=1.15.0 snapshotVersion=2.0 snapshot=false group=org.jetbrains.intellij.plugins -artifactId=gradle-intellij-plugin -pluginId=org.jetbrains.intellij +artifactId=intellij-platform-gradle-plugin +pluginId=org.jetbrains.intellij.platform description=The IntelliJ Platform Gradle Plugin is a plugin for the Gradle build system to help configure your environment for building, testing, verifying, and publishing plugins for IntelliJ-based IDEs.\ For more information, see [IntelliJ Platform Gradle Plugin documentation](https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html). diff --git a/src/integrationTest/resources/attaching-plugin-bundled-sources/build.gradle.kts b/src/integrationTest/resources/attaching-plugin-bundled-sources/build.gradle.kts index bfae44b600..8ea7b4994a 100644 --- a/src/integrationTest/resources/attaching-plugin-bundled-sources/build.gradle.kts +++ b/src/integrationTest/resources/attaching-plugin-bundled-sources/build.gradle.kts @@ -2,7 +2,7 @@ plugins { id("org.jetbrains.kotlin.jvm") - id("org.jetbrains.intellij") + id("org.jetbrains.intellij.platform") } repositories { diff --git a/src/integrationTest/resources/attaching-plugin-sources-from-ide-dist/build.gradle.kts b/src/integrationTest/resources/attaching-plugin-sources-from-ide-dist/build.gradle.kts index d710a71cd3..2c8eace76c 100644 --- a/src/integrationTest/resources/attaching-plugin-sources-from-ide-dist/build.gradle.kts +++ b/src/integrationTest/resources/attaching-plugin-sources-from-ide-dist/build.gradle.kts @@ -2,7 +2,7 @@ plugins { id("org.jetbrains.kotlin.jvm") - id("org.jetbrains.intellij") + id("org.jetbrains.intellij.platform") } repositories { diff --git a/src/integrationTest/resources/build-features/build.gradle.kts b/src/integrationTest/resources/build-features/build.gradle.kts index 10bb15fe5f..ece0504ec0 100644 --- a/src/integrationTest/resources/build-features/build.gradle.kts +++ b/src/integrationTest/resources/build-features/build.gradle.kts @@ -4,7 +4,7 @@ val instrumentCodeProperty = project.property("instrumentCode") == "true" plugins { id("org.jetbrains.kotlin.jvm") - id("org.jetbrains.intellij") + id("org.jetbrains.intellij.platform") } repositories { diff --git a/src/integrationTest/resources/classpath/build.gradle.kts b/src/integrationTest/resources/classpath/build.gradle.kts index e0d25b09da..85076b93b1 100644 --- a/src/integrationTest/resources/classpath/build.gradle.kts +++ b/src/integrationTest/resources/classpath/build.gradle.kts @@ -2,7 +2,7 @@ plugins { id("org.jetbrains.kotlin.jvm") - id("org.jetbrains.intellij") + id("org.jetbrains.intellij.platform") id("jacoco") } diff --git a/src/integrationTest/resources/instrumentation-task-disabled/build.gradle.kts b/src/integrationTest/resources/instrumentation-task-disabled/build.gradle.kts index 9c9abe28e8..1c1214656d 100644 --- a/src/integrationTest/resources/instrumentation-task-disabled/build.gradle.kts +++ b/src/integrationTest/resources/instrumentation-task-disabled/build.gradle.kts @@ -2,7 +2,7 @@ val instrumentCodeProperty = project.property("instrumentCode") == "true" plugins { id("org.jetbrains.kotlin.jvm") - id("org.jetbrains.intellij") + id("org.jetbrains.intellij.platform") } version = "1.0.0" diff --git a/src/integrationTest/resources/instrumentation-task/build.gradle.kts b/src/integrationTest/resources/instrumentation-task/build.gradle.kts index 972a9ef8a9..da312b8a8e 100644 --- a/src/integrationTest/resources/instrumentation-task/build.gradle.kts +++ b/src/integrationTest/resources/instrumentation-task/build.gradle.kts @@ -2,7 +2,7 @@ plugins { id("org.jetbrains.kotlin.jvm") - id("org.jetbrains.intellij") + id("org.jetbrains.intellij.platform") } version = "1.0.0" diff --git a/src/integrationTest/resources/instrumentation-task/submodule/build.gradle.kts b/src/integrationTest/resources/instrumentation-task/submodule/build.gradle.kts index dbce03c37d..daa2734f4d 100644 --- a/src/integrationTest/resources/instrumentation-task/submodule/build.gradle.kts +++ b/src/integrationTest/resources/instrumentation-task/submodule/build.gradle.kts @@ -1,7 +1,7 @@ plugins { id("java") id("kotlin") - id("org.jetbrains.intellij") + id("org.jetbrains.intellij.platform") } repositories { diff --git a/src/integrationTest/resources/jar-manifest-file/build.gradle.kts b/src/integrationTest/resources/jar-manifest-file/build.gradle.kts index 9bd8ac1b96..23da7497e4 100644 --- a/src/integrationTest/resources/jar-manifest-file/build.gradle.kts +++ b/src/integrationTest/resources/jar-manifest-file/build.gradle.kts @@ -1,6 +1,6 @@ plugins { id("org.jetbrains.kotlin.jvm") - id("org.jetbrains.intellij") + id("org.jetbrains.intellij.platform") } version = "1.0.0" diff --git a/src/integrationTest/resources/plugin-xml-patching/build.gradle.kts b/src/integrationTest/resources/plugin-xml-patching/build.gradle.kts index 59f502d265..beb9f9f2c4 100644 --- a/src/integrationTest/resources/plugin-xml-patching/build.gradle.kts +++ b/src/integrationTest/resources/plugin-xml-patching/build.gradle.kts @@ -1,6 +1,6 @@ plugins { id("org.jetbrains.kotlin.jvm") - id("org.jetbrains.intellij") + id("org.jetbrains.intellij.platform") } version = "1.0.0" diff --git a/src/integrationTest/resources/test-classpath-project-resources/build.gradle.kts b/src/integrationTest/resources/test-classpath-project-resources/build.gradle.kts index 4fe084a35c..cc6ddf0db9 100644 --- a/src/integrationTest/resources/test-classpath-project-resources/build.gradle.kts +++ b/src/integrationTest/resources/test-classpath-project-resources/build.gradle.kts @@ -1,6 +1,6 @@ plugins { id("org.jetbrains.kotlin.jvm") - id("org.jetbrains.intellij") + id("org.jetbrains.intellij.platform") } version = "1.0.0" diff --git a/src/integrationTest/resources/throwing-exceptions/build.gradle.kts b/src/integrationTest/resources/throwing-exceptions/build.gradle.kts index 4a27d14f9d..e6ca4d331f 100644 --- a/src/integrationTest/resources/throwing-exceptions/build.gradle.kts +++ b/src/integrationTest/resources/throwing-exceptions/build.gradle.kts @@ -1,6 +1,6 @@ plugins { id("org.jetbrains.kotlin.jvm") - id("org.jetbrains.intellij") + id("org.jetbrains.intellij.platform") } version = "1.0.0" diff --git a/src/integrationTest/resources/verify-plugin-configuration/build.gradle.kts b/src/integrationTest/resources/verify-plugin-configuration/build.gradle.kts index e97d391d04..3d13fda721 100644 --- a/src/integrationTest/resources/verify-plugin-configuration/build.gradle.kts +++ b/src/integrationTest/resources/verify-plugin-configuration/build.gradle.kts @@ -5,7 +5,7 @@ val downloadDirProperty = project.property("downloadDir").toString() plugins { id("org.jetbrains.kotlin.jvm") - id("org.jetbrains.intellij") + id("org.jetbrains.intellij.platform") } repositories { diff --git a/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginConstants.kt index 94b867ca92..576f090744 100644 --- a/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginConstants.kt @@ -4,7 +4,7 @@ package org.jetbrains.intellij object IntelliJPluginConstants { const val PLUGIN_NAME = "IntelliJ Platform Gradle Plugin" - const val PLUGIN_ID = "org.jetbrains.intellij" + const val PLUGIN_ID = "org.jetbrains.intellij.platform" const val PLUGIN_GROUP_NAME = "intellij" const val EXTENSION_NAME = "intellij" const val DEFAULT_SANDBOX = "idea-sandbox" diff --git a/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpec.kt b/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpec.kt index 882e7bafd7..6c532de693 100644 --- a/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpec.kt @@ -300,7 +300,7 @@ class IntelliJPluginSpec : IntelliJPluginSpecBase() { """ plugins { id 'java' - id 'org.jetbrains.intellij' + id 'org.jetbrains.intellij.platform' id 'org.jetbrains.kotlin.jvm' version '$kotlinPluginVersion' } intellij { @@ -333,7 +333,7 @@ class IntelliJPluginSpec : IntelliJPluginSpecBase() { """ plugins { id 'java' - id 'org.jetbrains.intellij' + id 'org.jetbrains.intellij.platform' id 'org.jetbrains.kotlin.jvm' version '$kotlinPluginVersion' } intellij { @@ -408,7 +408,7 @@ class IntelliJPluginSpec : IntelliJPluginSpecBase() { """ plugins { id 'java' - id 'org.jetbrains.intellij' + id 'org.jetbrains.intellij.platform' id 'org.jetbrains.kotlin.jvm' version '$kotlinPluginVersion' } intellij { diff --git a/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpecBase.kt b/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpecBase.kt index ae337c8d72..b8936de934 100644 --- a/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpecBase.kt +++ b/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpecBase.kt @@ -62,7 +62,7 @@ abstract class IntelliJPluginSpecBase : IntelliJPlatformTestBase() { """ plugins { id 'java' - id 'org.jetbrains.intellij' + id 'org.jetbrains.intellij.platform' id 'org.jetbrains.kotlin.jvm' version '$kotlinPluginVersion' } sourceCompatibility = 11 diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/PrepareSandboxTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/tasks/PrepareSandboxTaskSpec.kt index f6722f40de..32a2e5aaea 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/PrepareSandboxTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/tasks/PrepareSandboxTaskSpec.kt @@ -56,7 +56,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { file("nestedProject/build.gradle").groovy( """ repositories { mavenCentral() } - apply plugin: 'org.jetbrains.intellij' + apply plugin: 'org.jetbrains.intellij.platform' version = '0.42.123' compileJava { @@ -137,7 +137,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { allprojects { repositories { mavenCentral() } version = '0.42.123' - apply plugin: 'org.jetbrains.intellij' + apply plugin: 'org.jetbrains.intellij.platform' intellij { downloadSources = false version = "$intellijVersion" From a3bd1282c3d42ec304fd3d958612b6299c4e6dcb Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Tue, 13 Jun 2023 07:58:27 +0200 Subject: [PATCH 004/347] Move classes under the new package: `org.jetbrains.intellij.platform.gradleplugin` --- CHANGELOG.md | 2 + gradle.properties | 4 +- ...hingPluginBundledSourcesIntegrationTest.kt | 2 +- ...PluginSourcesFromIdeDistIntegrationTest.kt | 2 +- .../BuildFeaturesIntegrationTest.kt | 2 +- .../ClasspathInstrumentationTest.kt | 3 +- ...trumentationTaskDisabledIntegrationTest.kt | 2 +- .../InstrumentationTaskIntegrationTest.kt | 2 +- .../IntelliJPlatformIntegrationTestBase.kt | 2 +- .../JarManifestFileIntegrationTest.kt | 2 +- .../PluginXmlPatchingIntegrationTest.kt | 2 +- ...lasspathProjectResourcesIntegrationTest.kt | 2 +- .../ThrowingExceptionsIntegrationTest.kt | 2 +- ...erifyPluginConfigurationIntegrationTest.kt | 2 +- .../gradleplugin}/BuildException.kt | 2 +- .../gradleplugin}/BuildFeature.kt | 4 +- .../gradleplugin}/DependenciesUtils.kt | 8 +- .../IntelliJIvyDescriptorFileGenerator.kt | 10 +- .../gradleplugin}/IntelliJPlugin.kt | 236 ++++++++++++------ .../gradleplugin}/IntelliJPluginConstants.kt | 2 +- .../gradleplugin}/IntelliJPluginExtension.kt | 14 +- .../gradleplugin}/IntelliJPluginLibrary.kt | 2 +- .../{ => platform/gradleplugin}/Version.kt | 2 +- .../dependency/BuiltinPluginsRegistry.kt | 16 +- .../dependency/CustomPluginsRepository.kt | 10 +- .../IdePluginSourceZipFilesProvider.kt | 2 +- .../dependency/IdeaDependency.kt | 8 +- .../dependency/IdeaDependencyManager.kt | 32 +-- .../dependency/IdeaExtraDependency.kt | 4 +- .../dependency/IntellijIvyArtifact.kt | 2 +- .../dependency/JpsIdeaDependency.kt | 2 +- .../dependency/LocalIdeaDependency.kt | 2 +- .../dependency/MavenPluginsRepository.kt | 8 +- .../dependency/PluginDependency.kt | 2 +- .../dependency/PluginDependencyImpl.kt | 4 +- .../dependency/PluginDependencyManager.kt | 12 +- .../dependency/PluginDependencyNotation.kt | 4 +- .../dependency/PluginProjectDependency.kt | 4 +- .../dependency/PluginsRepository.kt | 2 +- .../PluginsRepositoryConfiguration.kt | 6 +- .../{ => platform/gradleplugin}/jbr/Jbr.kt | 2 +- .../gradleplugin}/jbr/JbrResolver.kt | 12 +- .../{ => platform/gradleplugin}/memoize.kt | 2 +- .../model/AndroidStudioReleases.kt | 2 +- .../gradleplugin}/model/MavenMetadata.kt | 2 +- .../gradleplugin}/model/ObjectFactory.kt | 2 +- .../model/PerformanceTestResult.kt | 2 +- .../model/PerformanceTestScript.kt | 2 +- .../model/PerformanceTestStatistic.kt | 2 +- .../gradleplugin}/model/PluginsCache.kt | 2 +- .../gradleplugin}/model/ProductInfo.kt | 2 +- .../gradleplugin}/model/ProductsReleases.kt | 2 +- .../gradleplugin}/model/XmlExtractor.kt | 8 +- .../performanceTest/ProfilerName.kt | 2 +- .../TestExecutionFailException.kt | 2 +- .../performanceTest/parsers/IdeaLogParser.kt | 4 +- .../parsers/SimpleIJPerformanceParser.kt | 4 +- .../gradleplugin}/tasks/BuildPluginTask.kt | 4 +- .../tasks/BuildSearchableOptionsTask.kt | 10 +- .../tasks/ClasspathIndexCleanupTask.kt | 10 +- ...loadAndroidStudioProductReleasesXmlTask.kt | 0 .../DownloadIdeaProductReleasesXmlTask.kt | 0 .../tasks/DownloadRobotServerPluginTask.kt | 18 +- .../tasks/DownloadZipSignerTask.kt | 8 +- .../tasks/InitializeIntelliJPluginTask.kt | 14 +- .../gradleplugin}/tasks/InstrumentCodeTask.kt | 8 +- .../tasks/InstrumentedJarTask.kt | 4 +- .../tasks/JarSearchableOptionsTask.kt | 14 +- .../tasks/ListBundledPluginsTask.kt | 10 +- .../tasks/ListProductsReleasesTask.kt | 14 +- .../gradleplugin}/tasks/PatchPluginXmlTask.kt | 12 +- .../gradleplugin}/tasks/PrepareSandboxTask.kt | 10 +- .../tasks/PrintBundledPluginsTask.kt | 4 +- .../tasks/PrintProductsReleasesTask.kt | 4 +- .../gradleplugin}/tasks/PublishPluginTask.kt | 12 +- .../gradleplugin}/tasks/RunIdeBase.kt | 10 +- .../tasks/RunIdeForUiTestTask.kt | 4 +- .../tasks/RunIdePerformanceTestTask.kt | 20 +- .../gradleplugin}/tasks/RunIdeTask.kt | 4 +- .../tasks/RunPluginVerifierTask.kt | 28 +-- .../tasks/SetupDependenciesTask.kt | 10 +- .../gradleplugin}/tasks/SignPluginTask.kt | 10 +- .../tasks/VerifyPluginConfigurationTask.kt | 10 +- .../tasks/VerifyPluginSignatureTask.kt | 10 +- .../gradleplugin}/tasks/VerifyPluginTask.kt | 12 +- .../gradleplugin}/tasks/ZipSigningToolBase.kt | 12 +- .../{ => platform/gradleplugin}/utils.kt | 28 +-- .../gradleplugin}/utils/ArchiveUtils.kt | 4 +- .../utils/DependenciesDownloader.kt | 10 +- .../utils/LatestVersionResolver.kt | 8 +- .../gradleplugin}/utils/OpenedPackages.kt | 2 +- .../utils/PlatformJavaVersions.kt | 4 +- .../utils/PlatformKotlinVersions.kt | 4 +- ...oolboxEnterprisePluginRepositoryService.kt | 2 +- .../IntelliJPluginManualConfigSpec.kt | 20 +- .../gradleplugin}/IntelliJPluginSpec.kt | 18 +- .../gradleplugin}/IntelliJPluginSpecBase.kt | 4 +- .../SearchableOptionsSpecBase.kt | 6 +- .../{ => platform/gradleplugin}/UtilsTest.kt | 4 +- .../gradleplugin}/VersionTest.kt | 2 +- .../gradleplugin}/jbr/JbrResolverTest.kt | 8 +- .../parsers/IdeaLogParserTest.kt | 2 +- .../parsers/SimpleIJPerfParserTest.kt | 2 +- .../tasks/BuildPluginTaskSpec.kt | 8 +- .../tasks/BuildSearchableOptionsTaskSpec.kt | 6 +- .../tasks/DownloadIntelliJPluginsSpec.kt | 4 +- .../tasks/DownloadIntelliJSpec.kt | 4 +- .../DownloadRobotServerPluginTaskSpec.kt | 6 +- .../tasks/IntelliJInstrumentCodeTaskSpec.kt | 4 +- .../tasks/JarSearchableOptionsTaskSpec.kt | 6 +- .../tasks/ListBundledPluginsTaskSpec.kt | 4 +- .../tasks/ListProductsReleasesTaskSpec.kt | 10 +- .../tasks/PatchPluginXmlTaskSpec.kt | 8 +- .../tasks/PrepareSandboxTaskSpec.kt | 12 +- .../tasks/ProcessResourcesTaskSpec.kt | 4 +- .../tasks/PublishPluginTaskSpec.kt | 6 +- .../tasks/RunPluginVerifierTaskSpec.kt | 22 +- .../tasks/SetupDependenciesTaskSpec.kt | 6 +- .../gradleplugin}/tasks/SignPluginTaskSpec.kt | 10 +- .../VerifyPluginConfigurationTaskSpec.kt | 6 +- .../tasks/VerifyPluginTaskSpec.kt | 6 +- .../gradleplugin}/test/localIdeTestUtils.kt | 4 +- .../gradleplugin}/IntelliJPlatformTestBase.kt | 2 +- 123 files changed, 554 insertions(+), 483 deletions(-) rename src/integrationTest/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/AttachingPluginBundledSourcesIntegrationTest.kt (93%) rename src/integrationTest/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/AttachingPluginSourcesFromIdeDistIntegrationTest.kt (93%) rename src/integrationTest/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/BuildFeaturesIntegrationTest.kt (98%) rename src/integrationTest/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/ClasspathInstrumentationTest.kt (97%) rename src/integrationTest/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/InstrumentationTaskDisabledIntegrationTest.kt (99%) rename src/integrationTest/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/InstrumentationTaskIntegrationTest.kt (98%) rename src/integrationTest/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/IntelliJPlatformIntegrationTestBase.kt (99%) rename src/integrationTest/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/JarManifestFileIntegrationTest.kt (93%) rename src/integrationTest/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/PluginXmlPatchingIntegrationTest.kt (92%) rename src/integrationTest/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/TestClasspathProjectResourcesIntegrationTest.kt (95%) rename src/integrationTest/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/ThrowingExceptionsIntegrationTest.kt (92%) rename src/integrationTest/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/VerifyPluginConfigurationIntegrationTest.kt (98%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/BuildException.kt (83%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/BuildFeature.kt (87%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/DependenciesUtils.kt (93%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/IntelliJIvyDescriptorFileGenerator.kt (94%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/IntelliJPlugin.kt (83%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/IntelliJPluginConstants.kt (99%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/IntelliJPluginExtension.kt (94%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/IntelliJPluginLibrary.kt (83%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/Version.kt (97%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/dependency/BuiltinPluginsRegistry.kt (90%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/dependency/CustomPluginsRepository.kt (85%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/dependency/IdePluginSourceZipFilesProvider.kt (94%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/dependency/IdeaDependency.kt (92%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/dependency/IdeaDependencyManager.kt (93%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/dependency/IdeaExtraDependency.kt (87%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/dependency/IntellijIvyArtifact.kt (97%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/dependency/JpsIdeaDependency.kt (91%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/dependency/LocalIdeaDependency.kt (91%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/dependency/MavenPluginsRepository.kt (90%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/dependency/PluginDependency.kt (93%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/dependency/PluginDependencyImpl.kt (96%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/dependency/PluginDependencyManager.kt (95%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/dependency/PluginDependencyNotation.kt (93%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/dependency/PluginProjectDependency.kt (95%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/dependency/PluginsRepository.kt (84%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/dependency/PluginsRepositoryConfiguration.kt (84%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/jbr/Jbr.kt (81%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/jbr/JbrResolver.kt (96%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/memoize.kt (96%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/model/AndroidStudioReleases.kt (95%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/model/MavenMetadata.kt (93%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/model/ObjectFactory.kt (88%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/model/PerformanceTestResult.kt (82%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/model/PerformanceTestScript.kt (94%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/model/PerformanceTestStatistic.kt (92%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/model/PluginsCache.kt (93%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/model/ProductInfo.kt (97%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/model/ProductsReleases.kt (97%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/model/XmlExtractor.kt (80%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/performanceTest/ProfilerName.kt (71%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/performanceTest/TestExecutionFailException.kt (74%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/performanceTest/parsers/IdeaLogParser.kt (86%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/performanceTest/parsers/SimpleIJPerformanceParser.kt (91%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/BuildPluginTask.kt (81%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/BuildSearchableOptionsTask.kt (89%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/ClasspathIndexCleanupTask.kt (81%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt (100%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/DownloadIdeaProductReleasesXmlTask.kt (100%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/DownloadRobotServerPluginTask.kt (82%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/DownloadZipSignerTask.kt (89%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/InitializeIntelliJPluginTask.kt (76%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/InstrumentCodeTask.kt (97%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/InstrumentedJarTask.kt (78%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/JarSearchableOptionsTask.kt (86%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/ListBundledPluginsTask.kt (84%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/ListProductsReleasesTask.kt (93%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/PatchPluginXmlTask.kt (93%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/PrepareSandboxTask.kt (94%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/PrintBundledPluginsTask.kt (85%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/PrintProductsReleasesTask.kt (85%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/PublishPluginTask.kt (92%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/RunIdeBase.kt (96%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/RunIdeForUiTestTask.kt (83%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/RunIdePerformanceTestTask.kt (84%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/RunIdeTask.kt (82%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/RunPluginVerifierTask.kt (95%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/SetupDependenciesTask.kt (81%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/SignPluginTask.kt (95%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/VerifyPluginConfigurationTask.kt (97%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/VerifyPluginSignatureTask.kt (87%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/VerifyPluginTask.kt (89%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/ZipSigningToolBase.kt (90%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/utils.kt (89%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/utils/ArchiveUtils.kt (94%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/utils/DependenciesDownloader.kt (93%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/utils/LatestVersionResolver.kt (82%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/utils/OpenedPackages.kt (98%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/utils/PlatformJavaVersions.kt (81%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/utils/PlatformKotlinVersions.kt (87%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/utils/ToolboxEnterprisePluginRepositoryService.kt (94%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/IntelliJPluginManualConfigSpec.kt (95%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/IntelliJPluginSpec.kt (97%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/IntelliJPluginSpecBase.kt (98%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/SearchableOptionsSpecBase.kt (90%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/UtilsTest.kt (87%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/VersionTest.kt (97%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/jbr/JbrResolverTest.kt (92%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/performanceTest/parsers/IdeaLogParserTest.kt (91%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/performanceTest/parsers/SimpleIJPerfParserTest.kt (95%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/BuildPluginTaskSpec.kt (97%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/BuildSearchableOptionsTaskSpec.kt (86%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/DownloadIntelliJPluginsSpec.kt (98%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/DownloadIntelliJSpec.kt (98%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/DownloadRobotServerPluginTaskSpec.kt (94%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/IntelliJInstrumentCodeTaskSpec.kt (96%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/JarSearchableOptionsTaskSpec.kt (85%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/ListBundledPluginsTaskSpec.kt (95%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/ListProductsReleasesTaskSpec.kt (94%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/PatchPluginXmlTaskSpec.kt (97%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/PrepareSandboxTaskSpec.kt (97%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/ProcessResourcesTaskSpec.kt (94%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/PublishPluginTaskSpec.kt (82%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/RunPluginVerifierTaskSpec.kt (92%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/SetupDependenciesTaskSpec.kt (82%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/SignPluginTaskSpec.kt (95%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/VerifyPluginConfigurationTaskSpec.kt (96%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/tasks/VerifyPluginTaskSpec.kt (96%) rename src/test/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/test/localIdeTestUtils.kt (93%) rename src/testFixtures/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/IntelliJPlatformTestBase.kt (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81cc115089..4d1f449b20 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ ### Changed - New project name: IntelliJ Platform Gradle Plugin - New project ID: `org.jetbrains.intellij.platform` +- New Maven coordinates: `org.jetbrains.intellij.platform:intellij-platform-gradle-plugin` +- Move classes under the new package: `org.jetbrains.intellij.platform.gradleplugin` - Disabled caching for `BuildPluginTask` ## [1.15.0] - 2023-07-07 diff --git a/gradle.properties b/gradle.properties index 4735876711..c70d6d7f71 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,14 +1,14 @@ version=1.15.0 snapshotVersion=2.0 snapshot=false -group=org.jetbrains.intellij.plugins +group=org.jetbrains.intellij.platform artifactId=intellij-platform-gradle-plugin pluginId=org.jetbrains.intellij.platform description=The IntelliJ Platform Gradle Plugin is a plugin for the Gradle build system to help configure your environment for building, testing, verifying, and publishing plugins for IntelliJ-based IDEs.\ For more information, see [IntelliJ Platform Gradle Plugin documentation](https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html). pluginDisplayName=IntelliJ Platform Gradle Plugin -pluginImplementationClass=org.jetbrains.intellij.IntelliJPlugin +pluginImplementationClass=org.jetbrains.intellij.platform.gradleplugin.IntelliJPlugin website=https://github.com/JetBrains/gradle-intellij-plugin snapshotUrl=https://oss.sonatype.org/content/repositories/snapshots/ diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/AttachingPluginBundledSourcesIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/AttachingPluginBundledSourcesIntegrationTest.kt similarity index 93% rename from src/integrationTest/kotlin/org/jetbrains/intellij/AttachingPluginBundledSourcesIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/AttachingPluginBundledSourcesIntegrationTest.kt index 6dacdd66e6..fed38b8e0d 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/AttachingPluginBundledSourcesIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/AttachingPluginBundledSourcesIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/AttachingPluginSourcesFromIdeDistIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/AttachingPluginSourcesFromIdeDistIntegrationTest.kt similarity index 93% rename from src/integrationTest/kotlin/org/jetbrains/intellij/AttachingPluginSourcesFromIdeDistIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/AttachingPluginSourcesFromIdeDistIntegrationTest.kt index 9acc0dfb5b..276a255e21 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/AttachingPluginSourcesFromIdeDistIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/AttachingPluginSourcesFromIdeDistIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/BuildFeaturesIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeaturesIntegrationTest.kt similarity index 98% rename from src/integrationTest/kotlin/org/jetbrains/intellij/BuildFeaturesIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeaturesIntegrationTest.kt index 1eaed6f732..3d9fb8ef54 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/BuildFeaturesIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeaturesIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import java.nio.file.Files import kotlin.test.Ignore diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/ClasspathInstrumentationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/ClasspathInstrumentationTest.kt similarity index 97% rename from src/integrationTest/kotlin/org/jetbrains/intellij/ClasspathInstrumentationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/ClasspathInstrumentationTest.kt index a428ca0919..3f693003c4 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/ClasspathInstrumentationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/ClasspathInstrumentationTest.kt @@ -1,8 +1,7 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin -import org.gradle.testkit.runner.BuildResult import java.nio.file.Files import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/InstrumentationTaskDisabledIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/InstrumentationTaskDisabledIntegrationTest.kt similarity index 99% rename from src/integrationTest/kotlin/org/jetbrains/intellij/InstrumentationTaskDisabledIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/InstrumentationTaskDisabledIntegrationTest.kt index 8c1350ada8..a875f5704b 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/InstrumentationTaskDisabledIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/InstrumentationTaskDisabledIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import java.nio.file.Files import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/InstrumentationTaskIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/InstrumentationTaskIntegrationTest.kt similarity index 98% rename from src/integrationTest/kotlin/org/jetbrains/intellij/InstrumentationTaskIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/InstrumentationTaskIntegrationTest.kt index 59690e0ab7..0b22567b62 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/InstrumentationTaskIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/InstrumentationTaskIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import java.nio.file.Files import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/IntelliJPlatformIntegrationTestBase.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformIntegrationTestBase.kt similarity index 99% rename from src/integrationTest/kotlin/org/jetbrains/intellij/IntelliJPlatformIntegrationTestBase.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformIntegrationTestBase.kt index 398aef683a..91b0f97792 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/IntelliJPlatformIntegrationTestBase.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformIntegrationTestBase.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import java.nio.file.FileSystems import java.nio.file.Files diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/JarManifestFileIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/JarManifestFileIntegrationTest.kt similarity index 93% rename from src/integrationTest/kotlin/org/jetbrains/intellij/JarManifestFileIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/JarManifestFileIntegrationTest.kt index 116c5804ac..56cc38db8c 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/JarManifestFileIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/JarManifestFileIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/PluginXmlPatchingIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/PluginXmlPatchingIntegrationTest.kt similarity index 92% rename from src/integrationTest/kotlin/org/jetbrains/intellij/PluginXmlPatchingIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/PluginXmlPatchingIntegrationTest.kt index a427bf8bef..b01f03dcd4 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/PluginXmlPatchingIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/PluginXmlPatchingIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/TestClasspathProjectResourcesIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/TestClasspathProjectResourcesIntegrationTest.kt similarity index 95% rename from src/integrationTest/kotlin/org/jetbrains/intellij/TestClasspathProjectResourcesIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/TestClasspathProjectResourcesIntegrationTest.kt index e3d6613b57..cdc5eb1842 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/TestClasspathProjectResourcesIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/TestClasspathProjectResourcesIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import java.io.File import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/ThrowingExceptionsIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/ThrowingExceptionsIntegrationTest.kt similarity index 92% rename from src/integrationTest/kotlin/org/jetbrains/intellij/ThrowingExceptionsIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/ThrowingExceptionsIntegrationTest.kt index 7c8bbf4715..016b6576c8 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/ThrowingExceptionsIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/ThrowingExceptionsIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/VerifyPluginConfigurationIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/VerifyPluginConfigurationIntegrationTest.kt similarity index 98% rename from src/integrationTest/kotlin/org/jetbrains/intellij/VerifyPluginConfigurationIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/VerifyPluginConfigurationIntegrationTest.kt index a4fa3f2530..c72d6bb641 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/VerifyPluginConfigurationIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/VerifyPluginConfigurationIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import java.nio.file.Files import kotlin.test.Ignore diff --git a/src/main/kotlin/org/jetbrains/intellij/BuildException.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildException.kt similarity index 83% rename from src/main/kotlin/org/jetbrains/intellij/BuildException.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildException.kt index a4c4997e4d..399d8a535a 100644 --- a/src/main/kotlin/org/jetbrains/intellij/BuildException.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildException.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import org.gradle.tooling.BuildException diff --git a/src/main/kotlin/org/jetbrains/intellij/BuildFeature.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeature.kt similarity index 87% rename from src/main/kotlin/org/jetbrains/intellij/BuildFeature.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeature.kt index 1861b3e10c..891fc62c44 100644 --- a/src/main/kotlin/org/jetbrains/intellij/BuildFeature.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeature.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import org.gradle.api.Project -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_ID as prefix +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_ID as prefix enum class BuildFeature(private val defaultValue: Boolean) { NO_SEARCHABLE_OPTIONS_WARNING(true), diff --git a/src/main/kotlin/org/jetbrains/intellij/DependenciesUtils.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/DependenciesUtils.kt similarity index 93% rename from src/main/kotlin/org/jetbrains/intellij/DependenciesUtils.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/DependenciesUtils.kt index fd611728a3..9caf96cdc0 100644 --- a/src/main/kotlin/org/jetbrains/intellij/DependenciesUtils.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/DependenciesUtils.kt @@ -2,7 +2,7 @@ @file:JvmName("DependenciesUtils") -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import groovy.lang.Closure import org.gradle.api.Action @@ -13,9 +13,9 @@ import org.gradle.api.file.FileTree import org.gradle.api.tasks.util.PatternFilterable import org.gradle.kotlin.dsl.getByType import org.gradle.kotlin.dsl.named -import org.jetbrains.intellij.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME -import org.jetbrains.intellij.dependency.PluginDependency -import org.jetbrains.intellij.tasks.SetupDependenciesTask +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginDependency +import org.jetbrains.intellij.platform.gradleplugin.tasks.SetupDependenciesTask fun Project.intellij() = intellijBase() fun Project.intellij(filter: Closure<*>) = intellijBase().matching(filter) diff --git a/src/main/kotlin/org/jetbrains/intellij/IntelliJIvyDescriptorFileGenerator.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJIvyDescriptorFileGenerator.kt similarity index 94% rename from src/main/kotlin/org/jetbrains/intellij/IntelliJIvyDescriptorFileGenerator.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJIvyDescriptorFileGenerator.kt index 57c961d3fb..0ab9640cf7 100644 --- a/src/main/kotlin/org/jetbrains/intellij/IntelliJIvyDescriptorFileGenerator.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJIvyDescriptorFileGenerator.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import org.gradle.api.publish.ivy.IvyArtifact import org.gradle.api.publish.ivy.IvyConfiguration @@ -8,10 +8,10 @@ import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration import org.gradle.api.publish.ivy.internal.publisher.IvyPublicationIdentity import org.gradle.internal.xml.SimpleXmlWriter import org.gradle.internal.xml.XmlTransformer -import org.jetbrains.intellij.dependency.IdePluginSourceZipFilesProvider -import org.jetbrains.intellij.dependency.IdeaDependency -import org.jetbrains.intellij.dependency.IntellijIvyArtifact -import org.jetbrains.intellij.dependency.PluginDependency +import org.jetbrains.intellij.platform.gradleplugin.dependency.IdePluginSourceZipFilesProvider +import org.jetbrains.intellij.platform.gradleplugin.dependency.IdeaDependency +import org.jetbrains.intellij.platform.gradleplugin.dependency.IntellijIvyArtifact +import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginDependency import java.io.File import java.io.IOException import java.io.UncheckedIOException diff --git a/src/main/kotlin/org/jetbrains/intellij/IntelliJPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlugin.kt similarity index 83% rename from src/main/kotlin/org/jetbrains/intellij/IntelliJPlugin.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlugin.kt index 8f7f446ad0..86b9a74402 100644 --- a/src/main/kotlin/org/jetbrains/intellij/IntelliJPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlugin.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import com.jetbrains.plugin.structure.base.utils.extension import com.jetbrains.plugin.structure.base.utils.hasExtension @@ -37,86 +37,160 @@ import org.gradle.util.GradleVersion import org.jetbrains.gradle.ext.IdeaExtPlugin import org.jetbrains.gradle.ext.ProjectSettings import org.jetbrains.gradle.ext.TaskTriggersConfig -import org.jetbrains.intellij.BuildFeature.* -import org.jetbrains.intellij.IntelliJPluginConstants.ANDROID_STUDIO_PRODUCTS_RELEASES_URL -import org.jetbrains.intellij.IntelliJPluginConstants.ANNOTATIONS_DEPENDENCY_VERSION -import org.jetbrains.intellij.IntelliJPluginConstants.BUILD_PLUGIN_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.BUILD_SEARCHABLE_OPTIONS_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.CLASSPATH_INDEX_CLEANUP_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.COMPILE_KOTLIN_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.DEFAULT_IDEA_VERSION -import org.jetbrains.intellij.IntelliJPluginConstants.DEFAULT_INTELLIJ_REPOSITORY -import org.jetbrains.intellij.IntelliJPluginConstants.DEFAULT_SANDBOX -import org.jetbrains.intellij.IntelliJPluginConstants.DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.DOWNLOAD_ZIP_SIGNER_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.EXTENSION_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.IDEA_CONFIGURATION_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.IDEA_GRADLE_PLUGIN_ID -import org.jetbrains.intellij.IntelliJPluginConstants.IDEA_PLUGINS_CONFIGURATION_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.IDEA_PRODUCTS_RELEASES_URL -import org.jetbrains.intellij.IntelliJPluginConstants.INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.INSTRUMENTED_JAR_CONFIGURATION_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.INSTRUMENTED_JAR_PREFIX -import org.jetbrains.intellij.IntelliJPluginConstants.INSTRUMENTED_JAR_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.INSTRUMENT_CODE_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.INSTRUMENT_TEST_CODE_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.INTELLIJ_DEFAULT_DEPENDENCIES_CONFIGURATION_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES -import org.jetbrains.intellij.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.JAVA_COMPILER_ANT_TASKS_MAVEN_METADATA -import org.jetbrains.intellij.IntelliJPluginConstants.KOTLIN_GRADLE_PLUGIN_ID -import org.jetbrains.intellij.IntelliJPluginConstants.LIST_BUNDLED_PLUGINS_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.MARKETPLACE_HOST -import org.jetbrains.intellij.IntelliJPluginConstants.PATCH_PLUGIN_XML_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.PERFORMANCE_PLUGIN_ID -import org.jetbrains.intellij.IntelliJPluginConstants.PERFORMANCE_TEST_CONFIGURATION_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_CLION -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_COMMUNITY -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_PHPSTORM -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_PYCHARM -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_RIDER -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_XML_DIR_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.PREPARE_SANDBOX_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.PREPARE_TESTING_SANDBOX_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.PREPARE_UI_TESTING_SANDBOX_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.PRINT_BUNDLED_PLUGINS_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.PRINT_PRODUCTS_RELEASES_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.PUBLISH_PLUGIN_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.RELEASE_SUFFIX_EAP -import org.jetbrains.intellij.IntelliJPluginConstants.RELEASE_SUFFIX_EAP_CANDIDATE -import org.jetbrains.intellij.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT -import org.jetbrains.intellij.IntelliJPluginConstants.RELEASE_TYPE_RELEASES -import org.jetbrains.intellij.IntelliJPluginConstants.RUN_IDE_FOR_UI_TESTS_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.RUN_IDE_PERFORMANCE_TEST_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.RUN_IDE_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.SEARCHABLE_OPTIONS_DIR_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.SIGN_PLUGIN_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.TASKS -import org.jetbrains.intellij.IntelliJPluginConstants.VERIFY_PLUGIN_CONFIGURATION_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.VERIFY_PLUGIN_SIGNATURE_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.VERIFY_PLUGIN_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.VERSION_LATEST -import org.jetbrains.intellij.dependency.* -import org.jetbrains.intellij.jbr.JbrResolver -import org.jetbrains.intellij.model.MavenMetadata -import org.jetbrains.intellij.model.XmlExtractor -import org.jetbrains.intellij.performanceTest.ProfilerName -import org.jetbrains.intellij.pluginRepository.PluginRepositoryFactory -import org.jetbrains.intellij.propertyProviders.IntelliJPlatformArgumentProvider -import org.jetbrains.intellij.propertyProviders.LaunchSystemArgumentProvider -import org.jetbrains.intellij.propertyProviders.PluginPathArgumentProvider -import org.jetbrains.intellij.tasks.* -import org.jetbrains.intellij.utils.ArchiveUtils -import org.jetbrains.intellij.utils.DependenciesDownloader -import org.jetbrains.intellij.utils.ivyRepository -import org.jetbrains.intellij.utils.mavenRepository +import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANDROID_STUDIO_PRODUCTS_RELEASES_URL +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANNOTATIONS_DEPENDENCY_VERSION +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_SEARCHABLE_OPTIONS_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.CLASSPATH_INDEX_CLEANUP_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.COMPILE_KOTLIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_IDEA_VERSION +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_INTELLIJ_REPOSITORY +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_SANDBOX +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ZIP_SIGNER_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.EXTENSION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_GRADLE_PLUGIN_ID +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PLUGINS_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PRODUCTS_RELEASES_URL +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_PREFIX +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENT_CODE_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENT_TEST_CODE_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEFAULT_DEPENDENCIES_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_COMPILER_ANT_TASKS_MAVEN_METADATA +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.KOTLIN_GRADLE_PLUGIN_ID +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.LIST_BUNDLED_PLUGINS_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MARKETPLACE_HOST +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PATCH_PLUGIN_XML_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PERFORMANCE_PLUGIN_ID +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PERFORMANCE_TEST_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_CLION +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_COMMUNITY +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_PHPSTORM +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_PYCHARM +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_RIDER +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_XML_DIR_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_SANDBOX_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_TESTING_SANDBOX_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_UI_TESTING_SANDBOX_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PRINT_BUNDLED_PLUGINS_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PRINT_PRODUCTS_RELEASES_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PUBLISH_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_EAP +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_EAP_CANDIDATE +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_TYPE_RELEASES +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_FOR_UI_TESTS_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_PERFORMANCE_TEST_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SEARCHABLE_OPTIONS_DIR_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SIGN_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_CONFIGURATION_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_SIGNATURE_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERSION_LATEST +import org.jetbrains.intellij.platform.gradleplugin.dependency.* +import org.jetbrains.intellij.platform.gradleplugin.jbr.JbrResolver +import org.jetbrains.intellij.platform.gradleplugin.model.MavenMetadata +import org.jetbrains.intellij.platform.gradleplugin.model.XmlExtractor +import org.jetbrains.intellij.platform.gradleplugin.performanceTest.ProfilerName +import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANNOTATIONS_DEPENDENCY_VERSION +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_SEARCHABLE_OPTIONS_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.CLASSPATH_INDEX_CLEANUP_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.COMPILE_KOTLIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_IDEA_VERSION +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_INTELLIJ_REPOSITORY +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_SANDBOX +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ZIP_SIGNER_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.EXTENSION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_GRADLE_PLUGIN_ID +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PLUGINS_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PRODUCTS_RELEASES_URL +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_PREFIX +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENT_CODE_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENT_TEST_CODE_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEFAULT_DEPENDENCIES_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_COMPILER_ANT_TASKS_MAVEN_METADATA +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.KOTLIN_GRADLE_PLUGIN_ID +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.LIST_BUNDLED_PLUGINS_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MARKETPLACE_HOST +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PATCH_PLUGIN_XML_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PERFORMANCE_PLUGIN_ID +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PERFORMANCE_TEST_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_CLION +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_COMMUNITY +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_PHPSTORM +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_PYCHARM +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_RIDER +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_PATH +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_XML_DIR_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_SANDBOX_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_TESTING_SANDBOX_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_UI_TESTING_SANDBOX_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PRINT_BUNDLED_PLUGINS_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PRINT_PRODUCTS_RELEASES_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PUBLISH_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_EAP +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_EAP_CANDIDATE +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_TYPE_RELEASES +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_FOR_UI_TESTS_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_PERFORMANCE_TEST_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SEARCHABLE_OPTIONS_DIR_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SETUP_INSTRUMENT_CODE_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SIGN_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_CONFIGURATION_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_SIGNATURE_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERSION_LATEST +import org.jetbrains.intellij.platform.gradleplugin.dependency.* +import org.jetbrains.intellij.platform.gradleplugin.jbr.JbrResolver +import org.jetbrains.intellij.platform.gradleplugin.model.MavenMetadata +import org.jetbrains.intellij.platform.gradleplugin.model.XmlExtractor +import org.jetbrains.intellij.platform.gradleplugin.performanceTest.ProfilerName +import org.jetbrains.intellij.platform.gradleplugin.tasks.* +import org.jetbrains.intellij.platform.gradleplugin.utils.* +import org.jetbrains.intellij.platform.gradleplugin.pluginRepository.PluginRepositoryFactory +import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.IntelliJPlatformArgumentProvider +import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.LaunchSystemArgumentProvider +import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.PluginPathArgumentProvider +import org.jetbrains.intellij.platform.gradleplugin.tasks.* +import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils +import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader +import org.jetbrains.intellij.platform.gradleplugin.utils.ivyRepository +import org.jetbrains.intellij.platform.gradleplugin.utils.mavenRepository import org.jetbrains.kotlin.gradle.dsl.kotlinExtension import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import java.io.File diff --git a/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt similarity index 99% rename from src/main/kotlin/org/jetbrains/intellij/IntelliJPluginConstants.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index 576f090744..6f4edd6f56 100644 --- a/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin object IntelliJPluginConstants { const val PLUGIN_NAME = "IntelliJ Platform Gradle Plugin" diff --git a/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt similarity index 94% rename from src/main/kotlin/org/jetbrains/intellij/IntelliJPluginExtension.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt index 8a99e85354..8c271d420e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginExtension.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import org.gradle.api.Action import org.gradle.api.Project @@ -9,12 +9,12 @@ import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.api.provider.Provider import org.gradle.kotlin.dsl.newInstance -import org.jetbrains.intellij.IntelliJPluginConstants.IDEA_PLUGINS_CONFIGURATION_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_COMMUNITY -import org.jetbrains.intellij.dependency.IdeaDependency -import org.jetbrains.intellij.dependency.PluginDependency -import org.jetbrains.intellij.dependency.PluginsRepositoryConfiguration -import org.jetbrains.intellij.utils.DependenciesDownloader +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PLUGINS_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_COMMUNITY +import org.jetbrains.intellij.platform.gradleplugin.dependency.IdeaDependency +import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginDependency +import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginsRepositoryConfiguration +import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader import javax.inject.Inject /** diff --git a/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginLibrary.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginLibrary.kt similarity index 83% rename from src/main/kotlin/org/jetbrains/intellij/IntelliJPluginLibrary.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginLibrary.kt index c3a245d3ea..6766571b5c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/IntelliJPluginLibrary.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginLibrary.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import org.gradle.api.component.SoftwareComponent diff --git a/src/main/kotlin/org/jetbrains/intellij/Version.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/Version.kt similarity index 97% rename from src/main/kotlin/org/jetbrains/intellij/Version.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/Version.kt index b89d8fdd2b..d3db0bbc0f 100644 --- a/src/main/kotlin/org/jetbrains/intellij/Version.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/Version.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin class Version( val major: Int = 0, diff --git a/src/main/kotlin/org/jetbrains/intellij/dependency/BuiltinPluginsRegistry.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/BuiltinPluginsRegistry.kt similarity index 90% rename from src/main/kotlin/org/jetbrains/intellij/dependency/BuiltinPluginsRegistry.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/BuiltinPluginsRegistry.kt index b46d2af802..9cf7ac5e1d 100644 --- a/src/main/kotlin/org/jetbrains/intellij/dependency/BuiltinPluginsRegistry.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/BuiltinPluginsRegistry.kt @@ -1,17 +1,17 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.dependency +package org.jetbrains.intellij.platform.gradleplugin.dependency import com.jetbrains.plugin.structure.base.utils.exists import com.jetbrains.plugin.structure.base.utils.listFiles import org.gradle.api.GradleException -import org.jetbrains.intellij.createPlugin -import org.jetbrains.intellij.debug -import org.jetbrains.intellij.ideProductInfo -import org.jetbrains.intellij.model.PluginsCache -import org.jetbrains.intellij.model.PluginsCachePlugin -import org.jetbrains.intellij.model.XmlExtractor -import org.jetbrains.intellij.warn +import org.jetbrains.intellij.platform.gradleplugin.createPlugin +import org.jetbrains.intellij.platform.gradleplugin.debug +import org.jetbrains.intellij.platform.gradleplugin.ideProductInfo +import org.jetbrains.intellij.platform.gradleplugin.model.PluginsCache +import org.jetbrains.intellij.platform.gradleplugin.model.PluginsCachePlugin +import org.jetbrains.intellij.platform.gradleplugin.model.XmlExtractor +import org.jetbrains.intellij.platform.gradleplugin.warn import java.io.File import java.io.Serializable import java.nio.file.Path diff --git a/src/main/kotlin/org/jetbrains/intellij/dependency/CustomPluginsRepository.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/CustomPluginsRepository.kt similarity index 85% rename from src/main/kotlin/org/jetbrains/intellij/dependency/CustomPluginsRepository.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/CustomPluginsRepository.kt index 2c299b22f6..15682eec05 100644 --- a/src/main/kotlin/org/jetbrains/intellij/dependency/CustomPluginsRepository.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/CustomPluginsRepository.kt @@ -1,15 +1,15 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.dependency +package org.jetbrains.intellij.platform.gradleplugin.dependency import com.jetbrains.plugin.structure.intellij.repository.CustomPluginRepositoryListingParser import com.jetbrains.plugin.structure.intellij.repository.CustomPluginRepositoryListingType import org.gradle.api.Project import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.debug -import org.jetbrains.intellij.resolveRedirection -import org.jetbrains.intellij.utils.DependenciesDownloader -import org.jetbrains.intellij.utils.ivyRepository +import org.jetbrains.intellij.platform.gradleplugin.debug +import org.jetbrains.intellij.platform.gradleplugin.resolveRedirection +import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader +import org.jetbrains.intellij.platform.gradleplugin.utils.ivyRepository import java.io.File import java.net.URL diff --git a/src/main/kotlin/org/jetbrains/intellij/dependency/IdePluginSourceZipFilesProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdePluginSourceZipFilesProvider.kt similarity index 94% rename from src/main/kotlin/org/jetbrains/intellij/dependency/IdePluginSourceZipFilesProvider.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdePluginSourceZipFilesProvider.kt index 59230d879b..cbb5bf9900 100644 --- a/src/main/kotlin/org/jetbrains/intellij/dependency/IdePluginSourceZipFilesProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdePluginSourceZipFilesProvider.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.dependency +package org.jetbrains.intellij.platform.gradleplugin.dependency import java.nio.file.Path import kotlin.io.path.name diff --git a/src/main/kotlin/org/jetbrains/intellij/dependency/IdeaDependency.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependency.kt similarity index 92% rename from src/main/kotlin/org/jetbrains/intellij/dependency/IdeaDependency.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependency.kt index 0152b91cc3..29a1d37c0c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/dependency/IdeaDependency.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependency.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.dependency +package org.jetbrains.intellij.platform.gradleplugin.dependency -import org.jetbrains.intellij.collectJars -import org.jetbrains.intellij.collectZips -import org.jetbrains.intellij.isKotlinRuntime +import org.jetbrains.intellij.platform.gradleplugin.collectJars +import org.jetbrains.intellij.platform.gradleplugin.collectZips +import org.jetbrains.intellij.platform.gradleplugin.isKotlinRuntime import java.io.File import java.io.Serializable import kotlin.io.path.isDirectory diff --git a/src/main/kotlin/org/jetbrains/intellij/dependency/IdeaDependencyManager.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt similarity index 93% rename from src/main/kotlin/org/jetbrains/intellij/dependency/IdeaDependencyManager.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt index 8ed2b8c82f..4e833b8a29 100644 --- a/src/main/kotlin/org/jetbrains/intellij/dependency/IdeaDependencyManager.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.dependency +package org.jetbrains.intellij.platform.gradleplugin.dependency import com.jetbrains.plugin.structure.base.utils.* import org.gradle.api.GradleException @@ -12,21 +12,21 @@ import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration import org.gradle.api.publish.ivy.internal.publication.DefaultIvyPublicationIdentity import org.gradle.internal.os.OperatingSystem import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.* -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPES -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_ANDROID_STUDIO -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_CLION -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_GATEWAY -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_GOLAND -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_COMMUNITY -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_ULTIMATE -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_PHPSTORM -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_RIDER -import org.jetbrains.intellij.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT -import org.jetbrains.intellij.IntelliJPluginConstants.RELEASE_TYPE_SNAPSHOTS -import org.jetbrains.intellij.model.AndroidStudioReleases -import org.jetbrains.intellij.model.XmlExtractor -import org.jetbrains.intellij.utils.* +import org.jetbrains.intellij.platform.gradleplugin.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPES +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_ANDROID_STUDIO +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_CLION +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_GATEWAY +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_GOLAND +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_COMMUNITY +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_ULTIMATE +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_PHPSTORM +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_RIDER +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_TYPE_SNAPSHOTS +import org.jetbrains.intellij.platform.gradleplugin.model.AndroidStudioReleases +import org.jetbrains.intellij.platform.gradleplugin.model.XmlExtractor +import org.jetbrains.intellij.platform.gradleplugin.utils.* import java.io.File import java.nio.file.Files import java.nio.file.Path diff --git a/src/main/kotlin/org/jetbrains/intellij/dependency/IdeaExtraDependency.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaExtraDependency.kt similarity index 87% rename from src/main/kotlin/org/jetbrains/intellij/dependency/IdeaExtraDependency.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaExtraDependency.kt index 0da6bb33c3..6486b400c8 100644 --- a/src/main/kotlin/org/jetbrains/intellij/dependency/IdeaExtraDependency.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaExtraDependency.kt @@ -1,8 +1,8 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.dependency +package org.jetbrains.intellij.platform.gradleplugin.dependency -import org.jetbrains.intellij.collectJars +import org.jetbrains.intellij.platform.gradleplugin.collectJars import java.io.File class IdeaExtraDependency(val name: String, val classes: File) { diff --git a/src/main/kotlin/org/jetbrains/intellij/dependency/IntellijIvyArtifact.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IntellijIvyArtifact.kt similarity index 97% rename from src/main/kotlin/org/jetbrains/intellij/dependency/IntellijIvyArtifact.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IntellijIvyArtifact.kt index e6b032d0e6..531a211b51 100644 --- a/src/main/kotlin/org/jetbrains/intellij/dependency/IntellijIvyArtifact.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IntellijIvyArtifact.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.dependency +package org.jetbrains.intellij.platform.gradleplugin.dependency import org.gradle.api.internal.tasks.DefaultTaskDependency import org.gradle.api.publish.ivy.IvyArtifact diff --git a/src/main/kotlin/org/jetbrains/intellij/dependency/JpsIdeaDependency.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/JpsIdeaDependency.kt similarity index 91% rename from src/main/kotlin/org/jetbrains/intellij/dependency/JpsIdeaDependency.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/JpsIdeaDependency.kt index 6eeb670ff1..c69f29ac99 100644 --- a/src/main/kotlin/org/jetbrains/intellij/dependency/JpsIdeaDependency.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/JpsIdeaDependency.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.dependency +package org.jetbrains.intellij.platform.gradleplugin.dependency import java.io.File diff --git a/src/main/kotlin/org/jetbrains/intellij/dependency/LocalIdeaDependency.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/LocalIdeaDependency.kt similarity index 91% rename from src/main/kotlin/org/jetbrains/intellij/dependency/LocalIdeaDependency.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/LocalIdeaDependency.kt index d573acd572..a9e2d7b2fb 100644 --- a/src/main/kotlin/org/jetbrains/intellij/dependency/LocalIdeaDependency.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/LocalIdeaDependency.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.dependency +package org.jetbrains.intellij.platform.gradleplugin.dependency import java.io.File diff --git a/src/main/kotlin/org/jetbrains/intellij/dependency/MavenPluginsRepository.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/MavenPluginsRepository.kt similarity index 90% rename from src/main/kotlin/org/jetbrains/intellij/dependency/MavenPluginsRepository.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/MavenPluginsRepository.kt index e24f5b4ac5..11cb959855 100644 --- a/src/main/kotlin/org/jetbrains/intellij/dependency/MavenPluginsRepository.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/MavenPluginsRepository.kt @@ -1,14 +1,14 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.dependency +package org.jetbrains.intellij.platform.gradleplugin.dependency import org.gradle.api.Action import org.gradle.api.Project import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.repositories.MavenArtifactRepository -import org.jetbrains.intellij.debug -import org.jetbrains.intellij.utils.DependenciesDownloader -import org.jetbrains.intellij.utils.mavenRepository +import org.jetbrains.intellij.platform.gradleplugin.debug +import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader +import org.jetbrains.intellij.platform.gradleplugin.utils.mavenRepository import java.io.File interface MavenRepository : PluginsRepository { diff --git a/src/main/kotlin/org/jetbrains/intellij/dependency/PluginDependency.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependency.kt similarity index 93% rename from src/main/kotlin/org/jetbrains/intellij/dependency/PluginDependency.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependency.kt index 00d12f223f..211da0771c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/dependency/PluginDependency.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependency.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.dependency +package org.jetbrains.intellij.platform.gradleplugin.dependency import com.jetbrains.plugin.structure.intellij.version.IdeVersion import java.io.File diff --git a/src/main/kotlin/org/jetbrains/intellij/dependency/PluginDependencyImpl.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyImpl.kt similarity index 96% rename from src/main/kotlin/org/jetbrains/intellij/dependency/PluginDependencyImpl.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyImpl.kt index 954ba62853..52291f9a92 100644 --- a/src/main/kotlin/org/jetbrains/intellij/dependency/PluginDependencyImpl.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyImpl.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.dependency +package org.jetbrains.intellij.platform.gradleplugin.dependency import com.jetbrains.plugin.structure.base.utils.isJar import com.jetbrains.plugin.structure.intellij.version.IdeVersion -import org.jetbrains.intellij.collectJars +import org.jetbrains.intellij.platform.gradleplugin.collectJars import java.io.File class PluginDependencyImpl( diff --git a/src/main/kotlin/org/jetbrains/intellij/dependency/PluginDependencyManager.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyManager.kt similarity index 95% rename from src/main/kotlin/org/jetbrains/intellij/dependency/PluginDependencyManager.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyManager.kt index cfecacc789..9fd969885e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/dependency/PluginDependencyManager.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyManager.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.dependency +package org.jetbrains.intellij.platform.gradleplugin.dependency import com.jetbrains.plugin.structure.base.utils.* import org.gradle.api.Project @@ -11,11 +11,11 @@ import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration import org.gradle.api.publish.ivy.internal.publication.DefaultIvyPublicationIdentity import org.gradle.kotlin.dsl.create import org.gradle.tooling.BuildException -import org.jetbrains.intellij.IntelliJIvyDescriptorFileGenerator -import org.jetbrains.intellij.createPlugin -import org.jetbrains.intellij.info -import org.jetbrains.intellij.utils.ArchiveUtils -import org.jetbrains.intellij.warn +import org.jetbrains.intellij.platform.gradleplugin.IntelliJIvyDescriptorFileGenerator +import org.jetbrains.intellij.platform.gradleplugin.createPlugin +import org.jetbrains.intellij.platform.gradleplugin.info +import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils +import org.jetbrains.intellij.platform.gradleplugin.warn import java.io.File import java.nio.file.Path import java.nio.file.Paths diff --git a/src/main/kotlin/org/jetbrains/intellij/dependency/PluginDependencyNotation.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyNotation.kt similarity index 93% rename from src/main/kotlin/org/jetbrains/intellij/dependency/PluginDependencyNotation.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyNotation.kt index a41482f928..48dce8cd89 100644 --- a/src/main/kotlin/org/jetbrains/intellij/dependency/PluginDependencyNotation.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyNotation.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.dependency +package org.jetbrains.intellij.platform.gradleplugin.dependency import org.gradle.api.Project import org.gradle.api.artifacts.Dependency -import org.jetbrains.intellij.or +import org.jetbrains.intellij.platform.gradleplugin.or import java.io.File import java.io.Serializable diff --git a/src/main/kotlin/org/jetbrains/intellij/dependency/PluginProjectDependency.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginProjectDependency.kt similarity index 95% rename from src/main/kotlin/org/jetbrains/intellij/dependency/PluginProjectDependency.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginProjectDependency.kt index 5c581e6bfc..43dd44ff77 100644 --- a/src/main/kotlin/org/jetbrains/intellij/dependency/PluginProjectDependency.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginProjectDependency.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.dependency +package org.jetbrains.intellij.platform.gradleplugin.dependency import com.jetbrains.plugin.structure.base.plugin.PluginCreationSuccess import com.jetbrains.plugin.structure.intellij.plugin.IdePluginManager import com.jetbrains.plugin.structure.intellij.version.IdeVersion -import org.jetbrains.intellij.error +import org.jetbrains.intellij.platform.gradleplugin.error import java.io.File class PluginProjectDependency(private val pluginDirectory: File, val context: String?) : PluginDependency { diff --git a/src/main/kotlin/org/jetbrains/intellij/dependency/PluginsRepository.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginsRepository.kt similarity index 84% rename from src/main/kotlin/org/jetbrains/intellij/dependency/PluginsRepository.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginsRepository.kt index c4a99985ea..7625846aeb 100644 --- a/src/main/kotlin/org/jetbrains/intellij/dependency/PluginsRepository.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginsRepository.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.dependency +package org.jetbrains.intellij.platform.gradleplugin.dependency import org.gradle.api.Project import java.io.File diff --git a/src/main/kotlin/org/jetbrains/intellij/dependency/PluginsRepositoryConfiguration.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginsRepositoryConfiguration.kt similarity index 84% rename from src/main/kotlin/org/jetbrains/intellij/dependency/PluginsRepositoryConfiguration.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginsRepositoryConfiguration.kt index 30bf5c411e..f0fcb2acd4 100644 --- a/src/main/kotlin/org/jetbrains/intellij/dependency/PluginsRepositoryConfiguration.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginsRepositoryConfiguration.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.dependency +package org.jetbrains.intellij.platform.gradleplugin.dependency import org.gradle.api.Action import org.gradle.api.artifacts.repositories.MavenArtifactRepository -import org.jetbrains.intellij.IntelliJPluginConstants.DEFAULT_INTELLIJ_PLUGINS_REPOSITORY -import org.jetbrains.intellij.utils.DependenciesDownloader +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_INTELLIJ_PLUGINS_REPOSITORY +import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader import javax.inject.Inject abstract class PluginsRepositoryConfiguration @Inject constructor( diff --git a/src/main/kotlin/org/jetbrains/intellij/jbr/Jbr.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/Jbr.kt similarity index 81% rename from src/main/kotlin/org/jetbrains/intellij/jbr/Jbr.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/Jbr.kt index b13ea894fc..632362e49c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/jbr/Jbr.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/Jbr.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.jbr +package org.jetbrains.intellij.platform.gradleplugin.jbr import java.nio.file.Path diff --git a/src/main/kotlin/org/jetbrains/intellij/jbr/JbrResolver.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolver.kt similarity index 96% rename from src/main/kotlin/org/jetbrains/intellij/jbr/JbrResolver.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolver.kt index cb5536ffb4..19cbfde3be 100644 --- a/src/main/kotlin/org/jetbrains/intellij/jbr/JbrResolver.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolver.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.jbr +package org.jetbrains.intellij.platform.gradleplugin.jbr import com.jetbrains.plugin.structure.base.utils.exists import com.jetbrains.plugin.structure.base.utils.listFiles @@ -9,11 +9,11 @@ import org.gradle.api.provider.Provider import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.* -import org.jetbrains.intellij.IntelliJPluginConstants.DEFAULT_JBR_REPOSITORY -import org.jetbrains.intellij.utils.ArchiveUtils -import org.jetbrains.intellij.utils.DependenciesDownloader -import org.jetbrains.intellij.utils.ivyRepository +import org.jetbrains.intellij.platform.gradleplugin.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_JBR_REPOSITORY +import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils +import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader +import org.jetbrains.intellij.platform.gradleplugin.utils.ivyRepository import java.io.File import java.io.FileReader import java.io.IOException diff --git a/src/main/kotlin/org/jetbrains/intellij/memoize.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/memoize.kt similarity index 96% rename from src/main/kotlin/org/jetbrains/intellij/memoize.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/memoize.kt index d691a2f8c0..81a395e9c8 100644 --- a/src/main/kotlin/org/jetbrains/intellij/memoize.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/memoize.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import org.gradle.api.internal.provider.AbstractMinimalProvider import org.gradle.api.internal.provider.DefaultValueSourceProviderFactory diff --git a/src/main/kotlin/org/jetbrains/intellij/model/AndroidStudioReleases.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/AndroidStudioReleases.kt similarity index 95% rename from src/main/kotlin/org/jetbrains/intellij/model/AndroidStudioReleases.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/AndroidStudioReleases.kt index a63fef7c04..8d13549744 100644 --- a/src/main/kotlin/org/jetbrains/intellij/model/AndroidStudioReleases.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/AndroidStudioReleases.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.model +package org.jetbrains.intellij.platform.gradleplugin.model import java.io.Serializable import javax.xml.bind.annotation.XmlAttribute diff --git a/src/main/kotlin/org/jetbrains/intellij/model/MavenMetadata.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/MavenMetadata.kt similarity index 93% rename from src/main/kotlin/org/jetbrains/intellij/model/MavenMetadata.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/MavenMetadata.kt index 1d7775b79e..1752c2f85e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/model/MavenMetadata.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/MavenMetadata.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.model +package org.jetbrains.intellij.platform.gradleplugin.model import javax.xml.bind.annotation.XmlElement import javax.xml.bind.annotation.XmlElementWrapper diff --git a/src/main/kotlin/org/jetbrains/intellij/model/ObjectFactory.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ObjectFactory.kt similarity index 88% rename from src/main/kotlin/org/jetbrains/intellij/model/ObjectFactory.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ObjectFactory.kt index a474954a5e..04cc8ec65b 100644 --- a/src/main/kotlin/org/jetbrains/intellij/model/ObjectFactory.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ObjectFactory.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.model +package org.jetbrains.intellij.platform.gradleplugin.model import javax.xml.bind.annotation.XmlRegistry diff --git a/src/main/kotlin/org/jetbrains/intellij/model/PerformanceTestResult.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestResult.kt similarity index 82% rename from src/main/kotlin/org/jetbrains/intellij/model/PerformanceTestResult.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestResult.kt index 7a9dcfb31c..dc7a8111c9 100644 --- a/src/main/kotlin/org/jetbrains/intellij/model/PerformanceTestResult.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestResult.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.model +package org.jetbrains.intellij.platform.gradleplugin.model data class PerformanceTestResult( val testName: String, diff --git a/src/main/kotlin/org/jetbrains/intellij/model/PerformanceTestScript.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestScript.kt similarity index 94% rename from src/main/kotlin/org/jetbrains/intellij/model/PerformanceTestScript.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestScript.kt index 7eeec771fe..3dae0924c3 100644 --- a/src/main/kotlin/org/jetbrains/intellij/model/PerformanceTestScript.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestScript.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.model +package org.jetbrains.intellij.platform.gradleplugin.model class PerformanceTestScript private constructor( val projectName: String?, diff --git a/src/main/kotlin/org/jetbrains/intellij/model/PerformanceTestStatistic.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestStatistic.kt similarity index 92% rename from src/main/kotlin/org/jetbrains/intellij/model/PerformanceTestStatistic.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestStatistic.kt index 889f34ae76..26408b7451 100644 --- a/src/main/kotlin/org/jetbrains/intellij/model/PerformanceTestStatistic.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestStatistic.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.model +package org.jetbrains.intellij.platform.gradleplugin.model class PerformanceTestStatistic private constructor( val totalTime: Long?, diff --git a/src/main/kotlin/org/jetbrains/intellij/model/PluginsCache.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PluginsCache.kt similarity index 93% rename from src/main/kotlin/org/jetbrains/intellij/model/PluginsCache.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PluginsCache.kt index b14702f64f..5e31144bea 100644 --- a/src/main/kotlin/org/jetbrains/intellij/model/PluginsCache.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PluginsCache.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.model +package org.jetbrains.intellij.platform.gradleplugin.model import java.io.Serializable import javax.xml.bind.annotation.XmlAttribute diff --git a/src/main/kotlin/org/jetbrains/intellij/model/ProductInfo.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt similarity index 97% rename from src/main/kotlin/org/jetbrains/intellij/model/ProductInfo.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt index a561f78b3a..86461d1934 100644 --- a/src/main/kotlin/org/jetbrains/intellij/model/ProductInfo.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.model +package org.jetbrains.intellij.platform.gradleplugin.model import kotlinx.serialization.Serializable import org.gradle.api.GradleException diff --git a/src/main/kotlin/org/jetbrains/intellij/model/ProductsReleases.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductsReleases.kt similarity index 97% rename from src/main/kotlin/org/jetbrains/intellij/model/ProductsReleases.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductsReleases.kt index 3e0c0fdcb2..81d8159899 100644 --- a/src/main/kotlin/org/jetbrains/intellij/model/ProductsReleases.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductsReleases.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.model +package org.jetbrains.intellij.platform.gradleplugin.model import java.io.Serializable import javax.xml.bind.annotation.XmlAttribute diff --git a/src/main/kotlin/org/jetbrains/intellij/model/XmlExtractor.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/XmlExtractor.kt similarity index 80% rename from src/main/kotlin/org/jetbrains/intellij/model/XmlExtractor.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/XmlExtractor.kt index 0f701d2136..5bfb178d6b 100644 --- a/src/main/kotlin/org/jetbrains/intellij/model/XmlExtractor.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/XmlExtractor.kt @@ -1,12 +1,12 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.model +package org.jetbrains.intellij.platform.gradleplugin.model import com.jetbrains.plugin.structure.base.utils.inputStream import com.jetbrains.plugin.structure.base.utils.outputStream import com.jetbrains.plugin.structure.intellij.utils.JDOMUtil -import org.jetbrains.intellij.transformXml -import org.jetbrains.intellij.warn +import org.jetbrains.intellij.platform.gradleplugin.transformXml +import org.jetbrains.intellij.platform.gradleplugin.warn import java.io.InputStream import java.nio.file.Path import javax.xml.bind.JAXBContext @@ -15,7 +15,7 @@ import javax.xml.bind.JAXBException class XmlExtractor(private val context: String? = null) { private val jaxbContext by lazy { - JAXBContext.newInstance("org.jetbrains.intellij.model", ObjectFactory::class.java.classLoader) + JAXBContext.newInstance("org.jetbrains.intellij.platform.gradleplugin.model", ObjectFactory::class.java.classLoader) } @Throws(JAXBException::class) diff --git a/src/main/kotlin/org/jetbrains/intellij/performanceTest/ProfilerName.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/ProfilerName.kt similarity index 71% rename from src/main/kotlin/org/jetbrains/intellij/performanceTest/ProfilerName.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/ProfilerName.kt index ef78245482..0f740c9982 100644 --- a/src/main/kotlin/org/jetbrains/intellij/performanceTest/ProfilerName.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/ProfilerName.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.performanceTest +package org.jetbrains.intellij.platform.gradleplugin.performanceTest enum class ProfilerName { YOURKIT, diff --git a/src/main/kotlin/org/jetbrains/intellij/performanceTest/TestExecutionFailException.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/TestExecutionFailException.kt similarity index 74% rename from src/main/kotlin/org/jetbrains/intellij/performanceTest/TestExecutionFailException.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/TestExecutionFailException.kt index 4f283dc9b1..fbaad6eb1d 100644 --- a/src/main/kotlin/org/jetbrains/intellij/performanceTest/TestExecutionFailException.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/TestExecutionFailException.kt @@ -1,5 +1,5 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.performanceTest +package org.jetbrains.intellij.platform.gradleplugin.performanceTest class TestExecutionFailException(message: String) : RuntimeException(message) diff --git a/src/main/kotlin/org/jetbrains/intellij/performanceTest/parsers/IdeaLogParser.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/IdeaLogParser.kt similarity index 86% rename from src/main/kotlin/org/jetbrains/intellij/performanceTest/parsers/IdeaLogParser.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/IdeaLogParser.kt index bd2f244f20..9cfda3567e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/performanceTest/parsers/IdeaLogParser.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/IdeaLogParser.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.performanceTest.parsers +package org.jetbrains.intellij.platform.gradleplugin.performanceTest.parsers import com.jetbrains.plugin.structure.base.utils.forEachLine -import org.jetbrains.intellij.model.PerformanceTestStatistic +import org.jetbrains.intellij.platform.gradleplugin.model.PerformanceTestStatistic import java.nio.file.Path class IdeaLogParser(private val logPath: String) { diff --git a/src/main/kotlin/org/jetbrains/intellij/performanceTest/parsers/SimpleIJPerformanceParser.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/SimpleIJPerformanceParser.kt similarity index 91% rename from src/main/kotlin/org/jetbrains/intellij/performanceTest/parsers/SimpleIJPerformanceParser.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/SimpleIJPerformanceParser.kt index 1de5a66625..490360d4d7 100644 --- a/src/main/kotlin/org/jetbrains/intellij/performanceTest/parsers/SimpleIJPerformanceParser.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/SimpleIJPerformanceParser.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.performanceTest.parsers +package org.jetbrains.intellij.platform.gradleplugin.performanceTest.parsers import com.jetbrains.plugin.structure.base.utils.forEachLine -import org.jetbrains.intellij.model.PerformanceTestScript +import org.jetbrains.intellij.platform.gradleplugin.model.PerformanceTestScript import java.nio.file.Path import java.time.Duration import java.util.concurrent.TimeUnit diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/BuildPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTask.kt similarity index 81% rename from src/main/kotlin/org/jetbrains/intellij/tasks/BuildPluginTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTask.kt index 9e041456d5..698b8af4ac 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/BuildPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTask.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.tasks.bundling.Zip import org.gradle.work.DisableCachingByDefault -import org.jetbrains.intellij.IntelliJPluginConstants +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants /** * Assembles a plugin and prepares ZIP archive for deployment. diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/BuildSearchableOptionsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTask.kt similarity index 89% rename from src/main/kotlin/org/jetbrains/intellij/tasks/BuildSearchableOptionsTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTask.kt index a3b5fe8dc8..22d1064a23 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/BuildSearchableOptionsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTask.kt @@ -1,16 +1,16 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.file.DirectoryProperty import org.gradle.api.provider.Property import org.gradle.api.tasks.CacheableTask import org.gradle.api.tasks.Internal import org.gradle.api.tasks.OutputDirectory -import org.jetbrains.intellij.BuildFeature -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.logCategory -import org.jetbrains.intellij.warn +import org.jetbrains.intellij.platform.gradleplugin.BuildFeature +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.warn /** * Builds an index of UI components (searchable options) for the plugin. diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/ClasspathIndexCleanupTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ClasspathIndexCleanupTask.kt similarity index 81% rename from src/main/kotlin/org/jetbrains/intellij/tasks/ClasspathIndexCleanupTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ClasspathIndexCleanupTask.kt index 5d6eeb0967..eae64b2c32 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/ClasspathIndexCleanupTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ClasspathIndexCleanupTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import com.jetbrains.plugin.structure.base.utils.deleteQuietly import org.gradle.api.DefaultTask @@ -10,10 +10,10 @@ import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity import org.gradle.api.tasks.TaskAction import org.gradle.work.DisableCachingByDefault -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.IntelliJPluginExtension -import org.jetbrains.intellij.info -import org.jetbrains.intellij.logCategory +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginExtension +import org.jetbrains.intellij.platform.gradleplugin.info +import org.jetbrains.intellij.platform.gradleplugin.logCategory /** * Remove `classpath.index` files that are created by the `PathClassLoader`. diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt similarity index 100% rename from src/main/kotlin/org/jetbrains/intellij/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/DownloadIdeaProductReleasesXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIdeaProductReleasesXmlTask.kt similarity index 100% rename from src/main/kotlin/org/jetbrains/intellij/tasks/DownloadIdeaProductReleasesXmlTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIdeaProductReleasesXmlTask.kt diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/DownloadRobotServerPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadRobotServerPluginTask.kt similarity index 82% rename from src/main/kotlin/org/jetbrains/intellij/tasks/DownloadRobotServerPluginTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadRobotServerPluginTask.kt index e3e356de8c..0dff2b4fb2 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/DownloadRobotServerPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadRobotServerPluginTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.DefaultTask import org.gradle.api.file.DirectoryProperty @@ -11,14 +11,14 @@ import org.gradle.api.tasks.OutputDirectory import org.gradle.api.tasks.TaskAction import org.gradle.kotlin.dsl.newInstance import org.gradle.work.DisableCachingByDefault -import org.jetbrains.intellij.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.VERSION_LATEST -import org.jetbrains.intellij.Version -import org.jetbrains.intellij.asPath -import org.jetbrains.intellij.logCategory -import org.jetbrains.intellij.utils.ArchiveUtils -import org.jetbrains.intellij.utils.LatestVersionResolver +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERSION_LATEST +import org.jetbrains.intellij.platform.gradleplugin.Version +import org.jetbrains.intellij.platform.gradleplugin.asPath +import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils +import org.jetbrains.intellij.platform.gradleplugin.utils.LatestVersionResolver import java.io.File import javax.inject.Inject diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/DownloadZipSignerTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadZipSignerTask.kt similarity index 89% rename from src/main/kotlin/org/jetbrains/intellij/tasks/DownloadZipSignerTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadZipSignerTask.kt index 21a673dab5..087be1f982 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/DownloadZipSignerTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadZipSignerTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.DefaultTask import org.gradle.api.file.RegularFileProperty @@ -10,9 +10,9 @@ import org.gradle.api.tasks.Optional import org.gradle.api.tasks.OutputFile import org.gradle.api.tasks.TaskAction import org.gradle.work.DisableCachingByDefault -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.VERSION_LATEST -import org.jetbrains.intellij.utils.LatestVersionResolver +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERSION_LATEST +import org.jetbrains.intellij.platform.gradleplugin.utils.LatestVersionResolver import java.nio.file.Path import kotlin.io.path.copyTo diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/InitializeIntelliJPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPluginTask.kt similarity index 76% rename from src/main/kotlin/org/jetbrains/intellij/tasks/InitializeIntelliJPluginTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPluginTask.kt index 2094d41c0b..3ebffaec0e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/InitializeIntelliJPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPluginTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import com.jetbrains.plugin.structure.base.utils.create import org.gradle.api.DefaultTask @@ -8,12 +8,12 @@ import org.gradle.api.provider.Property import org.gradle.api.tasks.Internal import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.UntrackedTask -import org.jetbrains.intellij.* -import org.jetbrains.intellij.IntelliJPluginConstants.GITHUB_REPOSITORY -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_ID -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_NAME -import org.jetbrains.intellij.utils.LatestVersionResolver +import org.jetbrains.intellij.platform.gradleplugin.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.GITHUB_REPOSITORY +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_ID +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_NAME +import org.jetbrains.intellij.platform.gradleplugin.utils.LatestVersionResolver import java.io.File /** diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/InstrumentCodeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentCodeTask.kt similarity index 97% rename from src/main/kotlin/org/jetbrains/intellij/tasks/InstrumentCodeTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentCodeTask.kt index 3bcae8dbe2..b95e52e4c1 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/InstrumentCodeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentCodeTask.kt @@ -2,7 +2,7 @@ @file:Suppress("SameReturnValue") -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import com.jetbrains.plugin.structure.base.utils.* import groovy.lang.Closure @@ -16,9 +16,9 @@ import org.gradle.api.tasks.* import org.gradle.work.ChangeType import org.gradle.work.Incremental import org.gradle.work.InputChanges -import org.jetbrains.intellij.* -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.dependency.IdeaDependency +import org.jetbrains.intellij.platform.gradleplugin.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.dependency.IdeaDependency import java.io.File import java.nio.file.Files import java.nio.file.Path diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/InstrumentedJarTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentedJarTask.kt similarity index 78% rename from src/main/kotlin/org/jetbrains/intellij/tasks/InstrumentedJarTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentedJarTask.kt index 515cb9e9c7..a75e7d27d1 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/InstrumentedJarTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentedJarTask.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.tasks.CacheableTask import org.gradle.api.tasks.bundling.Jar -import org.jetbrains.intellij.IntelliJPluginConstants +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants /** * Creates a JAR file with instrumented classes. diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/JarSearchableOptionsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/JarSearchableOptionsTask.kt similarity index 86% rename from src/main/kotlin/org/jetbrains/intellij/tasks/JarSearchableOptionsTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/JarSearchableOptionsTask.kt index 99286971d9..d3f25f8d4a 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/JarSearchableOptionsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/JarSearchableOptionsTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import com.jetbrains.plugin.structure.base.utils.listFiles import com.jetbrains.plugin.structure.base.utils.simpleName @@ -8,11 +8,11 @@ import org.gradle.api.file.DirectoryProperty import org.gradle.api.provider.Property import org.gradle.api.tasks.* import org.gradle.jvm.tasks.Jar -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.SEARCHABLE_OPTIONS_SUFFIX -import org.jetbrains.intellij.asPath -import org.jetbrains.intellij.logCategory -import org.jetbrains.intellij.warn +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SEARCHABLE_OPTIONS_SUFFIX +import org.jetbrains.intellij.platform.gradleplugin.asPath +import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.warn import java.nio.file.Path /** @@ -34,7 +34,7 @@ abstract class JarSearchableOptionsTask : Jar() { /** * The name of the plugin. * - * Default value: [org.jetbrains.intellij.IntelliJPluginExtension.pluginName] + * Default value: [org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginExtension.pluginName] */ @get:Input @get:Optional diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/ListBundledPluginsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListBundledPluginsTask.kt similarity index 84% rename from src/main/kotlin/org/jetbrains/intellij/tasks/ListBundledPluginsTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListBundledPluginsTask.kt index f3e54aed74..58c2bf2eba 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/ListBundledPluginsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListBundledPluginsTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import com.jetbrains.plugin.structure.base.utils.outputStream import org.gradle.api.DefaultTask @@ -11,10 +11,10 @@ import org.gradle.api.tasks.CacheableTask import org.gradle.api.tasks.Input import org.gradle.api.tasks.OutputFile import org.gradle.api.tasks.TaskAction -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.asPath -import org.jetbrains.intellij.dependency.BuiltinPluginsRegistry -import org.jetbrains.intellij.logCategory +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.asPath +import org.jetbrains.intellij.platform.gradleplugin.dependency.BuiltinPluginsRegistry +import org.jetbrains.intellij.platform.gradleplugin.logCategory import java.io.File /** diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/ListProductsReleasesTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTask.kt similarity index 93% rename from src/main/kotlin/org/jetbrains/intellij/tasks/ListProductsReleasesTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTask.kt index 48e109dd4c..c7dbce2846 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/ListProductsReleasesTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import com.jetbrains.plugin.structure.base.utils.outputStream import org.gradle.api.DefaultTask @@ -10,12 +10,12 @@ import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.api.provider.SetProperty import org.gradle.api.tasks.* -import org.jetbrains.intellij.* -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_ANDROID_STUDIO -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.model.AndroidStudioReleases -import org.jetbrains.intellij.model.ProductsReleases -import org.jetbrains.intellij.model.XmlExtractor +import org.jetbrains.intellij.platform.gradleplugin.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_ANDROID_STUDIO +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.model.AndroidStudioReleases +import org.jetbrains.intellij.platform.gradleplugin.model.ProductsReleases +import org.jetbrains.intellij.platform.gradleplugin.model.XmlExtractor /** * List all available IntelliJ-based IDE releases with their updates. diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/PatchPluginXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt similarity index 93% rename from src/main/kotlin/org/jetbrains/intellij/tasks/PatchPluginXmlTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt index bc3e0623b9..cda2661d80 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/PatchPluginXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import com.jetbrains.plugin.structure.base.utils.inputStream import com.jetbrains.plugin.structure.base.utils.simpleName @@ -13,11 +13,11 @@ import org.gradle.api.provider.Property import org.gradle.api.tasks.* import org.jdom2.Document import org.jdom2.Element -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.asPath -import org.jetbrains.intellij.logCategory -import org.jetbrains.intellij.transformXml -import org.jetbrains.intellij.warn +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.asPath +import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.transformXml +import org.jetbrains.intellij.platform.gradleplugin.warn import java.io.File /** diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/PrepareSandboxTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTask.kt similarity index 94% rename from src/main/kotlin/org/jetbrains/intellij/tasks/PrepareSandboxTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTask.kt index e1883222ef..2fa6285deb 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/PrepareSandboxTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import com.jetbrains.plugin.structure.base.utils.* import com.jetbrains.plugin.structure.intellij.utils.JDOMUtil @@ -16,10 +16,10 @@ import org.gradle.api.provider.Property import org.gradle.api.tasks.* import org.gradle.work.DisableCachingByDefault import org.jdom2.Element -import org.jetbrains.intellij.* -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.dependency.PluginDependency -import org.jetbrains.intellij.dependency.PluginProjectDependency +import org.jetbrains.intellij.platform.gradleplugin.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginDependency +import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginProjectDependency import java.io.File import java.nio.file.Path diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/PrintBundledPluginsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrintBundledPluginsTask.kt similarity index 85% rename from src/main/kotlin/org/jetbrains/intellij/tasks/PrintBundledPluginsTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrintBundledPluginsTask.kt index 63777a5cbd..5c970783cd 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/PrintBundledPluginsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrintBundledPluginsTask.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.DefaultTask import org.gradle.api.file.RegularFileProperty import org.gradle.api.tasks.* -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME /** * Prints the output produced by the [ListBundledPluginsTask] task. diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/PrintProductsReleasesTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrintProductsReleasesTask.kt similarity index 85% rename from src/main/kotlin/org/jetbrains/intellij/tasks/PrintProductsReleasesTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrintProductsReleasesTask.kt index b61136a9ca..44f69c7ee6 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/PrintProductsReleasesTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrintProductsReleasesTask.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.DefaultTask import org.gradle.api.file.RegularFileProperty import org.gradle.api.tasks.* -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME /** * Prints the output produced by the [ListProductsReleasesTask] task. diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/PublishPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PublishPluginTask.kt similarity index 92% rename from src/main/kotlin/org/jetbrains/intellij/tasks/PublishPluginTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PublishPluginTask.kt index 023b6fc1e4..b7b049fce8 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/PublishPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PublishPluginTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import com.jetbrains.plugin.structure.base.plugin.PluginCreationFail import com.jetbrains.plugin.structure.base.plugin.PluginCreationSuccess @@ -12,13 +12,13 @@ import org.gradle.api.file.RegularFileProperty import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.api.tasks.* -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.asPath -import org.jetbrains.intellij.info -import org.jetbrains.intellij.logCategory +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.asPath +import org.jetbrains.intellij.platform.gradleplugin.info +import org.jetbrains.intellij.platform.gradleplugin.logCategory import org.jetbrains.intellij.pluginRepository.PluginRepositoryFactory import org.jetbrains.intellij.pluginRepository.model.StringPluginId -import org.jetbrains.intellij.utils.ToolboxEnterprisePluginRepositoryService +import org.jetbrains.intellij.platform.gradleplugin.utils.ToolboxEnterprisePluginRepositoryService /** * Publishes plugin to the remote [JetBrains Marketplace](https://plugins.jetbrains.com) repository. diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/RunIdeBase.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeBase.kt similarity index 96% rename from src/main/kotlin/org/jetbrains/intellij/tasks/RunIdeBase.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeBase.kt index 31b9107a83..947c951a9b 100755 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/RunIdeBase.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeBase.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import com.dd.plist.NSDictionary import com.dd.plist.PropertyListParser @@ -13,10 +13,10 @@ import org.gradle.api.provider.Property import org.gradle.api.tasks.* import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem -import org.jetbrains.intellij.* -import org.jetbrains.intellij.IntelliJPluginConstants.GITHUB_REPOSITORY -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_ULTIMATE -import org.jetbrains.intellij.jbr.JbrResolver +import org.jetbrains.intellij.platform.gradleplugin.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.GITHUB_REPOSITORY +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_ULTIMATE +import org.jetbrains.intellij.platform.gradleplugin.jbr.JbrResolver import org.jetbrains.intellij.propertyProviders.IntelliJPlatformArgumentProvider import org.jetbrains.intellij.propertyProviders.LaunchSystemArgumentProvider import java.io.File diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/RunIdeForUiTestTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeForUiTestTask.kt similarity index 83% rename from src/main/kotlin/org/jetbrains/intellij/tasks/RunIdeForUiTestTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeForUiTestTask.kt index 00b479472b..4be4ef31fa 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/RunIdeForUiTestTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeForUiTestTask.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.tasks.JavaExec import org.gradle.api.tasks.UntrackedTask -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME /** * Runs the IDE instance with the developed plugin and robot-server installed and ready for UI testing. diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/RunIdePerformanceTestTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdePerformanceTestTask.kt similarity index 84% rename from src/main/kotlin/org/jetbrains/intellij/tasks/RunIdePerformanceTestTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdePerformanceTestTask.kt index d66df2ab8a..bca361e01e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/RunIdePerformanceTestTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdePerformanceTestTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import com.jetbrains.plugin.structure.base.utils.createDir import com.jetbrains.plugin.structure.base.utils.extension @@ -11,15 +11,15 @@ import org.gradle.api.tasks.Input import org.gradle.api.tasks.JavaExec import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.UntrackedTask -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.error -import org.jetbrains.intellij.info -import org.jetbrains.intellij.logCategory -import org.jetbrains.intellij.model.PerformanceTestResult -import org.jetbrains.intellij.performanceTest.ProfilerName -import org.jetbrains.intellij.performanceTest.TestExecutionFailException -import org.jetbrains.intellij.performanceTest.parsers.IdeaLogParser -import org.jetbrains.intellij.performanceTest.parsers.SimpleIJPerformanceParser +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.error +import org.jetbrains.intellij.platform.gradleplugin.info +import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.model.PerformanceTestResult +import org.jetbrains.intellij.platform.gradleplugin.performanceTest.ProfilerName +import org.jetbrains.intellij.platform.gradleplugin.performanceTest.TestExecutionFailException +import org.jetbrains.intellij.platform.gradleplugin.performanceTest.parsers.IdeaLogParser +import org.jetbrains.intellij.platform.gradleplugin.performanceTest.parsers.SimpleIJPerformanceParser import org.jetbrains.intellij.propertyProviders.PerformanceTestArgumentProvider import java.nio.file.Files import java.nio.file.Path diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/RunIdeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt similarity index 82% rename from src/main/kotlin/org/jetbrains/intellij/tasks/RunIdeTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt index 4608e628c8..7e259ac017 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/RunIdeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.tasks.JavaExec import org.gradle.api.tasks.UntrackedTask -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME /** * Runs the IDE instance with the developed plugin installed. diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/RunPluginVerifierTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt similarity index 95% rename from src/main/kotlin/org/jetbrains/intellij/tasks/RunPluginVerifierTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt index 379cf60d1d..5943278daf 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/RunPluginVerifierTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import com.jetbrains.plugin.structure.base.utils.* import org.apache.tools.ant.util.TeeOutputStream @@ -18,19 +18,19 @@ import org.gradle.kotlin.dsl.create import org.gradle.kotlin.dsl.newInstance import org.gradle.process.ExecOperations import org.gradle.process.internal.ExecException -import org.jetbrains.intellij.* -import org.jetbrains.intellij.IntelliJPluginConstants.CACHE_REDIRECTOR -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_ANDROID_STUDIO -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_COMMUNITY -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY -import org.jetbrains.intellij.IntelliJPluginConstants.VERSION_LATEST -import org.jetbrains.intellij.Version -import org.jetbrains.intellij.jbr.JbrResolver -import org.jetbrains.intellij.utils.ArchiveUtils -import org.jetbrains.intellij.utils.DependenciesDownloader -import org.jetbrains.intellij.utils.LatestVersionResolver -import org.jetbrains.intellij.utils.ivyRepository +import org.jetbrains.intellij.platform.gradleplugin.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.CACHE_REDIRECTOR +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_ANDROID_STUDIO +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_COMMUNITY +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERSION_LATEST +import org.jetbrains.intellij.platform.gradleplugin.Version +import org.jetbrains.intellij.platform.gradleplugin.jbr.JbrResolver +import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils +import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader +import org.jetbrains.intellij.platform.gradleplugin.utils.LatestVersionResolver +import org.jetbrains.intellij.platform.gradleplugin.utils.ivyRepository import java.io.ByteArrayOutputStream import java.io.File import java.io.IOException diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/SetupDependenciesTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTask.kt similarity index 81% rename from src/main/kotlin/org/jetbrains/intellij/tasks/SetupDependenciesTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTask.kt index 589dcc1887..fe250c872e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/SetupDependenciesTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTask.kt @@ -1,16 +1,16 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.DefaultTask import org.gradle.api.provider.Property import org.gradle.api.tasks.Internal import org.gradle.api.tasks.TaskAction import org.gradle.work.DisableCachingByDefault -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.dependency.IdeaDependency -import org.jetbrains.intellij.info -import org.jetbrains.intellij.logCategory +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.dependency.IdeaDependency +import org.jetbrains.intellij.platform.gradleplugin.info +import org.jetbrains.intellij.platform.gradleplugin.logCategory /** * Setups required dependencies for building and running project. diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/SignPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTask.kt similarity index 95% rename from src/main/kotlin/org/jetbrains/intellij/tasks/SignPluginTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTask.kt index b153f4e295..4752cdf46e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/SignPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.InvalidUserDataException import org.gradle.api.file.RegularFileProperty @@ -9,10 +9,10 @@ import org.gradle.api.provider.Property import org.gradle.api.tasks.* import org.gradle.api.tasks.Optional import org.gradle.process.ExecOperations -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.asPath -import org.jetbrains.intellij.debug -import org.jetbrains.intellij.logCategory +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.asPath +import org.jetbrains.intellij.platform.gradleplugin.debug +import org.jetbrains.intellij.platform.gradleplugin.logCategory import java.util.* import javax.inject.Inject diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/VerifyPluginConfigurationTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginConfigurationTask.kt similarity index 97% rename from src/main/kotlin/org/jetbrains/intellij/tasks/VerifyPluginConfigurationTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginConfigurationTask.kt index d717aaa548..e5800ca871 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/VerifyPluginConfigurationTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginConfigurationTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import com.jetbrains.plugin.structure.base.utils.exists import com.jetbrains.plugin.structure.base.utils.listFiles @@ -11,10 +11,10 @@ import org.gradle.api.provider.Property import org.gradle.api.provider.ProviderFactory import org.gradle.api.tasks.* import org.gradle.api.tasks.compile.JavaCompile -import org.jetbrains.intellij.* -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.utils.PlatformJavaVersions -import org.jetbrains.intellij.utils.PlatformKotlinVersions +import org.jetbrains.intellij.platform.gradleplugin.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.utils.PlatformJavaVersions +import org.jetbrains.intellij.platform.gradleplugin.utils.PlatformKotlinVersions import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import java.io.File import java.nio.file.Path diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/VerifyPluginSignatureTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginSignatureTask.kt similarity index 87% rename from src/main/kotlin/org/jetbrains/intellij/tasks/VerifyPluginSignatureTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginSignatureTask.kt index b36a306999..f53f807c09 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/VerifyPluginSignatureTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginSignatureTask.kt @@ -1,16 +1,16 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.InvalidUserDataException import org.gradle.api.file.RegularFileProperty import org.gradle.api.model.ObjectFactory import org.gradle.api.tasks.* import org.gradle.process.ExecOperations -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.asPath -import org.jetbrains.intellij.debug -import org.jetbrains.intellij.logCategory +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.asPath +import org.jetbrains.intellij.platform.gradleplugin.debug +import org.jetbrains.intellij.platform.gradleplugin.logCategory import javax.inject.Inject /** diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/VerifyPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginTask.kt similarity index 89% rename from src/main/kotlin/org/jetbrains/intellij/tasks/VerifyPluginTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginTask.kt index dfbd6d19bc..c068841c8f 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/VerifyPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import com.jetbrains.plugin.structure.base.plugin.PluginCreationFail import com.jetbrains.plugin.structure.base.plugin.PluginCreationSuccess @@ -11,11 +11,11 @@ import org.gradle.api.GradleException import org.gradle.api.file.DirectoryProperty import org.gradle.api.provider.Property import org.gradle.api.tasks.* -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.asPath -import org.jetbrains.intellij.error -import org.jetbrains.intellij.logCategory -import org.jetbrains.intellij.warn +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.asPath +import org.jetbrains.intellij.platform.gradleplugin.error +import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.warn /** * Validates completeness and contents of `plugin.xml` descriptors as well as plugin archive structure. diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/ZipSigningToolBase.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ZipSigningToolBase.kt similarity index 90% rename from src/main/kotlin/org/jetbrains/intellij/tasks/ZipSigningToolBase.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ZipSigningToolBase.kt index 412c8103ec..bd2a1333df 100644 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/ZipSigningToolBase.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ZipSigningToolBase.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import com.jetbrains.plugin.structure.base.utils.exists import org.apache.tools.ant.util.TeeOutputStream @@ -12,11 +12,11 @@ import org.gradle.api.provider.Property import org.gradle.api.tasks.* import org.gradle.process.ExecOperations import org.gradle.process.internal.ExecException -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.asPath -import org.jetbrains.intellij.debug -import org.jetbrains.intellij.error -import org.jetbrains.intellij.logCategory +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.asPath +import org.jetbrains.intellij.platform.gradleplugin.debug +import org.jetbrains.intellij.platform.gradleplugin.error +import org.jetbrains.intellij.platform.gradleplugin.logCategory import java.io.ByteArrayOutputStream import java.nio.file.Path import kotlin.io.path.absolutePathString diff --git a/src/main/kotlin/org/jetbrains/intellij/utils.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt similarity index 89% rename from src/main/kotlin/org/jetbrains/intellij/utils.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt index 576ccfec34..5a66d0feca 100755 --- a/src/main/kotlin/org/jetbrains/intellij/utils.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt @@ -3,7 +3,7 @@ @file:JvmName("Utils") @file:Suppress("BooleanMethodIsAlwaysInverted") -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import com.dd.plist.NSDictionary import com.dd.plist.PropertyListParser @@ -32,19 +32,19 @@ import org.gradle.util.GradleVersion import org.jdom2.Document import org.jdom2.output.Format import org.jdom2.output.XMLOutputter -import org.jetbrains.intellij.IntelliJPluginConstants.MINIMAL_SUPPORTED_GRADLE_VERSION -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_PYCHARM -import org.jetbrains.intellij.IntelliJPluginConstants.PLATFORM_TYPE_PYCHARM_COMMUNITY -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.RELEASE_SUFFIX_CUSTOM_SNAPSHOT -import org.jetbrains.intellij.IntelliJPluginConstants.RELEASE_SUFFIX_EAP -import org.jetbrains.intellij.IntelliJPluginConstants.RELEASE_SUFFIX_EAP_CANDIDATE -import org.jetbrains.intellij.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT -import org.jetbrains.intellij.IntelliJPluginConstants.RELEASE_TYPE_NIGHTLY -import org.jetbrains.intellij.IntelliJPluginConstants.RELEASE_TYPE_RELEASES -import org.jetbrains.intellij.IntelliJPluginConstants.RELEASE_TYPE_SNAPSHOTS -import org.jetbrains.intellij.dependency.IdeaDependency -import org.jetbrains.intellij.model.ProductInfo +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MINIMAL_SUPPORTED_GRADLE_VERSION +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_PYCHARM +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_PYCHARM_COMMUNITY +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_CUSTOM_SNAPSHOT +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_EAP +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_EAP_CANDIDATE +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_TYPE_NIGHTLY +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_TYPE_RELEASES +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_TYPE_SNAPSHOTS +import org.jetbrains.intellij.platform.gradleplugin.dependency.IdeaDependency +import org.jetbrains.intellij.platform.gradleplugin.model.ProductInfo import java.io.File import java.io.StringWriter import java.net.HttpURLConnection diff --git a/src/main/kotlin/org/jetbrains/intellij/utils/ArchiveUtils.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/ArchiveUtils.kt similarity index 94% rename from src/main/kotlin/org/jetbrains/intellij/utils/ArchiveUtils.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/ArchiveUtils.kt index 63d2dc2c5f..fc4846420b 100644 --- a/src/main/kotlin/org/jetbrains/intellij/utils/ArchiveUtils.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/ArchiveUtils.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.utils +package org.jetbrains.intellij.platform.gradleplugin.utils import com.jetbrains.plugin.structure.base.utils.* import org.gradle.api.file.ArchiveOperations import org.gradle.api.file.FileSystemOperations -import org.jetbrains.intellij.debug +import org.jetbrains.intellij.platform.gradleplugin.debug import java.nio.file.Path import java.util.function.BiConsumer import java.util.function.Predicate diff --git a/src/main/kotlin/org/jetbrains/intellij/utils/DependenciesDownloader.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/DependenciesDownloader.kt similarity index 93% rename from src/main/kotlin/org/jetbrains/intellij/utils/DependenciesDownloader.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/DependenciesDownloader.kt index 9dd04487a5..a8eed21640 100644 --- a/src/main/kotlin/org/jetbrains/intellij/utils/DependenciesDownloader.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/DependenciesDownloader.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.utils +package org.jetbrains.intellij.platform.gradleplugin.utils import org.gradle.api.artifacts.ArtifactRepositoryContainer import org.gradle.api.artifacts.ConfigurationContainer @@ -12,10 +12,10 @@ import org.gradle.api.artifacts.repositories.IvyArtifactRepository import org.gradle.api.artifacts.repositories.MavenArtifactRepository import org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.IntelliJPluginConstants.ANDROID_STUDIO_PRODUCTS_RELEASES_URL -import org.jetbrains.intellij.error -import org.jetbrains.intellij.info -import org.jetbrains.intellij.repositoryVersion +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANDROID_STUDIO_PRODUCTS_RELEASES_URL +import org.jetbrains.intellij.platform.gradleplugin.error +import org.jetbrains.intellij.platform.gradleplugin.info +import org.jetbrains.intellij.platform.gradleplugin.repositoryVersion import java.io.File import java.net.URI import java.net.URL diff --git a/src/main/kotlin/org/jetbrains/intellij/utils/LatestVersionResolver.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/LatestVersionResolver.kt similarity index 82% rename from src/main/kotlin/org/jetbrains/intellij/utils/LatestVersionResolver.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/LatestVersionResolver.kt index ad35d914d4..afd9cdacd8 100644 --- a/src/main/kotlin/org/jetbrains/intellij/utils/LatestVersionResolver.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/LatestVersionResolver.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.utils +package org.jetbrains.intellij.platform.gradleplugin.utils import org.gradle.api.GradleException -import org.jetbrains.intellij.debug -import org.jetbrains.intellij.model.MavenMetadata -import org.jetbrains.intellij.model.XmlExtractor +import org.jetbrains.intellij.platform.gradleplugin.debug +import org.jetbrains.intellij.platform.gradleplugin.model.MavenMetadata +import org.jetbrains.intellij.platform.gradleplugin.model.XmlExtractor import java.net.HttpURLConnection import java.net.URL diff --git a/src/main/kotlin/org/jetbrains/intellij/utils/OpenedPackages.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/OpenedPackages.kt similarity index 98% rename from src/main/kotlin/org/jetbrains/intellij/utils/OpenedPackages.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/OpenedPackages.kt index 9fbc263983..3345a13c49 100644 --- a/src/main/kotlin/org/jetbrains/intellij/utils/OpenedPackages.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/OpenedPackages.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.utils +package org.jetbrains.intellij.platform.gradleplugin.utils import org.gradle.internal.os.OperatingSystem diff --git a/src/main/kotlin/org/jetbrains/intellij/utils/PlatformJavaVersions.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/PlatformJavaVersions.kt similarity index 81% rename from src/main/kotlin/org/jetbrains/intellij/utils/PlatformJavaVersions.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/PlatformJavaVersions.kt index 9a290683eb..99b56cb851 100644 --- a/src/main/kotlin/org/jetbrains/intellij/utils/PlatformJavaVersions.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/PlatformJavaVersions.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.utils +package org.jetbrains.intellij.platform.gradleplugin.utils import org.gradle.api.JavaVersion -import org.jetbrains.intellij.Version +import org.jetbrains.intellij.platform.gradleplugin.Version // Java versions list used in IntelliJ Platform synchronized with: // https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html#intellij-platform-based-products-of-recent-ide-versions diff --git a/src/main/kotlin/org/jetbrains/intellij/utils/PlatformKotlinVersions.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/PlatformKotlinVersions.kt similarity index 87% rename from src/main/kotlin/org/jetbrains/intellij/utils/PlatformKotlinVersions.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/PlatformKotlinVersions.kt index 92691bcb6d..0d9b2a601f 100644 --- a/src/main/kotlin/org/jetbrains/intellij/utils/PlatformKotlinVersions.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/PlatformKotlinVersions.kt @@ -1,8 +1,8 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.utils +package org.jetbrains.intellij.platform.gradleplugin.utils -import org.jetbrains.intellij.Version +import org.jetbrains.intellij.platform.gradleplugin.Version // Bundled Kotlin versions list synchronized with: // https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library diff --git a/src/main/kotlin/org/jetbrains/intellij/utils/ToolboxEnterprisePluginRepositoryService.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/ToolboxEnterprisePluginRepositoryService.kt similarity index 94% rename from src/main/kotlin/org/jetbrains/intellij/utils/ToolboxEnterprisePluginRepositoryService.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/ToolboxEnterprisePluginRepositoryService.kt index 3911c590b6..3dbee01641 100644 --- a/src/main/kotlin/org/jetbrains/intellij/utils/ToolboxEnterprisePluginRepositoryService.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/ToolboxEnterprisePluginRepositoryService.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.utils +package org.jetbrains.intellij.platform.gradleplugin.utils import okhttp3.MultipartBody import okhttp3.RequestBody diff --git a/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginManualConfigSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginManualConfigSpec.kt similarity index 95% rename from src/test/kotlin/org/jetbrains/intellij/IntelliJPluginManualConfigSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginManualConfigSpec.kt index 9e7a00de32..40248b1b1b 100644 --- a/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginManualConfigSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginManualConfigSpec.kt @@ -1,6 +1,6 @@ // Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import kotlin.test.Test import kotlin.test.assertFalse @@ -15,7 +15,7 @@ class IntelliJPluginManualConfigSpec : IntelliJPluginSpecBase() { buildFile.groovy( """ - import org.jetbrains.intellij.DependenciesUtils + import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils intellij { version = '14.1.4' @@ -82,7 +82,7 @@ class IntelliJPluginManualConfigSpec : IntelliJPluginSpecBase() { writeTestFile() buildFile.groovy( """ - import org.jetbrains.intellij.DependenciesUtils + import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils intellij { version = '14.1.4' @@ -153,7 +153,7 @@ class IntelliJPluginManualConfigSpec : IntelliJPluginSpecBase() { writeTestFile() buildFile.groovy( """ - import org.jetbrains.intellij.DependenciesUtils + import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils intellij { configureDefaultDependencies = false @@ -218,7 +218,7 @@ class IntelliJPluginManualConfigSpec : IntelliJPluginSpecBase() { writeTestFile() buildFile.groovy( """ - import org.jetbrains.intellij.DependenciesUtils + import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils intellij { configureDefaultDependencies = false @@ -242,7 +242,7 @@ class IntelliJPluginManualConfigSpec : IntelliJPluginSpecBase() { writeTestFile() buildFile.groovy( """ - import org.jetbrains.intellij.DependenciesUtils + import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils intellij.configureDefaultDependencies = false dependencies { @@ -264,7 +264,7 @@ class IntelliJPluginManualConfigSpec : IntelliJPluginSpecBase() { writeTestFile() buildFile.groovy( """ - import org.jetbrains.intellij.DependenciesUtils + import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils intellij { configureDefaultDependencies = false @@ -291,7 +291,7 @@ class IntelliJPluginManualConfigSpec : IntelliJPluginSpecBase() { writeTestFile() buildFile.groovy( """ - import org.jetbrains.intellij.DependenciesUtils + import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils intellij { configureDefaultDependencies = false @@ -318,7 +318,7 @@ class IntelliJPluginManualConfigSpec : IntelliJPluginSpecBase() { writeTestFile() buildFile.groovy( """ - import org.jetbrains.intellij.DependenciesUtils + import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils intellij { configureDefaultDependencies = false @@ -343,7 +343,7 @@ class IntelliJPluginManualConfigSpec : IntelliJPluginSpecBase() { writeTestFile() buildFile.groovy( """ - import org.jetbrains.intellij.DependenciesUtils + import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils intellij { configureDefaultDependencies = false diff --git a/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpec.kt similarity index 97% rename from src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpec.kt index 6c532de693..f39eea71e5 100644 --- a/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpec.kt @@ -1,17 +1,17 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import com.jetbrains.plugin.structure.base.utils.forceDeleteIfExists import org.gradle.api.plugins.JavaPlugin.TEST_TASK_NAME import org.gradle.testkit.runner.BuildResult -import org.jetbrains.intellij.IntelliJPluginConstants.MARKETPLACE_HOST -import org.jetbrains.intellij.IntelliJPluginConstants.MINIMAL_SUPPORTED_GRADLE_VERSION -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.TASKS +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MARKETPLACE_HOST +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MINIMAL_SUPPORTED_GRADLE_VERSION +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS import org.jetbrains.intellij.pluginRepository.PluginRepositoryFactory -import org.jetbrains.intellij.test.createLocalIdeIfNotExists +import org.jetbrains.intellij.platform.gradleplugin.test.createLocalIdeIfNotExists import org.junit.Assume.assumeFalse import java.io.File import java.nio.file.Path @@ -638,7 +638,7 @@ class IntelliJPluginSpec : IntelliJPluginSpecBase() { this.groovy( """ import org.gradle.api.artifacts.result.UnresolvedArtifactResult - import org.jetbrains.intellij.IntelliJPluginConstants + import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants task printPluginSourceArtifacts { dependsOn(IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME) @@ -699,7 +699,7 @@ class IntelliJPluginSpec : IntelliJPluginSpecBase() { .also { println("Command: $it") } - .let(::ProcessProperties) + .let(IntelliJPluginSpec::ProcessProperties) class ProcessProperties(command: String) { diff --git a/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpecBase.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpecBase.kt similarity index 98% rename from src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpecBase.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpecBase.kt index b8936de934..53a03cdb98 100644 --- a/src/test/kotlin/org/jetbrains/intellij/IntelliJPluginSpecBase.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpecBase.kt @@ -1,12 +1,12 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import org.apache.commons.io.FileUtils import org.gradle.api.GradleException import org.gradle.api.internal.project.ProjectInternal import org.intellij.lang.annotations.Language -import org.jetbrains.intellij.IntelliJPluginConstants.DEFAULT_INTELLIJ_PLUGINS_REPOSITORY +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_INTELLIJ_PLUGINS_REPOSITORY import java.io.BufferedReader import java.io.File import java.io.FileOutputStream diff --git a/src/test/kotlin/org/jetbrains/intellij/SearchableOptionsSpecBase.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/SearchableOptionsSpecBase.kt similarity index 90% rename from src/test/kotlin/org/jetbrains/intellij/SearchableOptionsSpecBase.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/SearchableOptionsSpecBase.kt index f361cc3a23..8ea28a752f 100644 --- a/src/test/kotlin/org/jetbrains/intellij/SearchableOptionsSpecBase.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/SearchableOptionsSpecBase.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import org.intellij.lang.annotations.Language -import org.jetbrains.intellij.IntelliJPluginConstants.SEARCHABLE_OPTIONS_DIR_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.SEARCHABLE_OPTIONS_SUFFIX +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SEARCHABLE_OPTIONS_DIR_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SEARCHABLE_OPTIONS_SUFFIX import java.io.File abstract class SearchableOptionsSpecBase : IntelliJPluginSpecBase() { diff --git a/src/test/kotlin/org/jetbrains/intellij/UtilsTest.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/UtilsTest.kt similarity index 87% rename from src/test/kotlin/org/jetbrains/intellij/UtilsTest.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/UtilsTest.kt index eb3f973cfd..f6614bf81f 100644 --- a/src/test/kotlin/org/jetbrains/intellij/UtilsTest.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/UtilsTest.kt @@ -1,8 +1,8 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin -import org.jetbrains.intellij.dependency.PluginDependencyNotation +import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginDependencyNotation import kotlin.test.Test import kotlin.test.assertEquals diff --git a/src/test/kotlin/org/jetbrains/intellij/VersionTest.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/VersionTest.kt similarity index 97% rename from src/test/kotlin/org/jetbrains/intellij/VersionTest.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/VersionTest.kt index 7b950ba326..881eba8c4a 100644 --- a/src/test/kotlin/org/jetbrains/intellij/VersionTest.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/VersionTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import kotlin.test.Test import kotlin.test.assertEquals diff --git a/src/test/kotlin/org/jetbrains/intellij/jbr/JbrResolverTest.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolverTest.kt similarity index 92% rename from src/test/kotlin/org/jetbrains/intellij/jbr/JbrResolverTest.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolverTest.kt index cd69b531e1..c9e0ad419f 100644 --- a/src/test/kotlin/org/jetbrains/intellij/jbr/JbrResolverTest.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolverTest.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.jbr +package org.jetbrains.intellij.platform.gradleplugin.jbr import org.gradle.internal.os.OperatingSystem -import org.jetbrains.intellij.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import kotlin.test.Test const val TASK_NAME = "testJbrResolver" @@ -35,9 +35,7 @@ class JbrResolverTest : IntelliJPluginSpecBase() { private fun testJbrResolving(version: String, expected: String, variant: String? = null) { buildFile.groovy( """ - import org.jetbrains.intellij.tasks.RunIdeTask - - runIde { + runIde { jbrVersion = "$version" ${"jbrVariant = \"$variant\"".takeIf { variant != null }.orEmpty()} } diff --git a/src/test/kotlin/org/jetbrains/intellij/performanceTest/parsers/IdeaLogParserTest.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/IdeaLogParserTest.kt similarity index 91% rename from src/test/kotlin/org/jetbrains/intellij/performanceTest/parsers/IdeaLogParserTest.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/IdeaLogParserTest.kt index 8997ce594e..b22b8d24b8 100644 --- a/src/test/kotlin/org/jetbrains/intellij/performanceTest/parsers/IdeaLogParserTest.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/IdeaLogParserTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.performanceTest.parsers +package org.jetbrains.intellij.platform.gradleplugin.performanceTest.parsers import kotlin.test.Test import kotlin.test.assertEquals diff --git a/src/test/kotlin/org/jetbrains/intellij/performanceTest/parsers/SimpleIJPerfParserTest.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/SimpleIJPerfParserTest.kt similarity index 95% rename from src/test/kotlin/org/jetbrains/intellij/performanceTest/parsers/SimpleIJPerfParserTest.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/SimpleIJPerfParserTest.kt index 68d7bbeccf..d3489b3b32 100644 --- a/src/test/kotlin/org/jetbrains/intellij/performanceTest/parsers/SimpleIJPerfParserTest.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/SimpleIJPerfParserTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.performanceTest.parsers +package org.jetbrains.intellij.platform.gradleplugin.performanceTest.parsers import java.nio.file.Path import kotlin.test.Test diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/BuildPluginTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTaskSpec.kt similarity index 97% rename from src/test/kotlin/org/jetbrains/intellij/tasks/BuildPluginTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTaskSpec.kt index 9fa7f59600..ba1b0d4f63 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/BuildPluginTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTaskSpec.kt @@ -1,12 +1,12 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem -import org.jetbrains.intellij.IntelliJPluginConstants.BUILD_PLUGIN_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_NAME -import org.jetbrains.intellij.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import java.io.File import java.util.jar.Manifest import java.util.zip.ZipFile diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/BuildSearchableOptionsTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTaskSpec.kt similarity index 86% rename from src/test/kotlin/org/jetbrains/intellij/tasks/BuildSearchableOptionsTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTaskSpec.kt index aff181f2c6..7f3c1311e9 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/BuildSearchableOptionsTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTaskSpec.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks -import org.jetbrains.intellij.IntelliJPluginConstants.BUILD_SEARCHABLE_OPTIONS_TASK_NAME -import org.jetbrains.intellij.SearchableOptionsSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_SEARCHABLE_OPTIONS_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.SearchableOptionsSpecBase import kotlin.test.Test @Suppress("ComplexRedundantLet") diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/DownloadIntelliJPluginsSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIntelliJPluginsSpec.kt similarity index 98% rename from src/test/kotlin/org/jetbrains/intellij/tasks/DownloadIntelliJPluginsSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIntelliJPluginsSpec.kt index e94563eaf2..c3bed3de26 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/DownloadIntelliJPluginsSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIntelliJPluginsSpec.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.plugins.BasePlugin import org.gradle.internal.os.OperatingSystem -import org.jetbrains.intellij.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import org.junit.Assume.assumeFalse import java.io.File import kotlin.test.BeforeTest diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/DownloadIntelliJSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIntelliJSpec.kt similarity index 98% rename from src/test/kotlin/org/jetbrains/intellij/tasks/DownloadIntelliJSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIntelliJSpec.kt index 65952d8fb0..60bca14cc0 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/DownloadIntelliJSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIntelliJSpec.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.plugins.BasePlugin -import org.jetbrains.intellij.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import java.io.File import kotlin.test.Test import kotlin.test.assertEquals diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/DownloadRobotServerPluginTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadRobotServerPluginTaskSpec.kt similarity index 94% rename from src/test/kotlin/org/jetbrains/intellij/tasks/DownloadRobotServerPluginTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadRobotServerPluginTaskSpec.kt index 5a1e3f3f5f..d59beb3600 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/DownloadRobotServerPluginTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadRobotServerPluginTaskSpec.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks -import org.jetbrains.intellij.IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import java.io.File import kotlin.test.Test import kotlin.test.assertTrue diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/IntelliJInstrumentCodeTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/IntelliJInstrumentCodeTaskSpec.kt similarity index 96% rename from src/test/kotlin/org/jetbrains/intellij/tasks/IntelliJInstrumentCodeTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/IntelliJInstrumentCodeTaskSpec.kt index 5fde9dcc62..b4c0da80df 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/IntelliJInstrumentCodeTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/IntelliJInstrumentCodeTaskSpec.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.plugins.JavaPlugin import org.gradle.testkit.runner.TaskOutcome -import org.jetbrains.intellij.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import kotlin.test.Test import kotlin.test.assertEquals diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/JarSearchableOptionsTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/JarSearchableOptionsTaskSpec.kt similarity index 85% rename from src/test/kotlin/org/jetbrains/intellij/tasks/JarSearchableOptionsTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/JarSearchableOptionsTaskSpec.kt index 3678701e44..9fa96df10a 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/JarSearchableOptionsTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/JarSearchableOptionsTaskSpec.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks -import org.jetbrains.intellij.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME -import org.jetbrains.intellij.SearchableOptionsSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.SearchableOptionsSpecBase import java.io.File import kotlin.test.Test import kotlin.test.assertEquals diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/ListBundledPluginsTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListBundledPluginsTaskSpec.kt similarity index 95% rename from src/test/kotlin/org/jetbrains/intellij/tasks/ListBundledPluginsTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListBundledPluginsTaskSpec.kt index e388d68a38..b4a3879975 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/ListBundledPluginsTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListBundledPluginsTaskSpec.kt @@ -1,8 +1,8 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks -import org.jetbrains.intellij.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase class ListBundledPluginsTaskSpec : IntelliJPluginSpecBase() { diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/ListProductsReleasesTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTaskSpec.kt similarity index 94% rename from src/test/kotlin/org/jetbrains/intellij/tasks/ListProductsReleasesTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTaskSpec.kt index ecdebd3a23..06097f0dc3 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/ListProductsReleasesTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTaskSpec.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks -import org.jetbrains.intellij.IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import kotlin.test.BeforeTest import kotlin.test.Test import kotlin.test.assertEquals @@ -162,7 +162,7 @@ class ListProductsReleasesTaskSpec : IntelliJPluginSpecBase() { fun `get IDEs list without EAP releases`() { buildFile.groovy( """ - import org.jetbrains.intellij.tasks.ListProductsReleasesTask.Channel + import org.jetbrains.intellij.platform.gradleplugin.tasks.ListProductsReleasesTask.Channel listProductsReleases { sinceVersion = "2021.1" @@ -265,7 +265,7 @@ class ListProductsReleasesTaskSpec : IntelliJPluginSpecBase() { fun `get Android Studio releases for Release channel`() { buildFile.groovy( """ - import org.jetbrains.intellij.tasks.ListProductsReleasesTask.Channel + import org.jetbrains.intellij.platform.gradleplugin.tasks.ListProductsReleasesTask.Channel listProductsReleases { sinceVersion = "2021.1" diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/PatchPluginXmlTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTaskSpec.kt similarity index 97% rename from src/test/kotlin/org/jetbrains/intellij/tasks/PatchPluginXmlTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTaskSpec.kt index a3a9320d99..ca8135e72f 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/PatchPluginXmlTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTaskSpec.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.testkit.runner.TaskOutcome -import org.jetbrains.intellij.IntelliJPluginConstants.PATCH_PLUGIN_XML_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_XML_DIR_NAME -import org.jetbrains.intellij.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PATCH_PLUGIN_XML_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_XML_DIR_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import java.io.File import kotlin.test.Test import kotlin.test.assertEquals diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/PrepareSandboxTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTaskSpec.kt similarity index 97% rename from src/test/kotlin/org/jetbrains/intellij/tasks/PrepareSandboxTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTaskSpec.kt index 32a2e5aaea..a9b96ecde0 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/PrepareSandboxTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTaskSpec.kt @@ -1,12 +1,12 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks -import org.jetbrains.intellij.IntelliJPluginConstants.DEFAULT_SANDBOX -import org.jetbrains.intellij.IntelliJPluginConstants.PREPARE_SANDBOX_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.PREPARE_TESTING_SANDBOX_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.PREPARE_UI_TESTING_SANDBOX_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_SANDBOX +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_SANDBOX_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_TESTING_SANDBOX_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_UI_TESTING_SANDBOX_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import java.io.File import java.nio.file.Files.createTempDirectory import java.util.zip.ZipFile diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/ProcessResourcesTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ProcessResourcesTaskSpec.kt similarity index 94% rename from src/test/kotlin/org/jetbrains/intellij/tasks/ProcessResourcesTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ProcessResourcesTaskSpec.kt index 95400e8052..57d387ea75 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/ProcessResourcesTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ProcessResourcesTaskSpec.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.plugins.JavaPlugin import org.gradle.testkit.runner.TaskOutcome -import org.jetbrains.intellij.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import java.io.File import kotlin.test.Test import kotlin.test.assertEquals diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/PublishPluginTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PublishPluginTaskSpec.kt similarity index 82% rename from src/test/kotlin/org/jetbrains/intellij/tasks/PublishPluginTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PublishPluginTaskSpec.kt index 56d485e35b..29ec8587a7 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/PublishPluginTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PublishPluginTaskSpec.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks -import org.jetbrains.intellij.IntelliJPluginConstants.PUBLISH_PLUGIN_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PUBLISH_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import kotlin.test.BeforeTest import kotlin.test.Test diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/RunPluginVerifierTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTaskSpec.kt similarity index 92% rename from src/test/kotlin/org/jetbrains/intellij/tasks/RunPluginVerifierTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTaskSpec.kt index 2c3ca421c5..bd090068c3 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/RunPluginVerifierTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTaskSpec.kt @@ -1,12 +1,12 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.apache.commons.io.FileUtils -import org.jetbrains.intellij.IntelliJPluginConstants.BUILD_PLUGIN_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY -import org.jetbrains.intellij.IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import java.net.URL import kotlin.test.Test @@ -143,7 +143,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { val resource = resolveResourcePath("products-releases/idea-releases.xml") buildFile.groovy( """ - import org.jetbrains.intellij.tasks.ListProductsReleasesTask.Channel + import org.jetbrains.intellij.platform.gradleplugin.tasks.ListProductsReleasesTask.Channel version = "1.0.0" @@ -205,7 +205,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { writePluginXmlFile() buildFile.groovy( """ - import org.jetbrains.intellij.tasks.RunPluginVerifierTask.FailureLevel + import org.jetbrains.intellij.platform.gradleplugin.tasks.RunPluginVerifierTask.FailureLevel version = "1.0.0" @@ -248,9 +248,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { writePluginXmlFile() buildFile.groovy( """ - import org.jetbrains.intellij.tasks.RunPluginVerifierTask.FailureLevel - - version = "1.0.0" + version = "1.0.0" runPluginVerifier { ideVersions = ["foo", "foo", "", "foo"] @@ -269,7 +267,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { writePluginXmlFile() buildFile.groovy( """ - import org.jetbrains.intellij.tasks.RunPluginVerifierTask.FailureLevel + import org.jetbrains.intellij.platform.gradleplugin.tasks.RunPluginVerifierTask.FailureLevel version = "1.0.0" @@ -292,7 +290,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { writePluginXmlFile() buildFile.groovy( """ - import org.jetbrains.intellij.tasks.RunPluginVerifierTask.FailureLevel + import org.jetbrains.intellij.platform.gradleplugin.tasks.RunPluginVerifierTask.FailureLevel version = "1.0.0" diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/SetupDependenciesTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTaskSpec.kt similarity index 82% rename from src/test/kotlin/org/jetbrains/intellij/tasks/SetupDependenciesTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTaskSpec.kt index e980608bcf..c3a5ec64ad 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/SetupDependenciesTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTaskSpec.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks -import org.jetbrains.intellij.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import kotlin.test.Test @Suppress("ComplexRedundantLet") diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/SignPluginTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTaskSpec.kt similarity index 95% rename from src/test/kotlin/org/jetbrains/intellij/tasks/SignPluginTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTaskSpec.kt index f7e9314cd4..b9de31d740 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/SignPluginTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTaskSpec.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks -import org.jetbrains.intellij.IntelliJPluginConstants.DOWNLOAD_ZIP_SIGNER_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.SIGN_PLUGIN_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginConstants.VERIFY_PLUGIN_SIGNATURE_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ZIP_SIGNER_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SIGN_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_SIGNATURE_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import java.io.File import kotlin.test.Test import kotlin.test.assertTrue diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/VerifyPluginConfigurationTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginConfigurationTaskSpec.kt similarity index 96% rename from src/test/kotlin/org/jetbrains/intellij/tasks/VerifyPluginConfigurationTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginConfigurationTaskSpec.kt index 882139a7c5..2c24716377 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/VerifyPluginConfigurationTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginConfigurationTaskSpec.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.internal.impldep.org.testng.annotations.BeforeTest -import org.jetbrains.intellij.IntelliJPluginConstants.VERIFY_PLUGIN_CONFIGURATION_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_CONFIGURATION_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import java.io.File import kotlin.test.Test diff --git a/src/test/kotlin/org/jetbrains/intellij/tasks/VerifyPluginTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginTaskSpec.kt similarity index 96% rename from src/test/kotlin/org/jetbrains/intellij/tasks/VerifyPluginTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginTaskSpec.kt index 0ca5afa7c3..95432de09a 100644 --- a/src/test/kotlin/org/jetbrains/intellij/tasks/VerifyPluginTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginTaskSpec.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks -import org.jetbrains.intellij.IntelliJPluginConstants.VERIFY_PLUGIN_TASK_NAME -import org.jetbrains.intellij.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import kotlin.test.Test @Suppress("PluginXmlCapitalization", "PluginXmlValidity", "ComplexRedundantLet") diff --git a/src/test/kotlin/org/jetbrains/intellij/test/localIdeTestUtils.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/test/localIdeTestUtils.kt similarity index 93% rename from src/test/kotlin/org/jetbrains/intellij/test/localIdeTestUtils.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/test/localIdeTestUtils.kt index e91ad2a37a..ef7b7bd979 100644 --- a/src/test/kotlin/org/jetbrains/intellij/test/localIdeTestUtils.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/test/localIdeTestUtils.kt @@ -1,11 +1,11 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.test +package org.jetbrains.intellij.platform.gradleplugin.test import com.jetbrains.plugin.structure.base.utils.createDir import com.jetbrains.plugin.structure.base.utils.exists import com.jetbrains.plugin.structure.base.utils.forceDeleteIfExists -import org.jetbrains.intellij.IntelliJPluginConstants.DEFAULT_INTELLIJ_REPOSITORY +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_INTELLIJ_REPOSITORY import java.io.File import java.net.URL import java.nio.file.Files diff --git a/src/testFixtures/kotlin/org/jetbrains/intellij/IntelliJPlatformTestBase.kt b/src/testFixtures/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformTestBase.kt similarity index 99% rename from src/testFixtures/kotlin/org/jetbrains/intellij/IntelliJPlatformTestBase.kt rename to src/testFixtures/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformTestBase.kt index 0634d72d90..1678edd20e 100644 --- a/src/testFixtures/kotlin/org/jetbrains/intellij/IntelliJPlatformTestBase.kt +++ b/src/testFixtures/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformTestBase.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij +package org.jetbrains.intellij.platform.gradleplugin import org.gradle.testkit.runner.BuildResult import org.gradle.testkit.runner.GradleRunner From 74d52fa8cddb001a33ed1d2135c06dcc451fab07 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Tue, 13 Jun 2023 09:30:49 +0200 Subject: [PATCH 005/347] Rename Gradle project --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index c354e357b7..8c051acbb6 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -11,7 +11,7 @@ plugins { id("org.gradle.toolchains.foojay-resolver-convention") version("0.5.0") } -rootProject.name = "gradle-intellij-plugin" +rootProject.name = "IntelliJ Platform Gradle Plugin" gradleEnterprise { buildScan { From d334a9e0ae711dcc7116f131197319a7b01900ab Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Thu, 13 Jul 2023 10:34:16 +0200 Subject: [PATCH 006/347] Cleanup after the merge with master branch --- .../platform/gradleplugin/IntelliJPlugin.kt | 78 +------------------ .../IntelliJPlatformArgumentProvider.kt | 8 +- .../LaunchSystemArgumentProvider.kt | 6 +- .../PerformanceTestArgumentProvider.kt | 2 +- .../PluginPathArgumentProvider.kt | 2 +- ...loadAndroidStudioProductReleasesXmlTask.kt | 4 +- .../DownloadIdeaProductReleasesXmlTask.kt | 2 +- .../platform/gradleplugin/tasks/RunIdeBase.kt | 10 ++- .../tasks/RunIdePerformanceTestTask.kt | 8 +- 9 files changed, 26 insertions(+), 94 deletions(-) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/propertyProviders/IntelliJPlatformArgumentProvider.kt (87%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/propertyProviders/LaunchSystemArgumentProvider.kt (87%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/propertyProviders/PerformanceTestArgumentProvider.kt (95%) rename src/main/kotlin/org/jetbrains/intellij/{ => platform/gradleplugin}/propertyProviders/PluginPathArgumentProvider.kt (90%) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlugin.kt index 86b9a74402..849cef7570 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlugin.kt @@ -108,81 +108,6 @@ import org.jetbrains.intellij.platform.gradleplugin.jbr.JbrResolver import org.jetbrains.intellij.platform.gradleplugin.model.MavenMetadata import org.jetbrains.intellij.platform.gradleplugin.model.XmlExtractor import org.jetbrains.intellij.platform.gradleplugin.performanceTest.ProfilerName -import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANNOTATIONS_DEPENDENCY_VERSION -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_PLUGIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_SEARCHABLE_OPTIONS_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.CLASSPATH_INDEX_CLEANUP_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.COMPILE_KOTLIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_IDEA_VERSION -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_INTELLIJ_REPOSITORY -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_SANDBOX -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ZIP_SIGNER_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.EXTENSION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_GRADLE_PLUGIN_ID -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PLUGINS_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PRODUCTS_RELEASES_URL -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_PREFIX -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENT_CODE_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENT_TEST_CODE_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEFAULT_DEPENDENCIES_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_COMPILER_ANT_TASKS_MAVEN_METADATA -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.KOTLIN_GRADLE_PLUGIN_ID -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.LIST_BUNDLED_PLUGINS_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MARKETPLACE_HOST -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PATCH_PLUGIN_XML_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PERFORMANCE_PLUGIN_ID -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PERFORMANCE_TEST_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_CLION -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_COMMUNITY -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_PHPSTORM -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_PYCHARM -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_RIDER -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_PATH -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_XML_DIR_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_SANDBOX_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_TESTING_SANDBOX_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_UI_TESTING_SANDBOX_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PRINT_BUNDLED_PLUGINS_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PRINT_PRODUCTS_RELEASES_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PUBLISH_PLUGIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_EAP -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_EAP_CANDIDATE -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_TYPE_RELEASES -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_FOR_UI_TESTS_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_PERFORMANCE_TEST_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SEARCHABLE_OPTIONS_DIR_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SETUP_INSTRUMENT_CODE_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SIGN_PLUGIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_CONFIGURATION_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_SIGNATURE_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERSION_LATEST -import org.jetbrains.intellij.platform.gradleplugin.dependency.* -import org.jetbrains.intellij.platform.gradleplugin.jbr.JbrResolver -import org.jetbrains.intellij.platform.gradleplugin.model.MavenMetadata -import org.jetbrains.intellij.platform.gradleplugin.model.XmlExtractor -import org.jetbrains.intellij.platform.gradleplugin.performanceTest.ProfilerName -import org.jetbrains.intellij.platform.gradleplugin.tasks.* -import org.jetbrains.intellij.platform.gradleplugin.utils.* -import org.jetbrains.intellij.platform.gradleplugin.pluginRepository.PluginRepositoryFactory import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.IntelliJPlatformArgumentProvider import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.LaunchSystemArgumentProvider import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.PluginPathArgumentProvider @@ -191,6 +116,9 @@ import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader import org.jetbrains.intellij.platform.gradleplugin.utils.ivyRepository import org.jetbrains.intellij.platform.gradleplugin.utils.mavenRepository +import org.jetbrains.intellij.pluginRepository.PluginRepositoryFactory +import org.jetbrains.intellij.tasks.DownloadAndroidStudioProductReleasesXmlTask +import org.jetbrains.intellij.tasks.DownloadIdeaProductReleasesXmlTask import org.jetbrains.kotlin.gradle.dsl.kotlinExtension import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import java.io.File diff --git a/src/main/kotlin/org/jetbrains/intellij/propertyProviders/IntelliJPlatformArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt similarity index 87% rename from src/main/kotlin/org/jetbrains/intellij/propertyProviders/IntelliJPlatformArgumentProvider.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt index 4c602a9368..aab70a7c96 100644 --- a/src/main/kotlin/org/jetbrains/intellij/propertyProviders/IntelliJPlatformArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.propertyProviders +package org.jetbrains.intellij.platform.gradleplugin.propertyProviders import com.jetbrains.plugin.structure.base.utils.exists import com.jetbrains.plugin.structure.base.utils.readLines @@ -9,9 +9,9 @@ import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.gradle.process.CommandLineArgumentProvider import org.gradle.process.JavaForkOptions -import org.jetbrains.intellij.ideProductInfo -import org.jetbrains.intellij.resolveIdeHomeVariable -import org.jetbrains.intellij.utils.OpenedPackages +import org.jetbrains.intellij.platform.gradleplugin.ideProductInfo +import org.jetbrains.intellij.platform.gradleplugin.resolveIdeHomeVariable +import org.jetbrains.intellij.platform.gradleplugin.utils.OpenedPackages import java.nio.file.Path class IntelliJPlatformArgumentProvider( diff --git a/src/main/kotlin/org/jetbrains/intellij/propertyProviders/LaunchSystemArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt similarity index 87% rename from src/main/kotlin/org/jetbrains/intellij/propertyProviders/LaunchSystemArgumentProvider.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt index ef7918536c..b1856c2a15 100644 --- a/src/main/kotlin/org/jetbrains/intellij/propertyProviders/LaunchSystemArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt @@ -1,13 +1,13 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.propertyProviders +package org.jetbrains.intellij.platform.gradleplugin.propertyProviders import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.gradle.process.CommandLineArgumentProvider -import org.jetbrains.intellij.ideProductInfo -import org.jetbrains.intellij.resolveIdeHomeVariable +import org.jetbrains.intellij.platform.gradleplugin.ideProductInfo +import org.jetbrains.intellij.platform.gradleplugin.resolveIdeHomeVariable import java.io.File import java.nio.file.Path diff --git a/src/main/kotlin/org/jetbrains/intellij/propertyProviders/PerformanceTestArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/PerformanceTestArgumentProvider.kt similarity index 95% rename from src/main/kotlin/org/jetbrains/intellij/propertyProviders/PerformanceTestArgumentProvider.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/PerformanceTestArgumentProvider.kt index 5c1a343cbd..ad7d005d33 100644 --- a/src/main/kotlin/org/jetbrains/intellij/propertyProviders/PerformanceTestArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/PerformanceTestArgumentProvider.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.propertyProviders +package org.jetbrains.intellij.platform.gradleplugin.propertyProviders import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.PathSensitive diff --git a/src/main/kotlin/org/jetbrains/intellij/propertyProviders/PluginPathArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/PluginPathArgumentProvider.kt similarity index 90% rename from src/main/kotlin/org/jetbrains/intellij/propertyProviders/PluginPathArgumentProvider.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/PluginPathArgumentProvider.kt index a4cedeb5c9..9b80ed5d46 100644 --- a/src/main/kotlin/org/jetbrains/intellij/propertyProviders/PluginPathArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/PluginPathArgumentProvider.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.propertyProviders +package org.jetbrains.intellij.platform.gradleplugin.propertyProviders import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.PathSensitive diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt index 162c4c5c81..fd20f53b92 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt @@ -7,8 +7,8 @@ import org.gradle.api.tasks.CacheableTask import org.gradle.api.tasks.Input import org.gradle.api.tasks.Optional import org.gradle.api.tasks.Sync -import org.jetbrains.intellij.IntelliJPluginConstants -import org.jetbrains.intellij.logCategory +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants +import org.jetbrains.intellij.platform.gradleplugin.logCategory @CacheableTask abstract class DownloadAndroidStudioProductReleasesXmlTask : Sync() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIdeaProductReleasesXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIdeaProductReleasesXmlTask.kt index 4bf8d8959c..95bf131b13 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIdeaProductReleasesXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIdeaProductReleasesXmlTask.kt @@ -4,7 +4,7 @@ package org.jetbrains.intellij.tasks import org.gradle.api.provider.Property import org.gradle.api.tasks.* -import org.jetbrains.intellij.IntelliJPluginConstants +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants import java.io.File @CacheableTask diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeBase.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeBase.kt index 947c951a9b..02af46544f 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeBase.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeBase.kt @@ -17,8 +17,8 @@ import org.jetbrains.intellij.platform.gradleplugin.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.GITHUB_REPOSITORY import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_ULTIMATE import org.jetbrains.intellij.platform.gradleplugin.jbr.JbrResolver -import org.jetbrains.intellij.propertyProviders.IntelliJPlatformArgumentProvider -import org.jetbrains.intellij.propertyProviders.LaunchSystemArgumentProvider +import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.IntelliJPlatformArgumentProvider +import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.LaunchSystemArgumentProvider import java.io.File import java.nio.file.Files import java.nio.file.Path @@ -216,13 +216,15 @@ abstract class RunIdeBase : JavaExec() { private fun configureSystemProperties() { systemProperties(systemProperties) - jvmArgumentProviders.add(LaunchSystemArgumentProvider( + jvmArgumentProviders.add( + LaunchSystemArgumentProvider( ideDirPath, configDir.get(), systemDir.get(), pluginsDir.get().asFile, requiredPluginIds.get(), - )) + ) + ) val operatingSystem = OperatingSystem.current() val userDefinedSystemProperties = systemProperties diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdePerformanceTestTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdePerformanceTestTask.kt index bca361e01e..6cf7421e67 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdePerformanceTestTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdePerformanceTestTask.kt @@ -20,7 +20,7 @@ import org.jetbrains.intellij.platform.gradleplugin.performanceTest.ProfilerName import org.jetbrains.intellij.platform.gradleplugin.performanceTest.TestExecutionFailException import org.jetbrains.intellij.platform.gradleplugin.performanceTest.parsers.IdeaLogParser import org.jetbrains.intellij.platform.gradleplugin.performanceTest.parsers.SimpleIJPerformanceParser -import org.jetbrains.intellij.propertyProviders.PerformanceTestArgumentProvider +import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.PerformanceTestArgumentProvider import java.nio.file.Files import java.nio.file.Path import java.nio.file.Paths @@ -89,11 +89,13 @@ abstract class RunIdePerformanceTestTask : RunIdeBase() { // Passing to the IDE project to open args = listOf("${testDataDir.get()}/${testScript.projectName}") - jvmArgumentProviders.add(PerformanceTestArgumentProvider( + jvmArgumentProviders.add( + PerformanceTestArgumentProvider( scriptPath, testArtifactsDirPath, profilerName.get().name.lowercase(), - )) + ) + ) super.exec() IdeaLogParser(testArtifactsDirPath.resolve("idea.log").toAbsolutePath().toString()) From ead9839ae10dc1bffcbd8c3064572fe3817971cb Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 17 Jul 2023 11:25:03 +0200 Subject: [PATCH 007/347] Update minimal supported Gradle version to `8.0` --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .../workflows/reusable-integrationTests.yml | 2 +- .github/workflows/reusable-unitTests.yml | 2 +- .teamcity/settings.kts | 2 +- CHANGELOG.md | 1 + INTEGRATION_TESTS.md | 4 ++-- .../platform/gradleplugin/IntelliJPlugin.kt | 21 +++++++------------ .../gradleplugin/IntelliJPluginConstants.kt | 2 +- 8 files changed, 15 insertions(+), 21 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 0c8b54d5fe..e7834aa2d4 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -21,7 +21,7 @@ A clear and concise description of what you expected to happen. **Environment:** - OS: [e.g. macOS] - IntelliJ Platform Gradle Plugin Version [e.g. 2.0] - - Gradle Version [e.g. 7.4.2] + - Gradle Version [e.g. 8.2.1] **Additional context** Add any other context about the problem here. diff --git a/.github/workflows/reusable-integrationTests.yml b/.github/workflows/reusable-integrationTests.yml index 6d74bf063d..c9e0724bc8 100644 --- a/.github/workflows/reusable-integrationTests.yml +++ b/.github/workflows/reusable-integrationTests.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: gradleVersion: - - "7.6" + - "8.0" - "8.2.1" os: - windows-latest diff --git a/.github/workflows/reusable-unitTests.yml b/.github/workflows/reusable-unitTests.yml index b1fa2a475c..9635312f76 100644 --- a/.github/workflows/reusable-unitTests.yml +++ b/.github/workflows/reusable-unitTests.yml @@ -29,7 +29,7 @@ jobs: fail-fast: false matrix: gradleVersion: - - "7.6" + - "8.0" - "8.2.1" os: - windows-latest diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts index 7de67deab7..25720c97ad 100644 --- a/.teamcity/settings.kts +++ b/.teamcity/settings.kts @@ -44,7 +44,7 @@ project { } val operatingSystems = listOf("Linux", "Windows", "macOS") - val gradleVersions = listOf("7.6", "8.2.1") + val gradleVersions = listOf("8.0", "8.2.1") val buildChain = sequential { operatingSystems.forEach { os -> diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d1f449b20..e47d99f690 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - New project ID: `org.jetbrains.intellij.platform` - New Maven coordinates: `org.jetbrains.intellij.platform:intellij-platform-gradle-plugin` - Move classes under the new package: `org.jetbrains.intellij.platform.gradleplugin` +- Update minimal supported Gradle version to `8.0` - Disabled caching for `BuildPluginTask` ## [1.15.0] - 2023-07-07 diff --git a/INTEGRATION_TESTS.md b/INTEGRATION_TESTS.md index d9886e4abe..f9dfe3838a 100644 --- a/INTEGRATION_TESTS.md +++ b/INTEGRATION_TESTS.md @@ -13,8 +13,8 @@ Each of the Integration Tests is a standalone project that focuses on a specific Running Integration Tests is based on GitHub Actions and makes use of the matrix build so that we can run all tests with variations of different properties: - Operating systems: macOS, Windows, Linux - Gradle versions: - - first supported: `7.3` - - latest available: `7.6.1` + - first supported: `8.0` + - latest available: `8.2.1` - IntelliJ IDEA SDK versions: - latest stable: `2021.3.3` diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlugin.kt index 849cef7570..247cc57663 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlugin.kt @@ -33,7 +33,6 @@ import org.gradle.kotlin.dsl.* import org.gradle.language.jvm.tasks.ProcessResources import org.gradle.plugins.ide.idea.model.IdeaModel import org.gradle.plugins.ide.idea.model.IdeaProject -import org.gradle.util.GradleVersion import org.jetbrains.gradle.ext.IdeaExtPlugin import org.jetbrains.gradle.ext.ProjectSettings import org.jetbrains.gradle.ext.TaskTriggersConfig @@ -1244,15 +1243,13 @@ abstract class IntelliJPlugin : Plugin { dependsOn(PREPARE_TESTING_SANDBOX_TASK_NAME) finalizedBy(CLASSPATH_INDEX_CLEANUP_TASK_NAME) - if (GradleVersion.current() >= GradleVersion.version("8.0")) { // TODO: remove in 2.0 as Gradle 8 will become the minimum supported version - jbrResolver.resolveRuntime( - jbrVersion = jbrVersionProvider.orNull, - jbrVariant = jbrVariantProvider.orNull, - jbrArch = jbrArchProvider.orNull, - ideDir = ideDirProvider.map { it.toFile() }.orNull, - )?.let { - executable = it.toString() - } + jbrResolver.resolveRuntime( + jbrVersion = jbrVersionProvider.orNull, + jbrVariant = jbrVariantProvider.orNull, + jbrArch = jbrArchProvider.orNull, + ideDir = ideDirProvider.map { it.toFile() }.orNull, + )?.let { + executable = it.toString() } classpath = instrumentedCodeOutputsProvider.get() + instrumentedTestCodeOutputsProvider.get() + classpath @@ -1406,10 +1403,6 @@ abstract class IntelliJPlugin : Plugin { ) ) - onlyIf { - // Workaround for Gradle 7.x to don't fail on "An input file was expected to be present but it doesn't exist." - inputArchiveFile.isSpecified - } dependsOn(SIGN_PLUGIN_TASK_NAME) } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index 6f4edd6f56..3c27fbb91b 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -91,7 +91,7 @@ object IntelliJPluginConstants { const val ANNOTATIONS_DEPENDENCY_VERSION = "24.0.0" const val DEFAULT_IDEA_VERSION = "LATEST-EAP-SNAPSHOT" - const val MINIMAL_SUPPORTED_GRADLE_VERSION = "7.6" + const val MINIMAL_SUPPORTED_GRADLE_VERSION = "8.0" const val RELEASE_SUFFIX_EAP = "-EAP-SNAPSHOT" const val RELEASE_SUFFIX_EAP_CANDIDATE = "-EAP-CANDIDATE-SNAPSHOT" From 27d3e0302d6ce0cb8bf8477a680c62b8aa2a7e99 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 17 Jul 2023 15:57:47 +0200 Subject: [PATCH 008/347] Initial multi-plugin structure --- build.gradle.kts | 32 ++++++++++++-- gradle.properties | 4 -- .../gradleplugin/IntelliJPluginConstants.kt | 3 +- .../extensions/IntelliJPlatformExtension.kt | 6 +++ .../plugins/IntelliJPlatformBasePlugin.kt | 35 +++++++++++++++ .../IntelliJPlatformDependenciesPlugin.kt | 28 ++++++++++++ .../IntelliJPlatformPlugin.kt} | 27 +++++++++--- .../plugins/IntelliJPlatformTasksPlugin.kt | 28 ++++++++++++ .../tasks/UnbindSetupDependenciesTask.kt | 44 +++++++++++++++++++ .../intellij/platform/gradleplugin/utils.kt | 5 ++- 10 files changed, 194 insertions(+), 18 deletions(-) create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformDependenciesPlugin.kt rename src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/{IntelliJPlugin.kt => plugins/IntelliJPlatformPlugin.kt} (98%) create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/UnbindSetupDependenciesTask.kt diff --git a/build.gradle.kts b/build.gradle.kts index 18ad7ee25b..7bb653b5cd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -198,9 +198,33 @@ gradlePlugin { vcsUrl.set(properties("vcsUrl")) plugins.create("intellijPlugin") { - id = properties("pluginId").get() - displayName = properties("pluginDisplayName").get() - implementationClass = properties("pluginImplementationClass").get() + id = "org.jetbrains.intellij.platform" + displayName = "IntelliJ Platform Gradle Plugin" + implementationClass = "org.jetbrains.intellij.platform.gradleplugin.plugins.IntelliJPlatformPlugin" + description = project.description + tags.set(properties("tags").map { it.split(',') }) + } + + plugins.create("intellijPluginBase") { + id = "org.jetbrains.intellij.platform.base" + displayName = "IntelliJ Platform Gradle Plugin (base)" + implementationClass = "org.jetbrains.intellij.platform.gradleplugin.plugins.IntelliJPlatformBasePlugin" + description = project.description + tags.set(properties("tags").map { it.split(',') }) + } + + plugins.create("intellijPluginDependencies") { + id = "org.jetbrains.intellij.platform.dependencies" + displayName = "IntelliJ Platform Gradle Plugin (dependencies)" + implementationClass = "org.jetbrains.intellij.platform.gradleplugin.plugins.IntelliJPlatformDependenciesPlugin" + description = project.description + tags.set(properties("tags").map { it.split(',') }) + } + + plugins.create("intellijPluginTasks") { + id = "org.jetbrains.intellij.platform.tasks" + displayName = "IntelliJ Platform Gradle Plugin (tasks)" + implementationClass = "org.jetbrains.intellij.platform.gradleplugin.plugins.IntelliJPlatformTasksPlugin" description = project.description tags.set(properties("tags").map { it.split(',') }) } @@ -228,7 +252,7 @@ publishing { from(components["java"]) pom { - name.set(properties("pluginDisplayName")) + name.set("IntelliJ Platform Gradle Plugin") description.set(project.description) url.set(properties("website")) diff --git a/gradle.properties b/gradle.properties index c70d6d7f71..19176e1f88 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,13 +3,9 @@ snapshotVersion=2.0 snapshot=false group=org.jetbrains.intellij.platform artifactId=intellij-platform-gradle-plugin -pluginId=org.jetbrains.intellij.platform description=The IntelliJ Platform Gradle Plugin is a plugin for the Gradle build system to help configure your environment for building, testing, verifying, and publishing plugins for IntelliJ-based IDEs.\ For more information, see [IntelliJ Platform Gradle Plugin documentation](https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html). -pluginDisplayName=IntelliJ Platform Gradle Plugin -pluginImplementationClass=org.jetbrains.intellij.platform.gradleplugin.IntelliJPlugin - website=https://github.com/JetBrains/gradle-intellij-plugin snapshotUrl=https://oss.sonatype.org/content/repositories/snapshots/ vcsUrl=https://github.com/JetBrains/gradle-intellij-plugin diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index 3c27fbb91b..1d9c58f833 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -6,7 +6,8 @@ object IntelliJPluginConstants { const val PLUGIN_NAME = "IntelliJ Platform Gradle Plugin" const val PLUGIN_ID = "org.jetbrains.intellij.platform" const val PLUGIN_GROUP_NAME = "intellij" - const val EXTENSION_NAME = "intellij" + const val EXTENSION_NAME = "intellijPlatform" + const val DEFAULT_SANDBOX = "idea-sandbox" const val BUILD_PLUGIN_TASK_NAME = "buildPlugin" diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt new file mode 100644 index 0000000000..6063adaa93 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt @@ -0,0 +1,6 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.extensions + +abstract class IntelliJPlatformExtension { +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt new file mode 100644 index 0000000000..61684cdd26 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt @@ -0,0 +1,35 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.plugins + +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.create +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.EXTENSION_NAME +import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion +import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension +import org.jetbrains.intellij.platform.gradleplugin.info +import org.jetbrains.intellij.platform.gradleplugin.logCategory + +abstract class IntelliJPlatformBasePlugin : Plugin { + + private lateinit var context: String + + override fun apply(project: Project) { + context = project.logCategory() + + info(context, "Configuring plugin: org.jetbrains.intellij.platform.base") + project.checkGradleVersion() + + applyExtension(project) + applyTasks(project) + } + + private fun applyExtension(project: Project) { + project.extensions.create(EXTENSION_NAME) + } + + private fun applyTasks(project: Project) { + + } +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformDependenciesPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformDependenciesPlugin.kt new file mode 100644 index 0000000000..07b9782b05 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformDependenciesPlugin.kt @@ -0,0 +1,28 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.plugins + +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.apply +import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion +import org.jetbrains.intellij.platform.gradleplugin.info +import org.jetbrains.intellij.platform.gradleplugin.logCategory + +abstract class IntelliJPlatformDependenciesPlugin : Plugin { + + private lateinit var context: String + + override fun apply(project: Project) { + context = project.logCategory() + + info(context, "Configuring plugin: org.jetbrains.intellij.platform.dependencies") + project.checkGradleVersion() + + applyPlugins(project) + } + + private fun applyPlugins(project: Project) { + project.plugins.apply(IntelliJPlatformBasePlugin::class) + } +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt similarity index 98% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlugin.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt index 247cc57663..ca3fe445af 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradleplugin.plugins import com.jetbrains.plugin.structure.base.utils.extension import com.jetbrains.plugin.structure.base.utils.hasExtension @@ -36,6 +36,7 @@ import org.gradle.plugins.ide.idea.model.IdeaProject import org.jetbrains.gradle.ext.IdeaExtPlugin import org.jetbrains.gradle.ext.ProjectSettings import org.jetbrains.gradle.ext.TaskTriggersConfig +import org.jetbrains.intellij.platform.gradleplugin.* import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANDROID_STUDIO_PRODUCTS_RELEASES_URL import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANNOTATIONS_DEPENDENCY_VERSION @@ -128,7 +129,7 @@ import java.time.LocalDateTime import java.time.format.DateTimeFormatter import java.util.* -abstract class IntelliJPlugin : Plugin { +abstract class IntelliJPlatformPlugin : Plugin { private lateinit var archiveUtils: ArchiveUtils private lateinit var dependenciesDownloader: DependenciesDownloader @@ -136,9 +137,15 @@ abstract class IntelliJPlugin : Plugin { private lateinit var context: String override fun apply(project: Project) { + context = project.logCategory() + + info(context, "Configuring plugin: org.jetbrains.intellij.platform") project.checkGradleVersion() - context = project.logCategory() + + applyPlugins(project) + + return archiveUtils = project.objects.newInstance() dependenciesDownloader = project.objects.newInstance(project.gradle.startParameter.isOffline) @@ -192,6 +199,12 @@ abstract class IntelliJPlugin : Plugin { configureTasks(project, extension, ideaDependencyProvider) } + private fun applyPlugins(project: Project) { + project.plugins.apply(IntelliJPlatformBasePlugin::class) + project.plugins.apply(IntelliJPlatformDependenciesPlugin::class) + project.plugins.apply(IntelliJPlatformTasksPlugin::class) + } + private fun configureTasks(project: Project, extension: IntelliJPluginExtension, ideaDependencyProvider: Provider) { info(context, "Configuring plugin") project.tasks.withType { @@ -386,7 +399,7 @@ abstract class IntelliJPlugin : Plugin { private fun configureProjectAfterEvaluate(project: Project, extension: IntelliJPluginExtension, ideaDependencyProvider: Provider) { project.subprojects.forEach { subproject -> - if (subproject.plugins.findPlugin(IntelliJPlugin::class) == null) { + if (subproject.plugins.findPlugin(IntelliJPlatformPlugin::class) == null) { subproject.extensions.findByType()?.let { configureProjectAfterEvaluate(subproject, it, ideaDependencyProvider) } @@ -443,7 +456,7 @@ abstract class IntelliJPlugin : Plugin { private fun configureProjectPluginTasksDependency(dependency: Project, task: PrepareSandboxTask) { // invoke before tasks graph is ready - if (dependency.plugins.findPlugin(IntelliJPlugin::class) == null) { + if (dependency.plugins.findPlugin(IntelliJPlatformPlugin::class) == null) { throw BuildException("Cannot use '$dependency' as a plugin dependency. IntelliJ Plugin not found: ${dependency.plugins}") } dependency.tasks.named(PREPARE_SANDBOX_TASK_NAME) { @@ -453,7 +466,7 @@ abstract class IntelliJPlugin : Plugin { private fun configureProjectPluginDependency(project: Project, dependency: Project, dependencies: DependencySet, extension: IntelliJPluginExtension) { // invoke on demand when plugin artifacts are needed - if (dependency.plugins.findPlugin(IntelliJPlugin::class) == null) { + if (dependency.plugins.findPlugin(IntelliJPlatformPlugin::class) == null) { throw BuildException("Cannot use '$dependency' as a plugin dependency. IntelliJ Plugin not found: ${dependency.plugins}") } dependencies.add(project.dependencies.create(dependency)) @@ -1094,7 +1107,7 @@ abstract class IntelliJPlugin : Plugin { val closestCompilerVersion = URL(JAVA_COMPILER_ANT_TASKS_MAVEN_METADATA).openStream().use { inputStream -> val version = Version.parse(compilerVersion) XmlExtractor().unmarshal(inputStream).versioning?.versions - ?.map(Version::parse)?.filter { it <= version } + ?.map(Version.Companion::parse)?.filter { it <= version } ?.maxOf { it } ?.version } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt new file mode 100644 index 0000000000..7e64d806e7 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt @@ -0,0 +1,28 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.plugins + +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.apply +import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion +import org.jetbrains.intellij.platform.gradleplugin.info +import org.jetbrains.intellij.platform.gradleplugin.logCategory + +abstract class IntelliJPlatformTasksPlugin : Plugin { + + private lateinit var context: String + + override fun apply(project: Project) { + context = project.logCategory() + + info(context, "Configuring plugin: org.jetbrains.intellij.platform.tasks") + project.checkGradleVersion() + + applyPlugins(project) + } + + private fun applyPlugins(project: Project) { + project.plugins.apply(IntelliJPlatformBasePlugin::class) + } +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/UnbindSetupDependenciesTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/UnbindSetupDependenciesTask.kt new file mode 100644 index 0000000000..cacbc7e32b --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/UnbindSetupDependenciesTask.kt @@ -0,0 +1,44 @@ +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.tasks + +import org.gradle.api.DefaultTask +import org.gradle.api.provider.Property +import org.gradle.api.tasks.Internal +import org.gradle.api.tasks.TaskAction +import org.gradle.work.DisableCachingByDefault +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.dependency.IdeaDependency +import org.jetbrains.intellij.platform.gradleplugin.info +import org.jetbrains.intellij.platform.gradleplugin.logCategory + +/** + * Setups required dependencies for building and running project. + * + * This task is automatically added to the ["After Sync" Gradle trigger](https://www.jetbrains.com/help/idea/work-with-gradle-tasks.html#config_triggers_gradle) to make the IntelliJ SDK dependency available for IntelliJ IDEA right after the Gradle synchronization. + * + * > After removing the IntelliJ Platform Gradle Plugin from your project, the `Task 'setupDependencies' not found in root project` exception may occur. + * + * @see Frequently Asked Questions + */ +@DisableCachingByDefault(because = "No output state to track") +abstract class UnbindSetupDependenciesTask : DefaultTask() { + + /** + * Reference to the resolved `idea` dependency. + */ + @get:Internal + abstract val idea: Property + + private val context = logCategory() + + init { + group = PLUGIN_GROUP_NAME + description = "Sets up required dependencies for building and running project." + } + + @TaskAction + fun setupDependencies() { + info(context, "Setting up dependencies using: ${idea.get().classes}") + } +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt index 5a66d0feca..87edb7c24a 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt @@ -45,6 +45,7 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELE import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_TYPE_SNAPSHOTS import org.jetbrains.intellij.platform.gradleplugin.dependency.IdeaDependency import org.jetbrains.intellij.platform.gradleplugin.model.ProductInfo +import org.jetbrains.intellij.platform.gradleplugin.plugins.IntelliJPlatformPlugin import java.io.File import java.io.StringWriter import java.net.HttpURLConnection @@ -201,7 +202,7 @@ fun warn(logCategory: String? = null, message: String, e: Throwable? = null) = l fun info(logCategory: String? = null, message: String, e: Throwable? = null) = log(LogLevel.INFO, logCategory, message, e) fun debug(logCategory: String? = null, message: String, e: Throwable? = null) = log(LogLevel.DEBUG, logCategory, message, e) -private val logger = Logging.getLogger(IntelliJPlugin::class.java) +private val logger = Logging.getLogger(IntelliJPlatformPlugin::class.java) private fun log(level: LogLevel, logCategory: String?, message: String, e: Throwable?) { val category = "gradle-intellij-plugin ${logCategory.orEmpty()}".trim() @@ -296,7 +297,7 @@ internal fun Project.checkGradleVersion() { } } -internal fun getCurrentPluginVersion() = IntelliJPlugin::class.java +internal fun getCurrentPluginVersion() = IntelliJPlatformPlugin::class.java .run { getResource("$simpleName.class") } .runCatching { val manifestPath = with(this?.path) { From 3e566e3c23bea49f14a5b13c11f5861991ae0ed1 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Fri, 18 Aug 2023 13:26:30 +0200 Subject: [PATCH 009/347] - Added `org.jetbrains.intellij.buildFeature.useCacheRedirector` build feature - Added `IntelliJPlatformCollectorTransformer` and `IntelliJPlatformExtractTransformer` for handling IntelliJ Platform dependency archives - Added `jetbrainsAnnotations` dependency helper for adding JetBrains Annotations dependency - Added general `intellijPlatform` along with product-specific dependency helpers for adding IntelliJ Platform dependency --- CHANGELOG.md | 4 + build.gradle.kts | 91 ++++++----- gradle.properties | 4 +- .../platform/gradleplugin/BuildFeature.kt | 23 +-- .../gradleplugin/DependenciesUtils.kt | 16 ++ .../IntelliJIvyDescriptorFileGenerator.kt | 5 +- .../gradleplugin/IntelliJPlatformType.kt | 28 ++++ .../gradleplugin/IntelliJPluginConstants.kt | 40 ++--- .../gradleplugin/IntelliJPluginExtension.kt | 11 +- .../IntelliJPlatformCollectorTransformer.kt | 83 ++++++++++ .../IntelliJPlatformExtractTransformer.kt | 106 +++++++++++++ .../dependencies/intellijPlatform.kt | 113 ++++++++++++++ .../dependencies/jetbrainsAnnotations.kt | 21 +++ .../gradleplugin/dependency/IdeaDependency.kt | 1 + .../dependency/IdeaDependencyManager.kt | 147 ++++++++---------- .../extensions/IntelliJPlatformExtension.kt | 2 +- .../platform/gradleplugin/jbr/JbrResolver.kt | 2 +- .../plugins/IntelliJPlatformBasePlugin.kt | 36 ++++- .../IntelliJPlatformDependenciesPlugin.kt | 28 ---- .../plugins/IntelliJPlatformPlugin.kt | 133 +++++++--------- .../plugins/IntelliJPlatformSettingsPlugin.kt | 20 +++ .../plugins/IntelliJPlatformTasksPlugin.kt | 2 +- .../gradleplugin/repositories/intellij.kt | 70 +++++++++ .../tasks/ListProductsReleasesTask.kt | 12 +- .../platform/gradleplugin/tasks/RunIdeBase.kt | 4 +- .../tasks/RunPluginVerifierTask.kt | 31 ++-- .../intellij/platform/gradleplugin/utils.kt | 29 +--- 27 files changed, 721 insertions(+), 341 deletions(-) create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/IntelliJPlatformCollectorTransformer.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/IntelliJPlatformExtractTransformer.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsAnnotations.kt delete mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformDependenciesPlugin.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformSettingsPlugin.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellij.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index a618ffceb0..4aaac5e988 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ ### Added - Configure all tasks that extend task classes instead of just those created by the plugin - Make JbrResolver prefer Gradle javaToolchains by `JetBrains s.r.o`, if available. Only otherwise start fetching and running a new one. +- Added `org.jetbrains.intellij.buildFeature.useCacheRedirector` build feature +- Added `IntelliJPlatformCollectorTransformer` and `IntelliJPlatformExtractTransformer` for handling IntelliJ Platform dependency archives +- Added `jetbrainsAnnotations` dependency helper for adding JetBrains Annotations dependency +- Added general `intellijPlatform` along with product-specific dependency helpers for adding IntelliJ Platform dependency ### Changed - New project name: IntelliJ Platform Gradle Plugin diff --git a/build.gradle.kts b/build.gradle.kts index 7bb653b5cd..ca77c69867 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,7 +18,8 @@ plugins { alias(libs.plugins.dokka) } -version = when (properties("snapshot").get().toBoolean()) { +val isSnapshot = properties("snapshot").get().toBoolean() +version = when (isSnapshot) { true -> properties("snapshotVersion").map { "$it-SNAPSHOT" } false -> properties("version") }.get() @@ -213,10 +214,10 @@ gradlePlugin { tags.set(properties("tags").map { it.split(',') }) } - plugins.create("intellijPluginDependencies") { - id = "org.jetbrains.intellij.platform.dependencies" - displayName = "IntelliJ Platform Gradle Plugin (dependencies)" - implementationClass = "org.jetbrains.intellij.platform.gradleplugin.plugins.IntelliJPlatformDependenciesPlugin" + plugins.create("intellijPluginSettings") { + id = "org.jetbrains.intellij.platform.settings" + displayName = "IntelliJ Platform Gradle Plugin (settings)" + implementationClass = "org.jetbrains.intellij.platform.gradleplugin.plugins.IntelliJPlatformSettingsPlugin" description = project.description tags.set(properties("tags").map { it.split(',') }) } @@ -244,47 +245,53 @@ publishing { } } publications { - create("snapshot") { + create("pluginMaven") { groupId = properties("group").get() artifactId = properties("artifactId").get() version = version.toString() - - from(components["java"]) - - pom { - name.set("IntelliJ Platform Gradle Plugin") - description.set(project.description) - url.set(properties("website")) - - packaging = "jar" - - scm { - connection.set(properties("scmUrl")) - developerConnection.set(properties("scmUrl")) - url.set(properties("vcsUrl")) - } - - licenses { - license { - name.set("The Apache License, Version 2.0") - url.set("https://github.com/JetBrains/gradle-intellij-plugin/blob/master/LICENSE") - } - } - - developers { - developer { - id.set("zolotov") - name.set("Alexander Zolotov") - email.set("zolotov@jetbrains.com") - } - developer { - id.set("hsz") - name.set("Jakub Chrzanowski") - email.set("jakub.chrzanowski@jetbrains.com") - } - } - } } + +// create("snapshot") { +// groupId = properties("group").get() +// artifactId = properties("artifactId").get() +// version = version.toString() +// +// from(components["java"]) +// +// pom { +// name.set("IntelliJ Platform Gradle Plugin") +// description.set(project.description) +// url.set(properties("website")) +// +// packaging = "jar" +// +// scm { +// connection.set(properties("scmUrl")) +// developerConnection.set(properties("scmUrl")) +// url.set(properties("vcsUrl")) +// } +// +// licenses { +// license { +// name.set("The Apache License, Version 2.0") +// url.set("https://github.com/JetBrains/gradle-intellij-plugin/blob/master/LICENSE") +// } +// } +// +// developers { +// developer { +// id.set("zolotov") +// name.set("Alexander Zolotov") +// email.set("zolotov@jetbrains.com") +// } +// developer { +// id.set("hsz") +// name.set("Jakub Chrzanowski") +// email.set("jakub.chrzanowski@jetbrains.com") +// } +// } +// } +// } } } diff --git a/gradle.properties b/gradle.properties index afa85ac744..74a127625a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -version=1.15.0 -snapshotVersion=2.0 +version=2.0.0 +snapshotVersion=2.0.1 snapshot=false group=org.jetbrains.intellij.platform artifactId=intellij-platform-gradle-plugin diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeature.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeature.kt index 891fc62c44..036efa07df 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeature.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeature.kt @@ -3,18 +3,19 @@ package org.jetbrains.intellij.platform.gradleplugin import org.gradle.api.Project +import org.gradle.api.provider.ProviderFactory import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_ID as prefix enum class BuildFeature(private val defaultValue: Boolean) { NO_SEARCHABLE_OPTIONS_WARNING(true), PAID_PLUGIN_SEARCHABLE_OPTIONS_WARNING(true), SELF_UPDATE_CHECK(true), + USE_CACHE_REDIRECTOR(true), ; - fun getValue(project: Project) = project.findProperty(toString()) - ?.toString() - ?.toBoolean() - .or { defaultValue } + fun getValue(providers: ProviderFactory) = providers.gradleProperty(toString()) + .map { it.toBoolean() } + .orElse(defaultValue) override fun toString() = name .lowercase() @@ -28,10 +29,12 @@ enum class BuildFeature(private val defaultValue: Boolean) { fun Project.isBuildFeatureEnabled(feature: BuildFeature) = feature - .getValue(this) - .apply { - when (this) { - true -> "Build feature is enabled: $feature" - false -> "Build feature is disabled: $feature" - }.also { info(logCategory(), it) } + .getValue(providers) + .map { value -> + value.also { + when (value) { + true -> "Build feature is enabled: $feature" + false -> "Build feature is disabled: $feature" + }.also { info(logCategory(), value.toString()) } + } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/DependenciesUtils.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/DependenciesUtils.kt index 9caf96cdc0..6a98c7b359 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/DependenciesUtils.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/DependenciesUtils.kt @@ -17,11 +17,16 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SETU import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginDependency import org.jetbrains.intellij.platform.gradleplugin.tasks.SetupDependenciesTask +@Deprecated("Deprecated in 2.0") fun Project.intellij() = intellijBase() +@Deprecated("Deprecated in 2.0") fun Project.intellij(filter: Closure<*>) = intellijBase().matching(filter) +@Deprecated("Deprecated in 2.0") fun Project.intellij(filter: Action) = intellijBase().matching(filter) +@Deprecated("Deprecated in 2.0") fun Project.intellij(filter: PatternFilterable) = intellijBase().matching(filter) +@Deprecated("Deprecated in 2.0") private fun Project.intellijBase(): FileTree { val setupDependenciesTaskProvider = project.tasks.named(SETUP_DEPENDENCIES_TASK_NAME) val ideaProvider = setupDependenciesTaskProvider.flatMap { setupDependenciesTask -> @@ -37,11 +42,16 @@ private fun Project.intellijBase(): FileTree { return ideaProvider.get() } +@Deprecated("Deprecated in 2.0") fun Project.intellijPlugin(plugin: String) = intellijPluginBase(plugin) +@Deprecated("Deprecated in 2.0") fun Project.intellijPlugin(plugin: String, filter: Closure<*>) = intellijPluginBase(plugin).matching(filter) +@Deprecated("Deprecated in 2.0") fun Project.intellijPlugin(plugin: String, filter: Action) = intellijPluginBase(plugin).matching(filter) +@Deprecated("Deprecated in 2.0") fun Project.intellijPlugin(plugin: String, filter: PatternFilterable) = intellijPluginBase(plugin).matching(filter) +@Deprecated("Deprecated in 2.0") private fun Project.intellijPluginBase(plugin: String): FileTree { val extension = extensions.getByType() @@ -56,6 +66,7 @@ private fun Project.intellijPluginBase(plugin: String): FileTree { return files(dependency.jarFiles).asFileTree } +@Deprecated("Deprecated in 2.0") fun Project.intellijPlugins(vararg plugins: String): FileCollection { val extension = extensions.getByType() val selectedPlugins = mutableSetOf() @@ -76,11 +87,16 @@ fun Project.intellijPlugins(vararg plugins: String): FileCollection { return files(selectedPlugins.map { it.jarFiles }) } +@Deprecated("Deprecated in 2.0") fun Project.intellijExtra(extra: String) = intellijExtraBase(extra) +@Deprecated("Deprecated in 2.0") fun Project.intellijExtra(extra: String, filter: Closure<*>) = intellijExtraBase(extra).matching(filter) +@Deprecated("Deprecated in 2.0") fun Project.intellijExtra(extra: String, filter: Action) = intellijExtraBase(extra).matching(filter) +@Deprecated("Deprecated in 2.0") fun Project.intellijExtra(extra: String, filter: PatternFilterable) = intellijExtraBase(extra).matching(filter) +@Deprecated("Deprecated in 2.0") private fun Project.intellijExtraBase(extra: String): FileTree { val setupDependenciesTaskProvider = project.tasks.named(SETUP_DEPENDENCIES_TASK_NAME) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJIvyDescriptorFileGenerator.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJIvyDescriptorFileGenerator.kt index 0ab9640cf7..a59cd7a5ce 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJIvyDescriptorFileGenerator.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJIvyDescriptorFileGenerator.kt @@ -77,7 +77,10 @@ class IntelliJIvyDescriptorFileGenerator(private val projectIdentity: IvyPublica ?.sources ?.takeIf { plugin.builtin } ?.let { - val name = if (isDependencyOnPyCharm(ideaDependency)) "pycharmPC" else "ideaIC" + val name = when(ideaDependency.name) { + "pycharmPY", "pycharmPC" -> "pycharmPC" + else -> "ideaIC" + } val artifact = IntellijIvyArtifact(it.toPath(), name, "jar", "sources", "sources") artifact.conf = sourcesConfiguration.name addArtifact(artifact) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt new file mode 100644 index 0000000000..5dfcb73141 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt @@ -0,0 +1,28 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin + +import org.gradle.api.GradleException + +enum class IntelliJPlatformType(val code: String) { + AndroidStudio("AI"), + CLion("CL"), + Gateway("GW"), + GoLand("GO"), + IntellijIdeaCommunity("IC"), + IntellijIdeaUltimate("IU"), + JPS("JPS"), + PhpStorm("PS"), + PyCharmProfessional("PY"), + PyCharmCommunity("PC"), + Rider("RD"); + + companion object { + private val map = values().associateBy(IntelliJPlatformType::code) + + fun fromCode(code: String) = map[code] + ?: throw GradleException("Specified type '$code' is unknown. Supported values: ${values().joinToString()}") + } + + override fun toString() = code +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index 0edbf3a953..71be0956f6 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -7,7 +7,9 @@ object IntelliJPluginConstants { const val PLUGIN_ID = "org.jetbrains.intellij.platform" const val PLUGIN_GROUP_NAME = "intellij" const val EXTENSION_NAME = "intellijPlatform" + const val INTELLIJ_PLATFORM_REPOSITORY_SETTINGS_NAME = "intellijPlatformRepositoriesSettings" + @Deprecated("Check it") const val DEFAULT_SANDBOX = "idea-sandbox" const val BUILD_PLUGIN_TASK_NAME = "buildPlugin" @@ -35,6 +37,7 @@ object IntelliJPluginConstants { const val RUN_IDE_FOR_UI_TESTS_TASK_NAME = "runIdeForUiTests" const val RUN_IDE_PERFORMANCE_TEST_TASK_NAME = "runIdePerformanceTest" const val RUN_PLUGIN_VERIFIER_TASK_NAME = "runPluginVerifier" + @Deprecated("Deprecated in 2.0") const val SETUP_DEPENDENCIES_TASK_NAME = "setupDependencies" const val SIGN_PLUGIN_TASK_NAME = "signPlugin" const val VERIFY_PLUGIN_TASK_NAME = "verifyPlugin" @@ -76,6 +79,7 @@ object IntelliJPluginConstants { const val COMPILE_KOTLIN_TASK_NAME = "compileKotlin" const val KOTLIN_GRADLE_PLUGIN_ID = "org.jetbrains.kotlin.jvm" + @Deprecated("Deprecated in 2.0") const val IDEA_GRADLE_PLUGIN_ID = "org.jetbrains.gradle.plugin.idea-ext" const val PLUGIN_XML_DIR_NAME = "patchedPluginXmlFiles" @@ -83,14 +87,20 @@ object IntelliJPluginConstants { const val SEARCHABLE_OPTIONS_SUFFIX = ".searchableOptions.xml" // see https://github.com/JetBrains/gradle-intellij-plugin/issues/1060 + @Deprecated("Deprecated in 2.0") const val INTELLIJ_DEFAULT_DEPENDENCIES_CONFIGURATION_NAME = "z10_intellijDefaultDependencies" + @Deprecated("Deprecated in 2.0") const val PERFORMANCE_TEST_CONFIGURATION_NAME = "z20_performanceTest" + @Deprecated("Deprecated in 2.0") const val IDEA_PLUGINS_CONFIGURATION_NAME = "z50_ideaPlugins" + @Deprecated("Deprecated in 2.0") const val IDEA_CONFIGURATION_NAME = "z90_intellij" + const val INTELLIJ_PLATFORM_CONFIGURATION_NAME = "intellijPlatformConfiguration" + const val INSTRUMENTED_JAR_CONFIGURATION_NAME = "instrumentedJar" const val INSTRUMENTED_JAR_PREFIX = "instrumented" - const val ANNOTATIONS_DEPENDENCY_VERSION = "24.0.0" + const val ANNOTATIONS_DEPENDENCY_VERSION = "24.0.1" const val DEFAULT_IDEA_VERSION = "LATEST-EAP-SNAPSHOT" const val MINIMAL_SUPPORTED_GRADLE_VERSION = "8.0" const val JETBRAINS_JAVA_TOOLCHAIN_VENDOR_NAME = "JetBrains" @@ -100,10 +110,6 @@ object IntelliJPluginConstants { const val RELEASE_SUFFIX_SNAPSHOT = "-SNAPSHOT" const val RELEASE_SUFFIX_CUSTOM_SNAPSHOT = "-CUSTOM-SNAPSHOT" - const val RELEASE_TYPE_SNAPSHOTS = "snapshots" - const val RELEASE_TYPE_NIGHTLY = "nightly" - const val RELEASE_TYPE_RELEASES = "releases" - const val MARKETPLACE_HOST = "https://plugins.jetbrains.com" const val IDEA_PRODUCTS_RELEASES_URL = "https://www.jetbrains.com/updates/updates.xml" const val ANDROID_STUDIO_PRODUCTS_RELEASES_URL = "https://jb.gg/android-studio-releases-list.xml" @@ -119,28 +125,4 @@ object IntelliJPluginConstants { const val VERSION_LATEST = "latest" const val PERFORMANCE_PLUGIN_ID = "com.jetbrains.performancePlugin" - - const val PLATFORM_TYPE_ANDROID_STUDIO = "AI" - const val PLATFORM_TYPE_CLION = "CL" - const val PLATFORM_TYPE_GATEWAY = "GW" - const val PLATFORM_TYPE_GOLAND = "GO" - const val PLATFORM_TYPE_INTELLIJ_COMMUNITY = "IC" - const val PLATFORM_TYPE_INTELLIJ_ULTIMATE = "IU" - const val PLATFORM_TYPE_PHPSTORM = "PS" - const val PLATFORM_TYPE_PYCHARM = "PY" - const val PLATFORM_TYPE_PYCHARM_COMMUNITY = "PC" - const val PLATFORM_TYPE_RIDER = "RD" - - val PLATFORM_TYPES = listOf( - PLATFORM_TYPE_ANDROID_STUDIO, - PLATFORM_TYPE_CLION, - PLATFORM_TYPE_GATEWAY, - PLATFORM_TYPE_GOLAND, - PLATFORM_TYPE_INTELLIJ_COMMUNITY, - PLATFORM_TYPE_INTELLIJ_ULTIMATE, - PLATFORM_TYPE_PHPSTORM, - PLATFORM_TYPE_PYCHARM, - PLATFORM_TYPE_PYCHARM_COMMUNITY, - PLATFORM_TYPE_RIDER, - ) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt index 8c271d420e..209b35e350 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt @@ -9,8 +9,8 @@ import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.api.provider.Provider import org.gradle.kotlin.dsl.newInstance +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.IntellijIdeaCommunity import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PLUGINS_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_COMMUNITY import org.jetbrains.intellij.platform.gradleplugin.dependency.IdeaDependency import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginDependency import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginsRepositoryConfiguration @@ -151,13 +151,6 @@ abstract class IntelliJPluginExtension @Inject constructor( */ abstract val sandboxDir: Property - /** - * The IntelliJ-based IDE distributions repository URL. - * - * Default value: `https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository` - */ - abstract val intellijRepository: Property - /** * Configures repositories for downloading plugin dependencies. * @@ -239,7 +232,7 @@ abstract class IntelliJPluginExtension @Inject constructor( fun getVersionType(): Provider = version.map { versionTypeRegex.matchEntire(it)?.groupValues?.getOrNull(1) - ?: type.getOrElse(PLATFORM_TYPE_INTELLIJ_COMMUNITY) + ?: type.getOrElse(IntellijIdeaCommunity.toString()) } fun addPluginDependency(pluginDependency: PluginDependency) { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/IntelliJPlatformCollectorTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/IntelliJPlatformCollectorTransformer.kt new file mode 100644 index 0000000000..87066b6975 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/IntelliJPlatformCollectorTransformer.kt @@ -0,0 +1,83 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.artifacts + +import org.gradle.api.Project +import org.gradle.api.artifacts.transform.InputArtifact +import org.gradle.api.artifacts.transform.TransformAction +import org.gradle.api.artifacts.transform.TransformOutputs +import org.gradle.api.artifacts.transform.TransformParameters +import org.gradle.api.artifacts.type.ArtifactTypeDefinition.ZIP_TYPE +import org.gradle.api.attributes.Attribute +import org.gradle.api.file.FileSystemLocation +import org.gradle.api.plugins.JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME +import org.gradle.api.plugins.JavaPlugin.TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME +import org.gradle.api.provider.Provider +import org.gradle.api.tasks.Classpath +import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.registerTransform +import org.gradle.work.DisableCachingByDefault +import org.jetbrains.intellij.platform.gradleplugin.asPath +import org.jetbrains.intellij.platform.gradleplugin.collectJars +import org.jetbrains.intellij.platform.gradleplugin.isKotlinRuntime +import kotlin.io.path.isDirectory +import kotlin.io.path.name + +@DisableCachingByDefault(because = "Not worth caching") +abstract class IntelliJPlatformCollectorTransformer : TransformAction { + + @get:InputArtifact + @get:Classpath + abstract val inputArtifact: Provider + + override fun transform(outputs: TransformOutputs) { + val input = inputArtifact.get().asPath + val withKotlin = true // TODO: detect if project uses Kotlin + val lib = input.resolve("lib") + + // TODO: cleanup + if (lib.isDirectory()) { + val baseFiles = (collectJars(lib) { file -> + (withKotlin || !isKotlinRuntime(file.name.removeSuffix(".jar"))) && file.name != "junit.jar" && file.name != "annotations.jar" + }).sorted() + + val antFiles = collectJars(lib.resolve("ant/lib")).sorted() + (baseFiles + antFiles).forEach { + outputs.file(it) + } + } + } +} + +internal fun Project.applyIntellijPlatformCollectorTransformer() { + val extractedAttribute = Attribute.of("intellijPlatformExtracted", Boolean::class.javaObjectType) + val collectedAttribute = Attribute.of("intellijPlatformCollected", Boolean::class.javaObjectType) + + project.dependencies { + attributesSchema { + attribute(collectedAttribute) + } + + artifactTypes.maybeCreate(ZIP_TYPE) + .attributes + .attribute(collectedAttribute, false) + + listOf( + configurations.getByName(COMPILE_CLASSPATH_CONFIGURATION_NAME), + configurations.getByName(TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME), + ).forEach { + it.attributes { + attributes.attribute(collectedAttribute, true) + } + } + + registerTransform(IntelliJPlatformCollectorTransformer::class) { + from + .attribute(extractedAttribute, true) + .attribute(collectedAttribute, false) + to + .attribute(extractedAttribute, true) + .attribute(collectedAttribute, true) + } + } +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/IntelliJPlatformExtractTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/IntelliJPlatformExtractTransformer.kt new file mode 100644 index 0000000000..1edb28b49c --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/IntelliJPlatformExtractTransformer.kt @@ -0,0 +1,106 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.artifacts + +import org.gradle.api.Project +import org.gradle.api.artifacts.transform.InputArtifact +import org.gradle.api.artifacts.transform.TransformAction +import org.gradle.api.artifacts.transform.TransformOutputs +import org.gradle.api.artifacts.transform.TransformParameters +import org.gradle.api.artifacts.type.ArtifactTypeDefinition.ZIP_TYPE +import org.gradle.api.attributes.Attribute +import org.gradle.api.file.ArchiveOperations +import org.gradle.api.file.FileSystemLocation +import org.gradle.api.file.FileSystemOperations +import org.gradle.api.plugins.JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME +import org.gradle.api.plugins.JavaPlugin.TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME +import org.gradle.api.provider.Provider +import org.gradle.api.tasks.Classpath +import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.registerTransform +import org.gradle.work.DisableCachingByDefault +import org.jetbrains.intellij.platform.gradleplugin.asPath +import java.nio.file.Path +import javax.inject.Inject +import kotlin.io.path.name +import kotlin.io.path.nameWithoutExtension + +@DisableCachingByDefault(because = "Not worth caching") +abstract class IntelliJPlatformExtractTransformer @Inject constructor( + private val archiveOperations: ArchiveOperations, + private val fileSystemOperations: FileSystemOperations, +) : TransformAction { + + @get:InputArtifact + @get:Classpath + abstract val inputArtifact: Provider + + override fun transform(outputs: TransformOutputs) { + val input = inputArtifact.get().asPath + val nameWithoutExtension = input.nameWithoutExtension.removeSuffix(".tar") + val extension = input.name.removePrefix(nameWithoutExtension) + val targetDirectory = outputs.dir("$nameWithoutExtension.extracted") + +// val cacheDirectory = getZipCacheDirectory(input) + + // TODO: Check if [nameWithoutExtension] matches our artifact names + // TODO: Allow for providing custom IDE dir? + + when (extension) { + ".zip", ".sit" -> { + fileSystemOperations.copy { + from(archiveOperations.zipTree(input)) + into(targetDirectory) + } + } + + ".tar.gz" -> { + fileSystemOperations.copy { + from(archiveOperations.tarTree(input)) + into(targetDirectory) + } + } + + else -> throw IllegalArgumentException("Unknown type archive type: $extension") + } + } + + private fun getZipCacheDirectory(zipFile: Path /*, project: Project, type: IntelliJPlatformType */): Path { +// if (ideaDependencyCachePath.isNotEmpty()) { +// return File(ideaDependencyCachePath).apply { +// mkdirs() +// } +// } else if (type == IntelliJPlatformType.Rider && OperatingSystem.current().isWindows) { +// return project.buildDir.toPath() +// } + return zipFile.parent + } +} + +internal fun Project.applyIntellijPlatformExtractTransformer() { + val extractedAttribute = Attribute.of("intellijPlatformExtracted", Boolean::class.javaObjectType) + + project.dependencies { + attributesSchema { + attribute(extractedAttribute) + } + + artifactTypes.maybeCreate(ZIP_TYPE) + .attributes + .attribute(extractedAttribute, false) + + listOf( + configurations.getByName(COMPILE_CLASSPATH_CONFIGURATION_NAME), + configurations.getByName(TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME), + ).forEach { + it.attributes { + attributes.attribute(extractedAttribute, true) + } + } + + registerTransform(IntelliJPlatformExtractTransformer::class) { + from.attribute(extractedAttribute, false) + to.attribute(extractedAttribute, true) + } + } +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt new file mode 100644 index 0000000000..e1772b97a7 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt @@ -0,0 +1,113 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +@file:Suppress("unused") + +package org.jetbrains.intellij.platform.gradleplugin.dependencies + +import org.gradle.internal.os.OperatingSystem +import org.gradle.kotlin.dsl.DependencyHandlerScope +import org.gradle.kotlin.dsl.create +import org.jetbrains.intellij.platform.gradleplugin.BuildException +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME + +fun DependencyHandlerScope.intellijPlatform( + type: IntelliJPlatformType?, + version: String, + configurationName: String = INTELLIJ_PLATFORM_CONFIGURATION_NAME, +) = when (type) { + IntellijIdeaUltimate -> create( + group = "com.jetbrains.intellij.idea", + name = "ideaIU", + version = version, + ) + + IntellijIdeaCommunity -> create( + group = "com.jetbrains.intellij.idea", + name = "ideaIC", + version = version, +// ext = "zip", +// ext = "unzipped", + ) + + CLion -> create( + group = "com.jetbrains.intellij.clion", + name = "clion", + version = version, + ) + + PyCharmProfessional -> create( + group = "com.jetbrains.intellij.pycharm", + name = "pycharmPY", + version = version, + ) + + PyCharmCommunity -> create( + group = "com.jetbrains.intellij.pycharm", + name = "pycharmPC", + version = version, + ) + + GoLand -> create( + group = "com.jetbrains.intellij.goland", + name = "goland", + version = version, + ) + + PhpStorm -> create( + group = "com.jetbrains.intellij.phpstorm", + name = "phpstorm", + version = version, + ) + + Rider -> create( + group = "com.jetbrains.intellij.rider", + name = "riderRD", + version = version, +// hasSources = (sources && releaseType != IntelliJPluginConstants.RELEASE_TYPE_SNAPSHOTS).ifFalse { +// warn(context, "IDE sources are not available for Rider SNAPSHOTS") +// }, + ) + + Gateway -> create( + group = "com.jetbrains.gateway", + name = "JetBrainsGateway", + version = version, +// hasSources = false, + ) + + AndroidStudio -> create( + group = "com.google.android.studio", + name = "android-studio", + version = version, +// hasSources = false, + ext = when { + OperatingSystem.current().isLinux -> "tar.gz" + else -> "zip" + }, + ) +// { +// with(it) { +// Files.list(resolveAndroidStudioPath(this)) +// .forEach { entry -> Files.move(entry, resolve(entry.fileName), StandardCopyOption.REPLACE_EXISTING) } +// } +// } + + else -> throw BuildException("Specified type '$type' is unknown. Supported values: ${IntelliJPlatformType.values().joinToString(", ") { it.code }}") +}.let { dependency -> + add(configurationName, dependency) +} + +fun DependencyHandlerScope.intellijPlatform(type: String, version: String) = intellijPlatform(IntelliJPlatformType.fromCode(type), version) + +fun DependencyHandlerScope.androidStudio(version: String) = intellijPlatform(AndroidStudio, version) +fun DependencyHandlerScope.clion(version: String) = intellijPlatform(CLion, version) +fun DependencyHandlerScope.gateway(version: String) = intellijPlatform(Gateway, version) +fun DependencyHandlerScope.goland(version: String) = intellijPlatform(GoLand, version) +fun DependencyHandlerScope.intellijIdeaCommunity(version: String) = intellijPlatform(IntellijIdeaCommunity, version) +fun DependencyHandlerScope.intellijIdeaUltimate(version: String) = intellijPlatform(IntellijIdeaUltimate, version) +fun DependencyHandlerScope.phpstorm(version: String) = intellijPlatform(PhpStorm, version) +fun DependencyHandlerScope.pycharmProfessional(version: String) = intellijPlatform(PyCharmProfessional, version) +fun DependencyHandlerScope.pycharmCommunity(version: String) = intellijPlatform(PyCharmCommunity, version) +fun DependencyHandlerScope.rider(version: String) = intellijPlatform(Rider, version) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsAnnotations.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsAnnotations.kt new file mode 100644 index 0000000000..c4cfbbc9c6 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsAnnotations.kt @@ -0,0 +1,21 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +@file:Suppress("unused") + +package org.jetbrains.intellij.platform.gradleplugin.dependencies + +import org.gradle.kotlin.dsl.DependencyHandlerScope +import org.gradle.kotlin.dsl.create +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANNOTATIONS_DEPENDENCY_VERSION +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME + +fun DependencyHandlerScope.jetbrainsAnnotations( + version: String = ANNOTATIONS_DEPENDENCY_VERSION, + configurationName: String = INTELLIJ_PLATFORM_CONFIGURATION_NAME, +) = create( + group = "org.jetbrains", + name = "annotations", + version = version, +).let { dependency -> + add(configurationName, dependency) +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependency.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependency.kt index 29a1d37c0c..dd349cee1a 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependency.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependency.kt @@ -10,6 +10,7 @@ import java.io.Serializable import kotlin.io.path.isDirectory import kotlin.io.path.name +@Deprecated("Work on transformed dependency") open class IdeaDependency( val name: String, val version: String, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt index 00ca2b9f1a..0859c7e026 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt @@ -13,20 +13,10 @@ import org.gradle.api.publish.ivy.internal.publication.DefaultIvyPublicationIden import org.gradle.internal.os.OperatingSystem import org.gradle.kotlin.dsl.create import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPES -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_ANDROID_STUDIO -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_CLION -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_GATEWAY -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_GOLAND -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_COMMUNITY -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_ULTIMATE -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_PHPSTORM -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_RIDER +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_TYPE_SNAPSHOTS -import org.jetbrains.intellij.platform.gradleplugin.model.AndroidStudioReleases -import org.jetbrains.intellij.platform.gradleplugin.model.XmlExtractor -import org.jetbrains.intellij.platform.gradleplugin.utils.* +import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils +import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader import java.io.File import java.nio.file.Files import java.nio.file.Path @@ -36,7 +26,6 @@ import javax.inject.Inject @Suppress("BooleanMethodIsAlwaysInverted") abstract class IdeaDependencyManager @Inject constructor( - private val repositoryUrl: String, private val ideaDependencyCachePath: String, private val archiveUtils: ArchiveUtils, private val dependenciesDownloader: DependenciesDownloader, @@ -71,7 +60,7 @@ abstract class IdeaDependencyManager @Inject constructor( private fun createDependency( name: String, - type: String?, + type: IntelliJPlatformType?, version: String, buildNumber: String, classesDirectory: File, @@ -79,7 +68,7 @@ abstract class IdeaDependencyManager @Inject constructor( project: Project, extraDependencies: Collection, ) = when (type) { - "JPS" -> JpsIdeaDependency( + JPS -> JpsIdeaDependency( version, buildNumber, classesDirectory, @@ -116,11 +105,10 @@ abstract class IdeaDependencyManager @Inject constructor( } } - private fun resolveSources(version: String, type: String): File? { + private fun resolveSources(version: String, type: IntelliJPlatformType): File? { info(context, "Adding IDE sources repository") try { - val releaseType = releaseType(version) - val forPyCharm = isPyCharmType(type) + val forPyCharm = type == PyCharmProfessional || type == PyCharmCommunity val sourcesFiles = dependenciesDownloader.downloadFromRepository(context, { create( group = if (forPyCharm) "com.jetbrains.intellij.pycharm" else "com.jetbrains.intellij.idea", @@ -129,8 +117,6 @@ abstract class IdeaDependencyManager @Inject constructor( classifier = "sources", ext = "jar", ) - }, { - mavenRepository("$repositoryUrl/$releaseType") }) if (sourcesFiles.size == 1) { val sourcesDirectory = sourcesFiles.first() @@ -148,7 +134,7 @@ abstract class IdeaDependencyManager @Inject constructor( private fun unzipDependencyFile( cacheDirectory: File, zipFile: File, - type: String, + type: IntelliJPlatformType, checkVersionChange: Boolean, ) = archiveUtils.extract( zipFile.toPath(), // FIXME @@ -189,8 +175,8 @@ abstract class IdeaDependencyManager @Inject constructor( ?.let { markerFile.writeText(it.readText().trim()) } } - private fun resetExecutablePermissions(cacheDirectory: File, type: String) { - if (type == PLATFORM_TYPE_RIDER && !OperatingSystem.current().isWindows) { + private fun resetExecutablePermissions(cacheDirectory: File, type: IntelliJPlatformType) { + if (type == Rider && !OperatingSystem.current().isWindows) { for (file in cacheDirectory.walkTopDown()) { if (file.isFile && (file.extension == "dylib" @@ -240,8 +226,8 @@ abstract class IdeaDependencyManager @Inject constructor( .forEach { addArtifact(IntellijIvyArtifact.createZipDependency(it.toPath(), "sources", dependency.classes.toPath())) } if (dependency.sources != null) { - val name = when { - isDependencyOnPyCharm(dependency) -> "pycharmPC" + val name = when (dependency.name) { + "pycharmPY", "pycharmPC" -> "pycharmPC" else -> "ideaIC" } IntellijIvyArtifact(dependency.sources.toPath(), name, "jar", "sources", "sources").apply { @@ -263,56 +249,56 @@ abstract class IdeaDependencyManager @Inject constructor( .any { "org.jetbrains.kotlin" == it.group && isKotlinRuntime(it.name) } fun resolveRemote(project: Project, version: String, type: String, sources: Boolean, extraDependencies: List): IdeaDependency { - val releaseType = releaseType(version) - debug(context, "Adding IDE repository: $repositoryUrl/$releaseType") debug(context, "Adding IDE dependency") + val type = IntelliJPlatformType.fromCode(type) + val remoteIdeaDependency = when { - type == PLATFORM_TYPE_INTELLIJ_ULTIMATE -> RemoteIdeaDependency( + type == IntellijIdeaUltimate -> RemoteIdeaDependency( group = "com.jetbrains.intellij.idea", name = "ideaIU", ) - type == PLATFORM_TYPE_INTELLIJ_COMMUNITY -> RemoteIdeaDependency( + type == IntellijIdeaCommunity -> RemoteIdeaDependency( group = "com.jetbrains.intellij.idea", name = "ideaIC", ) - type == PLATFORM_TYPE_CLION -> RemoteIdeaDependency( + type == CLion -> RemoteIdeaDependency( group = "com.jetbrains.intellij.clion", name = "clion", ) - isPyCharmType(type) -> RemoteIdeaDependency( + type == PyCharmProfessional || type == PyCharmCommunity -> RemoteIdeaDependency( group = "com.jetbrains.intellij.pycharm", name = "pycharm$type", ) - type == PLATFORM_TYPE_GOLAND -> RemoteIdeaDependency( + type == GoLand -> RemoteIdeaDependency( group = "com.jetbrains.intellij.goland", name = "goland", ) - type == PLATFORM_TYPE_PHPSTORM -> RemoteIdeaDependency( + type == PhpStorm -> RemoteIdeaDependency( group = "com.jetbrains.intellij.phpstorm", name = "phpstorm", ) - type == PLATFORM_TYPE_RIDER -> RemoteIdeaDependency( + type == Rider -> RemoteIdeaDependency( group = "com.jetbrains.intellij.rider", name = "riderRD", - hasSources = (sources && releaseType != RELEASE_TYPE_SNAPSHOTS).ifFalse { - warn(context, "IDE sources are not available for Rider SNAPSHOTS") - }, +// hasSources = (sources && releaseType != RELEASE_TYPE_SNAPSHOTS).ifFalse { +// warn(context, "IDE sources are not available for Rider SNAPSHOTS") +// }, ) - type == PLATFORM_TYPE_GATEWAY -> RemoteIdeaDependency( + type == Gateway -> RemoteIdeaDependency( "com.jetbrains.gateway", "JetBrainsGateway", hasSources = false, ) - type == PLATFORM_TYPE_ANDROID_STUDIO -> RemoteIdeaDependency( + type == AndroidStudio -> RemoteIdeaDependency( "com.google.android.studio", "android-studio", hasSources = false, @@ -327,7 +313,7 @@ abstract class IdeaDependencyManager @Inject constructor( } } - else -> throw BuildException("Specified type '$type' is unknown. Supported values: ${PLATFORM_TYPES.joinToString()}", null) + else -> throw BuildException("Specified type '$type' is unknown. Supported values: ${IntelliJPlatformType.values().joinToString(", ") { it.code }}", null) } val classesDirectory = dependenciesDownloader.downloadFromRepository(context, { @@ -337,41 +323,39 @@ abstract class IdeaDependencyManager @Inject constructor( version = version, ext = remoteIdeaDependency.artifactExtension, ) - }, { - when (type) { - PLATFORM_TYPE_ANDROID_STUDIO -> { - val androidStudioReleases = - dependenciesDownloader.getAndroidStudioReleases(context)?.let { - XmlExtractor(context).fetch(it) - } ?: throw GradleException("Cannot resolve Android Studio Releases list") - - val release = androidStudioReleases.items.find { - it.version == version || it.build == "$PLATFORM_TYPE_ANDROID_STUDIO-$version" - } ?: throw GradleException("Cannot resolve Android Studio with provided version: $version") - - val arch = System.getProperty("os.arch") - val hasAppleM1Link by lazy { release.downloads.any { it.link.contains("-mac_arm.zip") } } - val suffix = with(OperatingSystem.current()) { - when { - isMacOsX -> when { - arch == "aarch64" && hasAppleM1Link -> "-mac_arm.zip" - else -> "-mac.zip" - } - - isLinux -> "-linux.tar.gz" - else -> "-windows.zip" - } - } - val url = release.downloads - .find { it.link.endsWith(suffix) } - ?.link - ?: throw GradleException("Cannot resolve Android Studio with provided version: $version") - - ivyRepository(url) - } - - else -> mavenRepository("$repositoryUrl/$releaseType") - } +// when (type) { +// PLATFORM_TYPE_ANDROID_STUDIO -> { +// val androidStudioReleases = +// dependenciesDownloader.getAndroidStudioReleases(context)?.let { +// XmlExtractor(context).fetch(it) +// } ?: throw GradleException("Cannot resolve Android Studio Releases list") +// +// val release = androidStudioReleases.items.find { +// it.version == version || it.build == "$PLATFORM_TYPE_ANDROID_STUDIO-$version" +// } ?: throw GradleException("Cannot resolve Android Studio with provided version: $version") +// +// val arch = System.getProperty("os.arch") +// val hasAppleM1Link by lazy { release.downloads.any { it.link.contains("-mac_arm.zip") } } +// val suffix = with(OperatingSystem.current()) { +// when { +// isMacOsX -> when { +// arch == "aarch64" && hasAppleM1Link -> "-mac_arm.zip" +// else -> "-mac.zip" +// } +// +// isLinux -> "-linux.tar.gz" +// else -> "-windows.zip" +// } +// } +// val url = release.downloads +// .find { it.link.endsWith(suffix) } +// ?.link +// ?: throw GradleException("Cannot resolve Android Studio with provided version: $version") +// +// ivyRepository(url) +// } +// +// else -> null }).first().let { debug(context, "IDE zip: " + it.path) unzipDependencyFile(getZipCacheDirectory(it, project, type), it, type, version.endsWith(RELEASE_SUFFIX_SNAPSHOT)) @@ -414,12 +398,12 @@ abstract class IdeaDependencyManager @Inject constructor( return createDependency("ideaLocal", null, buildNumber, buildNumber, ideaDir.toFile(), sources, project, emptyList()) } - private fun getZipCacheDirectory(zipFile: File, project: Project, type: String): File { + private fun getZipCacheDirectory(zipFile: File, project: Project, type: IntelliJPlatformType): File { if (ideaDependencyCachePath.isNotEmpty()) { return File(ideaDependencyCachePath).apply { mkdirs() } - } else if (type == PLATFORM_TYPE_RIDER && OperatingSystem.current().isWindows) { + } else if (type == Rider && OperatingSystem.current().isWindows) { return project.layout.buildDirectory.asFile.get() } return zipFile.parentFile @@ -452,15 +436,12 @@ abstract class IdeaDependencyManager @Inject constructor( private fun resolveExtraDependency(project: Project, version: String, name: String): File? { try { - val releaseType = releaseType(version) val files = dependenciesDownloader.downloadFromRepository(context, { create( group = "com.jetbrains.intellij.idea", name = name, version = version, ) - }, { - mavenRepository("$repositoryUrl/$releaseType") }) if (files.size == 1) { val dependencyFile = files.first() // TODO: remove when migrated to Path @@ -468,12 +449,12 @@ abstract class IdeaDependencyManager @Inject constructor( return when { dependency.isZip() -> { - val cacheDirectory = getZipCacheDirectory(dependencyFile, project, PLATFORM_TYPE_INTELLIJ_COMMUNITY) + val cacheDirectory = getZipCacheDirectory(dependencyFile, project, IntellijIdeaCommunity) debug(context, "IDE extra dependency '$name': " + cacheDirectory.path) unzipDependencyFile( cacheDirectory, dependencyFile, - PLATFORM_TYPE_INTELLIJ_COMMUNITY, + IntellijIdeaCommunity, version.endsWith(RELEASE_SUFFIX_SNAPSHOT) ).toFile() // FIXME } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt index 6063adaa93..3dcb730369 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt @@ -2,5 +2,5 @@ package org.jetbrains.intellij.platform.gradleplugin.extensions -abstract class IntelliJPlatformExtension { +interface IntelliJPlatformExtension { } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolver.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolver.kt index a360a7531d..83d86b49e3 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolver.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolver.kt @@ -14,7 +14,7 @@ import org.gradle.jvm.toolchain.internal.DefaultJvmVendorSpec import org.gradle.kotlin.dsl.create import org.jetbrains.intellij.platform.gradleplugin.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_JBR_REPOSITORY -import org.jetbrains.intellij.IntelliJPluginConstants.JETBRAINS_JAVA_TOOLCHAIN_VENDOR_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JETBRAINS_JAVA_TOOLCHAIN_VENDOR_NAME import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader import org.jetbrains.intellij.platform.gradleplugin.utils.ivyRepository diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt index 61684cdd26..341ea21cb6 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt @@ -4,14 +4,24 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.api.model.ObjectFactory +import org.gradle.api.provider.ProviderFactory import org.gradle.kotlin.dsl.create import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.EXTENSION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.artifacts.applyIntellijPlatformCollectorTransformer +import org.jetbrains.intellij.platform.gradleplugin.artifacts.applyIntellijPlatformExtractTransformer import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension import org.jetbrains.intellij.platform.gradleplugin.info import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.repositories.applyIntelliJPlatformSettings +import javax.inject.Inject -abstract class IntelliJPlatformBasePlugin : Plugin { +abstract class IntelliJPlatformBasePlugin @Inject constructor( + private val objects: ObjectFactory, + private val providers: ProviderFactory, +) : Plugin { private lateinit var context: String @@ -19,17 +29,27 @@ abstract class IntelliJPlatformBasePlugin : Plugin { context = project.logCategory() info(context, "Configuring plugin: org.jetbrains.intellij.platform.base") - project.checkGradleVersion() - - applyExtension(project) - applyTasks(project) + checkGradleVersion() + + val intellijPlatformConfiguration = project.configurations.create(INTELLIJ_PLATFORM_CONFIGURATION_NAME) + .setVisible(false) + .apply { + isCanBeConsumed = false + isCanBeResolved = true + } + + project.repositories.applyIntelliJPlatformSettings(objects, providers) + project.applyIntellijPlatformExtractTransformer() + project.applyIntellijPlatformCollectorTransformer() + project.applyExtension() + project.applyTasks() } - private fun applyExtension(project: Project) { - project.extensions.create(EXTENSION_NAME) + private fun Project.applyExtension() { + extensions.create(EXTENSION_NAME) } - private fun applyTasks(project: Project) { + private fun Project.applyTasks() { } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformDependenciesPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformDependenciesPlugin.kt deleted file mode 100644 index 07b9782b05..0000000000 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformDependenciesPlugin.kt +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -package org.jetbrains.intellij.platform.gradleplugin.plugins - -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.kotlin.dsl.apply -import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion -import org.jetbrains.intellij.platform.gradleplugin.info -import org.jetbrains.intellij.platform.gradleplugin.logCategory - -abstract class IntelliJPlatformDependenciesPlugin : Plugin { - - private lateinit var context: String - - override fun apply(project: Project) { - context = project.logCategory() - - info(context, "Configuring plugin: org.jetbrains.intellij.platform.dependencies") - project.checkGradleVersion() - - applyPlugins(project) - } - - private fun applyPlugins(project: Project) { - project.plugins.apply(IntelliJPlatformBasePlugin::class) - } -} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt index 55fcf6a624..fed406cbdb 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt @@ -41,6 +41,7 @@ import org.jetbrains.gradle.ext.ProjectSettings import org.jetbrains.gradle.ext.TaskTriggersConfig import org.jetbrains.intellij.platform.gradleplugin.* import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANDROID_STUDIO_PRODUCTS_RELEASES_URL import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANNOTATIONS_DEPENDENCY_VERSION import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_PLUGIN_TASK_NAME @@ -48,7 +49,6 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUIL import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.CLASSPATH_INDEX_CLEANUP_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.COMPILE_KOTLIN_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_IDEA_VERSION -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_INTELLIJ_REPOSITORY import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_SANDBOX import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME @@ -67,6 +67,7 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INST import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENT_TEST_CODE_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEFAULT_DEPENDENCIES_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_COMPILER_ANT_TASKS_MAVEN_METADATA import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.KOTLIN_GRADLE_PLUGIN_ID @@ -74,13 +75,7 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.LIST import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MARKETPLACE_HOST import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PATCH_PLUGIN_XML_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PERFORMANCE_PLUGIN_ID import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PERFORMANCE_TEST_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_CLION -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_COMMUNITY -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_PHPSTORM -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_PYCHARM -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_RIDER import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_XML_DIR_NAME @@ -93,7 +88,6 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PUBL import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_EAP import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_EAP_CANDIDATE import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_TYPE_RELEASES import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_FOR_UI_TESTS_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_PERFORMANCE_TEST_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_TASK_NAME @@ -143,10 +137,10 @@ abstract class IntelliJPlatformPlugin : Plugin { context = project.logCategory() info(context, "Configuring plugin: org.jetbrains.intellij.platform") - project.checkGradleVersion() - - applyPlugins(project) + checkGradleVersion() + project.applyPlugins() + project.applyConfigurations() return archiveUtils = project.objects.newInstance() @@ -184,10 +178,9 @@ abstract class IntelliJPlatformPlugin : Plugin { .dir(DEFAULT_SANDBOX) .map { it.asFile.canonicalPath } ) - intellijRepository.convention(DEFAULT_INTELLIJ_REPOSITORY) downloadSources.convention(!System.getenv().containsKey("CI")) configureDefaultDependencies.convention(true) - type.convention(PLATFORM_TYPE_INTELLIJ_COMMUNITY) + type.convention(IntellijIdeaCommunity.toString()) } val gradleProjectJavaToolchainSpec = project.extensions.getByType().toolchain @@ -202,15 +195,13 @@ abstract class IntelliJPlatformPlugin : Plugin { context, ) - val ideaDependencyProvider = prepareIdeaDependencyProvider(project, extension).memoize() - configureDependencies(project, extension, ideaDependencyProvider) + val ideaDependencyProvider = null as Provider // prepareIdeaDependencyProvider(project, extension).memoize() configureTasks(project, extension, ideaDependencyProvider) } - private fun applyPlugins(project: Project) { - project.plugins.apply(IntelliJPlatformBasePlugin::class) - project.plugins.apply(IntelliJPlatformDependenciesPlugin::class) - project.plugins.apply(IntelliJPlatformTasksPlugin::class) + private fun Project.applyPlugins() { + plugins.apply(IntelliJPlatformBasePlugin::class) + plugins.apply(IntelliJPlatformTasksPlugin::class) } private fun configureTasks(project: Project, extension: IntelliJPluginExtension, ideaDependencyProvider: Provider) { @@ -272,7 +263,6 @@ abstract class IntelliJPlatformPlugin : Plugin { val downloadSources = extension.downloadSources.get() val extraDependencies = extension.extraDependencies.get() val ideaDependencyCachePath = extension.ideaDependencyCachePath.orNull.orEmpty() - val intellijRepository = extension.intellijRepository.get() val localPath = extension.localPath.orNull val localSourcesPath = extension.localSourcesPath.orNull val type = extension.getVersionType().orNull @@ -281,7 +271,6 @@ abstract class IntelliJPlatformPlugin : Plugin { val ideaConfiguration = project.configurations.getByName(IDEA_CONFIGURATION_NAME) val dependencyManager = project.objects.newInstance( - intellijRepository, ideaDependencyCachePath, archiveUtils, dependenciesDownloader, @@ -324,18 +313,19 @@ abstract class IntelliJPlatformPlugin : Plugin { ideaDependency } - private fun configureDependencies(project: Project, extension: IntelliJPluginExtension, ideaDependencyProvider: Provider) { - val idea = project.configurations.create(IDEA_CONFIGURATION_NAME) - .setVisible(false) + private fun Project.applyConfigurations() { + val intellijPlatformConfiguration = project.configurations.maybeCreate(INTELLIJ_PLATFORM_CONFIGURATION_NAME) .apply { + isVisible = false isCanBeConsumed = false isCanBeResolved = true + description = "..." // TODO } val ideaPlugins = project.configurations.create(IDEA_PLUGINS_CONFIGURATION_NAME) .setVisible(false) .withDependencies { - configurePluginDependencies(project, ideaDependencyProvider, extension, this) +// configurePluginDependencies(project, ideaDependencyProvider, extension, this) } .apply { isCanBeConsumed = false @@ -361,46 +351,48 @@ abstract class IntelliJPlatformPlugin : Plugin { val performanceTest = project.configurations.create(PERFORMANCE_TEST_CONFIGURATION_NAME) .setVisible(false) .withDependencies { - val resolver = project.objects.newInstance( - project.gradle.gradleUserHomeDir.canonicalPath, - ideaDependencyProvider, - extension.getPluginsRepositories(), - archiveUtils, - context, - ) +// val resolver = project.objects.newInstance( +// project.gradle.gradleUserHomeDir.canonicalPath, +// ideaDependencyProvider, +// extension.getPluginsRepositories(), +// archiveUtils, +// context, +// ) // Check that the `runIdePerformanceTest` task was launched // Check that `performanceTesting.jar` is absent (that means it's a community version) // Check that user didn't pass a custom version of the performance plugin - if ( - RUN_IDE_PERFORMANCE_TEST_TASK_NAME in project.gradle.startParameter.taskNames - && extension.plugins.get().none { it is String && it.startsWith(PERFORMANCE_PLUGIN_ID) } - ) { - val bundledPlugins = BuiltinPluginsRegistry.resolveBundledPlugins(ideaDependencyProvider.get().classes.toPath(), context) - if (!bundledPlugins.contains(PERFORMANCE_PLUGIN_ID)) { - val buildNumber = ideaDependencyProvider.get().buildNumber - val resolvedPlugin = resolveLatestPluginUpdate(PERFORMANCE_PLUGIN_ID, buildNumber) - ?: throw BuildException("No suitable plugin update found for $PERFORMANCE_PLUGIN_ID:$buildNumber") - - val plugin = resolver.resolve(project, resolvedPlugin) - ?: throw BuildException(with(resolvedPlugin) { "Failed to resolve plugin $id:$version@$channel" }) - - configurePluginDependency(project, plugin, extension, this, resolver) - } - } +// if ( +// RUN_IDE_PERFORMANCE_TEST_TASK_NAME in project.gradle.startParameter.taskNames +// && extension.plugins.get().none { it is String && it.startsWith(PERFORMANCE_PLUGIN_ID) } +// ) { +// val bundledPlugins = BuiltinPluginsRegistry.resolveBundledPlugins(ideaDependencyProvider.get().classes.toPath(), context) +// if (!bundledPlugins.contains(PERFORMANCE_PLUGIN_ID)) { +// val buildNumber = ideaDependencyProvider.get().buildNumber +// val resolvedPlugin = resolveLatestPluginUpdate(PERFORMANCE_PLUGIN_ID, buildNumber) +// ?: throw BuildException("No suitable plugin update found for $PERFORMANCE_PLUGIN_ID:$buildNumber") +// +// val plugin = resolver.resolve(project, resolvedPlugin) +// ?: throw BuildException(with(resolvedPlugin) { "Failed to resolve plugin $id:$version@$channel" }) +// +// configurePluginDependency(project, plugin, extension, this, resolver) +// } +// } } .apply { isCanBeConsumed = false isCanBeResolved = true } - fun Configuration.extend() = extendsFrom(defaultDependencies, idea, ideaPlugins, performanceTest) +// fun Configuration.extend() = extendsFrom(defaultDependencies, idea, ideaPlugins, performanceTest) + fun Configuration.extend() = extendsFrom(intellijPlatformConfiguration) with(project.configurations) { getByName(COMPILE_ONLY_CONFIGURATION_NAME).extend() - getByName(TEST_IMPLEMENTATION_CONFIGURATION_NAME).extend() - project.pluginManager.withPlugin("java-test-fixtures") { - getByName("testFixturesCompileOnly").extend() + getByName(TEST_COMPILE_ONLY_CONFIGURATION_NAME).extend() +// getByName(TEST_IMPLEMENTATION_CONFIGURATION_NAME).extend() + project.pluginManager.withPlugin("java-test-fixtures") { // TODO: move to constants + getByName("testFixturesCompileOnly").extend() // TODO: move to constants } } } @@ -896,11 +888,9 @@ abstract class IntelliJPlatformPlugin : Plugin { project.tasks.register(BUILD_SEARCHABLE_OPTIONS_TASK_NAME) project.tasks.withType { outputDir.convention(project.layout.buildDirectory.dir(SEARCHABLE_OPTIONS_DIR_NAME)) - showPaidPluginWarning.convention(project.provider { - project.isBuildFeatureEnabled(PAID_PLUGIN_SEARCHABLE_OPTIONS_WARNING) && run { - sourcePluginXmlFiles(project).any { - parsePluginXml(it, context)?.productDescriptor != null - } + showPaidPluginWarning.convention(project.isBuildFeatureEnabled(PAID_PLUGIN_SEARCHABLE_OPTIONS_WARNING).map { + it && sourcePluginXmlFiles(project).any { + parsePluginXml(it, context)?.productDescriptor != null } }) @@ -971,9 +961,7 @@ abstract class IntelliJPlatformPlugin : Plugin { }) archiveBaseName.convention("lib/$SEARCHABLE_OPTIONS_DIR_NAME") destinationDirectory.convention(project.layout.buildDirectory.dir("libsSearchableOptions")) - noSearchableOptionsWarning.convention(project.provider { - project.isBuildFeatureEnabled(NO_SEARCHABLE_OPTIONS_WARNING) - }) + noSearchableOptionsWarning.convention(project.isBuildFeatureEnabled(NO_SEARCHABLE_OPTIONS_WARNING)) dependsOn(BUILD_SEARCHABLE_OPTIONS_TASK_NAME) dependsOn(PREPARE_SANDBOX_TASK_NAME) @@ -1021,14 +1009,11 @@ abstract class IntelliJPlatformPlugin : Plugin { val productInfo = ideProductInfo(it.classes.toPath()) val version = extension.getVersionNumber().orNull.orEmpty() - val type = extension.getVersionType().orNull.orEmpty() + val type = extension.getVersionType().orNull.orEmpty().let { + IntelliJPlatformType.fromCode(it) + } val localPath = extension.localPath.orNull.orEmpty() - val types = listOf( - PLATFORM_TYPE_CLION, - PLATFORM_TYPE_RIDER, - PLATFORM_TYPE_PYCHARM, - PLATFORM_TYPE_PHPSTORM, - ) + val types = listOf(CLion, Rider, PyCharmProfessional, PhpStorm) when { localPath.isNotBlank() || !version.endsWith(RELEASE_SUFFIX_SNAPSHOT) -> { @@ -1044,10 +1029,10 @@ abstract class IntelliJPlatformPlugin : Plugin { else -> { val prefix = when (type) { - PLATFORM_TYPE_CLION -> "CLION-" - PLATFORM_TYPE_RIDER -> "RIDER-" - PLATFORM_TYPE_PYCHARM -> "PYCHARM-" - PLATFORM_TYPE_PHPSTORM -> "PHPSTORM-" + CLion -> "CLION-" + Rider -> "RIDER-" + PyCharmProfessional -> "PYCHARM-" + PhpStorm -> "PHPSTORM-" else -> "" } prefix + version @@ -1069,8 +1054,6 @@ abstract class IntelliJPlatformPlugin : Plugin { ) }, { setOf( - "${extension.intellijRepository.get()}/${releaseType(version)}", - "${extension.intellijRepository.get()}/$RELEASE_TYPE_RELEASES", INTELLIJ_DEPENDENCIES, ).map(::mavenRepository) }, true).takeIf { it.isNotEmpty() } @@ -1570,9 +1553,7 @@ abstract class IntelliJPlatformPlugin : Plugin { project.tasks.register(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) project.tasks.withType { offline.convention(project.gradle.startParameter.isOffline) - selfUpdateCheck.convention(project.provider { - project.isBuildFeatureEnabled(SELF_UPDATE_CHECK) - }) + selfUpdateCheck.convention(project.isBuildFeatureEnabled(SELF_UPDATE_CHECK)) lockFile.convention(project.provider { temporaryDir.resolve(LocalDate.now().toString()) }) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformSettingsPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformSettingsPlugin.kt new file mode 100644 index 0000000000..5dc10393c0 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformSettingsPlugin.kt @@ -0,0 +1,20 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.plugins + +import org.gradle.api.Plugin +import org.gradle.api.initialization.Settings +import org.gradle.api.model.ObjectFactory +import org.gradle.api.provider.ProviderFactory +import org.jetbrains.intellij.platform.gradleplugin.repositories.applyIntelliJPlatformSettings +import javax.inject.Inject + +abstract class IntelliJPlatformSettingsPlugin @Inject constructor( + private val objects: ObjectFactory, + private val providers: ProviderFactory, +) : Plugin { + + override fun apply(settings: Settings) { + settings.dependencyResolutionManagement.repositories.applyIntelliJPlatformSettings(objects, providers) + } +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt index 7e64d806e7..510eb732a7 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt @@ -17,7 +17,7 @@ abstract class IntelliJPlatformTasksPlugin : Plugin { context = project.logCategory() info(context, "Configuring plugin: org.jetbrains.intellij.platform.tasks") - project.checkGradleVersion() + checkGradleVersion() applyPlugins(project) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellij.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellij.kt new file mode 100644 index 0000000000..9972d153da --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellij.kt @@ -0,0 +1,70 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.repositories + +import org.gradle.api.artifacts.dsl.RepositoryHandler +import org.gradle.api.artifacts.repositories.MavenArtifactRepository +import org.gradle.api.model.ObjectFactory +import org.gradle.api.plugins.ExtensionAware +import org.gradle.api.provider.Property +import org.gradle.api.provider.ProviderFactory +import org.gradle.kotlin.dsl.getByType +import org.gradle.kotlin.dsl.maven +import org.gradle.kotlin.dsl.newInstance +import org.jetbrains.intellij.platform.gradleplugin.BuildFeature +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants + +interface IntelliJPlatformRepositorySettings { + + val useCacheRedirector: Property +} + +internal fun RepositoryHandler.applyIntelliJPlatformSettings(objects: ObjectFactory, providers: ProviderFactory) { + val settings = objects.newInstance(IntelliJPlatformRepositorySettings::class) + + settings.useCacheRedirector.convention(BuildFeature.USE_CACHE_REDIRECTOR.getValue(providers)) + + (this as ExtensionAware).extensions.add(IntelliJPluginConstants.INTELLIJ_PLATFORM_REPOSITORY_SETTINGS_NAME, settings) +} + +internal val RepositoryHandler.intellijPlatformRepositorySettings: IntelliJPlatformRepositorySettings + get() = (this as ExtensionAware).extensions.getByType() + +internal typealias Action = (MavenArtifactRepository.() -> Unit) + +internal fun RepositoryHandler.customRepository( + name: String, + url: String, + urlWithCacheRedirector: String, + settings: IntelliJPlatformRepositorySettings = intellijPlatformRepositorySettings, + action: Action = {}, +) = maven(settings.useCacheRedirector.map { cached -> + when (cached) { + true -> urlWithCacheRedirector + false -> url + } +}) { + this.name = name + action(this) +} + +fun RepositoryHandler.intellij(action: Action = {}) = customRepository( + name = "IntelliJ Repository", + url = "https://www.jetbrains.com/intellij-repository/releases", + urlWithCacheRedirector = "https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/releases", + action = action, +) + +fun RepositoryHandler.intellijSnapshots(action: Action = {}) = customRepository( + name = "IntelliJ Repository (Snapshots)", + url = "https://www.jetbrains.com/intellij-repository/snapshots", + urlWithCacheRedirector = "https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/snapshots", + action = action, +) + +fun RepositoryHandler.intellijNightly(action: Action = {}) = customRepository( + name = "IntelliJ Repository (Nightly)", + url = "https://www.jetbrains.com/intellij-repository/nightly", + urlWithCacheRedirector = "https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/nightly", + action = action, +) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTask.kt index c7dbce2846..f17ff8a466 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTask.kt @@ -11,7 +11,7 @@ import org.gradle.api.provider.Property import org.gradle.api.provider.SetProperty import org.gradle.api.tasks.* import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_ANDROID_STUDIO +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.AndroidStudio import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME import org.jetbrains.intellij.platform.gradleplugin.model.AndroidStudioReleases import org.jetbrains.intellij.platform.gradleplugin.model.ProductsReleases @@ -146,7 +146,9 @@ abstract class ListProductsReleasesTask : DefaultTask() { ?.replace("*", "9999") ?.run(Version::parse) - val types = types.get() + val types = types.get().mapNotNull { + IntelliJPlatformType.fromCode(it) + } val channels = releaseChannels.get() fun testVersion(version: Version?, build: Version?): Boolean { @@ -164,7 +166,7 @@ abstract class ListProductsReleasesTask : DefaultTask() { val result = releases.map(ProductsReleases::products).flatten().asSequence() .flatMap { product -> product.codes.map { it to product }.asSequence() } - .filter { (type) -> types.contains(type) } + .filter { (type) -> types.contains(IntelliJPlatformType.fromCode(type)) } .flatMap { (type, product) -> product.channels.map { type to it }.asSequence() } .filter { (_, channel) -> channels.contains(Channel.valueOf(channel.status.uppercase())) } .flatMap { (type, channel) -> @@ -182,7 +184,7 @@ abstract class ListProductsReleasesTask : DefaultTask() { .distinct() .toList() - val androidStudioResult = when (types.contains(PLATFORM_TYPE_ANDROID_STUDIO)) { + val androidStudioResult = when (types.contains(AndroidStudio)) { true -> androidStudioReleases.flatMap { release -> release.items .asSequence() @@ -198,7 +200,7 @@ abstract class ListProductsReleasesTask : DefaultTask() { it.version.split('.').last().toInt() } } - .map { "$PLATFORM_TYPE_ANDROID_STUDIO-${it.version}" } + .map { "$AndroidStudio-${it.version}" } .toList() } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeBase.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeBase.kt index 02af46544f..4023ae0930 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeBase.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeBase.kt @@ -14,8 +14,8 @@ import org.gradle.api.tasks.* import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem import org.jetbrains.intellij.platform.gradleplugin.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.IntellijIdeaUltimate import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.GITHUB_REPOSITORY -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_ULTIMATE import org.jetbrains.intellij.platform.gradleplugin.jbr.JbrResolver import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.IntelliJPlatformArgumentProvider import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.LaunchSystemArgumentProvider @@ -247,7 +247,7 @@ abstract class RunIdeBase : JavaExec() { if (!systemProperties.containsKey("idea.platform.prefix")) { val prefix = findIdePrefix() - if (prefix == null && !ideBuildNumber(ideDir.get().toPath()).startsWith("$PLATFORM_TYPE_INTELLIJ_ULTIMATE-")) { + if (prefix == null && !ideBuildNumber(ideDir.get().toPath()).startsWith("$IntellijIdeaUltimate-")) { throw TaskExecutionException( this, GradleException( diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt index 5943278daf..d98bb4308a 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt @@ -19,9 +19,9 @@ import org.gradle.kotlin.dsl.newInstance import org.gradle.process.ExecOperations import org.gradle.process.internal.ExecException import org.jetbrains.intellij.platform.gradleplugin.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.AndroidStudio +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.IntellijIdeaCommunity import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.CACHE_REDIRECTOR -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_ANDROID_STUDIO -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_INTELLIJ_COMMUNITY import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERSION_LATEST @@ -332,9 +332,9 @@ abstract class RunPluginVerifierTask @Inject constructor( info(context, "Downloading IDE '$name' to: $ideDir") val url = resolveIdeUrl(type, version, buildType, context) - val dependencyVersion = listOf(type, version, buildType).filterNot(String::isNullOrEmpty).joinToString("-") + val dependencyVersion = listOf(type.toString(), version, buildType).filterNot(String::isNullOrEmpty).joinToString("-") val group = when (type) { - PLATFORM_TYPE_ANDROID_STUDIO -> "com.android" + AndroidStudio -> "com.android" else -> "com.jetbrains" } debug(context, "Downloading IDE from $url") @@ -505,15 +505,16 @@ abstract class RunPluginVerifierTask @Inject constructor( ideVersion: String, downloadPath: Path, context: String?, - block: (type: String, version: String, buildType: String) -> Path, + block: (type: IntelliJPlatformType, version: String, buildType: String) -> Path, ): Path { debug(context, "Resolving IDE path for: $ideVersion") - var (type, version) = ideVersion.trim().split('-', limit = 2) + null - - if (version == null) { - debug(context, "IDE type not specified, setting type to $PLATFORM_TYPE_INTELLIJ_COMMUNITY") - version = type - type = PLATFORM_TYPE_INTELLIJ_COMMUNITY + val (version, code) = ideVersion.trim().split('-', limit = 2).reversed() + null + val type = when(code) { + null -> run { + debug(context, "IDE type not specified, setting type to $IntellijIdeaCommunity") + IntellijIdeaCommunity + } + else -> IntelliJPlatformType.fromCode(code) } val name = "$type-$version" @@ -525,14 +526,14 @@ abstract class RunPluginVerifierTask @Inject constructor( } val buildTypes = when (type) { - PLATFORM_TYPE_ANDROID_STUDIO -> listOf("") + AndroidStudio -> listOf("") else -> listOf("release", "rc", "eap", "beta") } buildTypes.forEach { buildType -> debug(context, "Downloading IDE '$type-$version' from '$buildType' channel to: $downloadPath") try { - return block(type!!, version!!, buildType).also { + return block(type, version!!, buildType).also { debug(context, "Resolved IDE '$type-$version' path: $it") } } catch (e: IOException) { @@ -553,8 +554,8 @@ abstract class RunPluginVerifierTask @Inject constructor( * @param buildType release, rc, eap, beta * @return direct download URL prepended with [CACHE_REDIRECTOR] host */ - private fun resolveIdeUrl(type: String, version: String, buildType: String, context: String?): String { - val isAndroidStudio = type == PLATFORM_TYPE_ANDROID_STUDIO + private fun resolveIdeUrl(type: IntelliJPlatformType, version: String, buildType: String, context: String?): String { + val isAndroidStudio = type == AndroidStudio val url = when { isAndroidStudio -> "$ANDROID_STUDIO_DOWNLOAD_URL/$version/android-studio-$version-linux.tar.gz" else -> "$IDEA_DOWNLOAD_URL?code=$type&platform=linux&type=$buildType&${versionParameterName(version)}=$version" diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt index 87edb7c24a..5c6fa8671b 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt @@ -33,17 +33,7 @@ import org.jdom2.Document import org.jdom2.output.Format import org.jdom2.output.XMLOutputter import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MINIMAL_SUPPORTED_GRADLE_VERSION -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_PYCHARM -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLATFORM_TYPE_PYCHARM_COMMUNITY import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_CUSTOM_SNAPSHOT -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_EAP -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_EAP_CANDIDATE -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_TYPE_NIGHTLY -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_TYPE_RELEASES -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_TYPE_SNAPSHOTS -import org.jetbrains.intellij.platform.gradleplugin.dependency.IdeaDependency import org.jetbrains.intellij.platform.gradleplugin.model.ProductInfo import org.jetbrains.intellij.platform.gradleplugin.plugins.IntelliJPlatformPlugin import java.io.File @@ -59,8 +49,6 @@ import java.time.temporal.ChronoField import java.util.function.Predicate import java.util.jar.Manifest -val MAJOR_VERSION_PATTERN = "(RIDER-|GO-)?\\d{4}\\.\\d-(EAP\\d*-)?SNAPSHOT".toPattern() - internal fun sourcePluginXmlFiles(project: Project) = project .extensions.getByName("java") // Name hard-coded in JavaBasePlugin.addExtensions and well-known. .sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME) // TODO: iterate over all sourceSets? @@ -186,17 +174,6 @@ private fun collectFiles(directory: Path, filter: Predicate) = directory .orEmpty() .filter { filter.test(it) } -fun releaseType(version: String) = when { - version.endsWith(RELEASE_SUFFIX_EAP) || - version.endsWith(RELEASE_SUFFIX_EAP_CANDIDATE) || - version.endsWith(RELEASE_SUFFIX_CUSTOM_SNAPSHOT) || - version.matches(MAJOR_VERSION_PATTERN.toRegex()) - -> RELEASE_TYPE_SNAPSHOTS - - version.endsWith(RELEASE_SUFFIX_SNAPSHOT) -> RELEASE_TYPE_NIGHTLY - else -> RELEASE_TYPE_RELEASES -} - fun error(logCategory: String? = null, message: String, e: Throwable? = null) = log(LogLevel.ERROR, logCategory, message, e) fun warn(logCategory: String? = null, message: String, e: Throwable? = null) = log(LogLevel.WARN, logCategory, message, e) fun info(logCategory: String? = null, message: String, e: Throwable? = null) = log(LogLevel.INFO, logCategory, message, e) @@ -243,10 +220,6 @@ fun isKotlinRuntime(name: String) = name == "kotlin-stdlib" || name.startsWith("kotlin-stdlib-") || name == "kotlin-test" || name.startsWith("kotlin-test-") -fun isDependencyOnPyCharm(dependency: IdeaDependency) = dependency.name == "pycharmPY" || dependency.name == "pycharmPC" - -fun isPyCharmType(type: String) = type == PLATFORM_TYPE_PYCHARM || type == PLATFORM_TYPE_PYCHARM_COMMUNITY - val repositoryVersion: String by lazy { LocalDateTime.now().format( DateTimeFormatterBuilder() @@ -291,7 +264,7 @@ internal fun URL.resolveRedirection() = with(openConnection() as HttpURLConnecti }.also { disconnect() } } -internal fun Project.checkGradleVersion() { +internal fun checkGradleVersion() { if (GradleVersion.current() < GradleVersion.version(MINIMAL_SUPPORTED_GRADLE_VERSION)) { throw PluginInstantiationException("$PLUGIN_NAME requires Gradle $MINIMAL_SUPPORTED_GRADLE_VERSION and higher") } From ff5dab3e184a9fd81297991c21a8434d893d79b0 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Sat, 26 Aug 2023 05:41:19 +0200 Subject: [PATCH 010/347] Introduce `intellijPlatformSources(version: String)` dependencies helpers, `intellijPlatformSourcesConfiguration` configuration, attach sources to the SDK dependency in collector transformer --- .../gradleplugin/IntelliJPlatformType.kt | 68 +++++-- .../gradleplugin/IntelliJPluginConstants.kt | 2 + .../IntelliJPlatformCollectorTransformer.kt | 20 +- .../IntelliJPlatformExtractTransformer.kt | 31 ++-- .../dependencies/intellijPlatform.kt | 173 ++++++++++-------- .../dependencies/intellijPlatformSources.kt | 55 ++++++ .../plugins/IntelliJPlatformBasePlugin.kt | 12 +- .../plugins/IntelliJPlatformPlugin.kt | 11 +- 8 files changed, 261 insertions(+), 111 deletions(-) rename src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/{ => transform}/IntelliJPlatformCollectorTransformer.kt (81%) rename src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/{ => transform}/IntelliJPlatformExtractTransformer.kt (79%) create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformSources.kt diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt index 5dfcb73141..9b5e8468c1 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt @@ -4,18 +4,62 @@ package org.jetbrains.intellij.platform.gradleplugin import org.gradle.api.GradleException -enum class IntelliJPlatformType(val code: String) { - AndroidStudio("AI"), - CLion("CL"), - Gateway("GW"), - GoLand("GO"), - IntellijIdeaCommunity("IC"), - IntellijIdeaUltimate("IU"), - JPS("JPS"), - PhpStorm("PS"), - PyCharmProfessional("PY"), - PyCharmCommunity("PC"), - Rider("RD"); +enum class IntelliJPlatformType(val code: String, val groupId: String, val artifactId: String) { + AndroidStudio( + code = "AI", + groupId = "com.google.android.studio", + artifactId = "android-studio" + ), + CLion( + code = "CL", + groupId = "com.jetbrains.intellij.clion", + artifactId = "clion" + ), + Gateway( + code = "GW", + groupId = "com.jetbrains.gateway", + artifactId = "JetBrainsGateway" + ), + GoLand( + code = "GO", + groupId = "com.jetbrains.intellij.goland", + artifactId = "goland" + ), + IntellijIdeaCommunity( + code = "IC", + groupId = "com.jetbrains.intellij.idea", + artifactId = "ideaIC" + ), + IntellijIdeaUltimate( + code = "IU", + groupId = "com.jetbrains.intellij.idea", + artifactId = "ideaIU" + ), + JPS( + code = "JPS", + groupId = "", + artifactId = "" + ), + PhpStorm( + code = "PS", + groupId = "com.jetbrains.intellij.phpstorm", + artifactId = "phpstorm" + ), + PyCharmProfessional( + code = "PY", + groupId = "com.jetbrains.intellij.pycharm", + artifactId = "pycharmPY" + ), + PyCharmCommunity( + code = "PC", + groupId = "com.jetbrains.intellij.pycharm", + artifactId = "pycharmPC" + ), + Rider( + code = "RD", + groupId = "com.jetbrains.intellij.rider", + artifactId = "riderRD" + ); companion object { private val map = values().associateBy(IntelliJPlatformType::code) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index 71be0956f6..1a51bb9119 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -95,7 +95,9 @@ object IntelliJPluginConstants { const val IDEA_PLUGINS_CONFIGURATION_NAME = "z50_ideaPlugins" @Deprecated("Deprecated in 2.0") const val IDEA_CONFIGURATION_NAME = "z90_intellij" + const val INTELLIJ_PLATFORM_CONFIGURATION_NAME = "intellijPlatformConfiguration" + const val INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME = "intellijPlatformSourcesConfiguration" const val INSTRUMENTED_JAR_CONFIGURATION_NAME = "instrumentedJar" const val INSTRUMENTED_JAR_PREFIX = "instrumented" diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/IntelliJPlatformCollectorTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformCollectorTransformer.kt similarity index 81% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/IntelliJPlatformCollectorTransformer.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformCollectorTransformer.kt index 87066b6975..3539e82796 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/IntelliJPlatformCollectorTransformer.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformCollectorTransformer.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.artifacts +package org.jetbrains.intellij.platform.gradleplugin.artifacts.transform import org.gradle.api.Project import org.gradle.api.artifacts.transform.InputArtifact @@ -9,14 +9,17 @@ import org.gradle.api.artifacts.transform.TransformOutputs import org.gradle.api.artifacts.transform.TransformParameters import org.gradle.api.artifacts.type.ArtifactTypeDefinition.ZIP_TYPE import org.gradle.api.attributes.Attribute +import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.FileSystemLocation import org.gradle.api.plugins.JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME import org.gradle.api.plugins.JavaPlugin.TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME import org.gradle.api.provider.Provider import org.gradle.api.tasks.Classpath +import org.gradle.api.tasks.CompileClasspath import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.registerTransform import org.gradle.work.DisableCachingByDefault +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.asPath import org.jetbrains.intellij.platform.gradleplugin.collectJars import org.jetbrains.intellij.platform.gradleplugin.isKotlinRuntime @@ -24,7 +27,13 @@ import kotlin.io.path.isDirectory import kotlin.io.path.name @DisableCachingByDefault(because = "Not worth caching") -abstract class IntelliJPlatformCollectorTransformer : TransformAction { +abstract class IntelliJPlatformCollectorTransformer : TransformAction { + + interface Parameters : TransformParameters { + + @get:CompileClasspath + val sourcesClasspath: ConfigurableFileCollection + } @get:InputArtifact @get:Classpath @@ -46,6 +55,10 @@ abstract class IntelliJPlatformCollectorTransformer : TransformAction { - @get:InputArtifact @get:Classpath + @get:InputArtifact abstract val inputArtifact: Provider + private val IntelliJPlatformType.artifactPathPart + get() = "$separator$groupId$separator$artifactId$separator" + override fun transform(outputs: TransformOutputs) { val input = inputArtifact.get().asPath - val nameWithoutExtension = input.nameWithoutExtension.removeSuffix(".tar") - val extension = input.name.removePrefix(nameWithoutExtension) - val targetDirectory = outputs.dir("$nameWithoutExtension.extracted") -// val cacheDirectory = getZipCacheDirectory(input) + val type = IntelliJPlatformType.values().find { + input.pathString.contains(it.artifactPathPart) // com.jetbrains.intellij.idea/ideaIU + } ?: return + val version = input.getName(input.nameCount - 3) + val extension = input.name.removePrefix(input.nameWithoutExtension.removeSuffix(".tar")) + val targetDirectory = outputs.dir("$type-$version") - // TODO: Check if [nameWithoutExtension] matches our artifact names - // TODO: Allow for providing custom IDE dir? +// val cacheDirectory = getZipCacheDirectory(input) when (extension) { ".zip", ".sit" -> { @@ -65,7 +72,7 @@ abstract class IntelliJPlatformExtractTransformer @Inject constructor( } } - private fun getZipCacheDirectory(zipFile: Path /*, project: Project, type: IntelliJPlatformType */): Path { +// private fun getZipCacheDirectory(zipFile: Path, project: Project, type: IntelliJPlatformType): Path { // if (ideaDependencyCachePath.isNotEmpty()) { // return File(ideaDependencyCachePath).apply { // mkdirs() @@ -73,8 +80,8 @@ abstract class IntelliJPlatformExtractTransformer @Inject constructor( // } else if (type == IntelliJPlatformType.Rider && OperatingSystem.current().isWindows) { // return project.buildDir.toPath() // } - return zipFile.parent - } +// return zipFile.parent +// } } internal fun Project.applyIntellijPlatformExtractTransformer() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt index e1772b97a7..bf682de826 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt @@ -4,110 +4,135 @@ package org.jetbrains.intellij.platform.gradleplugin.dependencies -import org.gradle.internal.os.OperatingSystem +import org.gradle.api.provider.Provider import org.gradle.kotlin.dsl.DependencyHandlerScope import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.platform.gradleplugin.BuildException import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME -fun DependencyHandlerScope.intellijPlatform( - type: IntelliJPlatformType?, +internal fun DependencyHandlerScope.intellijPlatform( + type: IntelliJPlatformType, version: String, configurationName: String = INTELLIJ_PLATFORM_CONFIGURATION_NAME, -) = when (type) { - IntellijIdeaUltimate -> create( - group = "com.jetbrains.intellij.idea", - name = "ideaIU", - version = version, - ) - - IntellijIdeaCommunity -> create( - group = "com.jetbrains.intellij.idea", - name = "ideaIC", - version = version, -// ext = "zip", -// ext = "unzipped", - ) - - CLion -> create( - group = "com.jetbrains.intellij.clion", - name = "clion", - version = version, - ) - - PyCharmProfessional -> create( - group = "com.jetbrains.intellij.pycharm", - name = "pycharmPY", - version = version, - ) - - PyCharmCommunity -> create( - group = "com.jetbrains.intellij.pycharm", - name = "pycharmPC", - version = version, - ) - - GoLand -> create( - group = "com.jetbrains.intellij.goland", - name = "goland", - version = version, - ) - - PhpStorm -> create( - group = "com.jetbrains.intellij.phpstorm", - name = "phpstorm", - version = version, +) = add(configurationName, create( + group = type.groupId, + name = type.artifactId, + version = version, +)) + +internal fun DependencyHandlerScope.intellijPlatform( + type: IntelliJPlatformType, + versionProvider: Provider, + configurationName: String = INTELLIJ_PLATFORM_CONFIGURATION_NAME, +) = addProvider(configurationName, versionProvider.map { + create( + group = type.groupId, + name = type.artifactId, + version = it, ) - - Rider -> create( - group = "com.jetbrains.intellij.rider", - name = "riderRD", - version = version, +}) + +// return when (type) { +// IntellijIdeaUltimate -> create( +// group = "com.jetbrains.intellij.idea", +// name = "ideaIU", +// version = version, +// ) +// +// CLion -> create( +// group = "com.jetbrains.intellij.clion", +// name = "clion", +// version = version, +// ) +// +// PyCharmProfessional -> create( +// group = "com.jetbrains.intellij.pycharm", +// name = "pycharmPY", +// version = version, +// ) +// +// PyCharmCommunity -> create( +// group = "com.jetbrains.intellij.pycharm", +// name = "pycharmPC", +// version = version, +// ) +// +// GoLand -> create( +// group = "com.jetbrains.intellij.goland", +// name = "goland", +// version = version, +// ) +// +// PhpStorm -> create( +// group = "com.jetbrains.intellij.phpstorm", +// name = "phpstorm", +// version = version, +// ) +// +// Rider -> create( +// group = "com.jetbrains.intellij.rider", +// name = "riderRD", +// version = version, // hasSources = (sources && releaseType != IntelliJPluginConstants.RELEASE_TYPE_SNAPSHOTS).ifFalse { // warn(context, "IDE sources are not available for Rider SNAPSHOTS") // }, - ) - - Gateway -> create( - group = "com.jetbrains.gateway", - name = "JetBrainsGateway", - version = version, +// ) +// +// Gateway -> create( +// group = "com.jetbrains.gateway", +// name = "JetBrainsGateway", +// version = version, // hasSources = false, - ) - - AndroidStudio -> create( - group = "com.google.android.studio", - name = "android-studio", - version = version, +// ) +// +// AndroidStudio -> create( +// group = "com.google.android.studio", +// name = "android-studio", +// version = version, // hasSources = false, - ext = when { - OperatingSystem.current().isLinux -> "tar.gz" - else -> "zip" - }, - ) +// ext = when { +// OperatingSystem.current().isLinux -> "tar.gz" +// else -> "zip" +// }, +// ) // { // with(it) { // Files.list(resolveAndroidStudioPath(this)) // .forEach { entry -> Files.move(entry, resolve(entry.fileName), StandardCopyOption.REPLACE_EXISTING) } // } // } - - else -> throw BuildException("Specified type '$type' is unknown. Supported values: ${IntelliJPlatformType.values().joinToString(", ") { it.code }}") -}.let { dependency -> - add(configurationName, dependency) -} +// } fun DependencyHandlerScope.intellijPlatform(type: String, version: String) = intellijPlatform(IntelliJPlatformType.fromCode(type), version) +fun DependencyHandlerScope.intellijPlatform(type: String, version: Provider) = intellijPlatform(IntelliJPlatformType.fromCode(type), version) fun DependencyHandlerScope.androidStudio(version: String) = intellijPlatform(AndroidStudio, version) +fun DependencyHandlerScope.androidStudio(version: Provider) = intellijPlatform(AndroidStudio, version) + fun DependencyHandlerScope.clion(version: String) = intellijPlatform(CLion, version) +fun DependencyHandlerScope.clion(version: Provider) = intellijPlatform(CLion, version) + fun DependencyHandlerScope.gateway(version: String) = intellijPlatform(Gateway, version) +fun DependencyHandlerScope.gateway(version: Provider) = intellijPlatform(Gateway, version) + fun DependencyHandlerScope.goland(version: String) = intellijPlatform(GoLand, version) +fun DependencyHandlerScope.goland(version: Provider) = intellijPlatform(GoLand, version) + fun DependencyHandlerScope.intellijIdeaCommunity(version: String) = intellijPlatform(IntellijIdeaCommunity, version) +fun DependencyHandlerScope.intellijIdeaCommunity(version: Provider) = intellijPlatform(IntellijIdeaCommunity, version) + fun DependencyHandlerScope.intellijIdeaUltimate(version: String) = intellijPlatform(IntellijIdeaUltimate, version) +fun DependencyHandlerScope.intellijIdeaUltimate(version: Provider) = intellijPlatform(IntellijIdeaUltimate, version) + fun DependencyHandlerScope.phpstorm(version: String) = intellijPlatform(PhpStorm, version) +fun DependencyHandlerScope.phpstorm(version: Provider) = intellijPlatform(PhpStorm, version) + fun DependencyHandlerScope.pycharmProfessional(version: String) = intellijPlatform(PyCharmProfessional, version) +fun DependencyHandlerScope.pycharmProfessional(version: Provider) = intellijPlatform(PyCharmProfessional, version) + fun DependencyHandlerScope.pycharmCommunity(version: String) = intellijPlatform(PyCharmCommunity, version) +fun DependencyHandlerScope.pycharmCommunity(version: Provider) = intellijPlatform(PyCharmCommunity, version) + fun DependencyHandlerScope.rider(version: String) = intellijPlatform(Rider, version) +fun DependencyHandlerScope.rider(version: Provider) = intellijPlatform(Rider, version) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformSources.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformSources.kt new file mode 100644 index 0000000000..d5364b955a --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformSources.kt @@ -0,0 +1,55 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +@file:Suppress("unused") + +package org.jetbrains.intellij.platform.gradleplugin.dependencies + +import org.gradle.api.provider.Provider +import org.gradle.kotlin.dsl.DependencyHandlerScope +import org.gradle.kotlin.dsl.create +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.IntellijIdeaCommunity +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.PyCharmCommunity +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME + +fun DependencyHandlerScope.intellijPlatformSources( + type: IntelliJPlatformType?, + version: String, + configurationName: String = INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME, +) = add(configurationName, createIntelliJPlatformSourcesDependency(type, version)) + +internal fun DependencyHandlerScope.intellijPlatformSources( + type: IntelliJPlatformType?, + versionProvider: Provider, + configurationName: String = INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME, +) = addProvider(configurationName, versionProvider.map { createIntelliJPlatformSourcesDependency(type, it) }) + +internal fun DependencyHandlerScope.createIntelliJPlatformSourcesDependency( + type: IntelliJPlatformType?, + version: String, +) = when (type) { + IntellijIdeaCommunity -> create( + group = "com.jetbrains.intellij.idea", + name = "ideaIC", + version = version, + classifier = "sources", + ) + + PyCharmCommunity -> create( + group = "com.jetbrains.intellij.pycharm", + name = "pycharmPC", + version = version, + classifier = "sources", + ) + + else -> throw IllegalArgumentException("Specified type '$type' is unknown. Supported values: $IntellijIdeaCommunity, $PyCharmCommunity") +} + +fun DependencyHandlerScope.intellijPlatformSources(type: String, version: String) = intellijPlatformSources(IntelliJPlatformType.fromCode(type), version) +fun DependencyHandlerScope.intellijPlatformSources(type: String, version: Provider) = intellijPlatformSources(IntelliJPlatformType.fromCode(type), version) + +fun DependencyHandlerScope.intellijIdeaCommunitySources(version: String) = intellijPlatformSources(IntellijIdeaCommunity, version) +fun DependencyHandlerScope.intellijIdeaCommunitySources(version: Provider) = intellijPlatformSources(IntellijIdeaCommunity, version) + +fun DependencyHandlerScope.pycharmCommunitySources(version: String) = intellijPlatformSources(PyCharmCommunity, version) +fun DependencyHandlerScope.pycharmCommunitySources(version: Provider) = intellijPlatformSources(PyCharmCommunity, version) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt index 341ea21cb6..e308aae2ec 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt @@ -8,9 +8,8 @@ import org.gradle.api.model.ObjectFactory import org.gradle.api.provider.ProviderFactory import org.gradle.kotlin.dsl.create import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.EXTENSION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.artifacts.applyIntellijPlatformCollectorTransformer -import org.jetbrains.intellij.platform.gradleplugin.artifacts.applyIntellijPlatformExtractTransformer +import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyIntellijPlatformCollectorTransformer +import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyIntellijPlatformExtractTransformer import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension import org.jetbrains.intellij.platform.gradleplugin.info @@ -31,13 +30,6 @@ abstract class IntelliJPlatformBasePlugin @Inject constructor( info(context, "Configuring plugin: org.jetbrains.intellij.platform.base") checkGradleVersion() - val intellijPlatformConfiguration = project.configurations.create(INTELLIJ_PLATFORM_CONFIGURATION_NAME) - .setVisible(false) - .apply { - isCanBeConsumed = false - isCanBeResolved = true - } - project.repositories.applyIntelliJPlatformSettings(objects, providers) project.applyIntellijPlatformExtractTransformer() project.applyIntellijPlatformCollectorTransformer() diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt index fed406cbdb..b3f64599ff 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt @@ -68,6 +68,7 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INST import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEFAULT_DEPENDENCIES_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_COMPILER_ANT_TASKS_MAVEN_METADATA import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.KOTLIN_GRADLE_PLUGIN_ID @@ -139,8 +140,8 @@ abstract class IntelliJPlatformPlugin : Plugin { info(context, "Configuring plugin: org.jetbrains.intellij.platform") checkGradleVersion() - project.applyPlugins() project.applyConfigurations() + project.applyPlugins() return archiveUtils = project.objects.newInstance() @@ -322,6 +323,14 @@ abstract class IntelliJPlatformPlugin : Plugin { description = "..." // TODO } + project.configurations.maybeCreate(INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME) + .apply { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + description = "..." // TODO + } + val ideaPlugins = project.configurations.create(IDEA_PLUGINS_CONFIGURATION_NAME) .setVisible(false) .withDependencies { From ab820346639947bec80e18d29a6b46f2838401a5 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 28 Aug 2023 12:20:01 +0200 Subject: [PATCH 011/347] Drop deprecated `project.buildDir` usage --- build.gradle.kts | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index ca77c69867..30e9bc9940 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -90,11 +90,19 @@ tasks { } test { - val testGradleHomePath = properties("testGradleUserHome").getOrElse("$buildDir/testGradleHome") + val testGradleHome = properties("testGradleUserHome") + .map { File(it) } + .getOrElse( + layout.buildDirectory.asFile + .map { it.resolve("testGradleHome") } + .get() + ) + doFirst { - File(testGradleHomePath).mkdir() + testGradleHome.mkdir() } - systemProperties["test.gradle.home"] = testGradleHomePath + + systemProperties["test.gradle.home"] = testGradleHome systemProperties["test.gradle.scan"] = project.gradle.startParameter.isBuildScan systemProperties["test.kotlin.version"] = properties("kotlinVersion").get() systemProperties["test.gradle.default"] = properties("gradleVersion").get() @@ -103,7 +111,7 @@ tasks { systemProperties["test.intellij.version"] = properties("testIntelliJVersion").get() systemProperties["test.markdownPlugin.version"] = properties("testMarkdownPluginVersion").get() systemProperties["plugins.repository"] = properties("pluginsRepository").get() - outputs.dir(testGradleHomePath) + outputs.dir(testGradleHome) // Verbose tests output used for debugging tasks: // testLogging { @@ -154,11 +162,18 @@ testing { targets { all { testTask.configure { - val testGradleHomePath = properties("testGradleUserHome").getOrElse("$buildDir/testGradleHome") + val testGradleHome = properties("testGradleUserHome") + .map { File(it) } + .getOrElse( + layout.buildDirectory.asFile + .map { it.resolve("testGradleHome") } + .get() + ) + doFirst { - File(testGradleHomePath).mkdir() + testGradleHome.mkdir() } - systemProperties["test.gradle.home"] = testGradleHomePath + systemProperties["test.gradle.home"] = testGradleHome systemProperties["test.gradle.scan"] = project.gradle.startParameter.isBuildScan systemProperties["test.kotlin.version"] = properties("kotlinVersion").get() systemProperties["test.gradle.default"] = properties("gradleVersion").get() From 548ed8577aaef37bca44123b83d79512d1561880 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Tue, 29 Aug 2023 21:33:31 +0200 Subject: [PATCH 012/347] Deprecate `SetupDependenciesTask` --- CHANGELOG.md | 5 +- .../gradleplugin/IntelliJPluginConstants.kt | 11 ++- .../plugins/IntelliJPlatformBasePlugin.kt | 52 ++++++++++++- .../plugins/IntelliJPlatformPlugin.kt | 75 ------------------- .../plugins/IntelliJPlatformTasksPlugin.kt | 14 +++- .../tasks/SetupDependenciesTask.kt | 17 +++-- 6 files changed, 81 insertions(+), 93 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4aaac5e988..1ce028770d 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,12 +3,12 @@ ## [next] ### Added -- Configure all tasks that extend task classes instead of just those created by the plugin +- Configure all tasks that extend task classes instead of just those created by the plugin - Make JbrResolver prefer Gradle javaToolchains by `JetBrains s.r.o`, if available. Only otherwise start fetching and running a new one. - Added `org.jetbrains.intellij.buildFeature.useCacheRedirector` build feature - Added `IntelliJPlatformCollectorTransformer` and `IntelliJPlatformExtractTransformer` for handling IntelliJ Platform dependency archives - Added `jetbrainsAnnotations` dependency helper for adding JetBrains Annotations dependency -- Added general `intellijPlatform` along with product-specific dependency helpers for adding IntelliJ Platform dependency +- Added general `intellijPlatform` along with product-specific dependency helpers for adding IntelliJ Platform dependency ### Changed - New project name: IntelliJ Platform Gradle Plugin @@ -17,6 +17,7 @@ - Move classes under the new package: `org.jetbrains.intellij.platform.gradleplugin` - Update minimal supported Gradle version to `8.0` - Disabled caching for `BuildPluginTask` +- Deprecate `SetupDependenciesTask` ## [1.15.0] - 2023-07-07 diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index 1a51bb9119..211dd8da9e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -37,13 +37,14 @@ object IntelliJPluginConstants { const val RUN_IDE_FOR_UI_TESTS_TASK_NAME = "runIdeForUiTests" const val RUN_IDE_PERFORMANCE_TEST_TASK_NAME = "runIdePerformanceTest" const val RUN_PLUGIN_VERIFIER_TASK_NAME = "runPluginVerifier" - @Deprecated("Deprecated in 2.0") const val SETUP_DEPENDENCIES_TASK_NAME = "setupDependencies" const val SIGN_PLUGIN_TASK_NAME = "signPlugin" const val VERIFY_PLUGIN_TASK_NAME = "verifyPlugin" const val VERIFY_PLUGIN_CONFIGURATION_TASK_NAME = "verifyPluginConfiguration" const val VERIFY_PLUGIN_SIGNATURE_TASK_NAME = "verifyPluginSignature" + const val COMPILE_KOTLIN_TASK_NAME = "compileKotlin" + val TASKS = listOf( BUILD_PLUGIN_TASK_NAME, BUILD_SEARCHABLE_OPTIONS_TASK_NAME, @@ -77,10 +78,8 @@ object IntelliJPluginConstants { VERIFY_PLUGIN_SIGNATURE_TASK_NAME, ) - const val COMPILE_KOTLIN_TASK_NAME = "compileKotlin" const val KOTLIN_GRADLE_PLUGIN_ID = "org.jetbrains.kotlin.jvm" - @Deprecated("Deprecated in 2.0") - const val IDEA_GRADLE_PLUGIN_ID = "org.jetbrains.gradle.plugin.idea-ext" + const val JAVA_TEST_FIXTURES_PLUGIN_ID = "java-test-fixtures" const val PLUGIN_XML_DIR_NAME = "patchedPluginXmlFiles" const val SEARCHABLE_OPTIONS_DIR_NAME = "searchableOptions" @@ -89,15 +88,19 @@ object IntelliJPluginConstants { // see https://github.com/JetBrains/gradle-intellij-plugin/issues/1060 @Deprecated("Deprecated in 2.0") const val INTELLIJ_DEFAULT_DEPENDENCIES_CONFIGURATION_NAME = "z10_intellijDefaultDependencies" + @Deprecated("Deprecated in 2.0") const val PERFORMANCE_TEST_CONFIGURATION_NAME = "z20_performanceTest" + @Deprecated("Deprecated in 2.0") const val IDEA_PLUGINS_CONFIGURATION_NAME = "z50_ideaPlugins" + @Deprecated("Deprecated in 2.0") const val IDEA_CONFIGURATION_NAME = "z90_intellij" const val INTELLIJ_PLATFORM_CONFIGURATION_NAME = "intellijPlatformConfiguration" const val INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME = "intellijPlatformSourcesConfiguration" + const val TEST_FIXTURES_COMPILE_ONLY_CONFIGURATION_NAME = "testFixturesCompileOnly" const val INSTRUMENTED_JAR_CONFIGURATION_NAME = "instrumentedJar" const val INSTRUMENTED_JAR_PREFIX = "instrumented" diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt index e308aae2ec..3ca5478e38 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt @@ -4,10 +4,19 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.api.artifacts.Configuration import org.gradle.api.model.ObjectFactory +import org.gradle.api.plugins.JavaPlugin +import org.gradle.api.plugins.JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME +import org.gradle.api.plugins.JavaPlugin.TEST_COMPILE_ONLY_CONFIGURATION_NAME import org.gradle.api.provider.ProviderFactory +import org.gradle.kotlin.dsl.apply import org.gradle.kotlin.dsl.create import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.EXTENSION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_TEST_FIXTURES_PLUGIN_ID +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TEST_FIXTURES_COMPILE_ONLY_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyIntellijPlatformCollectorTransformer import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyIntellijPlatformExtractTransformer import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion @@ -31,10 +40,44 @@ abstract class IntelliJPlatformBasePlugin @Inject constructor( checkGradleVersion() project.repositories.applyIntelliJPlatformSettings(objects, providers) - project.applyIntellijPlatformExtractTransformer() - project.applyIntellijPlatformCollectorTransformer() + + project.applyPlugins() + project.applyConfigurations() project.applyExtension() project.applyTasks() + project.applyTransformers() + } + + private fun Project.applyPlugins() { + project.plugins.apply(JavaPlugin::class) + } + + private fun Project.applyConfigurations() { + val intellijPlatformConfiguration = project.configurations.maybeCreate(INTELLIJ_PLATFORM_CONFIGURATION_NAME) + .apply { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + description = "IntelliJ Platform dependency" + } + + project.configurations.maybeCreate(INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME) + .apply { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + description = "IntelliJ Platform Sources to be attached to the IntelliJ Platform dependency" + } + + fun Configuration.extend() = extendsFrom(intellijPlatformConfiguration) + + with(project.configurations) { + getByName(COMPILE_ONLY_CONFIGURATION_NAME).extend() + getByName(TEST_COMPILE_ONLY_CONFIGURATION_NAME).extend() + project.pluginManager.withPlugin(JAVA_TEST_FIXTURES_PLUGIN_ID) { + getByName(TEST_FIXTURES_COMPILE_ONLY_CONFIGURATION_NAME).extend() + } + } } private fun Project.applyExtension() { @@ -44,4 +87,9 @@ abstract class IntelliJPlatformBasePlugin @Inject constructor( private fun Project.applyTasks() { } + + private fun Project.applyTransformers() { + applyIntellijPlatformExtractTransformer() + applyIntellijPlatformCollectorTransformer() + } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt index b3f64599ff..a81ec7942f 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt @@ -9,14 +9,12 @@ import com.jetbrains.plugin.structure.intellij.version.IdeVersion import org.gradle.api.GradleException import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.artifacts.Configuration import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.DependencySet import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.DuplicatesStrategy import org.gradle.api.internal.plugins.DefaultArtifactPublicationSet import org.gradle.api.logging.LogLevel -import org.gradle.api.plugins.ExtensionAware import org.gradle.api.plugins.JavaPlugin import org.gradle.api.plugins.JavaPlugin.* import org.gradle.api.plugins.JavaPluginExtension @@ -34,11 +32,6 @@ import org.gradle.jvm.toolchain.JavaToolchainService import org.gradle.kotlin.dsl.* import org.gradle.kotlin.dsl.support.serviceOf import org.gradle.language.jvm.tasks.ProcessResources -import org.gradle.plugins.ide.idea.model.IdeaModel -import org.gradle.plugins.ide.idea.model.IdeaProject -import org.jetbrains.gradle.ext.IdeaExtPlugin -import org.jetbrains.gradle.ext.ProjectSettings -import org.jetbrains.gradle.ext.TaskTriggersConfig import org.jetbrains.intellij.platform.gradleplugin.* import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.* @@ -56,7 +49,6 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWN import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ZIP_SIGNER_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.EXTENSION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_GRADLE_PLUGIN_ID import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PLUGINS_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PRODUCTS_RELEASES_URL import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME @@ -67,8 +59,6 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INST import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENT_TEST_CODE_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEFAULT_DEPENDENCIES_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_COMPILER_ANT_TASKS_MAVEN_METADATA import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.KOTLIN_GRADLE_PLUGIN_ID @@ -94,7 +84,6 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SEARCHABLE_OPTIONS_DIR_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SIGN_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_CONFIGURATION_TASK_NAME @@ -148,18 +137,6 @@ abstract class IntelliJPlatformPlugin : Plugin { dependenciesDownloader = project.objects.newInstance(project.gradle.startParameter.isOffline) project.plugins.apply(JavaPlugin::class) - project.plugins.apply(IdeaExtPlugin::class) - - project.pluginManager.withPlugin(IDEA_GRADLE_PLUGIN_ID) { - project.idea { - // IdeaModel.project is available only for a root project - this.project?.settings { - taskTriggers { - afterSync(SETUP_DEPENDENCIES_TASK_NAME) - } - } - } - } val extension = project.extensions.create(EXTENSION_NAME, dependenciesDownloader).apply { version.convention(project.provider { @@ -215,7 +192,6 @@ abstract class IntelliJPlatformPlugin : Plugin { } configureInitializeGradleIntelliJPluginTask(project) - configureSetupDependenciesTask(project, ideaDependencyProvider) configureClassPathIndexCleanupTask(project, ideaDependencyProvider) configureInstrumentation(project, extension, ideaDependencyProvider) configurePatchPluginXmlTask(project, extension, ideaDependencyProvider) @@ -315,22 +291,6 @@ abstract class IntelliJPlatformPlugin : Plugin { } private fun Project.applyConfigurations() { - val intellijPlatformConfiguration = project.configurations.maybeCreate(INTELLIJ_PLATFORM_CONFIGURATION_NAME) - .apply { - isVisible = false - isCanBeConsumed = false - isCanBeResolved = true - description = "..." // TODO - } - - project.configurations.maybeCreate(INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME) - .apply { - isVisible = false - isCanBeConsumed = false - isCanBeResolved = true - description = "..." // TODO - } - val ideaPlugins = project.configurations.create(IDEA_PLUGINS_CONFIGURATION_NAME) .setVisible(false) .withDependencies { @@ -394,16 +354,6 @@ abstract class IntelliJPlatformPlugin : Plugin { } // fun Configuration.extend() = extendsFrom(defaultDependencies, idea, ideaPlugins, performanceTest) - fun Configuration.extend() = extendsFrom(intellijPlatformConfiguration) - - with(project.configurations) { - getByName(COMPILE_ONLY_CONFIGURATION_NAME).extend() - getByName(TEST_COMPILE_ONLY_CONFIGURATION_NAME).extend() -// getByName(TEST_IMPLEMENTATION_CONFIGURATION_NAME).extend() - project.pluginManager.withPlugin("java-test-fixtures") { // TODO: move to constants - getByName("testFixturesCompileOnly").extend() // TODO: move to constants - } - } } private fun configureProjectAfterEvaluate(project: Project, extension: IntelliJPluginExtension, ideaDependencyProvider: Provider) { @@ -1573,19 +1523,6 @@ abstract class IntelliJPlatformPlugin : Plugin { } } - private fun configureSetupDependenciesTask(project: Project, ideaDependencyProvider: Provider) { - info(context, "Configuring setup dependencies task") - - project.tasks.register(SETUP_DEPENDENCIES_TASK_NAME) - project.tasks.withType { - idea.convention(ideaDependencyProvider) - - Jvm.current().toolsJar?.let { toolsJar -> - project.dependencies.add(RUNTIME_ONLY_CONFIGURATION_NAME, project.files(toolsJar)) - } - } - } - private fun configurePluginDependencies( project: Project, ideaDependencyProvider: Provider, @@ -1661,18 +1598,6 @@ abstract class IntelliJPlatformPlugin : Plugin { private fun Project.resolveBuildTaskOutput() = tasks.named(BUILD_PLUGIN_TASK_NAME).flatMap { it.archiveFile } - private fun Project.idea( - action: IdeaModel.() -> Unit, - ) = extensions.configure("idea", action) - - private fun IdeaProject.settings( - action: ProjectSettings.() -> Unit, - ) = (this as ExtensionAware).extensions.configure("settings", action) - - private fun ProjectSettings.taskTriggers( - action: TaskTriggersConfig.() -> Unit, - ) = (this as ExtensionAware).extensions.configure("taskTriggers", action) - /** * Strips an [IdeVersion] of components other than SNAPSHOT and * that exceeds a patch, i.e. "excess" in the following * version will be stripped: major.minor.patch.excess.SNAPSHOT. diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt index 510eb732a7..907c1a87c3 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt @@ -5,9 +5,12 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.register +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion import org.jetbrains.intellij.platform.gradleplugin.info import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.tasks.SetupDependenciesTask abstract class IntelliJPlatformTasksPlugin : Plugin { @@ -19,10 +22,15 @@ abstract class IntelliJPlatformTasksPlugin : Plugin { info(context, "Configuring plugin: org.jetbrains.intellij.platform.tasks") checkGradleVersion() - applyPlugins(project) + project.applyPlugins() + project.applyTasks() } - private fun applyPlugins(project: Project) { - project.plugins.apply(IntelliJPlatformBasePlugin::class) + private fun Project.applyPlugins() { + plugins.apply(IntelliJPlatformBasePlugin::class) + } + + private fun Project.applyTasks() { + tasks.register(SETUP_DEPENDENCIES_TASK_NAME) } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTask.kt index fe250c872e..8deb5a5022 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTask.kt @@ -9,24 +9,27 @@ import org.gradle.api.tasks.TaskAction import org.gradle.work.DisableCachingByDefault import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME import org.jetbrains.intellij.platform.gradleplugin.dependency.IdeaDependency -import org.jetbrains.intellij.platform.gradleplugin.info +import org.jetbrains.intellij.platform.gradleplugin.error import org.jetbrains.intellij.platform.gradleplugin.logCategory /** - * Setups required dependencies for building and running project. + * A deprecated method for setting up IntelliJ Platform dependencies. * - * This task is automatically added to the ["After Sync" Gradle trigger](https://www.jetbrains.com/help/idea/work-with-gradle-tasks.html#config_triggers_gradle) to make the IntelliJ SDK dependency available for IntelliJ IDEA right after the Gradle synchronization. + * The `setupDependencies` task was automatically added to the ["After Sync" Gradle trigger](https://www.jetbrains.com/help/idea/work-with-gradle-tasks.html#config_triggers_gradle) to make the IntelliJ SDK dependency available for IntelliJ IDEA right after the Gradle synchronization. + * With IntelliJ Platform Gradle Plugin 2.0 release, this method is no longer needed as the native Gradle dependencies resolution is in use. * - * > After removing the IntelliJ Platform Gradle Plugin from your project, the `Task 'setupDependencies' not found in root project` exception may occur. + * To remove any references to this task, call the "Tasks Activation" action and remove the `setupDependencies` entry from the "After Sync" group. * - * @see Frequently Asked Questions + * TODO: Link to SDK Docs */ @DisableCachingByDefault(because = "No output state to track") abstract class SetupDependenciesTask : DefaultTask() { /** * Reference to the resolved `idea` dependency. + * TODO: suggest alternative method for accessing IDEA dependency */ + @Deprecated(message = "setupDependencies.idea is no longer available") @get:Internal abstract val idea: Property @@ -34,11 +37,11 @@ abstract class SetupDependenciesTask : DefaultTask() { init { group = PLUGIN_GROUP_NAME - description = "Sets up required dependencies for building and running project." + description = "Deprecated task" } @TaskAction fun setupDependencies() { - info(context, "Setting up dependencies using: ${idea.get().classes}") + error(context, "Task is deprecated now, see: [SDK Docs link]") } } From e7fbfd3903292bdbb9dbbd5e81a7879228930858 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Tue, 29 Aug 2023 21:40:27 +0200 Subject: [PATCH 013/347] Removed `intellij`, `intellijPlugin`, `intellijPlugins`, `intellijExtra` helper methods from `DependenciesUtils` --- CHANGELOG.md | 3 + .../gradleplugin/DependenciesUtils.kt | 114 ------ .../gradleplugin/IntelliJPluginExtension.kt | 6 +- .../IntelliJPluginManualConfigSpec.kt | 367 ------------------ 4 files changed, 6 insertions(+), 484 deletions(-) delete mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/DependenciesUtils.kt delete mode 100644 src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginManualConfigSpec.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ce028770d..3869729a7b 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,9 @@ - Disabled caching for `BuildPluginTask` - Deprecate `SetupDependenciesTask` +### Removed +- Removed `intellij`, `intellijPlugin`, `intellijPlugins`, `intellijExtra` helper methods from `DependenciesUtils` + ## [1.15.0] - 2023-07-07 ### Added diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/DependenciesUtils.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/DependenciesUtils.kt deleted file mode 100644 index 6a98c7b359..0000000000 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/DependenciesUtils.kt +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -@file:JvmName("DependenciesUtils") - -package org.jetbrains.intellij.platform.gradleplugin - -import groovy.lang.Closure -import org.gradle.api.Action -import org.gradle.api.GradleException -import org.gradle.api.Project -import org.gradle.api.file.FileCollection -import org.gradle.api.file.FileTree -import org.gradle.api.tasks.util.PatternFilterable -import org.gradle.kotlin.dsl.getByType -import org.gradle.kotlin.dsl.named -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginDependency -import org.jetbrains.intellij.platform.gradleplugin.tasks.SetupDependenciesTask - -@Deprecated("Deprecated in 2.0") -fun Project.intellij() = intellijBase() -@Deprecated("Deprecated in 2.0") -fun Project.intellij(filter: Closure<*>) = intellijBase().matching(filter) -@Deprecated("Deprecated in 2.0") -fun Project.intellij(filter: Action) = intellijBase().matching(filter) -@Deprecated("Deprecated in 2.0") -fun Project.intellij(filter: PatternFilterable) = intellijBase().matching(filter) - -@Deprecated("Deprecated in 2.0") -private fun Project.intellijBase(): FileTree { - val setupDependenciesTaskProvider = project.tasks.named(SETUP_DEPENDENCIES_TASK_NAME) - val ideaProvider = setupDependenciesTaskProvider.flatMap { setupDependenciesTask -> - setupDependenciesTask.idea.map { - files(it.jarFiles).asFileTree - } - } - - if (!state.executed) { - throw GradleException("intellij is not (yet) configured. Please note that you should configure intellij dependencies in the afterEvaluate block") - } - - return ideaProvider.get() -} - -@Deprecated("Deprecated in 2.0") -fun Project.intellijPlugin(plugin: String) = intellijPluginBase(plugin) -@Deprecated("Deprecated in 2.0") -fun Project.intellijPlugin(plugin: String, filter: Closure<*>) = intellijPluginBase(plugin).matching(filter) -@Deprecated("Deprecated in 2.0") -fun Project.intellijPlugin(plugin: String, filter: Action) = intellijPluginBase(plugin).matching(filter) -@Deprecated("Deprecated in 2.0") -fun Project.intellijPlugin(plugin: String, filter: PatternFilterable) = intellijPluginBase(plugin).matching(filter) - -@Deprecated("Deprecated in 2.0") -private fun Project.intellijPluginBase(plugin: String): FileTree { - val extension = extensions.getByType() - - if (!state.executed) { - throw GradleException("intellij plugin '$plugin' is not (yet) configured. Please note that you should specify plugins in the intellij.plugins property and configure dependencies on them in the afterEvaluate block") - } - - val dependency = extension.getPluginDependenciesList(this) - .find { it.id == plugin && it.jarFiles.isNotEmpty() } - ?: throw GradleException("intellij plugin '$plugin' is not found. Please note that you should specify plugins in the intellij.plugins property and configure dependencies on them in the afterEvaluate block") - - return files(dependency.jarFiles).asFileTree -} - -@Deprecated("Deprecated in 2.0") -fun Project.intellijPlugins(vararg plugins: String): FileCollection { - val extension = extensions.getByType() - val selectedPlugins = mutableSetOf() - val nonValidPlugins = mutableListOf() - - plugins.forEach { pluginName -> - extension - .getPluginDependenciesList(this) - .find { it.id == pluginName && it.jarFiles.isNotEmpty() } - .ifNull { nonValidPlugins.add(pluginName) } - ?.let { selectedPlugins.add(it) } - } - - if (nonValidPlugins.isNotEmpty()) { - throw GradleException("The following plugins: $nonValidPlugins are not (yet) configured or not found. Please note that you should specify plugins in the intellij.plugins property and configure dependencies on them in the afterEvaluate block") - } - - return files(selectedPlugins.map { it.jarFiles }) -} - -@Deprecated("Deprecated in 2.0") -fun Project.intellijExtra(extra: String) = intellijExtraBase(extra) -@Deprecated("Deprecated in 2.0") -fun Project.intellijExtra(extra: String, filter: Closure<*>) = intellijExtraBase(extra).matching(filter) -@Deprecated("Deprecated in 2.0") -fun Project.intellijExtra(extra: String, filter: Action) = intellijExtraBase(extra).matching(filter) -@Deprecated("Deprecated in 2.0") -fun Project.intellijExtra(extra: String, filter: PatternFilterable) = intellijExtraBase(extra).matching(filter) - -@Deprecated("Deprecated in 2.0") -private fun Project.intellijExtraBase(extra: String): FileTree { - val setupDependenciesTaskProvider = project.tasks.named(SETUP_DEPENDENCIES_TASK_NAME) - - if (!state.executed) { - throw GradleException("intellij is not (yet) configured. Please note that you should configure intellij dependencies in the afterEvaluate block") - } - - val setupDependenciesTask = setupDependenciesTaskProvider.get() - val dependency = setupDependenciesTask.idea.get() - val extraDependency = dependency.extraDependencies - .find { it.name == extra && it.jarFiles.isNotEmpty() } - ?: throw GradleException("intellij extra artifact '$extra' is not found. Please note that you should specify extra dependencies in the intellij.extraDependencies property and configure dependencies on them in the afterEvaluate block") - - return files(extraDependency.jarFiles).asFileTree -} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt index 209b35e350..9f8991fc6c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt @@ -206,21 +206,22 @@ abstract class IntelliJPluginExtension @Inject constructor( /** * If enabled, automatically configures the default IntelliJ Platform dependencies in the current project. - * Otherwise, the [intellij], [intellijPlugin], and [intellijPlugins] functions could be used for an explicit configuration. * * Default value: `true` */ + @Deprecated("Dependencies should be configured directly in Gradle build script") abstract val configureDefaultDependencies: Property /** * Configure extra dependency artifacts from the IntelliJ repository. - * The dependencies on them could be configured only explicitly using the [intellijExtra] function in the `dependencies` block. */ + @Deprecated("Dependencies should be configured directly in Gradle build script") abstract val extraDependencies: ListProperty /** * List of dependencies on external plugins. */ + @Deprecated("Dependencies should be configured directly in Gradle build script") abstract val pluginDependencies: ListProperty @get:Deprecated("ideaDependency is moved to the SetupDependenciesTask.idea", ReplaceWith("setupDependencies.idea.get()")) @@ -255,7 +256,6 @@ abstract class IntelliJPluginExtension @Inject constructor( return pluginDependencies.orNull?.toSet().orEmpty() } - @Suppress("DEPRECATION") @Deprecated("ideaDependency is moved to the SetupDependenciesTask.idea", ReplaceWith("setupDependencies.idea.get()")) fun getIdeaDependency(@Suppress("UNUSED_PARAMETER") project: Project): IdeaDependency = ideaDependency.get() diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginManualConfigSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginManualConfigSpec.kt deleted file mode 100644 index 52a19e6ecb..0000000000 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginManualConfigSpec.kt +++ /dev/null @@ -1,367 +0,0 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -package org.jetbrains.intellij.platform.gradleplugin - -import kotlin.test.Test -import kotlin.test.assertFalse -import kotlin.test.assertTrue - -@Suppress("GroovyAssignabilityCheck", "ComplexRedundantLet") -class IntelliJPluginManualConfigSpec : IntelliJPluginSpecBase() { - - @Test - fun `configure sdk manually test`() { - writeTestFile() - - buildFile.groovy( - """ - import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils - - intellij { - version = '14.1.4' - configureDefaultDependencies = false - } - - afterEvaluate { - dependencies { - compileOnly DependenciesUtils.intellij(project) { include('openapi.jar') } - implementation DependenciesUtils.intellij(project) { include('asm-all.jar') } - runtimeOnly DependenciesUtils.intellij(project) { exclude('idea.jar') } - testImplementation DependenciesUtils.intellij(project) { include('boot.jar') } - testRuntimeOnly DependenciesUtils.intellij(project) - } - } - - def implementation = project.provider { sourceSets.main.compileClasspath.asPath } - def runtimeOnly = project.provider { sourceSets.main.runtimeClasspath.asPath } - def testImplementation = project.provider { sourceSets.test.compileClasspath.asPath } - def testRuntimeOnly = project.provider { sourceSets.test.runtimeClasspath.asPath } - - task printMainCompileClassPath { doLast { println 'implementation: ' + implementation.get() } } - task printMainRuntimeClassPath { doLast { println 'runtimeOnly: ' + runtimeOnly.get() } } - task printTestCompileClassPath { doLast { println 'testImplementation: ' + testImplementation.get() } } - task printTestRuntimeClassPath { doLast { println 'testRuntimeOnly: ' + testRuntimeOnly.get() } } - """.trimIndent() - ) - - build( - "printMainCompileClassPath", - "printTestCompileClassPath", - "printTestRuntimeClassPath", - "printMainRuntimeClassPath", - ).output.lines().let { lines -> - val mainClasspath = lines.find { it.startsWith("implementation:") }.orEmpty() - val mainRuntimeClasspath = lines.find { it.startsWith("runtimeOnly:") }.orEmpty() - val testClasspath = lines.find { it.startsWith("testImplementation:") }.orEmpty() - val testRuntimeClasspath = lines.find { it.startsWith("testRuntimeOnly:") }.orEmpty() - - assertTrue(mainClasspath.contains("openapi.jar")) // included explicitly in compileOnly - assertTrue(mainRuntimeClasspath.contains("openapi.jar")) // includes all but idea.jar - assertFalse(testClasspath.contains("openapi.jar")) - assertTrue(testRuntimeClasspath.contains("openapi.jar")) // includes all - - assertTrue(mainClasspath.contains("asm-all.jar")) // included explicitly - assertTrue(testClasspath.contains("asm-all.jar")) - assertTrue(testRuntimeClasspath.contains("asm-all.jar")) // includes all - - assertFalse(mainClasspath.contains("boot.jar")) - assertTrue(testClasspath.contains("boot.jar")) // included explicitly - assertTrue(testRuntimeClasspath.contains("boot.jar")) // includes all - - assertFalse(mainClasspath.contains("idea.jar")) - assertFalse(mainRuntimeClasspath.contains("idea.jar")) // excluded explicitly - assertFalse(testClasspath.contains("idea.jar")) - assertTrue(testRuntimeClasspath.contains("idea.jar")) // includes all - - assertTrue(mainRuntimeClasspath.contains("idea_rt.jar")) // includes all but idea.jar - } - } - - @Test - fun `configure plugins manually test`() { - writeTestFile() - buildFile.groovy( - """ - import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils - - intellij { - version = '14.1.4' - configureDefaultDependencies = false - plugins = ['junit', 'testng', 'copyright'] - } - afterEvaluate { - dependencies { - compileOnly DependenciesUtils.intellijPlugin(project, 'junit') { include('junit-rt.jar') } - implementation DependenciesUtils.intellijPlugin(project, 'junit') { include('idea-junit.jar') } - runtimeOnly DependenciesUtils.intellijPlugin(project, 'testng') { exclude('testng-plugin.jar') } - testImplementation DependenciesUtils.intellijPlugin(project, 'testng') { include("testng.jar") } - testRuntimeOnly DependenciesUtils.intellijPlugins(project, 'junit', 'testng') - } - } - - def implementation = project.provider { sourceSets.main.compileClasspath.asPath } - def runtimeOnly = project.provider { sourceSets.main.runtimeClasspath.asPath } - def testImplementation = project.provider { sourceSets.test.compileClasspath.asPath } - def testRuntimeOnly = project.provider { sourceSets.test.runtimeClasspath.asPath } - - task printMainCompileClassPath { doLast { println 'implementation: ' + implementation.get() } } - task printMainRuntimeClassPath { doLast { println 'runtimeOnly: ' + runtimeOnly.get() } } - task printTestCompileClassPath { doLast { println 'testImplementation: ' + testImplementation.get() } } - task printTestRuntimeClassPath { doLast { println 'testRuntimeOnly: ' + testRuntimeOnly.get() } } - """.trimIndent() - ) - - build( - "printMainCompileClassPath", - "printTestCompileClassPath", - "printTestRuntimeClassPath", - "printMainRuntimeClassPath", - ).output.lines().let { lines -> - val mainClasspath = lines.find { it.startsWith("implementation:") }.orEmpty() - val mainRuntimeClasspath = lines.find { it.startsWith("runtimeOnly:") }.orEmpty() - val testClasspath = lines.find { it.startsWith("testImplementation:") }.orEmpty() - val testRuntimeClasspath = lines.find { it.startsWith("testRuntimeOnly:") }.orEmpty() - - assertTrue(mainClasspath.contains("junit-rt.jar")) // included explicitly in compileOnly - assertFalse(mainRuntimeClasspath.contains("junit-rt.jar")) - assertFalse(testClasspath.contains("junit-rt.jar")) - assertTrue(testRuntimeClasspath.contains("junit-rt.jar")) // includes all - - assertTrue(mainClasspath.contains("idea-junit.jar")) // included explicitly in compile - assertTrue(testClasspath.contains("idea-junit.jar")) // inherited from compile - assertTrue(testRuntimeClasspath.contains("idea-junit.jar")) // includes all - - assertFalse(mainClasspath.contains("testng-plugin.jar")) - assertFalse(mainRuntimeClasspath.contains("testng-plugin.jar")) // excluded explicitly - assertFalse(testClasspath.contains("testng-plugin.jar")) - assertTrue(testRuntimeClasspath.contains("testng-plugin.jar")) // includes all - - assertFalse(mainClasspath.contains("testng.jar")) - assertTrue(mainRuntimeClasspath.contains("testng.jar")) // includes testng - assertTrue(testClasspath.contains("testng.jar")) // included explicitly - assertTrue(testRuntimeClasspath.contains("testng.jar")) // includes all - - assertFalse(mainClasspath.contains("copyright.jar")) // not included (same for all below) - assertFalse(mainRuntimeClasspath.contains("copyright.jar")) - assertFalse(testClasspath.contains("copyright.jar")) - assertFalse(testRuntimeClasspath.contains("copyright.jar")) - } - } - - @Test - fun `configure extra dependencies manually test`() { - writeTestFile() - buildFile.groovy( - """ - import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils - - intellij { - configureDefaultDependencies = false - extraDependencies = ['intellij-core', 'jps-build-test'] - } - afterEvaluate { - dependencies { - implementation DependenciesUtils.intellijExtra(project, 'jps-build-test') { include('jps-build-test*.jar') } - runtimeOnly DependenciesUtils.intellijExtra(project, 'intellij-core') { exclude('intellij-core.jar') } - testImplementation DependenciesUtils.intellijExtra(project, 'intellij-core') { include("annotations.jar") } - testRuntimeOnly DependenciesUtils.intellijExtra(project, 'jps-build-test') - testRuntimeOnly DependenciesUtils.intellijExtra(project, 'intellij-core') - } - } - - def implementation = project.provider { sourceSets.main.compileClasspath.asPath } - def runtimeOnly = project.provider { sourceSets.main.runtimeClasspath.asPath } - def testImplementation = project.provider { sourceSets.test.compileClasspath.asPath } - def testRuntimeOnly = project.provider { sourceSets.test.runtimeClasspath.asPath } - - task printMainCompileClassPath { doLast { println 'implementation: ' + implementation.get() } } - task printMainRuntimeClassPath { doLast { println 'runtimeOnly: ' + runtimeOnly.get() } } - task printTestCompileClassPath { doLast { println 'testImplementation: ' + testImplementation.get() } } - task printTestRuntimeClassPath { doLast { println 'testRuntimeOnly: ' + testRuntimeOnly.get() } } - """.trimIndent() - ) - - build( - "printMainCompileClassPath", - "printTestCompileClassPath", - "printTestRuntimeClassPath", - "printMainRuntimeClassPath", - ).output.lines().let { lines -> - val mainClasspath = lines.find { it.startsWith("implementation:") }.orEmpty() - val mainRuntimeClasspath = lines.find { it.startsWith("runtimeOnly:") }.orEmpty() - val testClasspath = lines.find { it.startsWith("testImplementation:") }.orEmpty() - val testRuntimeClasspath = lines.find { it.startsWith("testRuntimeOnly:") }.orEmpty() - - assertTrue(mainClasspath.contains("jps-build-test")) // included explicitly in compileOnly (note - versioned jar, checking by name only) - assertTrue(mainRuntimeClasspath.contains("jps-build-test")) - assertTrue(testClasspath.contains("jps-build-test")) - assertTrue(testRuntimeClasspath.contains("jps-build-test")) // includes all - - assertFalse(mainClasspath.contains("intellij-core.jar")) - assertFalse(mainRuntimeClasspath.contains("intellij-core.jar")) // excluded explicitly - assertFalse(testClasspath.contains("intellij-core.jar")) // not included - assertTrue(testRuntimeClasspath.contains("intellij-core.jar")) // includes all - - assertFalse(mainClasspath.contains("annotations.jar")) - assertTrue(testClasspath.contains("annotations.jar")) // included explicitly - assertTrue(testRuntimeClasspath.contains("annotations.jar")) // includes all - - assertFalse(mainClasspath.contains("intellij-core-analysis-deprecated.jar")) - assertTrue(mainRuntimeClasspath.contains("intellij-core-analysis-deprecated.jar")) // includes intellij-core - assertFalse(testClasspath.contains("intellij-core-analysis-deprecated.jar")) - assertTrue(testRuntimeClasspath.contains("intellij-core-analysis-deprecated.jar")) // includes all - } - } - - @Test - fun `configure sdk manually fail without afterEvaluate`() { - writeTestFile() - buildFile.groovy( - """ - import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils - - intellij { - configureDefaultDependencies = false - } - dependencies { - compile DependenciesUtils.intellij(project) { include('asm-all.jar') } - } - """.trimIndent() - ) - - buildAndFail("tasks").let { - assertContains( - "intellij is not (yet) configured. Please note that you should configure intellij dependencies in the afterEvaluate block", - it.output - ) - } - } - - @Test - fun `configure plugins manually fail without afterEvaluate`() { - writeTestFile() - buildFile.groovy( - """ - import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils - - intellij.configureDefaultDependencies = false - dependencies { - compile DependenciesUtils.intellijPlugin(project, 'junit') - } - """.trimIndent() - ) - - buildAndFail("tasks").let { - assertContains( - "intellij plugin 'junit' is not (yet) configured. Please note that you should specify plugins in the intellij.plugins property and configure dependencies on them in the afterEvaluate block", - it.output - ) - } - } - - @Test - fun `configure plugins manually fail on unconfigured plugin`() { - writeTestFile() - buildFile.groovy( - """ - import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils - - intellij { - configureDefaultDependencies = false - plugins = [] - } - afterEvaluate { - dependencies { - compile DependenciesUtils.intellijPlugin(project, 'junit') - } - } - """.trimIndent() - ) - - buildAndFail("tasks").let { - assertContains( - "intellij plugin 'junit' is not found. Please note that you should specify plugins in the intellij.plugins property and configure dependencies on them in the afterEvaluate block", - it.output - ) - } - } - - @Test - fun `configure plugins manually fail on some unconfigured plugins`() { - writeTestFile() - buildFile.groovy( - """ - import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils - - intellij { - configureDefaultDependencies = false - plugins = ['junit'] - } - afterEvaluate { - dependencies { - compile DependenciesUtils.intellijPlugins(project, 'testng', 'junit', 'copyright') - } - } - """.trimIndent() - ) - - buildAndFail("tasks").let { - assertContains( - "The following plugins: [testng, copyright] are not (yet) configured or not found. Please note that you should specify plugins in the intellij.plugins property and configure dependencies on them in the afterEvaluate block", - it.output - ) - } - } - - @Test - fun `configure extra manually fail without afterEvaluate`() { - writeTestFile() - buildFile.groovy( - """ - import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils - - intellij { - configureDefaultDependencies = false - extraDependencies = ['intellij-core'] - } - dependencies { - compile DependenciesUtils.intellijExtra(project, 'intellij-core') - } - """.trimIndent() - ) - - buildAndFail("tasks").let { - assertContains( - "intellij is not (yet) configured. Please note that you should configure intellij dependencies in the afterEvaluate block", - it.output - ) - } - } - - @Test - fun `configure extra manually fail on unconfigured extra dependency`() { - writeTestFile() - buildFile.groovy( - """ - import org.jetbrains.intellij.platform.gradleplugin.DependenciesUtils - - intellij { - configureDefaultDependencies = false - extraDependencies = ['jps-build-test'] - } - afterEvaluate { - dependencies { - compile DependenciesUtils.intellijExtra(project, 'intellij-core') - } - } - """.trimIndent() - ) - - buildAndFail("tasks").let { - assertContains( - "intellij extra artifact 'intellij-core' is not found. Please note that you should specify extra dependencies in the intellij.extraDependencies property and configure dependencies on them in the afterEvaluate block", - it.output - ) - } - } -} From 3f3f09ca32c76db24fedf70f6a0c4020185aa60b Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Wed, 30 Aug 2023 12:55:48 +0200 Subject: [PATCH 014/347] Fix for configuration cache issue in `BuildFeature` --- .../jetbrains/intellij/platform/gradleplugin/BuildFeature.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeature.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeature.kt index 036efa07df..d2e481cf09 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeature.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeature.kt @@ -27,7 +27,7 @@ enum class BuildFeature(private val defaultValue: Boolean) { .let { "$prefix.buildFeature.$it" } } -fun Project.isBuildFeatureEnabled(feature: BuildFeature) = +fun Project.isBuildFeatureEnabled(feature: BuildFeature, context: String = logCategory()) = feature .getValue(providers) .map { value -> @@ -35,6 +35,6 @@ fun Project.isBuildFeatureEnabled(feature: BuildFeature) = when (value) { true -> "Build feature is enabled: $feature" false -> "Build feature is disabled: $feature" - }.also { info(logCategory(), value.toString()) } + }.also { info(context, value.toString()) } } } From b485f45668c0b4dd80b87748930bc0eda0102367 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Wed, 30 Aug 2023 12:57:36 +0200 Subject: [PATCH 015/347] InitializeIntelliJPluginTask: Add check for file existence of the lock file before creation --- .../gradleplugin/tasks/InitializeIntelliJPluginTask.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPluginTask.kt index 3ebffaec0e..e5d8f59bb5 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPluginTask.kt @@ -3,6 +3,7 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks import com.jetbrains.plugin.structure.base.utils.create +import com.jetbrains.plugin.structure.base.utils.exists import org.gradle.api.DefaultTask import org.gradle.api.provider.Property import org.gradle.api.tasks.Internal @@ -60,7 +61,11 @@ abstract class InitializeIntelliJPluginTask : DefaultTask() { warn(context, "$PLUGIN_NAME is outdated: $version. Update `$PLUGIN_ID` to: $latestVersion") } - lockFile.get().toPath().create() + with(lockFile.get().toPath()) { + if (!exists()) { + create() + } + } } catch (e: Exception) { error(context, e.message.orEmpty(), e) } From b45da1bd62c33f553bfb5703f806b1cd16f5ac9f Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Wed, 30 Aug 2023 12:58:25 +0200 Subject: [PATCH 016/347] Migrate the `InitializeIntelliJPluginTask` to `IntelliJPlatformTasksPlugin` --- .../plugins/IntelliJPlatformPlugin.kt | 30 +------------- .../plugins/IntelliJPlatformTasksPlugin.kt | 40 +++++++++++++++---- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt index a81ec7942f..e00c2ad8a3 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt @@ -33,7 +33,8 @@ import org.gradle.kotlin.dsl.* import org.gradle.kotlin.dsl.support.serviceOf import org.gradle.language.jvm.tasks.ProcessResources import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.* +import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.NO_SEARCHABLE_OPTIONS_WARNING +import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.PAID_PLUGIN_SEARCHABLE_OPTIONS_WARNING import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANDROID_STUDIO_PRODUCTS_RELEASES_URL import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANNOTATIONS_DEPENDENCY_VERSION @@ -51,7 +52,6 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.EXTE import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PLUGINS_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PRODUCTS_RELEASES_URL -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_PREFIX import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_TASK_NAME @@ -85,7 +85,6 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SEARCHABLE_OPTIONS_DIR_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SIGN_PLUGIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_CONFIGURATION_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_SIGNATURE_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_TASK_NAME @@ -111,7 +110,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import java.io.File import java.net.URL import java.nio.file.Path -import java.time.LocalDate import java.time.LocalDateTime import java.time.format.DateTimeFormatter import java.util.* @@ -191,7 +189,6 @@ abstract class IntelliJPlatformPlugin : Plugin { prepareConventionMappingsForRunIdeTask(project, extension, ideaDependencyProvider, PREPARE_UI_TESTING_SANDBOX_TASK_NAME) } - configureInitializeGradleIntelliJPluginTask(project) configureClassPathIndexCleanupTask(project, ideaDependencyProvider) configureInstrumentation(project, extension, ideaDependencyProvider) configurePatchPluginXmlTask(project, extension, ideaDependencyProvider) @@ -224,12 +221,6 @@ abstract class IntelliJPlatformPlugin : Plugin { dependsOn(VERIFY_PLUGIN_CONFIGURATION_TASK_NAME) } - (TASKS - INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME).forEach { - project.tasks.named(it) { - dependsOn(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) - } - } - project.afterEvaluate { configureProjectAfterEvaluate(this, extension, ideaDependencyProvider) } @@ -1506,23 +1497,6 @@ abstract class IntelliJPlatformPlugin : Plugin { } } - private fun configureInitializeGradleIntelliJPluginTask(project: Project) { - info(context, "Initializing IntelliJ Platform Gradle Plugin") - - project.tasks.register(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) - project.tasks.withType { - offline.convention(project.gradle.startParameter.isOffline) - selfUpdateCheck.convention(project.isBuildFeatureEnabled(SELF_UPDATE_CHECK)) - lockFile.convention(project.provider { - temporaryDir.resolve(LocalDate.now().toString()) - }) - - onlyIf { - !lockFile.get().exists() - } - } - } - private fun configurePluginDependencies( project: Project, ideaDependencyProvider: Provider, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt index 907c1a87c3..4def2270c9 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt @@ -4,13 +4,21 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.api.Task +import org.gradle.api.tasks.TaskContainer import org.gradle.kotlin.dsl.apply import org.gradle.kotlin.dsl.register +import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.SELF_UPDATE_CHECK +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion import org.jetbrains.intellij.platform.gradleplugin.info +import org.jetbrains.intellij.platform.gradleplugin.isBuildFeatureEnabled import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.tasks.InitializeIntelliJPluginTask import org.jetbrains.intellij.platform.gradleplugin.tasks.SetupDependenciesTask +import java.time.LocalDate abstract class IntelliJPlatformTasksPlugin : Plugin { @@ -22,15 +30,33 @@ abstract class IntelliJPlatformTasksPlugin : Plugin { info(context, "Configuring plugin: org.jetbrains.intellij.platform.tasks") checkGradleVersion() - project.applyPlugins() - project.applyTasks() - } + with(project.plugins) { + apply(IntelliJPlatformBasePlugin::class) + } + + with(project.tasks) { + configureTask(SETUP_DEPENDENCIES_TASK_NAME) + + configureTask(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) { + offline.convention(project.gradle.startParameter.isOffline) + selfUpdateCheck.convention(project.isBuildFeatureEnabled(SELF_UPDATE_CHECK)) + lockFile.convention(project.provider { + temporaryDir.resolve(LocalDate.now().toString()) + }) + + onlyIf { !lockFile.get().exists() } + } - private fun Project.applyPlugins() { - plugins.apply(IntelliJPlatformBasePlugin::class) + // Make all tasks depend on [INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME] + (TASKS - INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME).forEach { +// named(it) { dependsOn(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) } + } + } } - private fun Project.applyTasks() { - tasks.register(SETUP_DEPENDENCIES_TASK_NAME) + private inline fun TaskContainer.configureTask(name: String, noinline configuration: T.() -> Unit = {}) { + info(context, "Configuring task: $name") + val task = findByName(name) as? T ?: register(name).get() + task.configuration() } } From 622994f24430323bcd749df4b4dc9c59b090fca5 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Wed, 30 Aug 2023 14:20:53 +0200 Subject: [PATCH 017/347] Sub-plugins structure cleanup --- .../gradleplugin/IntelliJPluginConstants.kt | 3 + .../plugins/IntelliJPlatformAbstractPlugin.kt | 46 ++++++++++++++ .../plugins/IntelliJPlatformBasePlugin.kt | 60 ++++++------------- .../plugins/IntelliJPlatformTasksPlugin.kt | 52 ++++++---------- 4 files changed, 86 insertions(+), 75 deletions(-) create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractPlugin.kt diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index 211dd8da9e..df8ddfeb8b 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -5,6 +5,9 @@ package org.jetbrains.intellij.platform.gradleplugin object IntelliJPluginConstants { const val PLUGIN_NAME = "IntelliJ Platform Gradle Plugin" const val PLUGIN_ID = "org.jetbrains.intellij.platform" + const val PLUGIN_BASE_ID = "$PLUGIN_ID.base" + const val PLUGIN_TASKS_ID = "$PLUGIN_ID.tasks" + const val PLUGIN_GROUP_NAME = "intellij" const val EXTENSION_NAME = "intellijPlatform" const val INTELLIJ_PLATFORM_REPOSITORY_SETTINGS_NAME = "intellijPlatformRepositoriesSettings" diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractPlugin.kt new file mode 100644 index 0000000000..ebb4195892 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractPlugin.kt @@ -0,0 +1,46 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.plugins + +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.api.Task +import org.gradle.api.artifacts.ConfigurationContainer +import org.gradle.api.plugins.ExtensionContainer +import org.gradle.api.plugins.PluginContainer +import org.gradle.api.tasks.TaskContainer +import org.gradle.kotlin.dsl.register +import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion +import org.jetbrains.intellij.platform.gradleplugin.info +import org.jetbrains.intellij.platform.gradleplugin.logCategory + +abstract class IntelliJPlatformAbstractPlugin(val pluginId: String) : Plugin { + + protected lateinit var context: String + + final override fun apply(project: Project) { + context = project.logCategory() + + info(context, "Configuring plugin: $pluginId") + checkGradleVersion() + + configure(project) + + project.plugins.applyPlugins(project) + project.configurations.applyConfigurations(project) + project.extensions.applyExtension(project) + project.tasks.applyTasks(project) + } + + protected inline fun TaskContainer.configureTask(name: String, noinline configuration: T.() -> Unit = {}) { + info(context, "Configuring task: $name") + val task = findByName(name) as? T ?: register(name).get() + task.configuration() + } + + protected abstract fun configure(project: Project) + protected abstract fun PluginContainer.applyPlugins(project: Project) + protected abstract fun ConfigurationContainer.applyConfigurations(project: Project) + protected abstract fun ExtensionContainer.applyExtension(project: Project) + protected abstract fun TaskContainer.applyTasks(project: Project) +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt index 3ca5478e38..9b5a1cac66 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt @@ -2,13 +2,15 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins -import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.artifacts.Configuration +import org.gradle.api.artifacts.ConfigurationContainer import org.gradle.api.model.ObjectFactory +import org.gradle.api.plugins.ExtensionContainer import org.gradle.api.plugins.JavaPlugin import org.gradle.api.plugins.JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME import org.gradle.api.plugins.JavaPlugin.TEST_COMPILE_ONLY_CONFIGURATION_NAME +import org.gradle.api.plugins.PluginContainer import org.gradle.api.provider.ProviderFactory import org.gradle.kotlin.dsl.apply import org.gradle.kotlin.dsl.create @@ -16,44 +18,31 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.EXTE import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_TEST_FIXTURES_PLUGIN_ID +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_BASE_ID import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TEST_FIXTURES_COMPILE_ONLY_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyIntellijPlatformCollectorTransformer import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyIntellijPlatformExtractTransformer -import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension -import org.jetbrains.intellij.platform.gradleplugin.info -import org.jetbrains.intellij.platform.gradleplugin.logCategory import org.jetbrains.intellij.platform.gradleplugin.repositories.applyIntelliJPlatformSettings import javax.inject.Inject abstract class IntelliJPlatformBasePlugin @Inject constructor( private val objects: ObjectFactory, private val providers: ProviderFactory, -) : Plugin { - - private lateinit var context: String - - override fun apply(project: Project) { - context = project.logCategory() - - info(context, "Configuring plugin: org.jetbrains.intellij.platform.base") - checkGradleVersion() +) : IntelliJPlatformAbstractPlugin(PLUGIN_BASE_ID) { + override fun configure(project: Project) { + project.applyIntellijPlatformExtractTransformer() + project.applyIntellijPlatformCollectorTransformer() project.repositories.applyIntelliJPlatformSettings(objects, providers) - - project.applyPlugins() - project.applyConfigurations() - project.applyExtension() - project.applyTasks() - project.applyTransformers() } - private fun Project.applyPlugins() { - project.plugins.apply(JavaPlugin::class) + override fun PluginContainer.applyPlugins(project: Project) { + apply(JavaPlugin::class) } - private fun Project.applyConfigurations() { - val intellijPlatformConfiguration = project.configurations.maybeCreate(INTELLIJ_PLATFORM_CONFIGURATION_NAME) + override fun ConfigurationContainer.applyConfigurations(project: Project) { + val intellijPlatformConfiguration = maybeCreate(INTELLIJ_PLATFORM_CONFIGURATION_NAME) .apply { isVisible = false isCanBeConsumed = false @@ -61,7 +50,7 @@ abstract class IntelliJPlatformBasePlugin @Inject constructor( description = "IntelliJ Platform dependency" } - project.configurations.maybeCreate(INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME) + maybeCreate(INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME) .apply { isVisible = false isCanBeConsumed = false @@ -71,25 +60,14 @@ abstract class IntelliJPlatformBasePlugin @Inject constructor( fun Configuration.extend() = extendsFrom(intellijPlatformConfiguration) - with(project.configurations) { - getByName(COMPILE_ONLY_CONFIGURATION_NAME).extend() - getByName(TEST_COMPILE_ONLY_CONFIGURATION_NAME).extend() - project.pluginManager.withPlugin(JAVA_TEST_FIXTURES_PLUGIN_ID) { - getByName(TEST_FIXTURES_COMPILE_ONLY_CONFIGURATION_NAME).extend() - } + getByName(COMPILE_ONLY_CONFIGURATION_NAME).extend() + getByName(TEST_COMPILE_ONLY_CONFIGURATION_NAME).extend() + project.pluginManager.withPlugin(JAVA_TEST_FIXTURES_PLUGIN_ID) { + getByName(TEST_FIXTURES_COMPILE_ONLY_CONFIGURATION_NAME).extend() } } - private fun Project.applyExtension() { - extensions.create(EXTENSION_NAME) - } - - private fun Project.applyTasks() { - - } - - private fun Project.applyTransformers() { - applyIntellijPlatformExtractTransformer() - applyIntellijPlatformCollectorTransformer() + override fun ExtensionContainer.applyExtension(project: Project) { + create(EXTENSION_NAME) } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt index 4def2270c9..1214a85aff 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt @@ -2,61 +2,45 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins -import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.Task +import org.gradle.api.plugins.PluginContainer import org.gradle.api.tasks.TaskContainer import org.gradle.kotlin.dsl.apply -import org.gradle.kotlin.dsl.register import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.SELF_UPDATE_CHECK import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_TASKS_ID import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS -import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion -import org.jetbrains.intellij.platform.gradleplugin.info import org.jetbrains.intellij.platform.gradleplugin.isBuildFeatureEnabled -import org.jetbrains.intellij.platform.gradleplugin.logCategory import org.jetbrains.intellij.platform.gradleplugin.tasks.InitializeIntelliJPluginTask import org.jetbrains.intellij.platform.gradleplugin.tasks.SetupDependenciesTask import java.time.LocalDate -abstract class IntelliJPlatformTasksPlugin : Plugin { +abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractPlugin(PLUGIN_TASKS_ID) { - private lateinit var context: String + override fun PluginContainer.applyPlugins(project: Project) { + apply(IntelliJPlatformBasePlugin::class) + } - override fun apply(project: Project) { - context = project.logCategory() + override fun TaskContainer.applyTasks(project: Project) { + configureTask(SETUP_DEPENDENCIES_TASK_NAME) - info(context, "Configuring plugin: org.jetbrains.intellij.platform.tasks") - checkGradleVersion() + configureTask(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) { + offline.convention(project.gradle.startParameter.isOffline) + selfUpdateCheck.convention(project.isBuildFeatureEnabled(SELF_UPDATE_CHECK)) + lockFile.convention(project.provider { + temporaryDir.resolve(LocalDate.now().toString()) + }) - with(project.plugins) { - apply(IntelliJPlatformBasePlugin::class) + onlyIf { !lockFile.get().exists() } } - with(project.tasks) { - configureTask(SETUP_DEPENDENCIES_TASK_NAME) - - configureTask(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) { - offline.convention(project.gradle.startParameter.isOffline) - selfUpdateCheck.convention(project.isBuildFeatureEnabled(SELF_UPDATE_CHECK)) - lockFile.convention(project.provider { - temporaryDir.resolve(LocalDate.now().toString()) - }) - - onlyIf { !lockFile.get().exists() } - } - // Make all tasks depend on [INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME] (TASKS - INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME).forEach { + // Make all tasks depend on [INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME] + (TASKS - INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME).forEach { // named(it) { dependsOn(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) } - } } } - - private inline fun TaskContainer.configureTask(name: String, noinline configuration: T.() -> Unit = {}) { - info(context, "Configuring task: $name") - val task = findByName(name) as? T ?: register(name).get() - task.configuration() - } } From 64b75e0b19da40f82133e5a41c0035915234ef53 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Fri, 1 Sep 2023 12:52:50 +0200 Subject: [PATCH 018/347] Code cleanup --- .../gradleplugin/IntelliJPluginConstants.kt | 15 +++- .../dependencies/intellijPlatform.kt | 35 +++++--- ... IntelliJPlatformAbstractProjectPlugin.kt} | 28 +++---- .../plugins/IntelliJPlatformBasePlugin.kt | 81 +++++++++---------- .../plugins/IntelliJPlatformPlugin.kt | 4 +- .../plugins/IntelliJPlatformSettingsPlugin.kt | 1 + .../plugins/IntelliJPlatformTasksPlugin.kt | 35 ++++---- .../gradleplugin/IntelliJPluginSpec.kt | 16 ++-- .../tasks/SetupDependenciesTaskSpec.kt | 8 +- 9 files changed, 120 insertions(+), 103 deletions(-) rename src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/{IntelliJPlatformAbstractPlugin.kt => IntelliJPlatformAbstractProjectPlugin.kt} (55%) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index df8ddfeb8b..b2de85fd80 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -9,7 +9,17 @@ object IntelliJPluginConstants { const val PLUGIN_TASKS_ID = "$PLUGIN_ID.tasks" const val PLUGIN_GROUP_NAME = "intellij" - const val EXTENSION_NAME = "intellijPlatform" + + object Extensions { + const val INTELLIJ_PLATFORM = "intellijPlatform" + const val PLUGIN_CONFIGURATION = "pluginConfiguration" + const val PRODUCT_DESCRIPTOR = "productDescriptor" + } + + object Tasks { + const val SETUP_DEPENDENCIES = "setupDependencies" + } + const val INTELLIJ_PLATFORM_REPOSITORY_SETTINGS_NAME = "intellijPlatformRepositoriesSettings" @Deprecated("Check it") @@ -40,7 +50,6 @@ object IntelliJPluginConstants { const val RUN_IDE_FOR_UI_TESTS_TASK_NAME = "runIdeForUiTests" const val RUN_IDE_PERFORMANCE_TEST_TASK_NAME = "runIdePerformanceTest" const val RUN_PLUGIN_VERIFIER_TASK_NAME = "runPluginVerifier" - const val SETUP_DEPENDENCIES_TASK_NAME = "setupDependencies" const val SIGN_PLUGIN_TASK_NAME = "signPlugin" const val VERIFY_PLUGIN_TASK_NAME = "verifyPlugin" const val VERIFY_PLUGIN_CONFIGURATION_TASK_NAME = "verifyPluginConfiguration" @@ -74,7 +83,7 @@ object IntelliJPluginConstants { RUN_IDE_FOR_UI_TESTS_TASK_NAME, RUN_IDE_PERFORMANCE_TEST_TASK_NAME, RUN_PLUGIN_VERIFIER_TASK_NAME, - SETUP_DEPENDENCIES_TASK_NAME, + Tasks.SETUP_DEPENDENCIES, SIGN_PLUGIN_TASK_NAME, VERIFY_PLUGIN_TASK_NAME, VERIFY_PLUGIN_CONFIGURATION_TASK_NAME, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt index bf682de826..5bcb520990 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt @@ -4,6 +4,7 @@ package org.jetbrains.intellij.platform.gradleplugin.dependencies +import org.gradle.api.artifacts.dsl.DependencyHandler import org.gradle.api.provider.Provider import org.gradle.kotlin.dsl.DependencyHandlerScope import org.gradle.kotlin.dsl.create @@ -15,23 +16,31 @@ internal fun DependencyHandlerScope.intellijPlatform( type: IntelliJPlatformType, version: String, configurationName: String = INTELLIJ_PLATFORM_CONFIGURATION_NAME, -) = add(configurationName, create( - group = type.groupId, - name = type.artifactId, - version = version, -)) +) = add(configurationName, create(type, version)) internal fun DependencyHandlerScope.intellijPlatform( type: IntelliJPlatformType, versionProvider: Provider, configurationName: String = INTELLIJ_PLATFORM_CONFIGURATION_NAME, -) = addProvider(configurationName, versionProvider.map { - create( - group = type.groupId, - name = type.artifactId, - version = it, - ) -}) +) = addProvider(configurationName, versionProvider.map { version -> create(type, version) }) + +internal fun DependencyHandlerScope.intellijPlatform( + typeProvider: Provider, + version: String, + configurationName: String = INTELLIJ_PLATFORM_CONFIGURATION_NAME, +) = addProvider(configurationName, typeProvider.map { type -> create(type, version) }) + +internal fun DependencyHandlerScope.intellijPlatform( + typeProvider: Provider, + versionProvider: Provider, + configurationName: String = INTELLIJ_PLATFORM_CONFIGURATION_NAME, +) = addProvider(configurationName, typeProvider.zip(versionProvider) { type, version -> create(type, version) }) + +internal fun DependencyHandler.create(type: IntelliJPlatformType, version: String) = create( + group = type.groupId, + name = type.artifactId, + version = version, +) // return when (type) { // IntellijIdeaUltimate -> create( @@ -105,7 +114,9 @@ internal fun DependencyHandlerScope.intellijPlatform( // } fun DependencyHandlerScope.intellijPlatform(type: String, version: String) = intellijPlatform(IntelliJPlatformType.fromCode(type), version) +fun DependencyHandlerScope.intellijPlatform(type: Provider, version: String) = intellijPlatform(type.map { IntelliJPlatformType.fromCode(it) }, version) fun DependencyHandlerScope.intellijPlatform(type: String, version: Provider) = intellijPlatform(IntelliJPlatformType.fromCode(type), version) +fun DependencyHandlerScope.intellijPlatform(type: Provider, version: Provider) = intellijPlatform(type.map { IntelliJPlatformType.fromCode(it) }, version) fun DependencyHandlerScope.androidStudio(version: String) = intellijPlatform(AndroidStudio, version) fun DependencyHandlerScope.androidStudio(version: Provider) = intellijPlatform(AndroidStudio, version) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt similarity index 55% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractPlugin.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt index ebb4195892..711d8f058f 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt @@ -5,16 +5,15 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.Task -import org.gradle.api.artifacts.ConfigurationContainer -import org.gradle.api.plugins.ExtensionContainer -import org.gradle.api.plugins.PluginContainer +import org.gradle.api.plugins.ExtensionAware import org.gradle.api.tasks.TaskContainer +import org.gradle.kotlin.dsl.create import org.gradle.kotlin.dsl.register import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion import org.jetbrains.intellij.platform.gradleplugin.info import org.jetbrains.intellij.platform.gradleplugin.logCategory -abstract class IntelliJPlatformAbstractPlugin(val pluginId: String) : Plugin { +abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plugin { protected lateinit var context: String @@ -24,23 +23,22 @@ abstract class IntelliJPlatformAbstractPlugin(val pluginId: String) : Plugin TaskContainer.configureTask(name: String, noinline configuration: T.() -> Unit = {}) { info(context, "Configuring task: $name") val task = findByName(name) as? T ?: register(name).get() task.configuration() } - protected abstract fun configure(project: Project) - protected abstract fun PluginContainer.applyPlugins(project: Project) - protected abstract fun ConfigurationContainer.applyConfigurations(project: Project) - protected abstract fun ExtensionContainer.applyExtension(project: Project) - protected abstract fun TaskContainer.applyTasks(project: Project) + protected inline fun Any.configureExtension(name: String, noinline configuration: T.() -> Unit = {}) { + info(context, "Configuring extension: $name") + with((this as ExtensionAware).extensions) { + val extension = findByName(name) as? T ?: create(name) + extension.configuration() + } + } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt index 9b5a1cac66..7c22fdf453 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt @@ -4,17 +4,11 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins import org.gradle.api.Project import org.gradle.api.artifacts.Configuration -import org.gradle.api.artifacts.ConfigurationContainer -import org.gradle.api.model.ObjectFactory -import org.gradle.api.plugins.ExtensionContainer import org.gradle.api.plugins.JavaPlugin import org.gradle.api.plugins.JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME import org.gradle.api.plugins.JavaPlugin.TEST_COMPILE_ONLY_CONFIGURATION_NAME -import org.gradle.api.plugins.PluginContainer -import org.gradle.api.provider.ProviderFactory import org.gradle.kotlin.dsl.apply -import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.EXTENSION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_TEST_FIXTURES_PLUGIN_ID @@ -24,50 +18,53 @@ import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyInt import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyIntellijPlatformExtractTransformer import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension import org.jetbrains.intellij.platform.gradleplugin.repositories.applyIntelliJPlatformSettings -import javax.inject.Inject -abstract class IntelliJPlatformBasePlugin @Inject constructor( - private val objects: ObjectFactory, - private val providers: ProviderFactory, -) : IntelliJPlatformAbstractPlugin(PLUGIN_BASE_ID) { +abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugin(PLUGIN_BASE_ID) { - override fun configure(project: Project) { - project.applyIntellijPlatformExtractTransformer() - project.applyIntellijPlatformCollectorTransformer() - project.repositories.applyIntelliJPlatformSettings(objects, providers) - } + override fun Project.configure() { - override fun PluginContainer.applyPlugins(project: Project) { - apply(JavaPlugin::class) - } + with(plugins) { + apply(JavaPlugin::class) + } - override fun ConfigurationContainer.applyConfigurations(project: Project) { - val intellijPlatformConfiguration = maybeCreate(INTELLIJ_PLATFORM_CONFIGURATION_NAME) - .apply { - isVisible = false - isCanBeConsumed = false - isCanBeResolved = true - description = "IntelliJ Platform dependency" + configureExtension(Extensions.INTELLIJ_PLATFORM) { + configureExtension(Extensions.PLUGIN_CONFIGURATION) { + configureExtension(Extensions.PRODUCT_DESCRIPTOR) } + } - maybeCreate(INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME) - .apply { - isVisible = false - isCanBeConsumed = false - isCanBeResolved = true - description = "IntelliJ Platform Sources to be attached to the IntelliJ Platform dependency" - } + with(repositories) { + applyIntelliJPlatformSettings(objects, providers) + } - fun Configuration.extend() = extendsFrom(intellijPlatformConfiguration) + with(configurations) { + val intellijPlatformConfiguration = maybeCreate(INTELLIJ_PLATFORM_CONFIGURATION_NAME) + .apply { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + description = "IntelliJ Platform dependency" + } + + maybeCreate(INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME) + .apply { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + description = "IntelliJ Platform Sources to be attached to the IntelliJ Platform dependency" + } + + fun Configuration.extend() = extendsFrom(intellijPlatformConfiguration) + + getByName(COMPILE_ONLY_CONFIGURATION_NAME).extend() + getByName(TEST_COMPILE_ONLY_CONFIGURATION_NAME).extend() + pluginManager.withPlugin(JAVA_TEST_FIXTURES_PLUGIN_ID) { + getByName(TEST_FIXTURES_COMPILE_ONLY_CONFIGURATION_NAME).extend() + } - getByName(COMPILE_ONLY_CONFIGURATION_NAME).extend() - getByName(TEST_COMPILE_ONLY_CONFIGURATION_NAME).extend() - project.pluginManager.withPlugin(JAVA_TEST_FIXTURES_PLUGIN_ID) { - getByName(TEST_FIXTURES_COMPILE_ONLY_CONFIGURATION_NAME).extend() } - } - override fun ExtensionContainer.applyExtension(project: Project) { - create(EXTENSION_NAME) + applyIntellijPlatformExtractTransformer() + applyIntellijPlatformCollectorTransformer() } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt index e00c2ad8a3..d505a1a737 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt @@ -48,7 +48,7 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWN import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ZIP_SIGNER_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.EXTENSION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions.INTELLIJ_PLATFORM import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PLUGINS_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PRODUCTS_RELEASES_URL @@ -136,7 +136,7 @@ abstract class IntelliJPlatformPlugin : Plugin { project.plugins.apply(JavaPlugin::class) - val extension = project.extensions.create(EXTENSION_NAME, dependenciesDownloader).apply { + val extension = project.extensions.create(INTELLIJ_PLATFORM, dependenciesDownloader).apply { version.convention(project.provider { if (!localPath.isSpecified) { throw GradleException("The value for the 'intellij.version' property was not specified, see: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#intellij-extension-version") diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformSettingsPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformSettingsPlugin.kt index 5dc10393c0..a2128e390f 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformSettingsPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformSettingsPlugin.kt @@ -9,6 +9,7 @@ import org.gradle.api.provider.ProviderFactory import org.jetbrains.intellij.platform.gradleplugin.repositories.applyIntelliJPlatformSettings import javax.inject.Inject +@Suppress("UnstableApiUsage", "unused") abstract class IntelliJPlatformSettingsPlugin @Inject constructor( private val objects: ObjectFactory, private val providers: ProviderFactory, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt index 1214a85aff..99ca6acebe 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt @@ -3,44 +3,45 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins import org.gradle.api.Project -import org.gradle.api.plugins.PluginContainer -import org.gradle.api.tasks.TaskContainer import org.gradle.kotlin.dsl.apply import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.SELF_UPDATE_CHECK import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PATCH_PLUGIN_XML_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_TASKS_ID -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradleplugin.isBuildFeatureEnabled import org.jetbrains.intellij.platform.gradleplugin.tasks.InitializeIntelliJPluginTask import org.jetbrains.intellij.platform.gradleplugin.tasks.SetupDependenciesTask import java.time.LocalDate -abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractPlugin(PLUGIN_TASKS_ID) { +abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlugin(PLUGIN_TASKS_ID) { - override fun PluginContainer.applyPlugins(project: Project) { - apply(IntelliJPlatformBasePlugin::class) - } + override fun Project.configure() { + with(plugins) { + apply(IntelliJPlatformBasePlugin::class) + } - override fun TaskContainer.applyTasks(project: Project) { - configureTask(SETUP_DEPENDENCIES_TASK_NAME) + with(tasks) { + configureTask(Tasks.SETUP_DEPENDENCIES) - configureTask(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) { - offline.convention(project.gradle.startParameter.isOffline) - selfUpdateCheck.convention(project.isBuildFeatureEnabled(SELF_UPDATE_CHECK)) - lockFile.convention(project.provider { - temporaryDir.resolve(LocalDate.now().toString()) - }) + configureTask(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) { + offline.convention(project.gradle.startParameter.isOffline) + selfUpdateCheck.convention(project.isBuildFeatureEnabled(SELF_UPDATE_CHECK)) + lockFile.convention(project.provider { + temporaryDir.resolve(LocalDate.now().toString()) + }) - onlyIf { !lockFile.get().exists() } - } + onlyIf { !lockFile.get().exists() } + } // Make all tasks depend on [INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME] (TASKS - INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME).forEach { // Make all tasks depend on [INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME] (TASKS - INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME).forEach { // named(it) { dependsOn(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) } + } } } } diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpec.kt index f39eea71e5..577bdc13c0 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpec.kt @@ -8,10 +8,10 @@ import org.gradle.testkit.runner.BuildResult import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MARKETPLACE_HOST import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MINIMAL_SUPPORTED_GRADLE_VERSION import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS -import org.jetbrains.intellij.pluginRepository.PluginRepositoryFactory +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradleplugin.test.createLocalIdeIfNotExists +import org.jetbrains.intellij.pluginRepository.PluginRepositoryFactory import org.junit.Assume.assumeFalse import java.io.File import java.nio.file.Path @@ -560,11 +560,11 @@ class IntelliJPluginSpec : IntelliJPluginSpecBase() { def implementation = project.provider { sourceSets.main.compileClasspath.asPath } task printMainRuntimeClassPath { - dependsOn('$SETUP_DEPENDENCIES_TASK_NAME') + dependsOn('${Tasks.SETUP_DEPENDENCIES}') doLast { println 'runtimeOnly: ' + runtimeOnly.get() } } task printMainCompileClassPath { - dependsOn('$SETUP_DEPENDENCIES_TASK_NAME') + dependsOn('${Tasks.SETUP_DEPENDENCIES}') doLast { println 'implementation: ' + implementation.get() } } """.trimIndent() @@ -586,11 +586,11 @@ class IntelliJPluginSpec : IntelliJPluginSpecBase() { def implementation = project.provider { sourceSets.$sourceSetName.compileClasspath.asPath } task print${sourceSetName.replaceFirstChar { it.uppercase() }}RuntimeClassPath { - dependsOn('$SETUP_DEPENDENCIES_TASK_NAME') + dependsOn('${Tasks.SETUP_DEPENDENCIES}') doLast { println 'runtimeOnly: ' + runtimeOnly.get() } } task print${sourceSetName.replaceFirstChar { it.uppercase() }}CompileClassPath { - dependsOn('$SETUP_DEPENDENCIES_TASK_NAME') + dependsOn('${Tasks.SETUP_DEPENDENCIES}') doLast { println 'implementation: ' + implementation.get() } } """.trimIndent() @@ -638,10 +638,10 @@ class IntelliJPluginSpec : IntelliJPluginSpecBase() { this.groovy( """ import org.gradle.api.artifacts.result.UnresolvedArtifactResult - import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants + import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks task printPluginSourceArtifacts { - dependsOn(IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME) + dependsOn(Tasks.SETUP_DEPENDENCIES) def artifactsProvider = project.provider { def pluginComponentId = configurations.compileClasspath diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTaskSpec.kt index c3a5ec64ad..3d60173416 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTaskSpec.kt @@ -2,7 +2,7 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import kotlin.test.Test @@ -11,19 +11,19 @@ class SetupDependenciesTaskSpec : IntelliJPluginSpecBase() { @Test fun `idea dependency is available`() { - val testTaskName = "${SETUP_DEPENDENCIES_TASK_NAME}Test" + val testTaskName = "${Tasks.SETUP_DEPENDENCIES}Test" buildFile.groovy( """ def classes = providers.provider { - tasks.named('$SETUP_DEPENDENCIES_TASK_NAME').get().idea.get().classes + tasks.named('${Tasks.SETUP_DEPENDENCIES}').get().idea.get().classes } tasks.register('$testTaskName') { doLast { println classes.get() } - dependsOn('$SETUP_DEPENDENCIES_TASK_NAME') + dependsOn('${Tasks.SETUP_DEPENDENCIES}') } """.trimIndent() From 2009084d8c978b334f1963698f14ecf37e715d9b Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 11 Sep 2023 11:21:04 +0200 Subject: [PATCH 019/347] InitializeIntelliJPluginTask: update setup according to changes from the master branch --- .../plugins/IntelliJPlatformTasksPlugin.kt | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt index 99ca6acebe..3722c42b68 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt @@ -6,8 +6,6 @@ import org.gradle.api.Project import org.gradle.kotlin.dsl.apply import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.SELF_UPDATE_CHECK import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PATCH_PLUGIN_XML_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_TASKS_ID import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks @@ -15,6 +13,7 @@ import org.jetbrains.intellij.platform.gradleplugin.isBuildFeatureEnabled import org.jetbrains.intellij.platform.gradleplugin.tasks.InitializeIntelliJPluginTask import org.jetbrains.intellij.platform.gradleplugin.tasks.SetupDependenciesTask import java.time.LocalDate +import kotlin.io.path.exists abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlugin(PLUGIN_TASKS_ID) { @@ -29,19 +28,26 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug configureTask(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) { offline.convention(project.gradle.startParameter.isOffline) selfUpdateCheck.convention(project.isBuildFeatureEnabled(SELF_UPDATE_CHECK)) - lockFile.convention(project.provider { - temporaryDir.resolve(LocalDate.now().toString()) + selfUpdateLockPath.convention(project.provider { + temporaryDir.toPath().resolve(LocalDate.now().toString()) + }) + coroutinesJavaAgentPath.convention(project.provider { + temporaryDir.toPath().resolve("coroutines-javaagent.jar") }) - onlyIf { !lockFile.get().exists() } + onlyIf { + !selfUpdateLockPath.get().exists() || !coroutinesJavaAgentPath.get().exists() + } } + } - // Make all tasks depend on [INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME] - (TASKS - INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME).forEach { // Make all tasks depend on [INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME] (TASKS - INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME).forEach { + // Make all tasks depend on [INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME] + (TASKS - INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME).forEach { // named(it) { dependsOn(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) } } } } } + From 65fa459821fac56ef1702931f9a43529ea3db84c Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Thu, 14 Sep 2023 09:23:33 +0200 Subject: [PATCH 020/347] PatchPluginXmlTask refactoring; introduce `PluginConfiguration` to the `IntelliJPlatformExtension` --- .../gradleplugin/IntelliJPluginConstants.kt | 6 +- .../IntelliJPlatformCollectorTransformer.kt | 12 +- .../extensions/IntelliJPlatformExtension.kt | 172 ++++++++++++++- .../IntelliJPlatformAbstractProjectPlugin.kt | 19 ++ .../plugins/IntelliJPlatformBasePlugin.kt | 24 +- .../plugins/IntelliJPlatformPlugin.kt | 56 +---- .../plugins/IntelliJPlatformTasksPlugin.kt | 82 ++++++- .../IntelliJPlatformArgumentProvider.kt | 4 +- .../tasks/InitializeIntelliJPluginTask.kt | 2 +- .../gradleplugin/tasks/PatchPluginXmlTask.kt | 207 ++++++++++-------- .../intellij/platform/gradleplugin/utils.kt | 4 + .../gradleplugin/IntelliJPluginSpec.kt | 1 - 12 files changed, 428 insertions(+), 161 deletions(-) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index b2de85fd80..84bc57818b 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -11,9 +11,11 @@ object IntelliJPluginConstants { const val PLUGIN_GROUP_NAME = "intellij" object Extensions { + const val IDEA_VERSION = "ideaVersion" const val INTELLIJ_PLATFORM = "intellijPlatform" const val PLUGIN_CONFIGURATION = "pluginConfiguration" const val PRODUCT_DESCRIPTOR = "productDescriptor" + const val VENDOR = "vendor" } object Tasks { @@ -110,8 +112,8 @@ object IntelliJPluginConstants { @Deprecated("Deprecated in 2.0") const val IDEA_CONFIGURATION_NAME = "z90_intellij" - const val INTELLIJ_PLATFORM_CONFIGURATION_NAME = "intellijPlatformConfiguration" - const val INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME = "intellijPlatformSourcesConfiguration" + const val INTELLIJ_PLATFORM_CONFIGURATION_NAME = "intellijPlatform" + const val INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME = "intellijPlatformSources" const val TEST_FIXTURES_COMPILE_ONLY_CONFIGURATION_NAME = "testFixturesCompileOnly" const val INSTRUMENTED_JAR_CONFIGURATION_NAME = "instrumentedJar" diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformCollectorTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformCollectorTransformer.kt index 3539e82796..0540586673 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformCollectorTransformer.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformCollectorTransformer.kt @@ -2,6 +2,7 @@ package org.jetbrains.intellij.platform.gradleplugin.artifacts.transform +import com.jetbrains.plugin.structure.base.utils.exists import org.gradle.api.Project import org.gradle.api.artifacts.transform.InputArtifact import org.gradle.api.artifacts.transform.TransformAction @@ -16,6 +17,7 @@ import org.gradle.api.plugins.JavaPlugin.TEST_COMPILE_CLASSPATH_CONFIGURATION_NA import org.gradle.api.provider.Provider import org.gradle.api.tasks.Classpath import org.gradle.api.tasks.CompileClasspath +import org.gradle.internal.os.OperatingSystem import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.registerTransform import org.gradle.work.DisableCachingByDefault @@ -23,6 +25,7 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTE import org.jetbrains.intellij.platform.gradleplugin.asPath import org.jetbrains.intellij.platform.gradleplugin.collectJars import org.jetbrains.intellij.platform.gradleplugin.isKotlinRuntime +import org.jetbrains.intellij.platform.gradleplugin.or import kotlin.io.path.isDirectory import kotlin.io.path.name @@ -51,7 +54,14 @@ abstract class IntelliJPlatformCollectorTransformer : TransformAction(Extensions.PLUGIN_CONFIGURATION) + + @IntelliJPlatform + interface PluginConfiguration : ExtensionAware { + + val productDescriptor + get() = extensions.getByName(Extensions.PRODUCT_DESCRIPTOR) + val ideaVersion + get() = extensions.getByName(Extensions.IDEA_VERSION) + val vendor + get() = extensions.getByName(Extensions.VENDOR) + + /** + * A unique identifier of the plugin. + * It should be a fully qualified name similar to Java packages and must not collide with the ID of existing plugins. + * The ID is a technical value used to identify the plugin in the IDE and [JetBrains Marketplace](https://plugins.jetbrains.com/). + * Please use characters, numbers, and `.`/`-`/`_` symbols only and keep it reasonably short. + * + * The provided value will be set as a value of the `` element. + * + * See [Plugin Configuration File: `id`](https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html#idea-plugin__id) documentation for more details. + */ + val id: Property + + /** + * The user-visible plugin display name (Title Case). + * + * The provided value will be set as a value of the `` element. + * + * See [Plugin Configuration File: `name`](https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html#idea-plugin__name) documentation for more details. + */ + val name: Property + + /** + * The plugin version displayed in the Plugins settings dialog and in the JetBrains Marketplace plugin page. + * Plugins uploaded to the JetBrains Marketplace must follow semantic versioning. + * + * The provided value will be set as a value of the `` element. + * + * See [Plugin Configuration File: `version`](https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html#idea-plugin__version) documentation for more details. + */ + val version: Property + + /** + * The plugin description displayed on the JetBrains Marketplace plugin page and in the Plugins settings dialog. + * Simple HTML elements, like text formatting, paragraphs, lists, etc., are allowed and must be wrapped into `` section. + * + * The provided value will be set as a value of the `` element. + * + * See [Plugin Configuration File: `description`](https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html#idea-plugin__description) documentation for more details. + */ + val description: Property + + /** + * A short summary of new features, bugfixes, and changes provided with the latest plugin version. Change notes are displayed on the JetBrains Marketplace plugin page and in the Plugins settings dialog. + * Simple HTML elements, like text formatting, paragraphs, lists, etc., are allowed and must be wrapped into `` section. + * + * The provided value will be set as a value of the `` element. + * + * See [Plugin Configuration File: `description`](https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html#idea-plugin__change-notes) documentation for more details. + */ + val changeNotes: Property + + @IntelliJPlatform + interface ProductDescriptor { + + /** + * The plugin product code used in the JetBrains Sales System. + * The code must be agreed with JetBrains in advance and follow [the requirements](https://plugins.jetbrains.com/docs/marketplace/obtain-a-product-code-from-jetbrains.html). + * + * The provided value will be set as a value of the `` element attribute. + * + * See [Plugin Configuration File: `product-descriptor`](https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html#idea-plugin__product-descriptor) documentation for more details. + */ + val code: Property + + /** + * Date of the major version release in the `YYYYMMDD` format. + * + * The provided value will be set as a value of the `` element attribute. + * + * See [Plugin Configuration File: `product-descriptor`](https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html#idea-plugin__product-descriptor) documentation for more details. + */ + val releaseDate: Property + + /** + * A major version in a special number format. + * + * The provided value will be set as a value of the `` element attribute. + * + * See [Plugin Configuration File: `product-descriptor`](https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html#idea-plugin__product-descriptor) documentation for more details. + */ + val releaseVersion: Property + + /** + * The boolean value determining whether the plugin is a [Freemium](https://plugins.jetbrains.com/docs/marketplace/freemium.html) plugin. + * Default value: `false`. + * + * The provided value will be set as a value of the `` element attribute. + * + * See [Plugin Configuration File: `product-descriptor`](https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html#idea-plugin__product-descriptor) documentation for more details. + */ + val optional: Property + } + + @IntelliJPlatform + interface IdeaVersion { + + /** + * The lowest IDE version compatible with the plugin. + * + * The provided value will be set as a value of the `` element attribute. + * + * See [Plugin Configuration File: `idea-version`](https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html#idea-plugin__idea-version) documentation for more details. + */ + val sinceBuild: Property + + /** + * The highest IDE version compatible with the plugin. + * Undefined value declares compatibility with all the IDEs since the version specified by the since-build (also with the future builds what may cause incompatibility errors). + * + * The provided value will be set as a value of the `` element attribute. + * + * See [Plugin Configuration File: `idea-version`](https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html#idea-plugin__idea-version) documentation for more details. + */ + val untilBuild: Property + } + + @IntelliJPlatform + interface Vendor { + + /** + * The vendor name or organization ID (if created) in the Plugins settings dialog and in the JetBrains Marketplace plugin page. + * + * The provided value will be set as a value of the `` element. + * + * See [Plugin Configuration File: `vendor`](https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html#idea-plugin__vendor) documentation for more details. + */ + val name: Property + + /** + * The vendor's email address. + * + * The provided value will be set as a value of the `` element attribute. + * + * See [Plugin Configuration File](https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html#idea-plugin__vendor) documentation for more details. + */ + val email: Property + + /** + * The link to the vendor's homepage. + * + * The provided value will be set as a value of the `` element attribute. + * + * See [Plugin Configuration File](https://plugins.jetbrains.com/docs/intellij/plugin-configuration-file.html#idea-plugin__vendor) documentation for more details. + */ + val url: Property + } + } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt index 711d8f058f..b3c4a7961c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt @@ -2,14 +2,19 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins +import com.jetbrains.plugin.structure.intellij.version.IdeVersion import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.plugins.ExtensionAware +import org.gradle.api.plugins.JavaPlugin import org.gradle.api.tasks.TaskContainer import org.gradle.kotlin.dsl.create +import org.gradle.kotlin.dsl.getByName import org.gradle.kotlin.dsl.register +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion +import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension import org.jetbrains.intellij.platform.gradleplugin.info import org.jetbrains.intellij.platform.gradleplugin.logCategory @@ -41,4 +46,18 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu extension.configuration() } } + + protected val Project.intelliJPlatformExtension + get() = extensions.getByName(Extensions.INTELLIJ_PLATFORM) + + protected val Project.ideVersionProvider + get() = configurations.named(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME).map { configuration -> + configuration.resolvedConfiguration + .resolvedArtifacts + .firstOrNull { artifact -> artifact.name == "build" && artifact.file.name == "build.txt" } + ?.file?.readText()?.trim() + ?: throw Exception("build.txt doesn't exist") // TODO: TEST & FIX ME + }.map { + IdeVersion.createIdeVersion(it) + } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt index 7c22fdf453..a682f3d945 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt @@ -8,7 +8,7 @@ import org.gradle.api.plugins.JavaPlugin import org.gradle.api.plugins.JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME import org.gradle.api.plugins.JavaPlugin.TEST_COMPILE_ONLY_CONFIGURATION_NAME import org.gradle.kotlin.dsl.apply -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_TEST_FIXTURES_PLUGIN_ID @@ -27,12 +27,6 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi apply(JavaPlugin::class) } - configureExtension(Extensions.INTELLIJ_PLATFORM) { - configureExtension(Extensions.PLUGIN_CONFIGURATION) { - configureExtension(Extensions.PRODUCT_DESCRIPTOR) - } - } - with(repositories) { applyIntelliJPlatformSettings(objects, providers) } @@ -61,7 +55,23 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi pluginManager.withPlugin(JAVA_TEST_FIXTURES_PLUGIN_ID) { getByName(TEST_FIXTURES_COMPILE_ONLY_CONFIGURATION_NAME).extend() } + } + with(IntelliJPluginConstants.Extensions) { + this@configure.configureExtension(INTELLIJ_PLATFORM) { + configureExtension(PLUGIN_CONFIGURATION) { + configureExtension(PRODUCT_DESCRIPTOR) + configureExtension(IDEA_VERSION) { + sinceBuild.convention(ideVersionProvider.map { + "${it.baselineVersion}.${it.build}" + }) + untilBuild.convention(ideVersionProvider.map { + "${it.baselineVersion}.*" + }) + } + configureExtension(VENDOR) + } + } } applyIntellijPlatformExtractTransformer() diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt index 18c25eb539..ff49085419 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt @@ -52,6 +52,7 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Exte import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PLUGINS_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PRODUCTS_RELEASES_URL +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_PREFIX import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_TASK_NAME @@ -69,7 +70,6 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PATC import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PERFORMANCE_TEST_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_XML_DIR_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_SANDBOX_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_TESTING_SANDBOX_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_UI_TESTING_SANDBOX_TASK_NAME @@ -113,7 +113,6 @@ import java.nio.file.Path import java.time.LocalDateTime import java.time.format.DateTimeFormatter import java.util.* -import kotlin.io.path.exists abstract class IntelliJPlatformPlugin : Plugin { @@ -192,7 +191,6 @@ abstract class IntelliJPlatformPlugin : Plugin { configureClassPathIndexCleanupTask(project, ideaDependencyProvider) configureInstrumentation(project, extension, ideaDependencyProvider) - configurePatchPluginXmlTask(project, extension, ideaDependencyProvider) configureDownloadRobotServerPluginTask(project) configurePrepareSandboxTasks(project, extension, ideaDependencyProvider) configureListProductsReleasesTask(project, extension) @@ -436,48 +434,6 @@ abstract class IntelliJPlatformPlugin : Plugin { } } - private fun configurePatchPluginXmlTask(project: Project, extension: IntelliJPluginExtension, ideaDependencyProvider: Provider) { - info(context, "Configuring patch plugin.xml task") - - val buildNumberProvider = ideaDependencyProvider.map { it.buildNumber } - - project.tasks.register(PATCH_PLUGIN_XML_TASK_NAME) - project.tasks.withType { - version.convention(project.provider { - project.version.toString() - }) - pluginXmlFiles.convention(project.provider { - sourcePluginXmlFiles(project).map(Path::toFile) - }) - destinationDir.convention(project.layout.buildDirectory.dir(PLUGIN_XML_DIR_NAME)) - outputFiles.convention(pluginXmlFiles.map { - it.map { file -> - destinationDir.get().asFile.resolve(file.name) - } - }) - sinceBuild.convention(project.provider { - if (extension.updateSinceUntilBuild.get()) { - val ideVersion = IdeVersion.createIdeVersion(buildNumberProvider.get()) - "${ideVersion.baselineVersion}.${ideVersion.build}" - } else { - null - } - }) - untilBuild.convention(project.provider { - if (extension.updateSinceUntilBuild.get()) { - if (extension.sameSinceUntilBuild.get()) { - "${sinceBuild.get()}.*" - } else { - val ideVersion = IdeVersion.createIdeVersion(buildNumberProvider.get()) - "${ideVersion.baselineVersion}.*" - } - } else { - null - } - }) - } - } - private fun configurePrepareSandboxTasks(project: Project, extension: IntelliJPluginExtension, ideaDependencyProvider: Provider) { val jarTaskProvider = project.tasks.named(JAR_TASK_NAME) val instrumentedJarTaskProvider = project.tasks.named(INSTRUMENTED_JAR_TASK_NAME) @@ -749,9 +705,9 @@ abstract class IntelliJPlatformPlugin : Plugin { platformVersion.convention(ideaDependencyProvider.map { it.version }) - pluginXmlFiles.convention(patchPluginXmlTaskProvider.flatMap { patchPluginXmlTask -> - patchPluginXmlTask.outputFiles - }) +// pluginXmlFiles.convention(patchPluginXmlTaskProvider.flatMap { patchPluginXmlTask -> +// patchPluginXmlTask.outputFiles +// }) sourceCompatibility.convention(compileJavaTaskProvider.map { it.sourceCompatibility }) @@ -1459,8 +1415,8 @@ abstract class IntelliJPlatformPlugin : Plugin { project.layout.buildDirectory.file("$LIST_PRODUCTS_RELEASES_TASK_NAME.txt") ) types.convention(extension.type.map { listOf(it) }) - sinceBuild.convention(patchPluginXmlTaskProvider.flatMap { it.sinceBuild }) - untilBuild.convention(patchPluginXmlTaskProvider.flatMap { it.untilBuild }) +// sinceBuild.convention(patchPluginXmlTaskProvider.flatMap { it.sinceBuild }) +// untilBuild.convention(patchPluginXmlTaskProvider.flatMap { it.untilBuild }) releaseChannels.convention(EnumSet.allOf(ListProductsReleasesTask.Channel::class.java)) dependsOn(DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt index 3722c42b68..1450e3eaf3 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt @@ -3,14 +3,18 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins import org.gradle.api.Project +import org.gradle.api.tasks.SourceSet.MAIN_SOURCE_SET_NAME import org.gradle.kotlin.dsl.apply import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.SELF_UPDATE_CHECK import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PATCH_PLUGIN_XML_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_TASKS_ID import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradleplugin.isBuildFeatureEnabled +import org.jetbrains.intellij.platform.gradleplugin.sourceSets import org.jetbrains.intellij.platform.gradleplugin.tasks.InitializeIntelliJPluginTask +import org.jetbrains.intellij.platform.gradleplugin.tasks.PatchPluginXmlTask import org.jetbrains.intellij.platform.gradleplugin.tasks.SetupDependenciesTask import java.time.LocalDate import kotlin.io.path.exists @@ -28,10 +32,10 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug configureTask(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) { offline.convention(project.gradle.startParameter.isOffline) selfUpdateCheck.convention(project.isBuildFeatureEnabled(SELF_UPDATE_CHECK)) - selfUpdateLockPath.convention(project.provider { + selfUpdateLockPath.convention(provider { temporaryDir.toPath().resolve(LocalDate.now().toString()) }) - coroutinesJavaAgentPath.convention(project.provider { + coroutinesJavaAgentPath.convention(provider { temporaryDir.toPath().resolve("coroutines-javaagent.jar") }) @@ -39,10 +43,78 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug !selfUpdateLockPath.get().exists() || !coroutinesJavaAgentPath.get().exists() } } - } - // Make all tasks depend on [INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME] - (TASKS - INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME).forEach { + configureTask(PATCH_PLUGIN_XML_TASK_NAME) { + inputFile.convention(provider { + sourceSets.getByName(MAIN_SOURCE_SET_NAME).resources.srcDirs + .map { it.resolve("META-INF/plugin.xml") } + .firstOrNull { it.exists() } + }) + outputFile.convention(inputFile.map { + temporaryDir.resolve(it.name) + }) + + intelliJPlatformExtension.pluginConfiguration.let { + pluginId.convention(it.id) + pluginName.convention(it.name) + pluginVersion.convention(it.version) + pluginDescription.convention(it.description) + changeNotes.convention(it.changeNotes) + + it.productDescriptor.let { productDescriptor -> + productDescriptorCode.convention(productDescriptor.code) + productDescriptorReleaseDate.convention(productDescriptor.releaseDate) + productDescriptorReleaseVersion.convention(productDescriptor.releaseVersion) + productDescriptorOptional.convention(productDescriptor.optional) + } + + it.ideaVersion.let { ideaVersion -> + sinceBuild.convention(ideaVersion.sinceBuild) + untilBuild.convention(ideaVersion.untilBuild) + } + + it.vendor.let { vendor -> + vendorName.convention(vendor.name) + vendorEmail.convention(vendor.email) + vendorUrl.convention(vendor.url) + } + } + +// val buildNumberProvider = ideaDependencyProvider.map { it.buildNumber } + +// version.convention(project.provider { +// project.version.toString() +// }) +// pluginXmlFiles.convention(project.provider { +// sourcePluginXmlFiles(project).map(Path::toFile) +// }) +// destinationDir.convention(project.layout.buildDirectory.dir(IntelliJPluginConstants.PLUGIN_XML_DIR_NAME)) +// outputFiles.convention(pluginXmlFiles.map { +// it.map { file -> +// destinationDir.get().asFile.resolve(file.name) +// } +// }) +// sinceBuild.convention(project.provider { +// if (extension.updateSinceUntilBuild.get()) { +// val ideVersion = IdeVersion.createIdeVersion(buildNumberProvider.get()) +// "${ideVersion.baselineVersion}.${ideVersion.build}" +// } else { +// null +// } +// }) +// untilBuild.convention(project.provider { +// if (extension.updateSinceUntilBuild.get()) { +// if (extension.sameSinceUntilBuild.get()) { +// "${sinceBuild.get()}.*" +// } else { +// val ideVersion = IdeVersion.createIdeVersion(buildNumberProvider.get()) +// "${ideVersion.baselineVersion}.*" +// } +// } else { +// null +// } +// }) + } // Make all tasks depend on [INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME] (TASKS - INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME).forEach { // named(it) { dependsOn(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt index 399343a671..5356cd9268 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt @@ -10,8 +10,8 @@ import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.gradle.process.CommandLineArgumentProvider import org.gradle.process.JavaForkOptions -import org.jetbrains.intellij.Version -import org.jetbrains.intellij.ideBuildNumber +import org.jetbrains.intellij.platform.gradleplugin.Version +import org.jetbrains.intellij.platform.gradleplugin.ideBuildNumber import org.jetbrains.intellij.platform.gradleplugin.ideProductInfo import org.jetbrains.intellij.platform.gradleplugin.resolveIdeHomeVariable import org.jetbrains.intellij.platform.gradleplugin.utils.OpenedPackages diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPluginTask.kt index 0ff02779c2..8bf7a109c2 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPluginTask.kt @@ -68,7 +68,7 @@ abstract class InitializeIntelliJPluginTask : DefaultTask() { warn(context, "$PLUGIN_NAME is outdated: $version. Update `$PLUGIN_ID` to: $latestVersion") } - with(selfUpdateLockPath.get().toPath()) { + with(selfUpdateLockPath.get()) { if (!exists()) { create() } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt index cda2661d80..66da72743c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt @@ -2,23 +2,21 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks -import com.jetbrains.plugin.structure.base.utils.inputStream -import com.jetbrains.plugin.structure.base.utils.simpleName import com.jetbrains.plugin.structure.intellij.utils.JDOMUtil import org.gradle.api.DefaultTask import org.gradle.api.Project -import org.gradle.api.file.DirectoryProperty -import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property +import org.gradle.api.provider.Provider import org.gradle.api.tasks.* import org.jdom2.Document import org.jdom2.Element import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.asPath +import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension import org.jetbrains.intellij.platform.gradleplugin.logCategory import org.jetbrains.intellij.platform.gradleplugin.transformXml import org.jetbrains.intellij.platform.gradleplugin.warn import java.io.File +import kotlin.io.path.inputStream /** * Patches `plugin.xml` files with values provided to the task. @@ -30,77 +28,111 @@ import java.io.File @CacheableTask abstract class PatchPluginXmlTask : DefaultTask() { + @get:SkipWhenEmpty + @get:InputFile + @get:PathSensitive(PathSensitivity.RELATIVE) + abstract val inputFile: Property + + @get:OutputFile + abstract val outputFile: Property + /** - * The directory where the patched plugin.xml will be written. - * - * Default value: `${project.buildDir}/patchedPluginXmlFiles` + * @see [IntelliJPlatformExtension.PluginConfiguration.id] */ - @get:OutputDirectory - abstract val destinationDir: DirectoryProperty + @get:Input + @get:Optional + abstract val pluginId: Property /** - * The list of output `plugin.xml` files. + * @see [IntelliJPlatformExtension.PluginConfiguration.name] */ - @get:OutputFiles - abstract val outputFiles: ListProperty + @get:Input + @get:Optional + abstract val pluginName: Property /** - * The list of `plugin.xml` files to patch. - * - * Default value: auto-discovered from the project + * @see [IntelliJPlatformExtension.PluginConfiguration.version] */ - @get:SkipWhenEmpty - @get:InputFiles - @get:PathSensitive(PathSensitivity.RELATIVE) - abstract val pluginXmlFiles: ListProperty + @get:Input + @get:Optional + abstract val pluginVersion: Property /** - * The description of the plugin – will be set to the `` tag. + * @see [IntelliJPlatformExtension.PluginConfiguration.description] */ @get:Input @get:Optional abstract val pluginDescription: Property /** - * The lower bound of the version range to be patched – will be set for the `since-build` attribute of the `` tag. - * - * Default value: `intellij.version` in `Branch.Build.Fix` format + * @see [IntelliJPlatformExtension.PluginConfiguration.changeNotes] + */ + @get:Input + @get:Optional + abstract val changeNotes: Property + + /** + * @see [IntelliJPlatformExtension.PluginConfiguration.ProductDescriptor.code] + */ + @get:Input + @get:Optional + abstract val productDescriptorCode: Property + + /** + * @see [IntelliJPlatformExtension.PluginConfiguration.ProductDescriptor.releaseDate] + */ + @get:Input + @get:Optional + abstract val productDescriptorReleaseDate: Property + + /** + * @see [IntelliJPlatformExtension.PluginConfiguration.ProductDescriptor.releaseVersion] + */ + @get:Input + @get:Optional + abstract val productDescriptorReleaseVersion: Property + + /** + * @see [IntelliJPlatformExtension.PluginConfiguration.ProductDescriptor.optional] + */ + @get:Input + @get:Optional + abstract val productDescriptorOptional: Property + + /** + * @see [IntelliJPlatformExtension.PluginConfiguration.IdeaVersion.sinceBuild] */ @get:Input @get:Optional abstract val sinceBuild: Property /** - * The upper bound of the version range to be patched – will be set for the `until-build` attribute of the `` tag. - * - * Default value: `intellij.version` in `Branch.Build.*` format + * @see [IntelliJPlatformExtension.PluginConfiguration.IdeaVersion.untilBuild] */ @get:Input @get:Optional abstract val untilBuild: Property /** - * The version of the plugin – will be set for the `` tag. - * - * Default value: `${project.version}` + * @see [IntelliJPlatformExtension.PluginConfiguration.Vendor.name] */ @get:Input @get:Optional - abstract val version: Property + abstract val vendorName: Property /** - * The change notes of the plugin – will be set for the `` tag. + * @see [IntelliJPlatformExtension.PluginConfiguration.Vendor.email] */ @get:Input @get:Optional - abstract val changeNotes: Property + abstract val vendorEmail: Property /** - * The ID of the plugin – will be set for the `` tag. + * @see [IntelliJPlatformExtension.PluginConfiguration.Vendor.url] */ @get:Input @get:Optional - abstract val pluginId: Property + abstract val vendorUrl: Property private val context = logCategory() @@ -111,73 +143,66 @@ abstract class PatchPluginXmlTask : DefaultTask() { @TaskAction fun patchPluginXml() { - pluginXmlFiles.get() - .map(File::toPath) - .forEach { path -> - path.inputStream().use { inputStream -> - val document = JDOMUtil.loadDocument(inputStream) - - sinceBuild.orNull - ?.let { patchAttribute(document, "idea-version", "since-build", it) } - untilBuild.orNull - ?.let { patchAttribute(document, "idea-version", "until-build", it) } - pluginDescription.orNull - ?.let { patchTag(document, "description", it) } - changeNotes.orNull - ?.let { patchTag(document, "change-notes", it) } - version.orNull - .takeIf { it != Project.DEFAULT_VERSION } - ?.let { patchTag(document, "version", it) } - pluginId.orNull - ?.let { patchTag(document, "id", it) } - - destinationDir.get() - .asPath - .resolve(path.simpleName) - .let { transformXml(document, it) } - } - } - } + val inputPath = inputFile.get().toPath() + val outputPath = outputFile.get().toPath() - /** - * Sets the [content] value of the given [document] to the given [name] tag. - */ - private fun patchTag(document: Document, name: String, content: String) { - if (content.isEmpty()) { - return - } - val pluginXml = document.rootElement.takeIf { it.name == "idea-plugin" } ?: return + println("inputPath = ${inputPath}") + println("outputPath = ${outputPath}") + + inputPath.inputStream().use { inputStream -> + val document = JDOMUtil.loadDocument(inputStream) + + with(document) { + patch(pluginId, "id") + patch(pluginName, "name") + patch(pluginVersion.takeIf { it.get() != Project.DEFAULT_VERSION }, "version") + patch(pluginDescription, "description") + patch(changeNotes, "change-notes") - val tag = pluginXml.getChild(name) - if (tag != null) { - val existingValue = tag.text - if (existingValue.isNotEmpty()) { - warn(context, "Patching plugin.xml: value of '$name[$existingValue]' tag will be set to '$content'") + patch(productDescriptorCode, "product-descriptor", "code") + patch(productDescriptorReleaseDate, "product-descriptor", "release-date") + patch(productDescriptorReleaseVersion, "product-descriptor", "release-version") + patch(productDescriptorOptional.map { it.toString() }, "product-descriptor", "optional") + + patch(sinceBuild, "idea-version", "since-build") + patch(untilBuild, "idea-version", "until-build") + + patch(vendorName, "vendor") + patch(vendorEmail, "vendor", "email") + patch(vendorUrl, "vendor", "url") } - tag.text = content - } else { - pluginXml.addContent(0, Element(name).apply { text = content }) + + transformXml(document, outputPath) } } /** - * Sets the [attributeValue] value for the given [attributeName] of the given [document] under the specific [tagName] tag. + * Sets the [provider] value for the given [tagName] or [attributeName] of [tagName]. */ - private fun patchAttribute(document: Document, tagName: String, attributeName: String, attributeValue: String) { - if (attributeValue.isEmpty()) { - return + private fun Document.patch(provider: Provider?, tagName: String, attributeName: String? = null) { + provider ?: return + val value = provider.orNull ?: return + val pluginXml = rootElement.takeIf { it.name == "idea-plugin" } ?: return + val element = pluginXml.getChild(tagName) ?: Element(tagName).apply { + pluginXml.addContent(0, this) } - val pluginXml = document.rootElement.takeIf { it.name == "idea-plugin" } ?: return - val tag = pluginXml.getChild(tagName) - if (tag != null) { - val existingValue = tag.getAttribute(attributeName)?.value - if (!existingValue.isNullOrEmpty()) { - warn(context, "Patching plugin.xml: attribute '$attributeName=[$existingValue]' of '$tagName' tag will be set to '$attributeValue'") + when { + attributeName == null -> { + val existingValue = element.text + if (existingValue.isNotEmpty()) { + warn(context, "Patching plugin.xml: value of '$tagName[$existingValue]' tag will be set to '$value'") + } + element.text = value + } + + else -> { + val existingValue = element.getAttribute(attributeName)?.value + if (!existingValue.isNullOrEmpty()) { + warn(context, "Patching plugin.xml: attribute '$attributeName=[$existingValue]' of '$tagName' tag will be set to '$value'") + } + element.setAttribute(attributeName, value) } - tag.setAttribute(attributeName, attributeValue) - } else { - pluginXml.addContent(0, Element(tagName).apply { setAttribute(attributeName, attributeValue) }) } } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt index 5c6fa8671b..211280a0a5 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt @@ -26,6 +26,7 @@ import org.gradle.api.plugins.JavaPluginExtension import org.gradle.api.plugins.PluginInstantiationException import org.gradle.api.provider.Property import org.gradle.api.tasks.SourceSet +import org.gradle.api.tasks.SourceSetContainer import org.gradle.internal.os.OperatingSystem import org.gradle.kotlin.dsl.getByName import org.gradle.util.GradleVersion @@ -148,6 +149,7 @@ fun getIdeaClasspath(ideDir: Path): List { }.map { "$ideDir/lib/$it" } } +@Deprecated("Rely on `build.txt` artifact resolved in configuration") fun ideBuildNumber(ideDir: Path) = ideDir .resolve("Resources/build.txt") .takeIf { OperatingSystem.current().isMacOsX && it.exists() } @@ -295,3 +297,5 @@ internal val Property.isSpecified: Boolean else -> true } +internal val Project.sourceSets + get() = extensions.getByName("sourceSets") as SourceSetContainer diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpec.kt index e74e0f19ea..a1737cce9d 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpec.kt @@ -12,7 +12,6 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASK import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradleplugin.test.createLocalIdeIfNotExists import org.jetbrains.intellij.pluginRepository.PluginRepositoryFactory -import org.jetbrains.intellij.test.createLocalIdeIfNotExists import org.junit.AfterClass import org.junit.Assume.assumeFalse import java.io.File From f119638f02f13e22a82ed3f16566e10a30b50976 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Thu, 14 Sep 2023 18:14:39 +0200 Subject: [PATCH 021/347] Introduce dedicated configuration for extra IntelliJ Platform dependencies --- .../gradleplugin/IntelliJPluginConstants.kt | 1 + .../dependencies/jetbrainsAnnotations.kt | 4 ++-- .../plugins/IntelliJPlatformBasePlugin.kt | 14 +++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index 84bc57818b..d9490cbc8d 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -113,6 +113,7 @@ object IntelliJPluginConstants { const val IDEA_CONFIGURATION_NAME = "z90_intellij" const val INTELLIJ_PLATFORM_CONFIGURATION_NAME = "intellijPlatform" + const val INTELLIJ_PLATFORM_DEPENDENCIES_CONFIGURATION_NAME = "intellijPlatformDependencies" const val INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME = "intellijPlatformSources" const val TEST_FIXTURES_COMPILE_ONLY_CONFIGURATION_NAME = "testFixturesCompileOnly" diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsAnnotations.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsAnnotations.kt index c4cfbbc9c6..0daf361c02 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsAnnotations.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsAnnotations.kt @@ -7,11 +7,11 @@ package org.jetbrains.intellij.platform.gradleplugin.dependencies import org.gradle.kotlin.dsl.DependencyHandlerScope import org.gradle.kotlin.dsl.create import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANNOTATIONS_DEPENDENCY_VERSION -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_DEPENDENCIES_CONFIGURATION_NAME fun DependencyHandlerScope.jetbrainsAnnotations( version: String = ANNOTATIONS_DEPENDENCY_VERSION, - configurationName: String = INTELLIJ_PLATFORM_CONFIGURATION_NAME, + configurationName: String = INTELLIJ_PLATFORM_DEPENDENCIES_CONFIGURATION_NAME, ) = create( group = "org.jetbrains", name = "annotations", diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt index a682f3d945..c1d1220160 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt @@ -10,6 +10,7 @@ import org.gradle.api.plugins.JavaPlugin.TEST_COMPILE_ONLY_CONFIGURATION_NAME import org.gradle.kotlin.dsl.apply import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_DEPENDENCIES_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_TEST_FIXTURES_PLUGIN_ID import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_BASE_ID @@ -40,6 +41,14 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi description = "IntelliJ Platform dependency" } + val intellijPlatformDependenciesConfiguration = maybeCreate(INTELLIJ_PLATFORM_DEPENDENCIES_CONFIGURATION_NAME) + .apply { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + description = "IntelliJ Platform Dependencies dependency" + } + maybeCreate(INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME) .apply { isVisible = false @@ -48,7 +57,10 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi description = "IntelliJ Platform Sources to be attached to the IntelliJ Platform dependency" } - fun Configuration.extend() = extendsFrom(intellijPlatformConfiguration) + fun Configuration.extend() = extendsFrom( + intellijPlatformConfiguration, + intellijPlatformDependenciesConfiguration, + ) getByName(COMPILE_ONLY_CONFIGURATION_NAME).extend() getByName(TEST_COMPILE_ONLY_CONFIGURATION_NAME).extend() From 0e21075c5ccc48befb6cb930972a603c16c3fdcf Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 25 Sep 2023 17:32:21 +0200 Subject: [PATCH 022/347] PatchPluginXmlTask refactoring; introduce `PluginConfiguration` to the `IntelliJPlatformExtension`; `IntelliJPlatformBuildNumberTransformer` for obtaining build number of the picked IJ Platform dependency; intermediate `IdeVersionAwareTask` task class; throw an exception when multiple IJ Platform dependencies are added to the project --- .../gradleplugin/IntelliJPlatformType.kt | 11 ++-- .../gradleplugin/IntelliJPluginConstants.kt | 22 +++++-- .../IntelliJPlatformBuildNumberTransformer.kt | 64 +++++++++++++++++++ .../IntelliJPlatformCollectorTransformer.kt | 59 +++++++---------- .../IntelliJPlatformExtractTransformer.kt | 56 ++++++++-------- .../gradleplugin/dependencies/dependencies.kt | 22 +++++++ .../dependencies/intellijPlatform.kt | 21 ++---- .../dependencies/intellijPlatformPlugin.kt | 25 ++++++++ .../dependencies/intellijPlatformSources.kt | 9 +-- .../dependencies/jetbrainsAnnotations.kt | 4 +- .../dependency/IdeaDependencyManager.kt | 27 ++++---- .../IntelliJPlatformAbstractProjectPlugin.kt | 24 +++---- .../plugins/IntelliJPlatformBasePlugin.kt | 52 ++++++++++----- .../plugins/IntelliJPlatformPlugin.kt | 1 + .../plugins/IntelliJPlatformTasksPlugin.kt | 1 - .../gradleplugin/repositories/intellij.kt | 46 +------------ .../repositories/jetbrainsMarketplace.kt | 14 ++++ .../gradleplugin/repositories/repositories.kt | 49 ++++++++++++++ .../tasks/BuildSearchableOptionsTask.kt | 1 + .../gradleplugin/tasks/PatchPluginXmlTask.kt | 27 +++++--- .../gradleplugin/tasks/RunIdeForUiTestTask.kt | 1 + .../tasks/RunIdePerformanceTestTask.kt | 11 ++-- .../platform/gradleplugin/tasks/RunIdeTask.kt | 1 + .../gradleplugin/tasks/SignPluginTask.kt | 1 + .../tasks/VerifyPluginSignatureTask.kt | 1 + .../tasks/base/IdeVersionAwareTask.kt | 24 +++++++ .../tasks/{ => base}/RunIdeBase.kt | 14 ++-- .../tasks/{ => base}/ZipSigningToolBase.kt | 2 +- .../intellij/platform/gradleplugin/utils.kt | 22 ++++--- 29 files changed, 399 insertions(+), 213 deletions(-) create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformBuildNumberTransformer.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/dependencies.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformPlugin.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/jetbrainsMarketplace.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/IdeVersionAwareTask.kt rename src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/{ => base}/RunIdeBase.kt (97%) rename src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/{ => base}/ZipSigningToolBase.kt (98%) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt index fd4180731c..4bba219b7f 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt @@ -40,11 +40,12 @@ enum class IntelliJPlatformType(val code: String, val groupId: String, val artif groupId = "com.jetbrains.intellij.idea", artifactId = "ideaIU" ), - JPS( - code = "JPS", - groupId = "", - artifactId = "" - ), + + // JPS( +// code = "JPS", +// groupId = "", +// artifactId = "" +// ), PhpStorm( code = "PS", groupId = "com.jetbrains.intellij.phpstorm", diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index d9490cbc8d..d31becdad4 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -2,6 +2,8 @@ package org.jetbrains.intellij.platform.gradleplugin +import org.gradle.api.attributes.Attribute + object IntelliJPluginConstants { const val PLUGIN_NAME = "IntelliJ Platform Gradle Plugin" const val PLUGIN_ID = "org.jetbrains.intellij.platform" @@ -18,6 +20,21 @@ object IntelliJPluginConstants { const val VENDOR = "vendor" } + object Configurations { + const val INTELLIJ_PLATFORM = "intellijPlatform" + const val INTELLIJ_PLATFORM_BUILD_NUMBER = "intellijPlatformBuildNumber" + const val INTELLIJ_PLATFORM_DEPENDENCIES = "intellijPlatformDependencies" + const val INTELLIJ_PLATFORM_SOURCES = "intellijPlatformSources" + const val TEST_FIXTURES_COMPILE_ONLY = "testFixturesCompileOnly" + + object Attributes { + val extracted = Attribute.of("intellijPlatformExtracted", Boolean::class.javaObjectType) + val collected = Attribute.of("intellijPlatformCollected", Boolean::class.javaObjectType) + val buildNumber = Attribute.of("intellijPlatformBuildNumber", Boolean::class.javaObjectType) + } + + } + object Tasks { const val SETUP_DEPENDENCIES = "setupDependencies" } @@ -112,11 +129,6 @@ object IntelliJPluginConstants { @Deprecated("Deprecated in 2.0") const val IDEA_CONFIGURATION_NAME = "z90_intellij" - const val INTELLIJ_PLATFORM_CONFIGURATION_NAME = "intellijPlatform" - const val INTELLIJ_PLATFORM_DEPENDENCIES_CONFIGURATION_NAME = "intellijPlatformDependencies" - const val INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME = "intellijPlatformSources" - const val TEST_FIXTURES_COMPILE_ONLY_CONFIGURATION_NAME = "testFixturesCompileOnly" - const val INSTRUMENTED_JAR_CONFIGURATION_NAME = "instrumentedJar" const val INSTRUMENTED_JAR_PREFIX = "instrumented" diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformBuildNumberTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformBuildNumberTransformer.kt new file mode 100644 index 0000000000..ecd54663f4 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformBuildNumberTransformer.kt @@ -0,0 +1,64 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.artifacts.transform + +import org.gradle.api.Project +import org.gradle.api.artifacts.transform.InputArtifact +import org.gradle.api.artifacts.transform.TransformAction +import org.gradle.api.artifacts.transform.TransformOutputs +import org.gradle.api.artifacts.transform.TransformParameters +import org.gradle.api.artifacts.type.ArtifactTypeDefinition.ZIP_TYPE +import org.gradle.api.file.FileSystemLocation +import org.gradle.api.provider.Provider +import org.gradle.api.tasks.Classpath +import org.gradle.internal.os.OperatingSystem +import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.registerTransform +import org.gradle.work.DisableCachingByDefault +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes +import org.jetbrains.intellij.platform.gradleplugin.asPath +import org.jetbrains.intellij.platform.gradleplugin.or +import kotlin.io.path.exists + +@DisableCachingByDefault(because = "Not worth caching") +abstract class IntelliJPlatformBuildNumberTransformer : TransformAction { + + @get:Classpath + @get:InputArtifact + abstract val inputArtifact: Provider + + override fun transform(outputs: TransformOutputs) { + val input = inputArtifact.get().asPath + + val buildFile = input + .resolve("Resources/build.txt") + .takeIf { OperatingSystem.current().isMacOsX && it.exists() } + .or { input.resolve("build.txt") } + + outputs.file(buildFile) + } +} + + +internal fun Project.applyIntellijPlatformBuildNumberTransformer() { + project.dependencies { + attributesSchema { + attribute(Attributes.buildNumber) + } + + artifactTypes.maybeCreate(ZIP_TYPE) + .attributes + .attribute(Attributes.buildNumber, false) + + registerTransform(IntelliJPlatformBuildNumberTransformer::class) { + from + .attribute(Attributes.extracted, true) + .attribute(Attributes.collected, false) + .attribute(Attributes.buildNumber, false) + to + .attribute(Attributes.extracted, true) + .attribute(Attributes.collected, false) + .attribute(Attributes.buildNumber, true) + } + } +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformCollectorTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformCollectorTransformer.kt index 0540586673..f5bbb9704a 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformCollectorTransformer.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformCollectorTransformer.kt @@ -2,14 +2,12 @@ package org.jetbrains.intellij.platform.gradleplugin.artifacts.transform -import com.jetbrains.plugin.structure.base.utils.exists import org.gradle.api.Project import org.gradle.api.artifacts.transform.InputArtifact import org.gradle.api.artifacts.transform.TransformAction import org.gradle.api.artifacts.transform.TransformOutputs import org.gradle.api.artifacts.transform.TransformParameters import org.gradle.api.artifacts.type.ArtifactTypeDefinition.ZIP_TYPE -import org.gradle.api.attributes.Attribute import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.FileSystemLocation import org.gradle.api.plugins.JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME @@ -17,16 +15,14 @@ import org.gradle.api.plugins.JavaPlugin.TEST_COMPILE_CLASSPATH_CONFIGURATION_NA import org.gradle.api.provider.Provider import org.gradle.api.tasks.Classpath import org.gradle.api.tasks.CompileClasspath -import org.gradle.internal.os.OperatingSystem import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.registerTransform import org.gradle.work.DisableCachingByDefault -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.collectJars -import org.jetbrains.intellij.platform.gradleplugin.isKotlinRuntime -import org.jetbrains.intellij.platform.gradleplugin.or -import kotlin.io.path.isDirectory +import org.jetbrains.intellij.platform.gradleplugin.collectIntelliJPlatformDependencyJars +import kotlin.io.path.forEachDirectoryEntry +import kotlin.io.path.listDirectoryEntries import kotlin.io.path.name @DisableCachingByDefault(because = "Not worth caching") @@ -38,30 +34,21 @@ abstract class IntelliJPlatformCollectorTransformer : TransformAction override fun transform(outputs: TransformOutputs) { val input = inputArtifact.get().asPath - val withKotlin = true // TODO: detect if project uses Kotlin - val lib = input.resolve("lib") - - // TODO: cleanup - if (lib.isDirectory()) { - val baseFiles = (collectJars(lib) { file -> - (withKotlin || !isKotlinRuntime(file.name.removeSuffix(".jar"))) && file.name != "junit.jar" && file.name != "annotations.jar" - }).sorted() - - val antFiles = collectJars(lib.resolve("ant/lib")).sorted() - val buildFile = input - .resolve("Resources/build.txt") - .takeIf { OperatingSystem.current().isMacOsX && it.exists() } - .or { input.resolve("build.txt") } - .let { listOf(it) } - - (baseFiles + antFiles + buildFile).forEach { + if (input.name.startsWith("org")) { // FIXME + // Plugin dependency + input.forEachDirectoryEntry { + it.resolve("lib").listDirectoryEntries("*.jar").forEach(outputs::file) + } + } else { + // IntelliJ Platform SDK dependency + collectIntelliJPlatformDependencyJars(input).forEach { outputs.file(it) } } @@ -73,36 +60,34 @@ abstract class IntelliJPlatformCollectorTransformer : TransformAction - private val IntelliJPlatformType.artifactPathPart - get() = "$separator$groupId$separator$artifactId$separator" - override fun transform(outputs: TransformOutputs) { val input = inputArtifact.get().asPath - - val type = IntelliJPlatformType.values().find { - input.pathString.contains(it.artifactPathPart) // com.jetbrains.intellij.idea/ideaIU - } ?: return - val version = input.getName(input.nameCount - 3) val extension = input.name.removePrefix(input.nameWithoutExtension.removeSuffix(".tar")) - val targetDirectory = outputs.dir("$type-$version") - -// val cacheDirectory = getZipCacheDirectory(input) + val (groupId, artifactId, version) = input.pathString.split(separator).dropLast(2).takeLast(3) + + val targetDirectory = listOf( + { // check if input is an IntelliJ Platform SDK artifact + IntelliJPlatformType.values() + .find { groupId == it.groupId && artifactId == it.artifactId } + ?.let { "$it-$version" } + }, + { // check if input is an IntelliJ Platform Plugin fetched from JetBrains Marketplace + val marketplaceGroup = "com.jetbrains.plugins" + val channel = when { + groupId == marketplaceGroup -> "" + groupId.endsWith(".$marketplaceGroup") -> groupId.dropLast(marketplaceGroup.length + 1) + else -> return@listOf null + } + "$artifactId-$version" + "@$channel".takeIf { channel.isNotEmpty() }.orEmpty() + }, + ).firstNotNullOfOrNull { it() }?.let { outputs.dir(it) } ?: return when (extension) { ".zip", ".sit" -> { @@ -71,43 +78,32 @@ abstract class IntelliJPlatformExtractTransformer @Inject constructor( else -> throw IllegalArgumentException("Unknown type archive type: $extension") } } - -// private fun getZipCacheDirectory(zipFile: Path, project: Project, type: IntelliJPlatformType): Path { -// if (ideaDependencyCachePath.isNotEmpty()) { -// return File(ideaDependencyCachePath).apply { -// mkdirs() -// } -// } else if (type == IntelliJPlatformType.Rider && OperatingSystem.current().isWindows) { -// return project.buildDir.toPath() -// } -// return zipFile.parent -// } } internal fun Project.applyIntellijPlatformExtractTransformer() { - val extractedAttribute = Attribute.of("intellijPlatformExtracted", Boolean::class.javaObjectType) - project.dependencies { attributesSchema { - attribute(extractedAttribute) + attribute(Configurations.Attributes.extracted) } artifactTypes.maybeCreate(ZIP_TYPE) .attributes - .attribute(extractedAttribute, false) + .attribute(Configurations.Attributes.extracted, false) listOf( configurations.getByName(COMPILE_CLASSPATH_CONFIGURATION_NAME), configurations.getByName(TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME), ).forEach { it.attributes { - attributes.attribute(extractedAttribute, true) + attributes.attribute(Configurations.Attributes.extracted, true) } } registerTransform(IntelliJPlatformExtractTransformer::class) { - from.attribute(extractedAttribute, false) - to.attribute(extractedAttribute, true) + from + .attribute(Configurations.Attributes.extracted, false) + to + .attribute(Configurations.Attributes.extracted, true) } } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/dependencies.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/dependencies.kt new file mode 100644 index 0000000000..4cfcc87811 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/dependencies.kt @@ -0,0 +1,22 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.dependencies + +import org.gradle.api.artifacts.Dependency +import org.gradle.api.artifacts.dsl.DependencyHandler +import org.gradle.kotlin.dsl.create +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType + +internal typealias Action = (Dependency.() -> Unit) + +internal fun DependencyHandler.create( + type: IntelliJPlatformType, + version: String, + action: Action = {}, +) = create( + group = type.groupId, + name = type.artifactId, + version = version, +).apply { + action(this) +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt index 5bcb520990..bd5aea4724 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt @@ -4,44 +4,36 @@ package org.jetbrains.intellij.platform.gradleplugin.dependencies -import org.gradle.api.artifacts.dsl.DependencyHandler import org.gradle.api.provider.Provider import org.gradle.kotlin.dsl.DependencyHandlerScope -import org.gradle.kotlin.dsl.create import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations internal fun DependencyHandlerScope.intellijPlatform( type: IntelliJPlatformType, version: String, - configurationName: String = INTELLIJ_PLATFORM_CONFIGURATION_NAME, + configurationName: String = Configurations.INTELLIJ_PLATFORM, ) = add(configurationName, create(type, version)) internal fun DependencyHandlerScope.intellijPlatform( type: IntelliJPlatformType, versionProvider: Provider, - configurationName: String = INTELLIJ_PLATFORM_CONFIGURATION_NAME, + configurationName: String = Configurations.INTELLIJ_PLATFORM, ) = addProvider(configurationName, versionProvider.map { version -> create(type, version) }) internal fun DependencyHandlerScope.intellijPlatform( typeProvider: Provider, version: String, - configurationName: String = INTELLIJ_PLATFORM_CONFIGURATION_NAME, + configurationName: String = Configurations.INTELLIJ_PLATFORM, ) = addProvider(configurationName, typeProvider.map { type -> create(type, version) }) internal fun DependencyHandlerScope.intellijPlatform( typeProvider: Provider, versionProvider: Provider, - configurationName: String = INTELLIJ_PLATFORM_CONFIGURATION_NAME, + configurationName: String = Configurations.INTELLIJ_PLATFORM, ) = addProvider(configurationName, typeProvider.zip(versionProvider) { type, version -> create(type, version) }) -internal fun DependencyHandler.create(type: IntelliJPlatformType, version: String) = create( - group = type.groupId, - name = type.artifactId, - version = version, -) - // return when (type) { // IntellijIdeaUltimate -> create( // group = "com.jetbrains.intellij.idea", @@ -116,7 +108,8 @@ internal fun DependencyHandler.create(type: IntelliJPlatformType, version: Strin fun DependencyHandlerScope.intellijPlatform(type: String, version: String) = intellijPlatform(IntelliJPlatformType.fromCode(type), version) fun DependencyHandlerScope.intellijPlatform(type: Provider, version: String) = intellijPlatform(type.map { IntelliJPlatformType.fromCode(it) }, version) fun DependencyHandlerScope.intellijPlatform(type: String, version: Provider) = intellijPlatform(IntelliJPlatformType.fromCode(type), version) -fun DependencyHandlerScope.intellijPlatform(type: Provider, version: Provider) = intellijPlatform(type.map { IntelliJPlatformType.fromCode(it) }, version) +fun DependencyHandlerScope.intellijPlatform(type: Provider, version: Provider) = + intellijPlatform(type.map { IntelliJPlatformType.fromCode(it) }, version) fun DependencyHandlerScope.androidStudio(version: String) = intellijPlatform(AndroidStudio, version) fun DependencyHandlerScope.androidStudio(version: Provider) = intellijPlatform(AndroidStudio, version) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformPlugin.kt new file mode 100644 index 0000000000..2db5018404 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformPlugin.kt @@ -0,0 +1,25 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +@file:Suppress("unused") + +package org.jetbrains.intellij.platform.gradleplugin.dependencies + +import org.gradle.kotlin.dsl.DependencyHandlerScope +import org.gradle.kotlin.dsl.create +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations + +fun DependencyHandlerScope.intellijPlatformPlugin( + id: String, + version: String, + channel: String = "", + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCIES, +) = create( + group = when { + channel.isBlank() -> "com.jetbrains.plugins" + else -> "$channel.com.jetbrains.plugins" + }, + name = id, + version = version, +).let { dependency -> + add(configurationName, dependency) +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformSources.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformSources.kt index d5364b955a..8461716a62 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformSources.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformSources.kt @@ -10,18 +10,18 @@ import org.gradle.kotlin.dsl.create import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.IntellijIdeaCommunity import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.PyCharmCommunity -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations fun DependencyHandlerScope.intellijPlatformSources( type: IntelliJPlatformType?, version: String, - configurationName: String = INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME, + configurationName: String = Configurations.INTELLIJ_PLATFORM_SOURCES, ) = add(configurationName, createIntelliJPlatformSourcesDependency(type, version)) internal fun DependencyHandlerScope.intellijPlatformSources( type: IntelliJPlatformType?, versionProvider: Provider, - configurationName: String = INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME, + configurationName: String = Configurations.INTELLIJ_PLATFORM_SOURCES, ) = addProvider(configurationName, versionProvider.map { createIntelliJPlatformSourcesDependency(type, it) }) internal fun DependencyHandlerScope.createIntelliJPlatformSourcesDependency( @@ -46,7 +46,8 @@ internal fun DependencyHandlerScope.createIntelliJPlatformSourcesDependency( } fun DependencyHandlerScope.intellijPlatformSources(type: String, version: String) = intellijPlatformSources(IntelliJPlatformType.fromCode(type), version) -fun DependencyHandlerScope.intellijPlatformSources(type: String, version: Provider) = intellijPlatformSources(IntelliJPlatformType.fromCode(type), version) +fun DependencyHandlerScope.intellijPlatformSources(type: String, version: Provider) = + intellijPlatformSources(IntelliJPlatformType.fromCode(type), version) fun DependencyHandlerScope.intellijIdeaCommunitySources(version: String) = intellijPlatformSources(IntellijIdeaCommunity, version) fun DependencyHandlerScope.intellijIdeaCommunitySources(version: Provider) = intellijPlatformSources(IntellijIdeaCommunity, version) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsAnnotations.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsAnnotations.kt index 0daf361c02..3d7fce32c7 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsAnnotations.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsAnnotations.kt @@ -7,11 +7,11 @@ package org.jetbrains.intellij.platform.gradleplugin.dependencies import org.gradle.kotlin.dsl.DependencyHandlerScope import org.gradle.kotlin.dsl.create import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANNOTATIONS_DEPENDENCY_VERSION -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_DEPENDENCIES_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations fun DependencyHandlerScope.jetbrainsAnnotations( version: String = ANNOTATIONS_DEPENDENCY_VERSION, - configurationName: String = INTELLIJ_PLATFORM_DEPENDENCIES_CONFIGURATION_NAME, + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCIES, ) = create( group = "org.jetbrains", name = "annotations", diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt index ffe421ee6d..cff80a02fb 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt @@ -68,14 +68,14 @@ abstract class IdeaDependencyManager @Inject constructor( project: Project, extraDependencies: Collection, ) = when (type) { - JPS -> JpsIdeaDependency( - version, - buildNumber, - classesDirectory, - sourcesDirectory, - !hasKotlinDependency(project), - context, - ) +// JPS -> JpsIdeaDependency( +// version, +// buildNumber, +// classesDirectory, +// sourcesDirectory, +// !hasKotlinDependency(project), +// context, +// ) else -> { val pluginsRegistry = BuiltinPluginsRegistry.fromDirectory(classesDirectory.resolve("plugins").toPath(), context) @@ -97,9 +97,9 @@ abstract class IdeaDependencyManager @Inject constructor( buildNumber, classesDirectory, sourcesDirectory, - !hasKotlinDependency(project), - pluginsRegistry, - extraDependencies, + withKotlin = !hasKotlinDependency(project), + pluginsRegistry = pluginsRegistry, + extraDependencies = extraDependencies, ) } } @@ -324,7 +324,10 @@ abstract class IdeaDependencyManager @Inject constructor( name = Fleet.artifactId, ) - else -> throw BuildException("Specified type '$type' is unknown. Supported values: ${IntelliJPlatformType.values().joinToString(", ") { it.code }}", null) + else -> throw BuildException( + "Specified type '$type' is unknown. Supported values: ${IntelliJPlatformType.values().joinToString(", ") { it.code }}", + null + ) } val classesDirectory = dependenciesDownloader.downloadFromRepository(context, { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt index b3c4a7961c..fd0bac0da5 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt @@ -2,21 +2,22 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins -import com.jetbrains.plugin.structure.intellij.version.IdeVersion import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.plugins.ExtensionAware -import org.gradle.api.plugins.JavaPlugin import org.gradle.api.tasks.TaskContainer +import org.gradle.kotlin.dsl.assign import org.gradle.kotlin.dsl.create import org.gradle.kotlin.dsl.getByName import org.gradle.kotlin.dsl.register +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension import org.jetbrains.intellij.platform.gradleplugin.info import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.IdeVersionAwareTask abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plugin { @@ -36,7 +37,13 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu protected inline fun TaskContainer.configureTask(name: String, noinline configuration: T.() -> Unit = {}) { info(context, "Configuring task: $name") val task = findByName(name) as? T ?: register(name).get() - task.configuration() + + with(task) { + if (this is IdeVersionAwareTask) { + intelliJPlatformArtifacts = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM_BUILD_NUMBER) + } + configuration() + } } protected inline fun Any.configureExtension(name: String, noinline configuration: T.() -> Unit = {}) { @@ -49,15 +56,4 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu protected val Project.intelliJPlatformExtension get() = extensions.getByName(Extensions.INTELLIJ_PLATFORM) - - protected val Project.ideVersionProvider - get() = configurations.named(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME).map { configuration -> - configuration.resolvedConfiguration - .resolvedArtifacts - .firstOrNull { artifact -> artifact.name == "build" && artifact.file.name == "build.txt" } - ?.file?.readText()?.trim() - ?: throw Exception("build.txt doesn't exist") // TODO: TEST & FIX ME - }.map { - IdeVersion.createIdeVersion(it) - } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt index c1d1220160..d6a7a4d93a 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt @@ -2,19 +2,19 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins +import org.gradle.api.GradleException import org.gradle.api.Project import org.gradle.api.artifacts.Configuration import org.gradle.api.plugins.JavaPlugin import org.gradle.api.plugins.JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME import org.gradle.api.plugins.JavaPlugin.TEST_COMPILE_ONLY_CONFIGURATION_NAME import org.gradle.kotlin.dsl.apply +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_DEPENDENCIES_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_TEST_FIXTURES_PLUGIN_ID import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_BASE_ID -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TEST_FIXTURES_COMPILE_ONLY_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyIntellijPlatformBuildNumberTransformer import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyIntellijPlatformCollectorTransformer import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyIntellijPlatformExtractTransformer import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension @@ -33,7 +33,7 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi } with(configurations) { - val intellijPlatformConfiguration = maybeCreate(INTELLIJ_PLATFORM_CONFIGURATION_NAME) + val intellijPlatformConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM) .apply { isVisible = false isCanBeConsumed = false @@ -41,7 +41,23 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi description = "IntelliJ Platform dependency" } - val intellijPlatformDependenciesConfiguration = maybeCreate(INTELLIJ_PLATFORM_DEPENDENCIES_CONFIGURATION_NAME) + val intellijPlatformBuildNumberConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM_BUILD_NUMBER) + .apply { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + description = "IntelliJ Platform dependency build number" + + attributes { + attribute(Configurations.Attributes.extracted, true) +// attribute(Configurations.Attributes.collected, true) + attribute(Configurations.Attributes.buildNumber, true) + } + + extendsFrom(intellijPlatformConfiguration) + } + + val intellijPlatformDependenciesConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM_DEPENDENCIES) .apply { isVisible = false isCanBeConsumed = false @@ -49,7 +65,7 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi description = "IntelliJ Platform Dependencies dependency" } - maybeCreate(INTELLIJ_PLATFORM_SOURCES_CONFIGURATION_NAME) + maybeCreate(Configurations.INTELLIJ_PLATFORM_SOURCES) .apply { isVisible = false isCanBeConsumed = false @@ -65,7 +81,17 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi getByName(COMPILE_ONLY_CONFIGURATION_NAME).extend() getByName(TEST_COMPILE_ONLY_CONFIGURATION_NAME).extend() pluginManager.withPlugin(JAVA_TEST_FIXTURES_PLUGIN_ID) { - getByName(TEST_FIXTURES_COMPILE_ONLY_CONFIGURATION_NAME).extend() + getByName(Configurations.TEST_FIXTURES_COMPILE_ONLY).extend() + } + + val identifiers = IntelliJPlatformType.values().map { "${it.groupId}:${it.artifactId}" } + all { + incoming.beforeResolve { + val matched = dependencies.filter { identifiers.contains("${it.group}:${it.name}") } + if (matched.size > 1) { + throw GradleException("Conflicting dependencies detected: \n${matched.joinToString("\n")}") + } + } } } @@ -73,14 +99,7 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi this@configure.configureExtension(INTELLIJ_PLATFORM) { configureExtension(PLUGIN_CONFIGURATION) { configureExtension(PRODUCT_DESCRIPTOR) - configureExtension(IDEA_VERSION) { - sinceBuild.convention(ideVersionProvider.map { - "${it.baselineVersion}.${it.build}" - }) - untilBuild.convention(ideVersionProvider.map { - "${it.baselineVersion}.*" - }) - } + configureExtension(IDEA_VERSION) configureExtension(VENDOR) } } @@ -88,5 +107,6 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi applyIntellijPlatformExtractTransformer() applyIntellijPlatformCollectorTransformer() + applyIntellijPlatformBuildNumberTransformer() } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt index ff49085419..3af71b94a9 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt @@ -98,6 +98,7 @@ import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.IntelliJPl import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.LaunchSystemArgumentProvider import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.PluginPathArgumentProvider import org.jetbrains.intellij.platform.gradleplugin.tasks.* +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.RunIdeBase import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader import org.jetbrains.intellij.platform.gradleplugin.utils.ivyRepository diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt index 1450e3eaf3..a865578ceb 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt @@ -122,4 +122,3 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug } } } - diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellij.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellij.kt index 9972d153da..ed2132d4dc 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellij.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellij.kt @@ -1,52 +1,10 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +@file:Suppress("unused") + package org.jetbrains.intellij.platform.gradleplugin.repositories import org.gradle.api.artifacts.dsl.RepositoryHandler -import org.gradle.api.artifacts.repositories.MavenArtifactRepository -import org.gradle.api.model.ObjectFactory -import org.gradle.api.plugins.ExtensionAware -import org.gradle.api.provider.Property -import org.gradle.api.provider.ProviderFactory -import org.gradle.kotlin.dsl.getByType -import org.gradle.kotlin.dsl.maven -import org.gradle.kotlin.dsl.newInstance -import org.jetbrains.intellij.platform.gradleplugin.BuildFeature -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants - -interface IntelliJPlatformRepositorySettings { - - val useCacheRedirector: Property -} - -internal fun RepositoryHandler.applyIntelliJPlatformSettings(objects: ObjectFactory, providers: ProviderFactory) { - val settings = objects.newInstance(IntelliJPlatformRepositorySettings::class) - - settings.useCacheRedirector.convention(BuildFeature.USE_CACHE_REDIRECTOR.getValue(providers)) - - (this as ExtensionAware).extensions.add(IntelliJPluginConstants.INTELLIJ_PLATFORM_REPOSITORY_SETTINGS_NAME, settings) -} - -internal val RepositoryHandler.intellijPlatformRepositorySettings: IntelliJPlatformRepositorySettings - get() = (this as ExtensionAware).extensions.getByType() - -internal typealias Action = (MavenArtifactRepository.() -> Unit) - -internal fun RepositoryHandler.customRepository( - name: String, - url: String, - urlWithCacheRedirector: String, - settings: IntelliJPlatformRepositorySettings = intellijPlatformRepositorySettings, - action: Action = {}, -) = maven(settings.useCacheRedirector.map { cached -> - when (cached) { - true -> urlWithCacheRedirector - false -> url - } -}) { - this.name = name - action(this) -} fun RepositoryHandler.intellij(action: Action = {}) = customRepository( name = "IntelliJ Repository", diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/jetbrainsMarketplace.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/jetbrainsMarketplace.kt new file mode 100644 index 0000000000..4016d8563b --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/jetbrainsMarketplace.kt @@ -0,0 +1,14 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +@file:Suppress("unused") + +package org.jetbrains.intellij.platform.gradleplugin.repositories + +import org.gradle.api.artifacts.dsl.RepositoryHandler + +fun RepositoryHandler.jetbrainsMarketplace(action: Action = {}) = customRepository( + name = "JetBrains Marketplace Repository", + url = "https://plugins.jetbrains.com/maven", + urlWithCacheRedirector = "https://cache-redirector.jetbrains.com/plugins.jetbrains.com/maven", + action = action, +) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt new file mode 100644 index 0000000000..ecaaf5eef2 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt @@ -0,0 +1,49 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.repositories + +import org.gradle.api.artifacts.dsl.RepositoryHandler +import org.gradle.api.artifacts.repositories.MavenArtifactRepository +import org.gradle.api.model.ObjectFactory +import org.gradle.api.plugins.ExtensionAware +import org.gradle.api.provider.Property +import org.gradle.api.provider.ProviderFactory +import org.gradle.kotlin.dsl.getByType +import org.gradle.kotlin.dsl.maven +import org.gradle.kotlin.dsl.newInstance +import org.jetbrains.intellij.platform.gradleplugin.BuildFeature +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_REPOSITORY_SETTINGS_NAME + +interface IntelliJPlatformRepositorySettings { + + val useCacheRedirector: Property +} + +internal fun RepositoryHandler.applyIntelliJPlatformSettings(objects: ObjectFactory, providers: ProviderFactory) { + val settings = objects.newInstance(IntelliJPlatformRepositorySettings::class) + + settings.useCacheRedirector.convention(BuildFeature.USE_CACHE_REDIRECTOR.getValue(providers)) + + (this as ExtensionAware).extensions.add(INTELLIJ_PLATFORM_REPOSITORY_SETTINGS_NAME, settings) +} + +internal val RepositoryHandler.intellijPlatformRepositorySettings: IntelliJPlatformRepositorySettings + get() = (this as ExtensionAware).extensions.getByType() + +internal typealias Action = (MavenArtifactRepository.() -> Unit) + +internal fun RepositoryHandler.customRepository( + name: String, + url: String, + urlWithCacheRedirector: String, + settings: IntelliJPlatformRepositorySettings = intellijPlatformRepositorySettings, + action: Action = {}, +) = maven(settings.useCacheRedirector.map { cached -> + when (cached) { + true -> urlWithCacheRedirector + false -> url + } +}) { + this.name = name + action(this) +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTask.kt index 22d1064a23..535ffd4a70 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTask.kt @@ -10,6 +10,7 @@ import org.gradle.api.tasks.OutputDirectory import org.jetbrains.intellij.platform.gradleplugin.BuildFeature import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.RunIdeBase import org.jetbrains.intellij.platform.gradleplugin.warn /** diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt index 66da72743c..4705fbc072 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt @@ -3,7 +3,6 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks import com.jetbrains.plugin.structure.intellij.utils.JDOMUtil -import org.gradle.api.DefaultTask import org.gradle.api.Project import org.gradle.api.provider.Property import org.gradle.api.provider.Provider @@ -13,6 +12,7 @@ import org.jdom2.Element import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.IdeVersionAwareTask import org.jetbrains.intellij.platform.gradleplugin.transformXml import org.jetbrains.intellij.platform.gradleplugin.warn import java.io.File @@ -26,7 +26,7 @@ import kotlin.io.path.inputStream * @see Plugin Configuration File */ @CacheableTask -abstract class PatchPluginXmlTask : DefaultTask() { +abstract class PatchPluginXmlTask : IdeVersionAwareTask() { @get:SkipWhenEmpty @get:InputFile @@ -143,11 +143,16 @@ abstract class PatchPluginXmlTask : DefaultTask() { @TaskAction fun patchPluginXml() { + val inputPath = inputFile.get().toPath() val outputPath = outputFile.get().toPath() - println("inputPath = ${inputPath}") - println("outputPath = ${outputPath}") + val sinceBuildValue = sinceBuild.orNull ?: with(ideVersion) { + "$baselineVersion.$build" + } + val untilBuildValue = untilBuild.orNull ?: with(ideVersion) { + "$baselineVersion.*" + } inputPath.inputStream().use { inputStream -> val document = JDOMUtil.loadDocument(inputStream) @@ -164,8 +169,8 @@ abstract class PatchPluginXmlTask : DefaultTask() { patch(productDescriptorReleaseVersion, "product-descriptor", "release-version") patch(productDescriptorOptional.map { it.toString() }, "product-descriptor", "optional") - patch(sinceBuild, "idea-version", "since-build") - patch(untilBuild, "idea-version", "until-build") + patch(sinceBuildValue, "idea-version", "since-build") + patch(untilBuildValue, "idea-version", "until-build") patch(vendorName, "vendor") patch(vendorEmail, "vendor", "email") @@ -180,8 +185,14 @@ abstract class PatchPluginXmlTask : DefaultTask() { * Sets the [provider] value for the given [tagName] or [attributeName] of [tagName]. */ private fun Document.patch(provider: Provider?, tagName: String, attributeName: String? = null) { - provider ?: return - val value = provider.orNull ?: return + val value = provider?.orNull ?: return + patch(value, tagName, attributeName) + } + + /** + * Sets the [value] for the given [tagName] or [attributeName] of [tagName]. + */ + private fun Document.patch(value: String, tagName: String, attributeName: String? = null) { val pluginXml = rootElement.takeIf { it.name == "idea-plugin" } ?: return val element = pluginXml.getChild(tagName) ?: Element(tagName).apply { pluginXml.addContent(0, this) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeForUiTestTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeForUiTestTask.kt index 4be4ef31fa..643ec3395a 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeForUiTestTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeForUiTestTask.kt @@ -5,6 +5,7 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.tasks.JavaExec import org.gradle.api.tasks.UntrackedTask import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.RunIdeBase /** * Runs the IDE instance with the developed plugin and robot-server installed and ready for UI testing. diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdePerformanceTestTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdePerformanceTestTask.kt index 6cf7421e67..fab104fcc6 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdePerformanceTestTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdePerformanceTestTask.kt @@ -21,6 +21,7 @@ import org.jetbrains.intellij.platform.gradleplugin.performanceTest.TestExecutio import org.jetbrains.intellij.platform.gradleplugin.performanceTest.parsers.IdeaLogParser import org.jetbrains.intellij.platform.gradleplugin.performanceTest.parsers.SimpleIJPerformanceParser import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.PerformanceTestArgumentProvider +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.RunIdeBase import java.nio.file.Files import java.nio.file.Path import java.nio.file.Paths @@ -81,7 +82,7 @@ abstract class RunIdePerformanceTestTask : RunIdeBase() { Files.walk(testData, 1) .filter { it.extension == "ijperf" } - .forEach {scriptPath -> + .forEach { scriptPath -> val testName = scriptPath.nameWithoutExtension val testScript = SimpleIJPerformanceParser(scriptPath).parse() val testArtifactsDirPath = dir.resolve(testName).createDir() @@ -91,10 +92,10 @@ abstract class RunIdePerformanceTestTask : RunIdeBase() { jvmArgumentProviders.add( PerformanceTestArgumentProvider( - scriptPath, - testArtifactsDirPath, - profilerName.get().name.lowercase(), - ) + scriptPath, + testArtifactsDirPath, + profilerName.get().name.lowercase(), + ) ) super.exec() diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt index 7e259ac017..0825bd2a96 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt @@ -5,6 +5,7 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.tasks.JavaExec import org.gradle.api.tasks.UntrackedTask import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.RunIdeBase /** * Runs the IDE instance with the developed plugin installed. diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTask.kt index 4752cdf46e..588b7b45a0 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTask.kt @@ -13,6 +13,7 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUG import org.jetbrains.intellij.platform.gradleplugin.asPath import org.jetbrains.intellij.platform.gradleplugin.debug import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.ZipSigningToolBase import java.util.* import javax.inject.Inject diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginSignatureTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginSignatureTask.kt index f53f807c09..4ca70f8d2c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginSignatureTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginSignatureTask.kt @@ -11,6 +11,7 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUG import org.jetbrains.intellij.platform.gradleplugin.asPath import org.jetbrains.intellij.platform.gradleplugin.debug import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.ZipSigningToolBase import javax.inject.Inject /** diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/IdeVersionAwareTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/IdeVersionAwareTask.kt new file mode 100644 index 0000000000..7fd5dbc4b0 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/IdeVersionAwareTask.kt @@ -0,0 +1,24 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.tasks.base + +import com.jetbrains.plugin.structure.intellij.version.IdeVersion +import org.gradle.api.DefaultTask +import org.gradle.api.file.ConfigurableFileCollection +import org.gradle.api.tasks.InputFiles +import org.gradle.api.tasks.Internal +import org.gradle.api.tasks.PathSensitive +import org.gradle.api.tasks.PathSensitivity + +abstract class IdeVersionAwareTask : DefaultTask() { + + @get:InputFiles + @get:PathSensitive(PathSensitivity.RELATIVE) + abstract val intelliJPlatformArtifacts: ConfigurableFileCollection + + @get:Internal + val ideVersion: IdeVersion + get() = intelliJPlatformArtifacts.single().readText().let { + IdeVersion.createIdeVersion(it) + } +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeBase.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt similarity index 97% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeBase.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt index 9c59e0c5a8..a29ddbca7f 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeBase.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks.base import com.dd.plist.NSDictionary import com.dd.plist.PropertyListParser @@ -224,12 +224,12 @@ abstract class RunIdeBase : JavaExec() { jvmArgumentProviders.add( LaunchSystemArgumentProvider( - ideDirPath, - configDir.get(), - systemDir.get(), - pluginsDir.get().asFile, - requiredPluginIds.get(), - ) + ideDirPath, + configDir.get(), + systemDir.get(), + pluginsDir.get().asFile, + requiredPluginIds.get(), + ) ) val operatingSystem = OperatingSystem.current() diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ZipSigningToolBase.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/ZipSigningToolBase.kt similarity index 98% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ZipSigningToolBase.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/ZipSigningToolBase.kt index bd2a1333df..cf4533b83d 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ZipSigningToolBase.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/ZipSigningToolBase.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradleplugin.tasks.base import com.jetbrains.plugin.structure.base.utils.exists import org.apache.tools.ant.util.TeeOutputStream diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt index 211280a0a5..8b284b7153 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt @@ -49,6 +49,7 @@ import java.time.format.DateTimeFormatterBuilder import java.time.temporal.ChronoField import java.util.function.Predicate import java.util.jar.Manifest +import kotlin.io.path.name internal fun sourcePluginXmlFiles(project: Project) = project .extensions.getByName("java") // Name hard-coded in JavaBasePlugin.addExtensions and well-known. @@ -176,6 +177,14 @@ private fun collectFiles(directory: Path, filter: Predicate) = directory .orEmpty() .filter { filter.test(it) } +internal fun collectIntelliJPlatformDependencyJars(parent: Path): List { + val lib = parent.resolve("lib").takeIf { it.exists() && it.isDirectory } ?: return emptyList() + val baseFiles = collectJars(lib) { it.name !in listOf("junit.jar", "annotations.jar") }.sorted() + val antFiles = collectJars(lib.resolve("ant/lib")).sorted() + + return (baseFiles + antFiles) +} + fun error(logCategory: String? = null, message: String, e: Throwable? = null) = log(LogLevel.ERROR, logCategory, message, e) fun warn(logCategory: String? = null, message: String, e: Throwable? = null) = log(LogLevel.WARN, logCategory, message, e) fun info(logCategory: String? = null, message: String, e: Throwable? = null) = log(LogLevel.INFO, logCategory, message, e) @@ -235,12 +244,9 @@ fun T?.or(other: T): T = this ?: other fun T?.or(block: () -> T): T = this ?: block() -fun T?.ifNull(block: () -> Unit): T? { - if (this == null) { - block() - } - return this -} +fun T?.ifNull(block: () -> Unit): T? = this ?: block().let { null } + +fun T?.throwIfNull(block: () -> Exception) = this ?: throw block() fun Boolean.ifFalse(block: () -> Unit): Boolean { if (!this) { @@ -289,8 +295,8 @@ internal fun getCurrentPluginVersion() = IntelliJPlatformPlugin::class.java } }.getOrNull() -internal val Property.isSpecified: Boolean - get() = isPresent && when(val value = orNull) { +internal val Property.isSpecified + get() = isPresent && when (val value = orNull) { null -> false is String -> value.isNotEmpty() is RegularFile -> value.asFile.exists() From d64b585fd92d9d445efc49ade2149689ba5a117b Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 25 Sep 2023 20:53:33 +0200 Subject: [PATCH 023/347] cleanup --- .../IntelliJPlatformBuildNumberTransformer.kt | 34 +++++------- .../IntelliJPlatformCollectorTransformer.kt | 54 ++++++++----------- .../IntelliJPlatformExtractTransformer.kt | 49 +++++++---------- .../plugins/IntelliJPlatformBasePlugin.kt | 31 ++++++++--- 4 files changed, 78 insertions(+), 90 deletions(-) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformBuildNumberTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformBuildNumberTransformer.kt index ecd54663f4..f6c290134d 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformBuildNumberTransformer.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformBuildNumberTransformer.kt @@ -2,7 +2,7 @@ package org.jetbrains.intellij.platform.gradleplugin.artifacts.transform -import org.gradle.api.Project +import org.gradle.api.artifacts.dsl.DependencyHandler import org.gradle.api.artifacts.transform.InputArtifact import org.gradle.api.artifacts.transform.TransformAction import org.gradle.api.artifacts.transform.TransformOutputs @@ -12,7 +12,6 @@ import org.gradle.api.file.FileSystemLocation import org.gradle.api.provider.Provider import org.gradle.api.tasks.Classpath import org.gradle.internal.os.OperatingSystem -import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.registerTransform import org.gradle.work.DisableCachingByDefault import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes @@ -39,26 +38,19 @@ abstract class IntelliJPlatformBuildNumberTransformer : TransformAction(INTELLIJ_PLATFORM) { configureExtension(PLUGIN_CONFIGURATION) { @@ -104,9 +123,5 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi } } } - - applyIntellijPlatformExtractTransformer() - applyIntellijPlatformCollectorTransformer() - applyIntellijPlatformBuildNumberTransformer() } } From e578af398ac4f14fe3361090bfb0a35b36cf0d55 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Thu, 28 Sep 2023 16:42:56 +0200 Subject: [PATCH 024/347] [WIP] intellijPlatformLocal, use `product-info.json` instead of `build.txt`; drop `Info.plist`; minimal supported IDE version set to `223` --- build.gradle.kts | 1 - gradle/libs.versions.toml | 2 - .../gradleplugin/IntelliJPluginConstants.kt | 13 ++- ...ansformer.kt => ProductInfoTransformer.kt} | 25 +++-- .../gradleplugin/dependencies/dependencies.kt | 48 ++++++++- ...ns.kt => intellijPlatformBundledPlugin.kt} | 11 +-- .../dependencies/intellijPlatformLocal.kt | 97 +++++++++++++++++++ .../dependency/BuiltinPluginsRegistry.kt | 9 +- .../dependency/IdeaDependencyManager.kt | 4 +- .../platform/gradleplugin/model/IvyModule.kt | 64 ++++++++++++ .../gradleplugin/model/ObjectFactory.kt | 2 + .../gradleplugin/model/ProductInfo.kt | 4 +- .../IntelliJPlatformAbstractProjectPlugin.kt | 2 +- .../plugins/IntelliJPlatformBasePlugin.kt | 29 ++++-- .../plugins/IntelliJPlatformPlugin.kt | 60 ++---------- .../plugins/IntelliJPlatformTasksPlugin.kt | 35 ------- .../IntelliJPlatformArgumentProvider.kt | 38 +++----- .../LaunchSystemArgumentProvider.kt | 14 +-- .../repositories/intellijLocal.kt | 59 +++++++++++ .../gradleplugin/repositories/repositories.kt | 3 + .../tasks/base/IdeVersionAwareTask.kt | 14 ++- .../gradleplugin/tasks/base/RunIdeBase.kt | 70 +------------ .../intellij/platform/gradleplugin/utils.kt | 87 ++++------------- 23 files changed, 387 insertions(+), 304 deletions(-) rename src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/{IntelliJPlatformBuildNumberTransformer.kt => ProductInfoTransformer.kt} (66%) rename src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/{jetbrainsAnnotations.kt => intellijPlatformBundledPlugin.kt} (65%) create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/IvyModule.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellijLocal.kt diff --git a/build.gradle.kts b/build.gradle.kts index a4bf612519..996d961e17 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -51,7 +51,6 @@ dependencies { implementation(libs.jacksonDatabind) implementation(libs.kotlinxSerializationJson) implementation(libs.jaxbApi) - implementation(libs.ddPlist) compileOnly(embeddedKotlin("gradle-plugin")) additionalPluginClasspath(embeddedKotlin("gradle-plugin")) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index de2a6b4256..263c9c6ad3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,6 @@ [versions] # libraries annotations = "24.0.1" -ddPlist = "1.27" gradleIdeaExt = "1.1.7" intellijStructure = "3.260" intellijPluginRepositoryRestClient = "2.0.36" @@ -17,7 +16,6 @@ gradleChangelogPlugin = "2.2.0" [libraries] annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" } -ddPlist = { group = "com.googlecode.plist", name = "dd-plist", version.ref = "ddPlist" } gradleIdeaExt = { group = "gradle.plugin.org.jetbrains.gradle.plugin.idea-ext", name = "gradle-idea-ext", version.ref = "gradleIdeaExt" } intellijPluginRepositoryRestClient = { group = "org.jetbrains.intellij", name = "plugin-repository-rest-client", version.ref = "intellijPluginRepositoryRestClient" } intellijStructureBase = { group = "org.jetbrains.intellij.plugins", name = "structure-base", version.ref = "intellijStructure" } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index d31becdad4..f520c804bd 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -22,7 +22,8 @@ object IntelliJPluginConstants { object Configurations { const val INTELLIJ_PLATFORM = "intellijPlatform" - const val INTELLIJ_PLATFORM_BUILD_NUMBER = "intellijPlatformBuildNumber" + const val INTELLIJ_PLATFORM_LOCAL = "intellijPlatformLocal" + const val INTELLIJ_PLATFORM_PRODUCT_INFO = "intellijPlatformProductInfo" const val INTELLIJ_PLATFORM_DEPENDENCIES = "intellijPlatformDependencies" const val INTELLIJ_PLATFORM_SOURCES = "intellijPlatformSources" const val TEST_FIXTURES_COMPILE_ONLY = "testFixturesCompileOnly" @@ -30,16 +31,20 @@ object IntelliJPluginConstants { object Attributes { val extracted = Attribute.of("intellijPlatformExtracted", Boolean::class.javaObjectType) val collected = Attribute.of("intellijPlatformCollected", Boolean::class.javaObjectType) - val buildNumber = Attribute.of("intellijPlatformBuildNumber", Boolean::class.javaObjectType) + val productInfo = Attribute.of("intellijPlatformProductInfo", Boolean::class.javaObjectType) } + } + object Dependencies { + const val INTELLIJ_PLATFORM_LOCAL_GROUP = "intellijPlatformLocal" } object Tasks { const val SETUP_DEPENDENCIES = "setupDependencies" } - const val INTELLIJ_PLATFORM_REPOSITORY_SETTINGS_NAME = "intellijPlatformRepositoriesSettings" + const val INTELLIJ_PLATFORM_REPOSITORY_SETTINGS_NAME = "intellijPlatformRepositorySettings" + const val INTELLIJ_PLATFORM_DEPENDENCY_SETTINGS_NAME = "intellijPlatformDependencySettings" @Deprecated("Check it") const val DEFAULT_SANDBOX = "idea-sandbox" @@ -132,9 +137,9 @@ object IntelliJPluginConstants { const val INSTRUMENTED_JAR_CONFIGURATION_NAME = "instrumentedJar" const val INSTRUMENTED_JAR_PREFIX = "instrumented" - const val ANNOTATIONS_DEPENDENCY_VERSION = "24.0.1" const val DEFAULT_IDEA_VERSION = "LATEST-EAP-SNAPSHOT" const val MINIMAL_SUPPORTED_GRADLE_VERSION = "8.0" + const val MINIMAL_SUPPORTED_INTELLIJ_PLATFORM_VERSION = "223" const val JETBRAINS_JAVA_TOOLCHAIN_VENDOR_NAME = "JetBrains" const val RELEASE_SUFFIX_EAP = "-EAP-SNAPSHOT" diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformBuildNumberTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ProductInfoTransformer.kt similarity index 66% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformBuildNumberTransformer.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ProductInfoTransformer.kt index f6c290134d..068b5705c5 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformBuildNumberTransformer.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ProductInfoTransformer.kt @@ -11,16 +11,14 @@ import org.gradle.api.artifacts.type.ArtifactTypeDefinition.ZIP_TYPE import org.gradle.api.file.FileSystemLocation import org.gradle.api.provider.Provider import org.gradle.api.tasks.Classpath -import org.gradle.internal.os.OperatingSystem import org.gradle.kotlin.dsl.registerTransform import org.gradle.work.DisableCachingByDefault import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.or -import kotlin.io.path.exists +import org.jetbrains.intellij.platform.gradleplugin.resolveProductInfoPath @DisableCachingByDefault(because = "Not worth caching") -abstract class IntelliJPlatformBuildNumberTransformer : TransformAction { +abstract class ProductInfoTransformer : TransformAction { @get:Classpath @get:InputArtifact @@ -29,28 +27,27 @@ abstract class IntelliJPlatformBuildNumberTransformer : TransformAction Unit) + +interface IntelliJPlatformDependencySettings { + + val ivyDirectory: Property +} + +internal fun DependencyHandler.applyIntelliJPlatformSettings(objects: ObjectFactory, providers: ProviderFactory, layout: ProjectLayout) { + val settings = objects.newInstance(IntelliJPlatformDependencySettings::class) + + settings.ivyDirectory.convention(layout.projectDirectory.asPath.resolve(".gradle").resolve("intellijPlatform").resolve("ivy").pathString) + + (this as ExtensionAware).extensions.add(IntelliJPluginConstants.INTELLIJ_PLATFORM_DEPENDENCY_SETTINGS_NAME, settings) +} + +internal val DependencyHandler.intellijPlatformDependencySettings: IntelliJPlatformDependencySettings + get() = (this as ExtensionAware).extensions.getByType() -internal typealias Action = (Dependency.() -> Unit) internal fun DependencyHandler.create( type: IntelliJPlatformType, version: String, - action: Action = {}, + settings: IntelliJPlatformDependencySettings = intellijPlatformDependencySettings, + action: DependencyAction = {}, ) = create( group = type.groupId, name = type.artifactId, version = version, ).apply { - action(this) + action(this, settings) +} + +internal fun DependencyHandler.create( + productInfo: ProductInfo, + settings: IntelliJPlatformDependencySettings = intellijPlatformDependencySettings, + action: DependencyAction = {}, +) = create( + group = Dependencies.INTELLIJ_PLATFORM_LOCAL_GROUP, + name = productInfo.productCode, + version = productInfo.version, +).apply { + action(this, settings) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsAnnotations.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformBundledPlugin.kt similarity index 65% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsAnnotations.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformBundledPlugin.kt index 3d7fce32c7..e56a5ae008 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsAnnotations.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformBundledPlugin.kt @@ -6,16 +6,15 @@ package org.jetbrains.intellij.platform.gradleplugin.dependencies import org.gradle.kotlin.dsl.DependencyHandlerScope import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANNOTATIONS_DEPENDENCY_VERSION import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations -fun DependencyHandlerScope.jetbrainsAnnotations( - version: String = ANNOTATIONS_DEPENDENCY_VERSION, +fun DependencyHandlerScope.intellijPlatformBundledPlugin( + id: String, configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCIES, ) = create( - group = "org.jetbrains", - name = "annotations", - version = version, + group = "", + name = id, + version = "version", ).let { dependency -> add(configurationName, dependency) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt new file mode 100644 index 0000000000..7276305d7d --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt @@ -0,0 +1,97 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +@file:Suppress("unused") + +package org.jetbrains.intellij.platform.gradleplugin.dependencies + +import org.gradle.api.GradleException +import org.gradle.api.artifacts.Dependency +import org.gradle.api.artifacts.dsl.DependencyHandler +import org.gradle.internal.os.OperatingSystem +import org.jetbrains.intellij.platform.gradleplugin.BuildException +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MINIMAL_SUPPORTED_INTELLIJ_PLATFORM_VERSION +import org.jetbrains.intellij.platform.gradleplugin.Version +import org.jetbrains.intellij.platform.gradleplugin.collectIntelliJPlatformDependencyJars +import org.jetbrains.intellij.platform.gradleplugin.model.* +import org.jetbrains.intellij.platform.gradleplugin.productInfo +import java.nio.file.Path +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import kotlin.io.path.* + +fun DependencyHandler.intellijPlatformLocal(localPath: String): Dependency? { + + val ideaDir = Path.of(localPath).let { + it.takeUnless { OperatingSystem.current().isMacOsX && it.extension == "app" } ?: it.resolve("Contents") + } + + if (!ideaDir.exists() || !ideaDir.isDirectory()) { + throw BuildException("Specified localPath '$localPath' doesn't exist or is not a directory") + } + + val productInfo = ideaDir.productInfo() + if (Version.parse(productInfo.buildNumber) < Version.parse(MINIMAL_SUPPORTED_INTELLIJ_PLATFORM_VERSION)) { + throw GradleException("The minimal supported IDE version is $MINIMAL_SUPPORTED_INTELLIJ_PLATFORM_VERSION+, the provided version is too low: ${productInfo.version} (${productInfo.buildNumber})") + } + + val ivyFileName = "${productInfo.productCode}-${productInfo.version}.xml" + + val dependency = create(productInfo) { + val targetFile = Path.of(it.ivyDirectory.get()).resolve(ivyFileName) + + if (targetFile.notExists()) { + targetFile.parent.createDirectories() + targetFile.createFile() + + val extractor = XmlExtractor() + val ivyModule = IvyModule( + info = IvyModuleInfo( + organisation = group, + module = name, + revision = version, + publication = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")), + ), + configurations = mutableListOf( + IvyModuleConfiguration( + name = "default", + visibility = "public", + ), + IvyModuleConfiguration( + name = "compile", + visibility = "public", + ), + IvyModuleConfiguration( + name = "sources", + visibility = "public", + ), + IvyModuleConfiguration( + name = Configurations.INTELLIJ_PLATFORM_LOCAL, + visibility = "public", + ), + ), + publications = collectIntelliJPlatformDependencyJars(ideaDir).map { file -> + IvyModulePublication( + name = file.relativeTo(ideaDir).pathString.removeSuffix(".${file.extension}"), + type = "jar", + ext = "jar", +// conf = Configurations.INTELLIJ_PLATFORM_LOCAL, + conf = "default", + ) + }, + ) + + println("XXX") + + extractor.marshal(ivyModule, targetFile) + + } + + + + println("ideaDir = ${ideaDir}") + println("targetFile = ${targetFile}") + } + + return add(Configurations.INTELLIJ_PLATFORM_LOCAL, dependency) +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/BuiltinPluginsRegistry.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/BuiltinPluginsRegistry.kt index 9cf7ac5e1d..d109bd4279 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/BuiltinPluginsRegistry.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/BuiltinPluginsRegistry.kt @@ -7,10 +7,10 @@ import com.jetbrains.plugin.structure.base.utils.listFiles import org.gradle.api.GradleException import org.jetbrains.intellij.platform.gradleplugin.createPlugin import org.jetbrains.intellij.platform.gradleplugin.debug -import org.jetbrains.intellij.platform.gradleplugin.ideProductInfo import org.jetbrains.intellij.platform.gradleplugin.model.PluginsCache import org.jetbrains.intellij.platform.gradleplugin.model.PluginsCachePlugin import org.jetbrains.intellij.platform.gradleplugin.model.XmlExtractor +import org.jetbrains.intellij.platform.gradleplugin.productInfo import org.jetbrains.intellij.platform.gradleplugin.warn import java.io.File import java.io.Serializable @@ -129,9 +129,10 @@ class BuiltinPluginsRegistry(private val pluginsDirectory: File, private val con } } - fun resolveBundledPlugins(ideDir: Path, context: String?) = ideProductInfo(ideDir) - ?.bundledPlugins - ?.takeIf { it.isNotEmpty() } + fun resolveBundledPlugins(ideDir: Path, context: String?) = ideDir + .productInfo() + .bundledPlugins + .takeIf { it.isNotEmpty() } ?: fromDirectory(ideDir.resolve("plugins"), context) .plugins .keys diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt index cff80a02fb..d3c6dbb6c4 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt @@ -377,7 +377,7 @@ abstract class IdeaDependencyManager @Inject constructor( } info(context, "IDE dependency cache directory: $classesDirectory") - val buildNumber = ideBuildNumber(classesDirectory) + val buildNumber = classesDirectory.productInfo().buildNumber val sourcesDirectory = when { remoteIdeaDependency.hasSources ?: sources -> resolveSources(version, type) else -> null @@ -404,7 +404,7 @@ abstract class IdeaDependencyManager @Inject constructor( if (!ideaDir.exists() || !ideaDir.isDirectory) { throw BuildException("Specified localPath '$localPath' doesn't exist or is not a directory", null) } - val buildNumber = ideBuildNumber(ideaDir) + val buildNumber = ideaDir.productInfo().buildNumber val sources = when { !localPathSources.isNullOrEmpty() -> File(localPathSources) else -> null diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/IvyModule.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/IvyModule.kt new file mode 100644 index 0000000000..230d83e670 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/IvyModule.kt @@ -0,0 +1,64 @@ +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.model + +import javax.xml.bind.annotation.XmlAttribute +import javax.xml.bind.annotation.XmlElement +import javax.xml.bind.annotation.XmlElementWrapper +import javax.xml.bind.annotation.XmlRootElement + +@XmlRootElement(name = "ivy-module") +data class IvyModule( + + @set:XmlAttribute + var version: String = "2.0", + + @set:XmlElement + var info: IvyModuleInfo? = null, + + @set:XmlElement(name = "conf") + @set:XmlElementWrapper + var configurations: List = mutableListOf(), + + @set:XmlElement(name = "artifact") + @set:XmlElementWrapper + var publications: List = mutableListOf(), +) + +data class IvyModuleConfiguration( + + @set:XmlAttribute + var name: String? = null, + + @set:XmlAttribute + var visibility: String? = null, +) + +data class IvyModuleInfo( + + @set:XmlAttribute + var organisation: String? = null, + + @set:XmlAttribute + var module: String? = null, + + @set:XmlAttribute + var revision: String? = null, + + @set:XmlAttribute + var publication: String? = null, +) + +data class IvyModulePublication( + @set:XmlAttribute + var name: String? = null, + + @set:XmlAttribute + var type: String? = null, + + @set:XmlAttribute + var ext: String? = null, + + @set:XmlAttribute + var conf: String? = null, +) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ObjectFactory.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ObjectFactory.kt index 04cc8ec65b..2b4502b2f9 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ObjectFactory.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ObjectFactory.kt @@ -15,4 +15,6 @@ class ObjectFactory { fun createProductsReleases() = ProductsReleases() fun createAndroidStudioReleases() = AndroidStudioReleases() + + fun createIvyModule() = IvyModule() } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt index 86461d1934..fa9d538c87 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt @@ -11,8 +11,8 @@ data class ProductInfo( val name: String? = null, val version: String? = null, val versionSuffix: String? = null, - val buildNumber: String? = null, - val productCode: String? = null, + val buildNumber: String = "", + val productCode: String = "", val dataDirectoryName: String? = null, val svgIconPath: String? = null, val productVendor: String? = null, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt index fd0bac0da5..78c8e4759f 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt @@ -40,7 +40,7 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu with(task) { if (this is IdeVersionAwareTask) { - intelliJPlatformArtifacts = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM_BUILD_NUMBER) + intelliJPlatformProductInfo = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) } configuration() } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt index 142dcf1049..468e3e6812 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt @@ -14,9 +14,10 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Conf import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_TEST_FIXTURES_PLUGIN_ID import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_BASE_ID -import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyIntellijPlatformBuildNumberTransformer import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyIntellijPlatformCollectorTransformer import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyIntellijPlatformExtractTransformer +import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyProductInfoTransformer +import org.jetbrains.intellij.platform.gradleplugin.dependencies.applyIntelliJPlatformSettings import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension import org.jetbrains.intellij.platform.gradleplugin.repositories.applyIntelliJPlatformSettings @@ -41,7 +42,21 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi description = "IntelliJ Platform dependency" } - val intellijPlatformBuildNumberConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM_BUILD_NUMBER) + val intellijPlatformLocalConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM_LOCAL) + .apply { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + description = "IntelliJ Platform local IDE dependency" + + attributes { + attribute(Attributes.extracted, true) + attribute(Attributes.collected, false) + attribute(Attributes.productInfo, false) + } + } + + maybeCreate(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) .apply { isVisible = false isCanBeConsumed = false @@ -50,8 +65,7 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi attributes { attribute(Attributes.extracted, true) -// attribute(Configurations.Attributes.collected, true) - attribute(Attributes.buildNumber, true) + attribute(Attributes.productInfo, true) } extendsFrom(intellijPlatformConfiguration) @@ -75,6 +89,7 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi fun Configuration.extend() = extendsFrom( intellijPlatformConfiguration, + intellijPlatformLocalConfiguration, intellijPlatformDependenciesConfiguration, ) @@ -96,8 +111,10 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi } with(dependencies) { + applyIntelliJPlatformSettings(objects, providers, layout) + attributesSchema { - attribute(Attributes.buildNumber) + attribute(Attributes.productInfo) attribute(Attributes.collected) attribute(Attributes.extracted) } @@ -111,7 +128,7 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi configurations.getByName(TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME), configurations.getByName(Configurations.INTELLIJ_PLATFORM_SOURCES), ) - applyIntellijPlatformBuildNumberTransformer() + applyProductInfoTransformer() } with(IntelliJPluginConstants.Extensions) { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt index 3af71b94a9..ac695a781c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt @@ -37,7 +37,6 @@ import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.NO_SEARCHABLE_O import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.PAID_PLUGIN_SEARCHABLE_OPTIONS_WARNING import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANDROID_STUDIO_PRODUCTS_RELEASES_URL -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANNOTATIONS_DEPENDENCY_VERSION import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_SEARCHABLE_OPTIONS_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.CLASSPATH_INDEX_CLEANUP_TASK_NAME @@ -58,7 +57,6 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INST import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENT_CODE_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENT_TEST_CODE_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEFAULT_DEPENDENCIES_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_COMPILER_ANT_TASKS_MAVEN_METADATA @@ -292,22 +290,6 @@ abstract class IntelliJPlatformPlugin : Plugin { isCanBeResolved = true } - val defaultDependencies = project.configurations.create(INTELLIJ_DEFAULT_DEPENDENCIES_CONFIGURATION_NAME) - .setVisible(false) - .withDependencies { - add( - project.dependencies.create( - group = "org.jetbrains", - name = "annotations", - version = ANNOTATIONS_DEPENDENCY_VERSION, - ) - ) - } - .apply { - isCanBeConsumed = false - isCanBeResolved = true - } - val performanceTest = project.configurations.create(PERFORMANCE_TEST_CONFIGURATION_NAME) .setVisible(false) .withDependencies { @@ -462,9 +444,7 @@ abstract class IntelliJPlatformPlugin : Plugin { ideaDependencyProvider.map { ideaDependency -> ideaDependency.classes.toPath().let { // Fall back on build number if product-info.json is not present, this is the case for recent versions of Android Studio. - ideProductInfo(it) - ?.run { "$productCode-$projectVersion" } - ?: ideBuildNumber(it) + it.productInfo().run { "$productCode-$projectVersion" } } } }.orElse(extension.getVersionType().zip(extension.getVersionNumber()) { type, version -> @@ -810,11 +790,6 @@ abstract class IntelliJPlatformPlugin : Plugin { }) dependsOn(PREPARE_SANDBOX_TASK_NAME) - - onlyIf { - val number = ideBuildNumber(ideDir.get().toPath()) - Version.parse(number.split('-').last()) >= Version.parse("191.2752") - } } } @@ -844,10 +819,7 @@ abstract class IntelliJPlatformPlugin : Plugin { systemDir.convention(extension.sandboxDir.map { project.file("$it/system") }) - autoReloadPlugins.convention(ideDir.map { - val number = ideBuildNumber(it.toPath()) - Version.parse(number.split('-').last()) >= Version.parse("202.0") - }) + autoReloadPlugins.convention(true) projectWorkingDir.convention(ideDir.map { it.resolve("bin") }) @@ -925,7 +897,7 @@ abstract class IntelliJPlatformPlugin : Plugin { sourceSet.compileClasspath }) compilerVersion.convention(ideaDependencyProvider.map { - val productInfo = ideProductInfo(it.classes.toPath()) + val productInfo = it.classes.toPath().productInfo() val version = extension.getVersionNumber().orNull.orEmpty() val type = extension.getVersionType().orNull.orEmpty().let { @@ -936,12 +908,12 @@ abstract class IntelliJPlatformPlugin : Plugin { when { localPath.isNotBlank() || !version.endsWith(RELEASE_SUFFIX_SNAPSHOT) -> { - val eapSuffix = RELEASE_SUFFIX_EAP.takeIf { productInfo?.versionSuffix == "EAP" }.orEmpty() + val eapSuffix = RELEASE_SUFFIX_EAP.takeIf { productInfo.versionSuffix == "EAP" }.orEmpty() IdeVersion.createIdeVersion(it.buildNumber).stripExcessComponents().asStringWithoutProductCode() + eapSuffix } version == DEFAULT_IDEA_VERSION && types.contains(type) -> { - productInfo?.buildNumber?.let { buildNumber -> + productInfo.buildNumber?.let { buildNumber -> Version.parse(buildNumber).let { v -> "${v.major}.${v.minor}$RELEASE_SUFFIX_EAP_CANDIDATE" } } ?: version } @@ -1200,17 +1172,8 @@ abstract class IntelliJPlatformPlugin : Plugin { ) ) - // since 193 plugins from classpath are loaded before plugins from plugins directory - // to handle this, use plugin.path property as the task's the very first source of plugins - // we cannot do this for IDEA < 193, as plugins from plugin.path can be loaded twice - val ideVersion = IdeVersion.createIdeVersion(buildNumberProvider.get()) - if (ideVersion.baselineVersion >= 193) { - jvmArgumentProviders.add(PluginPathArgumentProvider(pluginsDirectoryProvider.get())) - } - - if (ideVersion.baselineVersion >= 221) { - systemProperty("java.system.class.loader", "com.intellij.util.lang.PathClassLoader") - } + jvmArgumentProviders.add(PluginPathArgumentProvider(pluginsDirectoryProvider.get())) + systemProperty("java.system.class.loader", "com.intellij.util.lang.PathClassLoader") } } } @@ -1531,15 +1494,6 @@ abstract class IntelliJPlatformPlugin : Plugin { .takeIf { it.exists() } } }) - - val buildNumberProvider = ideaDependencyProvider.map { - it.buildNumber - } - - onlyIf { - val ideVersion = IdeVersion.createIdeVersion(buildNumberProvider.get()) - ideVersion.baselineVersion >= 221 - } } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt index a865578ceb..a7cd68e703 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt @@ -79,41 +79,6 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug vendorUrl.convention(vendor.url) } } - -// val buildNumberProvider = ideaDependencyProvider.map { it.buildNumber } - -// version.convention(project.provider { -// project.version.toString() -// }) -// pluginXmlFiles.convention(project.provider { -// sourcePluginXmlFiles(project).map(Path::toFile) -// }) -// destinationDir.convention(project.layout.buildDirectory.dir(IntelliJPluginConstants.PLUGIN_XML_DIR_NAME)) -// outputFiles.convention(pluginXmlFiles.map { -// it.map { file -> -// destinationDir.get().asFile.resolve(file.name) -// } -// }) -// sinceBuild.convention(project.provider { -// if (extension.updateSinceUntilBuild.get()) { -// val ideVersion = IdeVersion.createIdeVersion(buildNumberProvider.get()) -// "${ideVersion.baselineVersion}.${ideVersion.build}" -// } else { -// null -// } -// }) -// untilBuild.convention(project.provider { -// if (extension.updateSinceUntilBuild.get()) { -// if (extension.sameSinceUntilBuild.get()) { -// "${sinceBuild.get()}.*" -// } else { -// val ideVersion = IdeVersion.createIdeVersion(buildNumberProvider.get()) -// "${ideVersion.baselineVersion}.*" -// } -// } else { -// null -// } -// }) } // Make all tasks depend on [INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME] (TASKS - INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME).forEach { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt index 5356cd9268..2c9846526a 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt @@ -10,9 +10,7 @@ import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.gradle.process.CommandLineArgumentProvider import org.gradle.process.JavaForkOptions -import org.jetbrains.intellij.platform.gradleplugin.Version -import org.jetbrains.intellij.platform.gradleplugin.ideBuildNumber -import org.jetbrains.intellij.platform.gradleplugin.ideProductInfo +import org.jetbrains.intellij.platform.gradleplugin.productInfo import org.jetbrains.intellij.platform.gradleplugin.resolveIdeHomeVariable import org.jetbrains.intellij.platform.gradleplugin.utils.OpenedPackages import java.nio.file.Path @@ -23,17 +21,6 @@ class IntelliJPlatformArgumentProvider( private val options: JavaForkOptions, ) : CommandLineArgumentProvider { - private val buildNumber by lazy { - ideDirectory - .let(::ideBuildNumber) - .split('-') - .last() - .let(Version::parse) - } - - private val productInfo - get() = ideProductInfo(ideDirectory) - private val bootclasspath get() = ideDirectory .resolve("lib/boot.jar") @@ -42,25 +29,24 @@ class IntelliJPlatformArgumentProvider( .orEmpty() private val vmOptions - get() = productInfo - ?.currentLaunch - ?.vmOptionsFilePath + get() = ideDirectory + .productInfo() + .currentLaunch + .vmOptionsFilePath ?.removePrefix("../") ?.let { ideDirectory.resolve(it).readLines() } .orEmpty() .filter { !it.contains("kotlinx.coroutines.debug=off") } - private val kotlinxCoroutinesJavaAgent - get() = "-javaagent:$coroutinesJavaAgentPath".takeIf { - buildNumber >= Version(221) - } + private val kotlinxCoroutinesJavaAgent = "-javaagent:$coroutinesJavaAgentPath" private val additionalJvmArguments - get() = productInfo - ?.currentLaunch - ?.additionalJvmArguments - ?.filterNot { it.startsWith("-D") } - ?.takeIf { it.isNotEmpty() } + get() = ideDirectory + .productInfo() + .currentLaunch + .additionalJvmArguments + .filterNot { it.startsWith("-D") } + .takeIf { it.isNotEmpty() } ?.map { it.resolveIdeHomeVariable(ideDirectory) } ?: OpenedPackages diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt index b1856c2a15..055e31fbee 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt @@ -6,7 +6,7 @@ import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.gradle.process.CommandLineArgumentProvider -import org.jetbrains.intellij.platform.gradleplugin.ideProductInfo +import org.jetbrains.intellij.platform.gradleplugin.productInfo import org.jetbrains.intellij.platform.gradleplugin.resolveIdeHomeVariable import java.io.File import java.nio.file.Path @@ -20,12 +20,12 @@ class LaunchSystemArgumentProvider( ) : CommandLineArgumentProvider { private val currentLaunchProperties - get() = ideProductInfo(ideDirectory) - ?.currentLaunch - ?.additionalJvmArguments - ?.filter { it.startsWith("-D") } - ?.map { it.resolveIdeHomeVariable(ideDirectory) } - .orEmpty() + get() = ideDirectory + .productInfo() + .currentLaunch + .additionalJvmArguments + .filter { it.startsWith("-D") } + .map { it.resolveIdeHomeVariable(ideDirectory) } override fun asArguments() = currentLaunchProperties + listOf( "-Didea.config.path=${configDirectory.absolutePath}", diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellijLocal.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellijLocal.kt new file mode 100644 index 0000000000..57b000abb7 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellijLocal.kt @@ -0,0 +1,59 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +@file:Suppress("unused") + +package org.jetbrains.intellij.platform.gradleplugin.repositories + +import org.gradle.api.artifacts.dsl.RepositoryHandler +import org.gradle.api.artifacts.repositories.ArtifactRepository +import java.net.URI + +fun RepositoryHandler.intellijLocal(): ArtifactRepository = + ivy { + // URL of the Ivy repository + + + val ivyPath = "/Users/hsz/Projects/JetBrains/intellij-plugin-template/.gradle/intellijPlatform/ivy" + + url = URI("file://$ivyPath") + ivyPattern("$ivyPath/[module]-[revision].[ext]") + + + val idePath = + "/Users/hsz/Applications/IntelliJ IDEA Ultimate.app/Contents" + + artifactPattern("$idePath/[artifact].[ext]") + } + +// ivy { +// val ivyDirectory = gradleIntelliJPlatform.resolve("ivy") +// +//// url = ivyDirectory.toUri() +//// ivyPattern("$ivyDirectory/[module]-[revision]-ivy.[ext]") // ivy xml +// ivyPattern("/Users/hsz/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2022.3.3/19e52733ac61e1d2e675720f92daf5959355cb1e/ideaIC-2022.3.3/ideaIC-2022.3.3-2-withKotlin-withSources.xml") +// artifactPattern("/Users/hsz/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2022.3.3/19e52733ac61e1d2e675720f92daf5959355cb1e/ideaIC-2022.3.3/[artifact].[ext]") +//// artifactPattern("/Users/hsz/Applications/IntelliJ IDEA Ultimate.app/Contents/lib/app.jar") +// } + + +//ivy { +// url = dependency.classes.toURI() +// ivyPattern("${ivyFile.parent}/[module]-[revision].[ext]") // ivy xml +// artifactPattern("${dependency.classes.path}/[artifact].[ext]") // idea libs +// if (dependency.sources != null) { +// artifactPattern("${dependency.sources.parent}/[artifact]-[revision]-[classifier].[ext]") +// } +//} + +//ivy { +// val ivyFileSuffix = plugin.getFqn().substring("${plugin.id}-${plugin.version}".length) +// ivyPattern("$cacheDirectoryPath/[organisation]/[module]-[revision]$ivyFileSuffix.[ext]") // ivy xml +// ideaDependency.classes.let { +// artifactPattern("$it/plugins/[module]/[artifact](.[ext])") // builtin plugins +// artifactPattern("$it/[artifact](.[ext])") // plugin sources delivered with IDE +// } +// artifactPattern("$cacheDirectoryPath(/[classifier])/[module]-[revision]/[artifact](.[ext])") // external zip plugins +// if (ideaDependency.sources != null) { +// artifactPattern("${ideaDependency.sources.parent}/[artifact]-${ideaDependency.version}(-[classifier]).[ext]") +// } +//} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt index ecaaf5eef2..030a009767 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt @@ -3,6 +3,7 @@ package org.jetbrains.intellij.platform.gradleplugin.repositories import org.gradle.api.artifacts.dsl.RepositoryHandler +import org.gradle.api.artifacts.repositories.ArtifactRepository import org.gradle.api.artifacts.repositories.MavenArtifactRepository import org.gradle.api.model.ObjectFactory import org.gradle.api.plugins.ExtensionAware @@ -14,6 +15,8 @@ import org.gradle.kotlin.dsl.newInstance import org.jetbrains.intellij.platform.gradleplugin.BuildFeature import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_REPOSITORY_SETTINGS_NAME +internal typealias ArtifactRepositoryAction = (ArtifactRepository.() -> Unit) + interface IntelliJPlatformRepositorySettings { val useCacheRedirector: Property diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/IdeVersionAwareTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/IdeVersionAwareTask.kt index 7fd5dbc4b0..10026ef481 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/IdeVersionAwareTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/IdeVersionAwareTask.kt @@ -9,16 +9,22 @@ import org.gradle.api.tasks.InputFiles import org.gradle.api.tasks.Internal import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity +import org.jetbrains.intellij.platform.gradleplugin.model.ProductInfo +import org.jetbrains.intellij.platform.gradleplugin.productInfo abstract class IdeVersionAwareTask : DefaultTask() { @get:InputFiles @get:PathSensitive(PathSensitivity.RELATIVE) - abstract val intelliJPlatformArtifacts: ConfigurableFileCollection + abstract val intelliJPlatformProductInfo: ConfigurableFileCollection + + @get:Internal + val productInfo: ProductInfo + get() = intelliJPlatformProductInfo.also { + println("intelliJPlatformProductInfo = \n${intelliJPlatformProductInfo.joinToString("\n")}") + }.single().toPath().productInfo() @get:Internal val ideVersion: IdeVersion - get() = intelliJPlatformArtifacts.single().readText().let { - IdeVersion.createIdeVersion(it) - } + get() = IdeVersion.createIdeVersion(productInfo.buildNumber) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt index a29ddbca7f..b9652eb4b5 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt @@ -2,10 +2,6 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks.base -import com.dd.plist.NSDictionary -import com.dd.plist.PropertyListParser -import com.jetbrains.plugin.structure.base.utils.exists -import com.jetbrains.plugin.structure.base.utils.hasExtension import org.gradle.api.GradleException import org.gradle.api.file.DirectoryProperty import org.gradle.api.provider.ListProperty @@ -14,15 +10,12 @@ import org.gradle.api.tasks.* import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.IntellijIdeaUltimate import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.GITHUB_REPOSITORY import org.jetbrains.intellij.platform.gradleplugin.jbr.JbrResolver import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.IntelliJPlatformArgumentProvider import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.LaunchSystemArgumentProvider import java.io.File -import java.nio.file.Files import java.nio.file.Path -import kotlin.streams.asSequence /** * Base task for running an IDE with the current plugin in various modes. @@ -158,25 +151,6 @@ abstract class RunIdeBase : JavaExec() { ideDir.get().toPath() } - private val infoPlist by lazy { - ideDirPath - .resolve("Info.plist") - .takeIf(Path::exists) - ?.let { PropertyListParser.parse(it) as NSDictionary } - } - - private val buildNumber by lazy { - ideDirPath - .let(::ideBuildNumber) - .split('-') - .last() - .let(Version::parse) - } - - private val build221 by lazy { - Version.parse("221.0") - } - init { mainClass.set("com.intellij.idea.Main") enableAssertions = true @@ -252,56 +226,24 @@ abstract class RunIdeBase : JavaExec() { } if (!systemProperties.containsKey("idea.platform.prefix")) { - val prefix = findIdePrefix() - if (prefix == null && !ideBuildNumber(ideDir.get().toPath()).startsWith("$IntellijIdeaUltimate-")) { - throw TaskExecutionException( + val prefix = ideDir.get().toPath().productInfo().productCode + ?: throw TaskExecutionException( this, GradleException( "Cannot find IDE platform prefix. Please create a bug report at $GITHUB_REPOSITORY. " + "As a workaround specify `idea.platform.prefix` system property for task `${this.name}` manually." ) ) - } - if (prefix != null) { - systemProperty("idea.platform.prefix", prefix) - } + systemProperty("idea.platform.prefix", prefix) info(context, "Using idea.platform.prefix=$prefix") } - if (buildNumber >= build221) { - systemProperty("java.system.class.loader", "com.intellij.util.lang.PathClassLoader") - } + systemProperty("java.system.class.loader", "com.intellij.util.lang.PathClassLoader") systemPropertyIfNotDefined("idea.vendor.name", "JetBrains", userDefinedSystemProperties) systemPropertyIfNotDefined("idea.plugin.in.sandbox.mode", true, userDefinedSystemProperties) } - /** - * Resolves the IDE prefix. - */ - private fun findIdePrefix(): String? { - info(context, "Looking for platform prefix") - - val prefix = Files.list(ideDirPath.resolve("bin")) - .asSequence() - .filter { it.hasExtension("sh") || it.hasExtension("bat") } - .flatMap { Files.lines(it).asSequence() } - .mapNotNull { platformPrefixSystemPropertyRegex.find(it)?.groupValues?.getOrNull(1) } - .firstOrNull() - - return when { - prefix != null -> prefix - - OperatingSystem.current().isMacOsX && infoPlist != null -> infoPlist - ?.getDictionary("JVMOptions") - ?.getDictionary("Properties") - ?.getValue("idea.platform.prefix") - .ifNull { error(context, "Cannot find prefix in $infoPlist") } - - else -> null - } - } - /** * Helper function to set system property if it is not defined yet. */ @@ -322,8 +264,4 @@ abstract class RunIdeBase : JavaExec() { } return File(binDir, path) } - - companion object { - private val platformPrefixSystemPropertyRegex = Regex("-Didea.platform.prefix=([A-z]+)") - } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt index 8b284b7153..f7d3dcc354 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt @@ -5,8 +5,6 @@ package org.jetbrains.intellij.platform.gradleplugin -import com.dd.plist.NSDictionary -import com.dd.plist.PropertyListParser import com.jetbrains.plugin.structure.base.plugin.PluginCreationFail import com.jetbrains.plugin.structure.base.plugin.PluginCreationSuccess import com.jetbrains.plugin.structure.base.plugin.PluginProblem @@ -16,6 +14,7 @@ import com.jetbrains.plugin.structure.intellij.plugin.IdePlugin import com.jetbrains.plugin.structure.intellij.plugin.IdePluginManager import com.jetbrains.plugin.structure.intellij.utils.JDOMUtil import kotlinx.serialization.json.Json +import org.gradle.api.GradleException import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.file.FileSystemLocation @@ -27,7 +26,6 @@ import org.gradle.api.plugins.PluginInstantiationException import org.gradle.api.provider.Property import org.gradle.api.tasks.SourceSet import org.gradle.api.tasks.SourceSetContainer -import org.gradle.internal.os.OperatingSystem import org.gradle.kotlin.dsl.getByName import org.gradle.util.GradleVersion import org.jdom2.Document @@ -49,6 +47,7 @@ import java.time.format.DateTimeFormatterBuilder import java.time.temporal.ChronoField import java.util.function.Predicate import java.util.jar.Manifest +import kotlin.io.path.exists import kotlin.io.path.name internal fun sourcePluginXmlFiles(project: Project) = project @@ -101,69 +100,20 @@ internal fun String.resolveIdeHomeVariable(ideDir: Path) = } } -fun getIdeaClasspath(ideDir: Path): List { - val buildNumber = ideBuildNumber(ideDir).split('-').last().let { Version.parse(it) } - val build203 = Version.parse("203.0") - val build221 = Version.parse("221.0") - val build223 = Version.parse("223.0") +fun getIdeaClasspath(ideDir: Path) = ideDir + .productInfo() + .currentLaunch + .bootClassPathJarNames + .map { "$ideDir/lib/$it" } - val currentLaunch = ideProductInfo(ideDir)?.currentLaunch - val infoPlist = ideDir.resolve("Info.plist").takeIf(Path::exists)?.let { - PropertyListParser.parse(it) as NSDictionary - } - - return when { - buildNumber > build223 -> - currentLaunch - ?.bootClassPathJarNames - ?: infoPlist - ?.getDictionary("JVMOptions") - ?.getValue("ClassPath") - ?.split(':') - ?.map { it.removePrefix("\$APP_PACKAGE/Contents/lib/") } - .orEmpty() - - buildNumber > build221 -> listOf( - "3rd-party-rt.jar", - "util.jar", - "util_rt.jar", - "jna.jar", - ) - - buildNumber > build203 -> listOf( - "bootstrap.jar", - "util.jar", - "jdom.jar", - "log4j.jar", - "jna.jar", - ) - - else -> listOf( - "bootstrap.jar", - "extensions.jar", - "util.jar", - "jdom.jar", - "log4j.jar", - "jna.jar", - "trove4j.jar", - ) - }.map { "$ideDir/lib/$it" } -} - -@Deprecated("Rely on `build.txt` artifact resolved in configuration") -fun ideBuildNumber(ideDir: Path) = ideDir - .resolve("Resources/build.txt") - .takeIf { OperatingSystem.current().isMacOsX && it.exists() } - .or { ideDir.resolve("build.txt") } - .readText().trim() +internal fun Path.resolveProductInfoPath(name: String = "product-info.json") = + listOf(this, resolve(name), resolve("Resources").resolve(name)) + .find { it.name == name && it.exists() } + ?: throw GradleException("Could not resolve $name file in: $this") private val json = Json { ignoreUnknownKeys = true } -fun ideProductInfo(ideDir: Path) = ideDir - .resolve("Resources/product-info.json") - .takeIf { OperatingSystem.current().isMacOsX && it.exists() } - .or { ideDir.resolve("product-info.json") } - .runCatching { json.decodeFromString(readText()) } - .getOrNull() +internal fun Path.productInfo() = resolveProductInfoPath() + .run { json.decodeFromString(readText()) } fun collectJars(directory: Path, filter: Predicate = Predicate { true }) = collectFiles(directory) { it.isJar() && filter.test(it) } @@ -179,7 +129,7 @@ private fun collectFiles(directory: Path, filter: Predicate) = directory internal fun collectIntelliJPlatformDependencyJars(parent: Path): List { val lib = parent.resolve("lib").takeIf { it.exists() && it.isDirectory } ?: return emptyList() - val baseFiles = collectJars(lib) { it.name !in listOf("junit.jar", "annotations.jar") }.sorted() + val baseFiles = collectJars(lib) { it.name !in listOf("junit.jar") }.sorted() val antFiles = collectJars(lib.resolve("ant/lib")).sorted() return (baseFiles + antFiles) @@ -255,10 +205,6 @@ fun Boolean.ifFalse(block: () -> Unit): Boolean { return this } -fun NSDictionary.getDictionary(key: String) = this[key] as? NSDictionary - -fun NSDictionary.getValue(key: String) = this[key]?.toString() - internal val FileSystemLocation.asPath get() = asFile.toPath().toAbsolutePath() @@ -305,3 +251,8 @@ internal val Property.isSpecified internal val Project.sourceSets get() = extensions.getByName("sourceSets") as SourceSetContainer + +internal val Project.gradleIntelliJPlatform + get() = layout.projectDirectory.asPath + .resolve(".gradle") + .resolve("intellijPlatform") From 3dea083b51232e5c37530912bbae5952e48adba0 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Thu, 5 Oct 2023 07:59:17 +0200 Subject: [PATCH 025/347] intellijPlatformLocal --- .../gradleplugin/IntelliJPlatformType.kt | 26 ++-- .../gradleplugin/IntelliJPluginConstants.kt | 2 +- ...Transformer.kt => CollectorTransformer.kt} | 29 +++-- ...Transformer.kt => ExtractorTransformer.kt} | 11 +- .../transform/ProductInfoTransformer.kt | 10 +- .../gradleplugin/dependencies/dependencies.kt | 12 +- .../dependencies/intellijPlatformLocal.kt | 123 +++++++++--------- .../plugins/IntelliJPlatformBasePlugin.kt | 13 +- .../repositories/intellijLocal.kt | 59 --------- .../gradleplugin/repositories/repositories.kt | 5 +- .../gradleplugin/tasks/BuildPluginTask.kt | 6 +- ...loadAndroidStudioProductReleasesXmlTask.kt | 3 +- .../DownloadIdeaProductReleasesXmlTask.kt | 3 +- .../gradleplugin/tasks/InstrumentedJarTask.kt | 4 +- 14 files changed, 127 insertions(+), 179 deletions(-) rename src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/{IntelliJPlatformCollectorTransformer.kt => CollectorTransformer.kt} (72%) rename src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/{IntelliJPlatformExtractTransformer.kt => ExtractorTransformer.kt} (93%) delete mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellijLocal.kt diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt index 4bba219b7f..338e04052f 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt @@ -8,63 +8,63 @@ enum class IntelliJPlatformType(val code: String, val groupId: String, val artif AndroidStudio( code = "AI", groupId = "com.google.android.studio", - artifactId = "android-studio" + artifactId = "android-studio", ), CLion( code = "CL", groupId = "com.jetbrains.intellij.clion", - artifactId = "clion" + artifactId = "clion", ), Fleet( code = "FL", groupId = "com.jetbrains.intellij.fleetBackend", - artifactId = "fleetBackend" + artifactId = "fleetBackend", ), Gateway( code = "GW", - groupId = "com.jetbrains.gateway", - artifactId = "JetBrainsGateway" + groupId = "com.jetbrains.intellij.gateway", + artifactId = "gateway", ), GoLand( code = "GO", groupId = "com.jetbrains.intellij.goland", - artifactId = "goland" + artifactId = "goland", ), IntellijIdeaCommunity( code = "IC", groupId = "com.jetbrains.intellij.idea", - artifactId = "ideaIC" + artifactId = "ideaIC", ), IntellijIdeaUltimate( code = "IU", groupId = "com.jetbrains.intellij.idea", - artifactId = "ideaIU" + artifactId = "ideaIU", ), // JPS( // code = "JPS", // groupId = "", -// artifactId = "" +// artifactId = "", // ), PhpStorm( code = "PS", groupId = "com.jetbrains.intellij.phpstorm", - artifactId = "phpstorm" + artifactId = "phpstorm", ), PyCharmProfessional( code = "PY", groupId = "com.jetbrains.intellij.pycharm", - artifactId = "pycharmPY" + artifactId = "pycharmPY", ), PyCharmCommunity( code = "PC", groupId = "com.jetbrains.intellij.pycharm", - artifactId = "pycharmPC" + artifactId = "pycharmPC", ), Rider( code = "RD", groupId = "com.jetbrains.intellij.rider", - artifactId = "riderRD" + artifactId = "riderRD", ); companion object { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index f520c804bd..b7411f1b38 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -22,7 +22,7 @@ object IntelliJPluginConstants { object Configurations { const val INTELLIJ_PLATFORM = "intellijPlatform" - const val INTELLIJ_PLATFORM_LOCAL = "intellijPlatformLocal" + const val INTELLIJ_PLATFORM_LOCAL_INSTANCE = "intellijPlatformLocalInstance" const val INTELLIJ_PLATFORM_PRODUCT_INFO = "intellijPlatformProductInfo" const val INTELLIJ_PLATFORM_DEPENDENCIES = "intellijPlatformDependencies" const val INTELLIJ_PLATFORM_SOURCES = "intellijPlatformSources" diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformCollectorTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/CollectorTransformer.kt similarity index 72% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformCollectorTransformer.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/CollectorTransformer.kt index 17004b542c..d2c3de6dbf 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/IntelliJPlatformCollectorTransformer.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/CollectorTransformer.kt @@ -8,6 +8,7 @@ import org.gradle.api.artifacts.transform.InputArtifact import org.gradle.api.artifacts.transform.TransformAction import org.gradle.api.artifacts.transform.TransformOutputs import org.gradle.api.artifacts.transform.TransformParameters +import org.gradle.api.artifacts.type.ArtifactTypeDefinition.DIRECTORY_TYPE import org.gradle.api.artifacts.type.ArtifactTypeDefinition.ZIP_TYPE import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.FileSystemLocation @@ -24,7 +25,7 @@ import kotlin.io.path.listDirectoryEntries import kotlin.io.path.name @DisableCachingByDefault(because = "Not worth caching") -abstract class IntelliJPlatformCollectorTransformer : TransformAction { +abstract class CollectorTransformer : TransformAction { interface Parameters : TransformParameters { @@ -42,9 +43,12 @@ abstract class IntelliJPlatformCollectorTransformer : TransformAction outputs.file(file) } } } else { + // TODO: check if the given directory is IDEA — i.e. by checking if there's product-info.json file // IntelliJ Platform SDK dependency collectIntelliJPlatformDependencyJars(input).forEach { outputs.file(it) @@ -52,18 +56,25 @@ abstract class IntelliJPlatformCollectorTransformer : TransformAction Unit) interface IntelliJPlatformDependencySettings { - val ivyDirectory: Property + val ivyDirectory: DirectoryProperty } internal fun DependencyHandler.applyIntelliJPlatformSettings(objects: ObjectFactory, providers: ProviderFactory, layout: ProjectLayout) { val settings = objects.newInstance(IntelliJPlatformDependencySettings::class) - settings.ivyDirectory.convention(layout.projectDirectory.asPath.resolve(".gradle").resolve("intellijPlatform").resolve("ivy").pathString) + settings.ivyDirectory.convention(layout.projectDirectory.dir(".gradle/intellijPlatform/ivy")) - (this as ExtensionAware).extensions.add(IntelliJPluginConstants.INTELLIJ_PLATFORM_DEPENDENCY_SETTINGS_NAME, settings) + (this as ExtensionAware).extensions.add(INTELLIJ_PLATFORM_DEPENDENCY_SETTINGS_NAME, settings) } internal val DependencyHandler.intellijPlatformDependencySettings: IntelliJPlatformDependencySettings diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt index 7276305d7d..ec10da9c82 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt @@ -5,14 +5,15 @@ package org.jetbrains.intellij.platform.gradleplugin.dependencies import org.gradle.api.GradleException +import org.gradle.api.Project import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.dsl.DependencyHandler import org.gradle.internal.os.OperatingSystem import org.jetbrains.intellij.platform.gradleplugin.BuildException -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.INTELLIJ_PLATFORM_LOCAL_INSTANCE import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MINIMAL_SUPPORTED_INTELLIJ_PLATFORM_VERSION import org.jetbrains.intellij.platform.gradleplugin.Version -import org.jetbrains.intellij.platform.gradleplugin.collectIntelliJPlatformDependencyJars +import org.jetbrains.intellij.platform.gradleplugin.asPath import org.jetbrains.intellij.platform.gradleplugin.model.* import org.jetbrains.intellij.platform.gradleplugin.productInfo import java.nio.file.Path @@ -20,78 +21,70 @@ import java.time.LocalDateTime import java.time.format.DateTimeFormatter import kotlin.io.path.* -fun DependencyHandler.intellijPlatformLocal(localPath: String): Dependency? { - - val ideaDir = Path.of(localPath).let { - it.takeUnless { OperatingSystem.current().isMacOsX && it.extension == "app" } ?: it.resolve("Contents") - } - - if (!ideaDir.exists() || !ideaDir.isDirectory()) { - throw BuildException("Specified localPath '$localPath' doesn't exist or is not a directory") - } - - val productInfo = ideaDir.productInfo() - if (Version.parse(productInfo.buildNumber) < Version.parse(MINIMAL_SUPPORTED_INTELLIJ_PLATFORM_VERSION)) { - throw GradleException("The minimal supported IDE version is $MINIMAL_SUPPORTED_INTELLIJ_PLATFORM_VERSION+, the provided version is too low: ${productInfo.version} (${productInfo.buildNumber})") - } - - val ivyFileName = "${productInfo.productCode}-${productInfo.version}.xml" +val Project.intellijPlatformLocal: DependencyHandler.(String) -> Dependency? + get() = { localPath -> + val ideaDir = Path.of(localPath).let { + it.takeUnless { OperatingSystem.current().isMacOsX && it.extension == "app" } ?: it.resolve("Contents") + } - val dependency = create(productInfo) { - val targetFile = Path.of(it.ivyDirectory.get()).resolve(ivyFileName) + if (!ideaDir.exists() || !ideaDir.isDirectory()) { + throw BuildException("Specified localPath '$localPath' doesn't exist or is not a directory") + } - if (targetFile.notExists()) { - targetFile.parent.createDirectories() - targetFile.createFile() + val productInfo = ideaDir.productInfo() + if (Version.parse(productInfo.buildNumber) < Version.parse(MINIMAL_SUPPORTED_INTELLIJ_PLATFORM_VERSION)) { + throw GradleException("The minimal supported IDE version is $MINIMAL_SUPPORTED_INTELLIJ_PLATFORM_VERSION+, the provided version is too low: ${productInfo.version} (${productInfo.buildNumber})") + } - val extractor = XmlExtractor() - val ivyModule = IvyModule( - info = IvyModuleInfo( - organisation = group, - module = name, - revision = version, - publication = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")), - ), - configurations = mutableListOf( - IvyModuleConfiguration( - name = "default", - visibility = "public", + val ivyFileName = "${productInfo.productCode}-${productInfo.version}.xml" + val dependency = create(productInfo) { + val targetFile = it.ivyDirectory.file(ivyFileName).get().asPath + + if (targetFile.notExists()) { + targetFile.parent.createDirectories() + targetFile.createFile() + + val extractor = XmlExtractor() + val ivyModule = IvyModule( + info = IvyModuleInfo( + organisation = group, + module = name, + revision = version, + publication = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")), ), - IvyModuleConfiguration( - name = "compile", - visibility = "public", + configurations = mutableListOf( + IvyModuleConfiguration( + name = "default", + visibility = "public", + ), ), - IvyModuleConfiguration( - name = "sources", - visibility = "public", + publications = mutableListOf( + IvyModulePublication( + name = ideaDir.pathString, + type = "directory", + ext = null, + conf = "default", + ) ), - IvyModuleConfiguration( - name = Configurations.INTELLIJ_PLATFORM_LOCAL, - visibility = "public", - ), - ), - publications = collectIntelliJPlatformDependencyJars(ideaDir).map { file -> - IvyModulePublication( - name = file.relativeTo(ideaDir).pathString.removeSuffix(".${file.extension}"), - type = "jar", - ext = "jar", -// conf = Configurations.INTELLIJ_PLATFORM_LOCAL, - conf = "default", - ) - }, - ) + ) + extractor.marshal(ivyModule, targetFile) + } - println("XXX") + this@intellijPlatformLocal.repositories.ivy { + val ivyDirectory = it.ivyDirectory.get().asFile - extractor.marshal(ivyModule, targetFile) - - } + url = ivyDirectory.toURI() + ivyPattern("$ivyDirectory/[module]-[revision].[ext]") + artifactPattern(ideaDir.absolutePathString()) +// artifactPattern("$ivyDirectory/[artifact]") +// artifactPattern("/Users/hsz/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2023.2/5bcf969924aafaa0d1b4d4602ff824251b1004f6/[artifact](-[classifier])(.[ext])") +// artifactPattern("/[artifact]") +// artifactPattern("/Users/hsz/Projects/JetBrains/intellij-plugin-template/.gradle/intellijPlatform/sources/ideaIC-2023.2-[classifier].jar") +// artifactPattern(ideaDir.absolutePathString()) + } + } - println("ideaDir = ${ideaDir}") - println("targetFile = ${targetFile}") + add(INTELLIJ_PLATFORM_LOCAL_INSTANCE, dependency) } - - return add(Configurations.INTELLIJ_PLATFORM_LOCAL, dependency) -} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt index 468e3e6812..c84edb750b 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt @@ -14,8 +14,8 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Conf import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_TEST_FIXTURES_PLUGIN_ID import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_BASE_ID -import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyIntellijPlatformCollectorTransformer -import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyIntellijPlatformExtractTransformer +import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyCollectorTransformer +import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyExtractorTransformer import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyProductInfoTransformer import org.jetbrains.intellij.platform.gradleplugin.dependencies.applyIntelliJPlatformSettings import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension @@ -42,7 +42,7 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi description = "IntelliJ Platform dependency" } - val intellijPlatformLocalConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM_LOCAL) + val intellijPlatformLocalConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM_LOCAL_INSTANCE) .apply { isVisible = false isCanBeConsumed = false @@ -51,8 +51,6 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi attributes { attribute(Attributes.extracted, true) - attribute(Attributes.collected, false) - attribute(Attributes.productInfo, false) } } @@ -69,6 +67,7 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi } extendsFrom(intellijPlatformConfiguration) + extendsFrom(intellijPlatformLocalConfiguration) } val intellijPlatformDependenciesConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM_DEPENDENCIES) @@ -119,11 +118,11 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi attribute(Attributes.extracted) } - applyIntellijPlatformExtractTransformer( + applyExtractorTransformer( configurations.getByName(COMPILE_CLASSPATH_CONFIGURATION_NAME), configurations.getByName(TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME), ) - applyIntellijPlatformCollectorTransformer( + applyCollectorTransformer( configurations.getByName(COMPILE_CLASSPATH_CONFIGURATION_NAME), configurations.getByName(TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME), configurations.getByName(Configurations.INTELLIJ_PLATFORM_SOURCES), diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellijLocal.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellijLocal.kt deleted file mode 100644 index 57b000abb7..0000000000 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellijLocal.kt +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -@file:Suppress("unused") - -package org.jetbrains.intellij.platform.gradleplugin.repositories - -import org.gradle.api.artifacts.dsl.RepositoryHandler -import org.gradle.api.artifacts.repositories.ArtifactRepository -import java.net.URI - -fun RepositoryHandler.intellijLocal(): ArtifactRepository = - ivy { - // URL of the Ivy repository - - - val ivyPath = "/Users/hsz/Projects/JetBrains/intellij-plugin-template/.gradle/intellijPlatform/ivy" - - url = URI("file://$ivyPath") - ivyPattern("$ivyPath/[module]-[revision].[ext]") - - - val idePath = - "/Users/hsz/Applications/IntelliJ IDEA Ultimate.app/Contents" - - artifactPattern("$idePath/[artifact].[ext]") - } - -// ivy { -// val ivyDirectory = gradleIntelliJPlatform.resolve("ivy") -// -//// url = ivyDirectory.toUri() -//// ivyPattern("$ivyDirectory/[module]-[revision]-ivy.[ext]") // ivy xml -// ivyPattern("/Users/hsz/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2022.3.3/19e52733ac61e1d2e675720f92daf5959355cb1e/ideaIC-2022.3.3/ideaIC-2022.3.3-2-withKotlin-withSources.xml") -// artifactPattern("/Users/hsz/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2022.3.3/19e52733ac61e1d2e675720f92daf5959355cb1e/ideaIC-2022.3.3/[artifact].[ext]") -//// artifactPattern("/Users/hsz/Applications/IntelliJ IDEA Ultimate.app/Contents/lib/app.jar") -// } - - -//ivy { -// url = dependency.classes.toURI() -// ivyPattern("${ivyFile.parent}/[module]-[revision].[ext]") // ivy xml -// artifactPattern("${dependency.classes.path}/[artifact].[ext]") // idea libs -// if (dependency.sources != null) { -// artifactPattern("${dependency.sources.parent}/[artifact]-[revision]-[classifier].[ext]") -// } -//} - -//ivy { -// val ivyFileSuffix = plugin.getFqn().substring("${plugin.id}-${plugin.version}".length) -// ivyPattern("$cacheDirectoryPath/[organisation]/[module]-[revision]$ivyFileSuffix.[ext]") // ivy xml -// ideaDependency.classes.let { -// artifactPattern("$it/plugins/[module]/[artifact](.[ext])") // builtin plugins -// artifactPattern("$it/[artifact](.[ext])") // plugin sources delivered with IDE -// } -// artifactPattern("$cacheDirectoryPath(/[classifier])/[module]-[revision]/[artifact](.[ext])") // external zip plugins -// if (ideaDependency.sources != null) { -// artifactPattern("${ideaDependency.sources.parent}/[artifact]-${ideaDependency.version}(-[classifier]).[ext]") -// } -//} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt index 030a009767..51fcd4357e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt @@ -3,7 +3,6 @@ package org.jetbrains.intellij.platform.gradleplugin.repositories import org.gradle.api.artifacts.dsl.RepositoryHandler -import org.gradle.api.artifacts.repositories.ArtifactRepository import org.gradle.api.artifacts.repositories.MavenArtifactRepository import org.gradle.api.model.ObjectFactory import org.gradle.api.plugins.ExtensionAware @@ -15,7 +14,7 @@ import org.gradle.kotlin.dsl.newInstance import org.jetbrains.intellij.platform.gradleplugin.BuildFeature import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_REPOSITORY_SETTINGS_NAME -internal typealias ArtifactRepositoryAction = (ArtifactRepository.() -> Unit) +internal typealias Action = (MavenArtifactRepository.() -> Unit) interface IntelliJPlatformRepositorySettings { @@ -33,8 +32,6 @@ internal fun RepositoryHandler.applyIntelliJPlatformSettings(objects: ObjectFact internal val RepositoryHandler.intellijPlatformRepositorySettings: IntelliJPlatformRepositorySettings get() = (this as ExtensionAware).extensions.getByType() -internal typealias Action = (MavenArtifactRepository.() -> Unit) - internal fun RepositoryHandler.customRepository( name: String, url: String, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTask.kt index 698b8af4ac..b1930add5f 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTask.kt @@ -4,18 +4,18 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.tasks.bundling.Zip import org.gradle.work.DisableCachingByDefault -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME /** * Assembles a plugin and prepares ZIP archive for deployment. * * @see [Zip] */ - @DisableCachingByDefault(because = "Zip based tasks do not benefit from caching") +@DisableCachingByDefault(because = "Zip based tasks do not benefit from caching") abstract class BuildPluginTask : Zip() { init { - group = IntelliJPluginConstants.PLUGIN_GROUP_NAME + group = PLUGIN_GROUP_NAME description = "Assembles plugin and prepares ZIP archive for deployment." } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt index fd20f53b92..226c9c6f54 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt @@ -8,6 +8,7 @@ import org.gradle.api.tasks.Input import org.gradle.api.tasks.Optional import org.gradle.api.tasks.Sync import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME import org.jetbrains.intellij.platform.gradleplugin.logCategory @CacheableTask @@ -24,7 +25,7 @@ abstract class DownloadAndroidStudioProductReleasesXmlTask : Sync() { abstract val releasesUrl: Property init { - group = IntelliJPluginConstants.PLUGIN_GROUP_NAME + group = PLUGIN_GROUP_NAME description = "Downloads XML files containing the Android Studio product release information." } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIdeaProductReleasesXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIdeaProductReleasesXmlTask.kt index 95bf131b13..83a9dfdc25 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIdeaProductReleasesXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIdeaProductReleasesXmlTask.kt @@ -5,6 +5,7 @@ package org.jetbrains.intellij.tasks import org.gradle.api.provider.Property import org.gradle.api.tasks.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME import java.io.File @CacheableTask @@ -22,7 +23,7 @@ abstract class DownloadIdeaProductReleasesXmlTask : Sync() { abstract val inputFile: Property init { - group = IntelliJPluginConstants.PLUGIN_GROUP_NAME + group = PLUGIN_GROUP_NAME description = "Downloads XML files containing the IntelliJ IDEA product release information." } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentedJarTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentedJarTask.kt index a75e7d27d1..688d3868ea 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentedJarTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentedJarTask.kt @@ -4,7 +4,7 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.api.tasks.CacheableTask import org.gradle.api.tasks.bundling.Jar -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME /** * Creates a JAR file with instrumented classes. @@ -15,7 +15,7 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants abstract class InstrumentedJarTask : Jar() { init { - group = IntelliJPluginConstants.PLUGIN_GROUP_NAME + group = PLUGIN_GROUP_NAME description = "Assembles an instrumented JAR archive." } } From 0af0afddb43a6fe45d2591dfe82950eaf38d89cc Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Thu, 5 Oct 2023 08:36:06 +0200 Subject: [PATCH 026/347] Drop sources resolving support --- .../IntelliJIvyDescriptorFileGenerator.kt | 34 ---------- .../gradleplugin/IntelliJPluginConstants.kt | 1 - .../gradleplugin/IntelliJPluginExtension.kt | 7 -- .../transform/CollectorTransformer.kt | 19 +----- .../dependencies/intellijPlatform.kt | 5 -- .../dependencies/intellijPlatformSources.kt | 56 ---------------- .../gradleplugin/dependency/IdeaDependency.kt | 6 -- .../dependency/IdeaDependencyManager.kt | 66 +------------------ .../dependency/JpsIdeaDependency.kt | 2 - .../dependency/LocalIdeaDependency.kt | 3 +- .../dependency/PluginDependencyManager.kt | 7 +- .../plugins/IntelliJPlatformBasePlugin.kt | 9 --- .../plugins/IntelliJPlatformPlugin.kt | 7 +- 13 files changed, 8 insertions(+), 214 deletions(-) delete mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformSources.kt diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJIvyDescriptorFileGenerator.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJIvyDescriptorFileGenerator.kt index a59cd7a5ce..7009746843 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJIvyDescriptorFileGenerator.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJIvyDescriptorFileGenerator.kt @@ -8,8 +8,6 @@ import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration import org.gradle.api.publish.ivy.internal.publisher.IvyPublicationIdentity import org.gradle.internal.xml.SimpleXmlWriter import org.gradle.internal.xml.XmlTransformer -import org.jetbrains.intellij.platform.gradleplugin.dependency.IdePluginSourceZipFilesProvider -import org.jetbrains.intellij.platform.gradleplugin.dependency.IdeaDependency import org.jetbrains.intellij.platform.gradleplugin.dependency.IntellijIvyArtifact import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginDependency import java.io.File @@ -57,38 +55,6 @@ class IntelliJIvyDescriptorFileGenerator(private val projectIdentity: IvyPublica return this } - fun addSourceArtifacts(ideaDependency: IdeaDependency?, plugin: PluginDependency, baseDir: Path, groupId: String): IntelliJIvyDescriptorFileGenerator { - val sourcesConfiguration = DefaultIvyConfiguration("sources") - addConfiguration(sourcesConfiguration) - if (plugin.sourceJarFiles.isNotEmpty()) { - plugin.sourceJarFiles.forEach { - addArtifact(IntellijIvyArtifact.createJarDependency(it.toPath(), sourcesConfiguration.name, baseDir, groupId)) - } - } else { - ideaDependency - ?.sourceZipFiles - ?.map { it.toPath() } - ?.let { IdePluginSourceZipFilesProvider.getSourceZips(it, plugin.platformPluginId) } - ?.let { IntellijIvyArtifact.createZipDependency(it, sourcesConfiguration.name, ideaDependency.classes.toPath()) } - ?.let(::addArtifact) - } - // see: https://github.com/JetBrains/gradle-intellij-plugin/issues/153 - ideaDependency - ?.sources - ?.takeIf { plugin.builtin } - ?.let { - val name = when(ideaDependency.name) { - "pycharmPY", "pycharmPC" -> "pycharmPC" - else -> "ideaIC" - } - val artifact = IntellijIvyArtifact(it.toPath(), name, "jar", "sources", "sources") - artifact.conf = sourcesConfiguration.name - addArtifact(artifact) - } - - return this - } - @Deprecated("Use writeTo(path: Path) instead") fun writeTo(file: File) { xmlTransformer.transform(file, ivyFileEncoding) { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index b7411f1b38..77d40354e6 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -25,7 +25,6 @@ object IntelliJPluginConstants { const val INTELLIJ_PLATFORM_LOCAL_INSTANCE = "intellijPlatformLocalInstance" const val INTELLIJ_PLATFORM_PRODUCT_INFO = "intellijPlatformProductInfo" const val INTELLIJ_PLATFORM_DEPENDENCIES = "intellijPlatformDependencies" - const val INTELLIJ_PLATFORM_SOURCES = "intellijPlatformSources" const val TEST_FIXTURES_COMPILE_ONLY = "testFixturesCompileOnly" object Attributes { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt index 9f8991fc6c..e259d09715 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt @@ -69,13 +69,6 @@ abstract class IntelliJPluginExtension @Inject constructor( */ abstract val localPath: Property - /** - * The path to local archive with IDE sources. - * - * Default value: `null` - */ - abstract val localSourcesPath: Property - /** * Required. * The version of the IntelliJ Platform IDE that will be used to build the plugin. diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/CollectorTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/CollectorTransformer.kt index d2c3de6dbf..059683c161 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/CollectorTransformer.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/CollectorTransformer.kt @@ -10,11 +10,9 @@ import org.gradle.api.artifacts.transform.TransformOutputs import org.gradle.api.artifacts.transform.TransformParameters import org.gradle.api.artifacts.type.ArtifactTypeDefinition.DIRECTORY_TYPE import org.gradle.api.artifacts.type.ArtifactTypeDefinition.ZIP_TYPE -import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.FileSystemLocation import org.gradle.api.provider.Provider import org.gradle.api.tasks.Classpath -import org.gradle.api.tasks.CompileClasspath import org.gradle.kotlin.dsl.registerTransform import org.gradle.work.DisableCachingByDefault import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes @@ -25,13 +23,7 @@ import kotlin.io.path.listDirectoryEntries import kotlin.io.path.name @DisableCachingByDefault(because = "Not worth caching") -abstract class CollectorTransformer : TransformAction { - - interface Parameters : TransformParameters { - - @get:CompileClasspath - val sourcesClasspath: ConfigurableFileCollection - } +abstract class CollectorTransformer : TransformAction { @get:Classpath @get:InputArtifact @@ -54,17 +46,12 @@ abstract class CollectorTransformer : TransformAction create( // group = "com.jetbrains.gateway", // name = "JetBrainsGateway", // version = version, -// hasSources = false, // ) // // AndroidStudio -> create( // group = "com.google.android.studio", // name = "android-studio", // version = version, -// hasSources = false, // ext = when { // OperatingSystem.current().isLinux -> "tar.gz" // else -> "zip" diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformSources.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformSources.kt deleted file mode 100644 index 8461716a62..0000000000 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformSources.kt +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -@file:Suppress("unused") - -package org.jetbrains.intellij.platform.gradleplugin.dependencies - -import org.gradle.api.provider.Provider -import org.gradle.kotlin.dsl.DependencyHandlerScope -import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.IntellijIdeaCommunity -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.PyCharmCommunity -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations - -fun DependencyHandlerScope.intellijPlatformSources( - type: IntelliJPlatformType?, - version: String, - configurationName: String = Configurations.INTELLIJ_PLATFORM_SOURCES, -) = add(configurationName, createIntelliJPlatformSourcesDependency(type, version)) - -internal fun DependencyHandlerScope.intellijPlatformSources( - type: IntelliJPlatformType?, - versionProvider: Provider, - configurationName: String = Configurations.INTELLIJ_PLATFORM_SOURCES, -) = addProvider(configurationName, versionProvider.map { createIntelliJPlatformSourcesDependency(type, it) }) - -internal fun DependencyHandlerScope.createIntelliJPlatformSourcesDependency( - type: IntelliJPlatformType?, - version: String, -) = when (type) { - IntellijIdeaCommunity -> create( - group = "com.jetbrains.intellij.idea", - name = "ideaIC", - version = version, - classifier = "sources", - ) - - PyCharmCommunity -> create( - group = "com.jetbrains.intellij.pycharm", - name = "pycharmPC", - version = version, - classifier = "sources", - ) - - else -> throw IllegalArgumentException("Specified type '$type' is unknown. Supported values: $IntellijIdeaCommunity, $PyCharmCommunity") -} - -fun DependencyHandlerScope.intellijPlatformSources(type: String, version: String) = intellijPlatformSources(IntelliJPlatformType.fromCode(type), version) -fun DependencyHandlerScope.intellijPlatformSources(type: String, version: Provider) = - intellijPlatformSources(IntelliJPlatformType.fromCode(type), version) - -fun DependencyHandlerScope.intellijIdeaCommunitySources(version: String) = intellijPlatformSources(IntellijIdeaCommunity, version) -fun DependencyHandlerScope.intellijIdeaCommunitySources(version: Provider) = intellijPlatformSources(IntellijIdeaCommunity, version) - -fun DependencyHandlerScope.pycharmCommunitySources(version: String) = intellijPlatformSources(PyCharmCommunity, version) -fun DependencyHandlerScope.pycharmCommunitySources(version: Provider) = intellijPlatformSources(PyCharmCommunity, version) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependency.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependency.kt index dd349cee1a..bfbe8a9e75 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependency.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependency.kt @@ -16,7 +16,6 @@ open class IdeaDependency( val version: String, val buildNumber: String, val classes: File, - val sources: File?, val withKotlin: Boolean, val pluginsRegistry: BuiltinPluginsRegistry, val extraDependencies: Collection, @@ -54,9 +53,6 @@ open class IdeaDependency( if (withKotlin) { fqn += "-withKotlin" } - if (sources != null) { - fqn += "-withSources" - } return fqn } @@ -71,7 +67,6 @@ open class IdeaDependency( if (version != other.version) return false if (buildNumber != other.buildNumber) return false if (classes != other.classes) return false - if (sources != other.sources) return false if (withKotlin != other.withKotlin) return false if (pluginsRegistry != other.pluginsRegistry) return false if (extraDependencies != other.extraDependencies) return false @@ -87,7 +82,6 @@ open class IdeaDependency( result = 31 * result + version.hashCode() result = 31 * result + buildNumber.hashCode() result = 31 * result + classes.hashCode() - result = 31 * result + sources.hashCode() result = 31 * result + withKotlin.hashCode() result = 31 * result + pluginsRegistry.hashCode() result = 31 * result + extraDependencies.hashCode() diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt index d3c6dbb6c4..6560b173ad 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt @@ -43,9 +43,6 @@ abstract class IdeaDependencyManager @Inject constructor( url = dependency.classes.toURI() ivyPattern("${ivyFile.parent}/[module]-[revision]$ivyFileSuffix.[ext]") // ivy xml artifactPattern("${dependency.classes.path}/[artifact].[ext]") // idea libs - if (dependency.sources != null) { - artifactPattern("${dependency.sources.parent}/[artifact]-[revision]-[classifier].[ext]") - } } dependencies.add( @@ -64,7 +61,6 @@ abstract class IdeaDependencyManager @Inject constructor( version: String, buildNumber: String, classesDirectory: File, - sourcesDirectory: File?, project: Project, extraDependencies: Collection, ) = when (type) { @@ -72,7 +68,6 @@ abstract class IdeaDependencyManager @Inject constructor( // version, // buildNumber, // classesDirectory, -// sourcesDirectory, // !hasKotlinDependency(project), // context, // ) @@ -85,7 +80,6 @@ abstract class IdeaDependencyManager @Inject constructor( version, buildNumber, classesDirectory, - sourcesDirectory, !hasKotlinDependency(project), pluginsRegistry, extraDependencies, @@ -96,7 +90,6 @@ abstract class IdeaDependencyManager @Inject constructor( version, buildNumber, classesDirectory, - sourcesDirectory, withKotlin = !hasKotlinDependency(project), pluginsRegistry = pluginsRegistry, extraDependencies = extraDependencies, @@ -105,32 +98,6 @@ abstract class IdeaDependencyManager @Inject constructor( } } - private fun resolveSources(version: String, type: IntelliJPlatformType): File? { - info(context, "Adding IDE sources repository") - try { - val forPyCharm = type == PyCharmProfessional || type == PyCharmCommunity - val sourcesFiles = dependenciesDownloader.downloadFromRepository(context, { - create( - group = if (forPyCharm) "com.jetbrains.intellij.pycharm" else "com.jetbrains.intellij.idea", - name = if (forPyCharm) "pycharmPC" else "ideaIC", - version = version, - classifier = "sources", - ext = "jar", - ) - }) - if (sourcesFiles.size == 1) { - val sourcesDirectory = sourcesFiles.first() - debug(context, "IDE sources jar: " + sourcesDirectory.path) - return sourcesDirectory - } else { - warn(context, "Cannot attach IDE sources. Found files: $sourcesFiles") - } - } catch (e: ResolveException) { - warn(context, "Cannot resolve IDE sources dependency", e) - } - return null - } - private fun unzipDependencyFile( cacheDirectory: File, zipFile: File, @@ -216,7 +183,6 @@ abstract class IdeaDependencyManager @Inject constructor( IntelliJIvyDescriptorFileGenerator(identity).apply { addConfiguration(DefaultIvyConfiguration("default")) addConfiguration(DefaultIvyConfiguration("compile")) - addConfiguration(DefaultIvyConfiguration("sources")) dependency.jarFiles .forEach { addArtifact(IntellijIvyArtifact.createJarDependency(it.toPath(), "compile", dependency.classes.toPath())) } @@ -225,17 +191,6 @@ abstract class IdeaDependencyManager @Inject constructor( .filter { it.nameWithoutExtension in sourceZipArtifacts } .forEach { addArtifact(IntellijIvyArtifact.createZipDependency(it.toPath(), "sources", dependency.classes.toPath())) } - if (dependency.sources != null) { - val name = when (dependency.name) { - "pycharmPY", "pycharmPC" -> "pycharmPC" - else -> "ideaIC" - } - IntellijIvyArtifact(dependency.sources.toPath(), name, "jar", "sources", "sources").apply { - conf = "sources" - addArtifact(this) - } - } - writeTo(ivyFile) } } @@ -249,7 +204,7 @@ abstract class IdeaDependencyManager @Inject constructor( .any { "org.jetbrains.kotlin" == it.group && isKotlinRuntime(it.name) } @Deprecated("Use DependencyHandlerScope.intellijPlatform(type: IntelliJPlatformType, version: String, configurationName: String)") - fun resolveRemote(project: Project, version: String, type: String, sources: Boolean, extraDependencies: List): IdeaDependency { + fun resolveRemote(project: Project, version: String, type: String, extraDependencies: List): IdeaDependency { debug(context, "Adding IDE dependency") val type = IntelliJPlatformType.fromCode(type) @@ -293,21 +248,16 @@ abstract class IdeaDependencyManager @Inject constructor( type == Rider -> RemoteIdeaDependency( group = Rider.groupId, name = Rider.artifactId, -// hasSources = (sources && releaseType != RELEASE_TYPE_SNAPSHOTS).ifFalse { -// warn(context, "IDE sources are not available for Rider SNAPSHOTS") -// }, ) type == Gateway -> RemoteIdeaDependency( group = Gateway.groupId, name = Gateway.artifactId, - hasSources = false, ) type == AndroidStudio -> RemoteIdeaDependency( group = AndroidStudio.groupId, name = AndroidStudio.artifactId, - hasSources = false, artifactExtension = when { OperatingSystem.current().isLinux -> "tar.gz" else -> "zip" @@ -378,10 +328,6 @@ abstract class IdeaDependencyManager @Inject constructor( info(context, "IDE dependency cache directory: $classesDirectory") val buildNumber = classesDirectory.productInfo().buildNumber - val sourcesDirectory = when { - remoteIdeaDependency.hasSources ?: sources -> resolveSources(version, type) - else -> null - } val resolvedExtraDependencies = resolveExtraDependencies(project, version, extraDependencies) return createDependency( remoteIdeaDependency.name, @@ -389,13 +335,12 @@ abstract class IdeaDependencyManager @Inject constructor( version, buildNumber, classesDirectory.toFile(), // FIXME - sourcesDirectory, project, resolvedExtraDependencies, ) } - fun resolveLocal(project: Project, localPath: String, localPathSources: String?): IdeaDependency { + fun resolveLocal(project: Project, localPath: String): IdeaDependency { debug(context, "Adding local IDE dependency") val ideaDir = Path.of(localPath).let { it.takeUnless { it.endsWith(".app") } ?: it.resolve("Contents") @@ -405,11 +350,7 @@ abstract class IdeaDependencyManager @Inject constructor( throw BuildException("Specified localPath '$localPath' doesn't exist or is not a directory", null) } val buildNumber = ideaDir.productInfo().buildNumber - val sources = when { - !localPathSources.isNullOrEmpty() -> File(localPathSources) - else -> null - } - return createDependency("ideaLocal", null, buildNumber, buildNumber, ideaDir.toFile(), sources, project, emptyList()) + return createDependency("ideaLocal", null, buildNumber, buildNumber, ideaDir.toFile(), project, emptyList()) } private fun getZipCacheDirectory(zipFile: File, project: Project, type: IntelliJPlatformType): File { @@ -504,7 +445,6 @@ abstract class IdeaDependencyManager @Inject constructor( private data class RemoteIdeaDependency( val group: String, val name: String, - val hasSources: Boolean? = null, val artifactExtension: String = "zip", val postProcess: (Path) -> Unit = {}, ) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/JpsIdeaDependency.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/JpsIdeaDependency.kt index c69f29ac99..8c25a7f207 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/JpsIdeaDependency.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/JpsIdeaDependency.kt @@ -8,7 +8,6 @@ class JpsIdeaDependency( version: String, buildNumber: String, classes: File, - sources: File?, withKotlin: Boolean, context: String?, ) : IdeaDependency( @@ -16,7 +15,6 @@ class JpsIdeaDependency( version, buildNumber, classes, - sources, withKotlin, BuiltinPluginsRegistry(classes, context), emptyList(), diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/LocalIdeaDependency.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/LocalIdeaDependency.kt index a9e2d7b2fb..844202ae9c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/LocalIdeaDependency.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/LocalIdeaDependency.kt @@ -9,11 +9,10 @@ class LocalIdeaDependency( version: String, buildNumber: String, classes: File, - sources: File?, withKotlin: Boolean, builtinPluginsRegistry: BuiltinPluginsRegistry, extraDependencies: Collection, -) : IdeaDependency(name, version, buildNumber, classes, sources, withKotlin, builtinPluginsRegistry, extraDependencies) { +) : IdeaDependency(name, version, buildNumber, classes, withKotlin, builtinPluginsRegistry, extraDependencies) { override fun getIvyRepositoryDirectory() = when { version.endsWith(".SNAPSHOT") -> null diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyManager.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyManager.kt index 9fd969885e..cbfb61cd61 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyManager.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyManager.kt @@ -46,8 +46,7 @@ abstract class PluginDependencyManager @Inject constructor( } else { info(context, "Looking for builtin '${dependency.id}' in: ${ideaDependency.classes.canonicalPath}") ideaDependency.pluginsRegistry.findPlugin(dependency.id)?.let { - val builtinPluginVersion = "${ideaDependency.name}-${ideaDependency.buildNumber}" + - "-withSources".takeIf { ideaDependency.sources != null }.orEmpty() + val builtinPluginVersion = "${ideaDependency.name}-${ideaDependency.buildNumber}" return PluginDependencyImpl(it.name, dependency.id, builtinPluginVersion, it.toFile(), true) } } @@ -118,9 +117,6 @@ abstract class PluginDependencyManager @Inject constructor( artifactPattern("$it/[artifact](.[ext])") // plugin sources delivered with IDE } artifactPattern("$cacheDirectoryPath(/[classifier])/[module]-[revision]/[artifact](.[ext])") // external zip plugins - if (ideaDependency.sources != null) { - artifactPattern("${ideaDependency.sources.parent}/[artifact]-${ideaDependency.version}(-[classifier]).[ext]") - } } } if (!plugin.builtin && !plugin.maven) { @@ -145,7 +141,6 @@ abstract class PluginDependencyManager @Inject constructor( IntelliJIvyDescriptorFileGenerator(identity) .addConfiguration(DefaultIvyConfiguration("default")) .addCompileArtifacts(plugin, baseDir, groupId) - .addSourceArtifacts(ideaDependency, plugin, baseDir, groupId) .writeTo(ivyFile) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt index c84edb750b..d3bb5458d0 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt @@ -78,14 +78,6 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi description = "IntelliJ Platform Dependencies dependency" } - maybeCreate(Configurations.INTELLIJ_PLATFORM_SOURCES) - .apply { - isVisible = false - isCanBeConsumed = false - isCanBeResolved = true - description = "IntelliJ Platform Sources to be attached to the IntelliJ Platform dependency" - } - fun Configuration.extend() = extendsFrom( intellijPlatformConfiguration, intellijPlatformLocalConfiguration, @@ -125,7 +117,6 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi applyCollectorTransformer( configurations.getByName(COMPILE_CLASSPATH_CONFIGURATION_NAME), configurations.getByName(TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME), - configurations.getByName(Configurations.INTELLIJ_PLATFORM_SOURCES), ) applyProductInfoTransformer() } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt index ac695a781c..01fb538b4d 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt @@ -153,7 +153,6 @@ abstract class IntelliJPlatformPlugin : Plugin { .dir(DEFAULT_SANDBOX) .map { it.asFile.canonicalPath } ) - downloadSources.convention(!System.getenv().containsKey("CI")) configureDefaultDependencies.convention(true) type.convention(IntellijIdeaCommunity.toString()) } @@ -226,11 +225,9 @@ abstract class IntelliJPlatformPlugin : Plugin { private fun prepareIdeaDependencyProvider(project: Project, extension: IntelliJPluginExtension) = project.provider { val configureDefaultDependencies = extension.configureDefaultDependencies.get() - val downloadSources = extension.downloadSources.get() val extraDependencies = extension.extraDependencies.get() val ideaDependencyCachePath = extension.ideaDependencyCachePath.orNull.orEmpty() val localPath = extension.localPath.orNull - val localSourcesPath = extension.localSourcesPath.orNull val type = extension.getVersionType().orNull val version = extension.getVersionNumber().orNull @@ -250,12 +247,12 @@ abstract class IntelliJPlatformPlugin : Plugin { version != null && type != null -> { info(context, "Using IDE from remote repository") - dependencyManager.resolveRemote(project, version, type, downloadSources, extraDependencies) + dependencyManager.resolveRemote(project, version, type, extraDependencies) } localPath != null -> { info(context, "Using path to locally installed IDE: $localPath") - dependencyManager.resolveLocal(project, localPath, localSourcesPath) + dependencyManager.resolveLocal(project, localPath) } else -> { From 2eb4b5f70737cf754cce12d837b9b5a3f9635e90 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 9 Oct 2023 11:58:00 +0200 Subject: [PATCH 027/347] Update IntelliJ Platform code for Fleet --- .../intellij/platform/gradleplugin/IntelliJPlatformType.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt index 338e04052f..e5ed78b7fb 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt @@ -16,7 +16,7 @@ enum class IntelliJPlatformType(val code: String, val groupId: String, val artif artifactId = "clion", ), Fleet( - code = "FL", + code = "FLIJ", groupId = "com.jetbrains.intellij.fleetBackend", artifactId = "fleetBackend", ), From c5f1a4696c97c4fffa842810d73167a842fb2762 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 9 Oct 2023 14:24:01 +0200 Subject: [PATCH 028/347] Gradle 8.4 --- gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.jar | Bin 63375 -> 63721 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 17 +++++++++-------- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/gradle.properties b/gradle.properties index 73aa8ca90c..ab799315b2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,7 @@ tags=intellij,jetbrains,idea ossrhUsername= ossrhPassword= pluginsRepository=https://cache-redirector.jetbrains.com/plugins.jetbrains.com/maven -gradleVersion=8.2.1 +gradleVersion=8.4 kotlinVersion=1.9.10 testGradleVersion= testGradleArguments= diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 033e24c4cdf41af1ab109bc7f253b2b887023340..7f93135c49b765f8051ef9d0a6055ff8e46073d8 100644 GIT binary patch delta 28216 zcmZ6yQ*@x+6TO*^ZQHip9ox2TJ8x{;wr$&H$LgqKv*-KI%$l`+bAK-CVxOv0&)z5g z2JHL}tl@+Jd?b>@B>9{`5um}}z@(_WbP841wh56Q*(#D!%+_WFn zxTW!hkY%qR9|LgnC$UfeVp69yjV8RF>YD%YeVEatr**mzN7 z%~mf;`MId9ttnTP(NBpBu_T!aR9RPfUey|B+hCTWWUp*Wy%dWP;fVVjO?KDc*VJ^iSto8gEBp#a5qRnMR zR-GrMr4};1AUK^Wl4El^I$-(Vox98wN~VNm(oL!Se73~FCH0%|9`4hgXt)VkY;&YA zxyNzaSx28JDZ@IjQQ-r%=U60hdM!;;Y1B&M`-jR5wo|dL0PfRJBs={0-i#sk@ffUT z&!L4AR}OfxIMF;CysW-jf@GxJRaJf6F$^KwJk-s_L0t?_fJ4k67RHAk3M+heW>EqQ>mh(Ebmt5gvhew5D{oe# zo`>K30R3ukH;X#Wq!&s zh<7!d$VmuwoQfFr&7EXB^fHQhPSUeX-@m@70<^Z-3rtpi;hOA_$6iw7N*XT>pwkm9^O|F` zV$|!O7HK<&%rdLqo6c5A>AL}T)rY)mCX9IQZdUUafh2CzC~-ixktzMIU(ZZ}?tK;b zJk9Wwx!+Ej!fTgInh8by&<<;Q+>(gN(w-wO{3c($ua2PiC10N6MH6zHuCrIMQL^<_ zJbok&IZ1f&2hF8#E}+@2;m7z@mRJbXJZAMDrA>>?YCn~dS;HOKzymOhHng2>Vqt^| zqR71FIPY1`Y_tsTs>9k)&f%JOVl9oUZ$3ufI0`kM#_d@%1~~NYRSbgq>`8HS@YCTP zN1lIW7odKxwcu71yGi#68$K_+c ziEt@@hyTm6*U^3V^=kEYm`?AR*^&DQz$%CV6-c-87CA>z6cAI!Vqdi|Jtw*PVTC)3 zlYI4yE!rS)gHla|DYjQ~Vea(In8~mqeIn7W;5?2$4lJ;wAqMcLS|AcWwN%&FK2(WL zCB@UE7+TPVkEN#q8zY_zi3x8BE+TsYo3s#nfJ3DnuABb|!28j#;A;27g+x)xLTX7; zFdUA=o26z`apjP!WJaK>P+gP2ijuSvm!WBq{8a4#OJrB?Ug=K7+zHCo#~{om5nhEs z9#&+qk>(sVESM`sJSaE)ybL7yTB^J;zDIu1m$&l!OE#yxvjF6c{p&|oM!+4^|7sVv zEAcZqfZP}eW}<;f4=Lg1u0_*M-Zd@kKx|7%JfW;#kT}yRVY^C5IX^Mr^9vW0=G!6T zF&u}?lsA7r)qVcE`SrY(kG$-uK` zy|vn}D^GBxhP+f%Y;>yBFh0^0Q5|u_)gQylO808C5xO_%+ih8?+Yv@4|M?vYB7is!1y@n%8fZ?IL%a@%Qe;9q@IC)BmfjA?Nu*COkU$PP%XoE%%B7dd0rf;*AuGIs%d zOMi)Jd9Gk%3W)sXCM{Upg&JbSh^G5j%l!y8;nw*n+WIK}OM-wt=d*R0>_L9r1Z`Z+ zc;l>^^y#C*RBicDoGdG^c-*Zr{)PYO-TL>cc2ra#H9P@ml{LnWdB+Cg@@z`F$Cg+) zG%M(!=}+i3o``uvsP4UI;}edQyyqZbhpD_!BTz{O#yrq`+%` zc`uT~qNjFFBRixfq)^)E7CBxi+tN7qW>|BPwlr(li({kN6O$wSLd~@Z?I;>xiv*V4 zNVM-0H#h?4NaQa%3c&yC zig%>pq3m7pKFUN(2zW>A1lJ+WSZAKAGYMiK8&pp)v01^a<6B_rE*}s1p0O(4zakbSt3e((EqbeC`uF1H|A;Kp%N@+b0~5;x6Sji?IUl||MmI_F~I2l;HWrhBF@A~cyW>#?3TOhsOX~T z(J+~?l^huJf-@6)ffBq5{}E(V#{dT0S-bwmxJdBun@ag@6#pTiE9Ezrr2eTc4o@dX z7^#jNNu1QkkCv-BX}AEd5UzX2tqN~X2OVPl&L0Ji(PJ5Iy^nx?^D%V!wnX-q2I;-) z60eT5kXD5n4_=;$XA%1n?+VR-OduZ$j7f}>l5G`pHDp*bY%p$(?FY8OO;Quk$1iAZ zsH$={((`g1fW)?#-qm}Z7ooqMF{7%3NJzC`sqBIK+w16yQ{=>80lt}l2ilW=>G0*7 zeU>_{?`68NS8DJ>H1#HgY!!{EG)+Cvvb{7~_tlQnzU!^l+JP7RmY4hKA zbNYsg5Imd)jj?9-HRiDIvpga&yhaS2y6}aAS?|gA9y$}Z2w%N?Hi;14$6Qt9Fc(zl zSClM66;E1hxh^>PDv1XMq3yzJ#jIQ2n+?hwjw)8hFcXDQ$PiWf{s&^_>jbGGeg0{e zx4b5kIhB2gIgyS27y+;DfV`%)h1F!WTP!76o?^QsSBR~nBXnz|IYr*$k${m-u>9Mj z>09A!u0*q9wSQ>0WDmmm6hKju+`dxYkybvA=1jG|1`G$ikS^okbnAN=Wz*xojmwWtY zZq{@FnLJg|h&Ci78w-ZXi=9I>WkRlD1d>c0=b9iXFguf*jq8UF(aM^HPO6~l!aXXi zc4bhK;mEsobxUit``hThf!0qvU3#~h%+C7bA-UJ%beFlm%?79KFM=Q2ALm>*ejo)1 zN33ZFKX8=zsg25G0Ab*X= zdcI5{@`irEC^Vn3q59Jucz{N6{KZY%y!;&|6(=B*Qp4*X@6+qsstjw|K^Wnh^m zw8Uv>6;*bKq>4?Gx3QFDLt`0UxmmN7Xiq<$s>g!~1}N!FL8j3aRyuwusB^Rr5ctV|o-cP?J#Un1>4_;4aB&7@B;k zdZy2^x1cZ-*IQTd25OC9?`_p0K$U0DHZIt8<7E+h=)E^Rp0gzu`UVffNxwLzG zX*D_UAl34>+%*J+r|O0;FZ>F4(Wc?6+cR=BtS-N0cj2Yp2q1d6l?d$Iytr<#v-_FO z?eHZv2-Ip;7yMv=O)FL_oCZRJQZX}2v%EkS681es?4j-kL}8;X|j8CJgydxjyLn~K)YXxg3=u&4MoB$FGPl~zhg3Z zt9ULN>|(KD1PZU)Y&rZfmS<5B={#}jsn5pr0NC%Kj3BZIDQ?<^F6!SqVMmILZ*Rg9 zh;>0;5a)j%SOPWU-3a2Uio^ISC|#-S@d({=CDa}9snC0(l2PSpUg_lNxPwJt^@lHE zzsH2EZ{#WTf~S~FR+S{&bn+>G!R`)dK>!wpyCXVYKkn$H26^H}y?Pi92!6C`>d|xr z04#wV>t1@WEpp8Z4ox^;Kfbf?SOf8A+gRb-FV zo*K})Vl88rX(Cy{n7WTpuH!!Cg7%u|7ebCsC3o@cBYL-WRS+Ei#Eqz-Kus=L zHm{IVReCv-q^w<(1uL|t!n?OI9^C>u04UcQmT0+f^tju& z)>4-ifqvfZeaFYITS2-g=cs6(oOxE+d0EAHd3=(PzjT#uzKm@ zgrDe|sc}|ch_f*s3u~u-E>%w54`pHmYs8;Y6D8+zZv{~2!v$2Rn;zl9<~J?1z{;(A z@UoM9-m`u#g!u`Iq<$7d5R2hKH24np5$k`9nQM%%90Hu&6MGS8YIgT?UIB{>&e~~QN=3Dxs}jp=o+ZtT+@i3B z08fM@&s=^0OlDN8C7NrIV)tHN@k(btrvS=hU;f^XtyY9ut0iGguY>N^z5G-_QRcbC zY1in&LcJK1Gy{kQR-+*eQxf|JW=##h%gG)PkfBE#!`!l9VMx=a#}oEB`ankvFMAzGI$+YZtR5 z1#tsKLDn{?6SAY-0$IOK4t{yC)-@xeTjmW*n{|re;5Zj0I?(*cntWv<9!m=Xzc)thU&Kd>|ZN$$^G_#)x z2%^6f(ME|_JBHgD=EEJIc0R()U=&0+!(7cWHJKxMo1=D#X9X^ zrn{#b5-y<<3@jpQxz(mDBys9EFS5&gC%No+d9<9`I(p|yOCN8U|MWIe?<88JU1}F$ z65mW}YpxpK(06$&)134EYp_b9?A<36n^XgK?+NsqIxAAw_@(Tp-w?v6(>YT23bWyZ zk~QuSf%CmhEgzU-si-Le?l zi<Y8De#UBk7GH}6lp7u4ZWWW(HWvk6HGK98r>$Lhc4g>ap&DIbg26pN+IKTkJ zj5m%j@9m+o$P$$I!#9sR5R0^V@L^NNGv^d6!c6ZN5bxwax7k%OpKLd_i@oS9R%8#E zOguV^hwbW1dDkx{my`)5g+*i`=fWpHXS6_nmBZR1B?{kB6?K=0PvDypQp`g_ZXmio zBbJ}pvNMlcCGE?=PM>)|nvl5CgjfTi#%PTW40+-&gMw{NEtnF+S~(9qEfgfDG^6G4 z%$l!(mS|w3m6R10{XU%-Ur0t>CjI)`_R)dXqz;6O(d3<7PL>M_R%b8%6DaTC^J;#i1tIdy>{u!xr>XSQX51%i%eA(F-EG&?U3Y(n$kgTebw z*5Ia#73$3pSKF2>3>E&PR7fw#DEU;bDP7H_=iDgSbb#c^bgLQP$1EJqp!V1){_wra zF59?uP;Z@lTi7ryb657UZjutvVVOkT6$~??*6|%Rc<>G0dh(q_OVcx$60m@FQA&sL zfT*O1>pj?j0>2}h+`SRQ%DG!)|FBZo@t$e_g0-S3r>OdqMG>pIeoj+aK^9mNx16!O z7_Y)>4;X8X_QdIEDmGS_z)Zut1ZLLs+{!kZ!>rS_()wo@HKglQ?U-lq6Q26_Rs?#N z)9_e6|54ab35x_OYoog1O$J@^GOgyFR-BQ#au9KSFL3Ku3489qnI6QaKc`JoyDPg^ zDi3~ zFkumPkT5n=3>cI$4y%}(Ae_H+!eb+hL;0W01;%>Oq(0LM7ssp8>O+%V zmDC^L*Fu(}l%Hx*h_ZlbpuhcNVU~)(u3aW~F4l`abNHXu3G!^0jg}1t0wVPvqviVl z*4n&FOdwTl$9Y*C{d+BqOpJPzJ5pqch&V)B+BgSX+A^mM=Ffbslck)9h)zaqElW|< zaiVEi?-|}Ls9(^o<1${kiaD?DOCUBc1Hqg$t(*zUGLFyu_2$jzb$j*Rzwak55Sb3D zBQOlKj)KDu?6F4rqoOEyb=8zc+9NUu8(MTSv6hmf)&w1EUDX6k zGk)E41#Er(#H*^f+!#Vwq1tp~5Jy;xy)BC*M!Oj+eyvuV*3I>G#x6sjNiwB|OZN8e zVIIX=qcZHZj-ZHpGn!_dijxQ5_EF#^i>2B)OK;Sy-yZo$XVzt_j9q-YZSzV?Evk`6 zC$NlaWbZuB)tebCI0f&_rmIw7^GY_1hNtO%zBgBo2-wfycBB z*db(hOg4Om(MRI;=R3R|BOH9z#LTn%#zCSy?Qf!75wuqvVD=eiaCi7r+H5i;9$?zr zyrOR5UhmUEienla;e|Z~zNvROs1xkD`qDKJW_?BGV+Sla;(8$2nW%OS%ret|12;a; z`E{Z#hS)NP5PF$|Ib`}Rv&68%SpPEY{~l=$!$)u*edKO&Lc}y!b&0L0^rp4s%dR#p z&Rb0lAa!89w%6_piY4(I@-_px7>I)K?vD>PO6o&HRX)65xFFC@m1IrI+!QDQ%A{a# zmbl4N{^INwcVhl<1YIW2ERZ#wL3d6g*(vTMETNjPZ5Dw40)3-NdH2n?7Nh+W=A#IV zR8ny_^+GY|#y{SwBT2Yu;d*mFqm>x@DMuwPv#=^Z3b7?G!HP{rQWuX(0hQs6<0%Tf zH6%>VCi5&)-@gLCq!dOCUITlfZFq@J2-eBXEpGiaPsz|N(}t+~!V!agF$|5<%u)YX z0`N<4D`wP>I_3S1LL%z=*o`9$hB_7V#%Yq4Q~rTp<&_YN{g|gU9i(1B_d7l}iL6Zj z-<#a0p5CAQ&F2b+?uXUv#vk+p0=i(Xqbm7R;1_TukEVny;PKIT)s&(PE~Qc3$Q8 z{{+A?Mw{8ajV#H_*i98t&3Qtt5V(x0G8PMp$VJ5>HqoymH+V3RRQXLKocae7bawv$ z`JLyE?M8K>eOH`+aFX=tS_INlAhueE#lj|qEp*GvJLZt|wee$As&+4;0i-1=(S<8g$m3Xb=#BWA0>4=j}1$3D)zaX}Q=oUvOk^ z*G8i{bP{R$f13(&Bv@%4!0}n~d|tu=4$8T7p~mgvKI_8zACF<}1^ z2T!5zg82qwbK-BTWdGH#74|81kL~SQYYrjQ$I2ygzB)uvzS!zyH@kIbvnHcMZ&U$h zq+N1$CZR5Y2qw(GxEM~)!j$edV-jfeN`L)8uvMwk7gw&i;sjR=9}`q>qB;toio7ZJ z;57Za)8J~a)%KinL+9}ShCi>x8hLFcKK94Ew2zwm>sf=WmwJu5!=CvcEMU%wSWcDY{lffr`Ln!Vqu*WB* zm|=gzA%I%wGdVshI$arMJQ*i1FBvfIIxcK?A|vEFs}|1mtY0ERL%Sg*HC&n?!hgiIDq|(#Y)g^T%xRON`#>J+>-SyaWjZJ#@}e8@R;yVcl)vqza?DVx4(E%~O$55{&N zT{2{U;6Y@lG5sg#RM|zLWsf&$9N)6ORZp{rCCAYJIlkI}9_WLpLn|}+b}1IN-Cuz7 ze(Ao9VI*_Wa7V>iyWl>Pe`x1A-zQc2*tLF-w`QUfmv(O5PK<=ZoWR-;gMko_-RA9F z6ERTL6?g*aZkeyS!)4qACG4KV$_#|Ti@ba6!rT1w3amqq9yP}9m1hV$-~9)!hdS<@ zeIWE`dsZg*#2YN;?ZJx;d6rtWudEpbNy9qH+7#Idck6NN2)~$>A|)8W{w5ATfDn^p zrkpo-Ft13BWQ#RlSm97m=}<_U{m?I7ZT*b?p5Yw^?qD%r;u96}`y1p5q8s>CBzb0< z9Yw8l1oLhiP|iF7m3ShOabR`)#w_g%KJ80S+Jee;g`Bi2w;d&Ef5hpPGr?ej?@?in z$+JzNK!N1SYh~M5&#c*Vac+leQN%Wfdw|hY*?CB1`S8dmVer9}RbmWlg`?mWRg-)| zAhh`uWNth_@elmkDC-$xJD&5Fhd<&ky!b?%N*@sfd@>i!!MR{oSpex+KiL0j*K?W) z4*WmucKqiVu>OCKD~>A^AXP=rVaX8PU!DdX&Lx0#=hJwC6B}=J2PcLSRZe!oJZN+D zTED*HJ8`{wvt0(%3_rZIe(CyVblz{zJ}bPW#u_=_wNkl;x&mu{Bw+ zHKu~yN`slvxNvTQ*SQpvx0vKA-Z*$O8ob_+^?LI4!Dz=#ReaG6;8M1N06Fv%b87jH z+)BJ$Uvk0^nbuW}2^EFv;ilA8Z5+$!?0#CEOOec?WMsi3H}Hlh*N`96xq^?}t+n!= zvyd6n;GI!|mX|la=NIbK({<)6IljR};&OBfmBiH;49R6^dP0gKS*D$lF;sKX_VfeVlea2Qyc&L^)p8C zgNS|b8Uo9DzwhC(vVPW3+dGS&-V{dt%WY%BfrEklVMAnbNYKb3bJMd0*y6d!?+lJ` zZ20^QvpPDgXOo5xG0%*-xUUNIri#IvhXS?mk7k1lbRY)+rUasnarW-lk0U%jNLzn% z*QBY5#(V`3Ta6#dsRh_*sT-8!c6F@mZp|t0h!2+tSx*_}41whAjUG@QLb94;Um2bR zcsW%39m?x5CVdXHTRF<&FlIt3f?4Q&hBmTeSu~6a=TZjeQb#O#BW9`C{gGR?TnUF< zTbe9(bsJ;20&PefJqcfM|Erf9&5@pDUhxo^UOWRhF8l2>sOE9;N>BvkXI|V`R1gqa zS`ZM*|5rzl$puo-fR&-nYU+0!!};VqQ#KkEiYba##FZyZV8)16E(G(4`~bK6JzDMuJ)vrJ`JvjUZ&7PE{@R+(v8qop6hX>Zql zN%WhroL_|=H{CBeF7pD@9`kmBgA zeSC`r*~jk4O$2q93WFvgdwft4XhI2j7TuV-`o^qUMpO?bfG(NxfR#+oagb#A@0IM6RYV$cSzvH=jYYHm^E2ky!Yg z;J3EoqNPuCR(a%Uq|t({W+_um%W5&6`ka8$ilj^S($F0X*Vm{fSHpKo8vbXdxw|S+ zBS&wt3{IF`-5HYW62(IfGenbS{{~z9#gEESBE;;kL~OnuV&cw?83V=C?1Kgq#=Cv) zTMbbRFu}Knl4TFi9pC?AHX~h74l`fcBbZ53h?^aTWn3f}zwsx~tsCk6f;P zu&HY5B_812M#a5$B4Eq&;Fc3U=^1^{Zm|c?xncA)Q&yq?<->-oJKf*)Qs*obH+2x(FnH|-x(lQb`R5Gdl?o!$nCx`d<3|6ed7R3raL>;n7=qV4|byO!fh5x{2#Vtq7Z0D+qio4lT zZtn~8C9PmHYw1`~*xzKHu02^SWG?I?(k(4=fz*>Ymd$>U+QAU-qN zClRs5z}Z&%9MUWZW$JT{S8Z=+bI??tHG;snJWo$H^+& zUNV$D&)zckKt*O$0hwAu9522A{34ez&5Mr61!_7-37jyZwKz=e@8~y6NCZ?yv?h&~ z;O7*xraDDhV79j90vUoLd#^G$lBk}3FThNgTWpDQR?JTc6#pY5h07ZBUGbebfCf-#PPfMIelyFl*xiiV+z<%58 zfOFgaKz_9w>IJpXJB^zPK(;wy4FhM`q_)Gn9%l^f|G9BR7HnlACCTXo0aGm@s(30Aqqu%!C zu=BD^+qu+L+c{O&Zjz&EHp#|}udvwCzlK|grM+h)>GIfH?2$nRuus5)iTBo*tJd;` z@@O=aib<`dV=~$<|Dn-@tb-aWUX-?7l0vx3#Sm0TnaVQcw?p5q>0G^SK6y2Tyq9*B zwoT%p?VP@CIl0rZo^&%IkhWbd`t+=mui19oeJ`-4sAZ@;IyTSt*+pu-^;o^%@oZ3D-?IU6-_yavDEcK3xqhA;t&txcIA7Lpf(m5p5b3-cSM zzxkM?Qw~IiFzp6T+m(ed>g}kuEngzy=hEN3UpC{@K}NvgBg0F6ZR*|S63w4@H`|EK zbobi^WwJmyPCJYTDC2KQ?v?X+C}X?7;%-zFLrHq~1tdQkfZMvyg(L}Ynk-&SdM{Oo zHXCPKXKu1Sf|^#-cH6dNiF<4hb}gvkqnP!Ky?Si=w?^qdiJMBR2~_A`$u$B?Q4B@q zGQ=ZYEhcDODOH(TqCDcy3YqxXhe*yqVFiKZ#Ut09D$Lg_V>Iplw)Y7(A)%k&BnThg0n6dv?&X8j#*hafajC7Z=HEJI3)^OAw&F;{~^Y zq+Vq4H6h1GTCfRJ^synHxe^VI{T@^Iu2ABOU_8+7()wBYX`?a>!zPl~Tp~lmT4s6m zS!=UZUxBD}oob`p+w^oP9mTLo_hGr>Uz|4j733cYy!S58UucX(*8P{4tNEJ_3_d#e zpWr}m=kE^>#sn6+=ifksiN)<2pn;d}9h0&rm{2^(h}v^2Q)YM@*U`ghE`TAuOPBQi zq%LMOyUVSGoFiUN;N@;slp~cvl5BE+05_i7K8~rPRyxLbVb~SuvZXpbD>_75_3J}Z z&AlK5SZF_DbJ*;_sH5Nep`U?H0l9kh1r4|~wZW8G33FSfb2v8v8-$UIzYI=alOa#J zbTtOz=ol7sN#XXeuJ(#tH{ zRjBq2r!@tEi){HTj3x|iFJbo%iruQ=6v&DAkW12o60mUVsbkJG>Mv&<^p>0~hUX># z!kuy60#ZSSeQB|ewqlJ&a^CyNOn7uNUAzu0Y_`V@>%6kf&60I;Q+P>~ za$iUy6P8UTgB3d|UA2|qH~S%r6K5;ySM`(U^#9oR(OU`$1E8oXf2a2*JEGYGVf&cR zE{=3SPw~Uo*83OYx2N9vSGO9UYfG2by&tlbXZYzuw{Ld1?lZSu6INZ4eFxt2&;!16 z-dfJy(XuJrOaPqP#$evbf(g~NNq6k}7nEe7>8x3`<%4wDb?_p@jS3A3;jC*LCi4=B zG_+zb)E)9Ek@?=}^T+2-yq+o$BkZylg!hJibRn)U!Zj0?BrvfV?>nfk>BCadh8K({ zEp5gWwj#F^U)ZD3;am5GO}RnhP^BNZPXS-=oc^}0hutWW_t*&s+s*6@73OZD8f;9U z*RDgj-%t-nbu}PW^4KZm>x?y~>gAiq7(+3rjvBKJej@m?(5Z)QaP9<9!$}=zw1myy z-p#s2{t*b3wMe!KGUpXr?%IY?j(X}8py|4sH$0R_Px3~s^dRlWOFoZMF(8MFtm3!c z5}fy!oh(F=pw-G7iPGllNl(x-vy>(i>a4B76GKVarn-lpUDbuYT-&^oU z<}-6qO-a1cx`Q=MP{1M?p2x4yMm|oGQ)($ zjq!wIrfG%WBmT3@uV+b(@t%$P$%MDJy9XOvVI7{0y{}ffn!r-)wxvA^yBAucD|OHE z^iOEy{v4n4m4(L9hbsypf5Zny((kaUAa&`^u$d0+Os)e^>ePMVF!DUO>e{F z{k2%oVQ}-q5mBQMmP7il&BS_>#}GAlIvArt-u!m_gEPh#dwz96gJI>v)R|(rTa>$eL1bgJ0%k?(9B22W?pKIl4Jg~Nmz z8XfqPUPnT9wp!Nqmb86!!hdVpKB-0UHT*rKhH%la=coFZ>F{!;XHQfGIH?e!(trd$ zwK=?;#WRz|F?d9Q(VxHOfByE$c7|tgKw*aiM9kOz^Sk3Q4GIo7)h9X;$EC54iar3|MN{zd%afpw5w%VeU+5Z*&v( zKE!zed9qHQM$jCr+<}>6q5nQTb$>FO1JsWkt5jE_o$e8};a8nInzIdBDwkPYPi~&D zb9&lML^jKp)Uxs`N@~}Qe2E%U3EJ&ds=2dR)%w>xJLAAKw)S4I)d?*9t>BldVm(hr zHR6$#P82}d=O^m>p+P^;Z$$Dv@de}zwJWQK_m2~;;EXewN z2BCeYmQUDbO6su=>uX{KCD>T}=}zlLHDd0__&?%N{o+`F`0^fR(AxJDCl~jGIWo5? ze92r^DAe+qtH;u*_Tx-r{9p|tatXyj5CQ-jtv}#{8rF@SjhqVc>F_6Tn;)6n6;$h- z!|HU6)_V=hwlrtS^(|8?`{(DuyjF&bw*h+-8<6B?hBGh~)ALVWFB9_&XFy|NEfg6E za^1eeIe&B{NbUpKA9L34MqcDR$)dFb-zL!U7GR$=SeScuUh_wxNT5}3cJ58l=%(Jn z-rBT1vgO;*7kA3uv^QekntXOnkEGkMKlz|;(`f3Ax>`-)&$!~SZEx&dOAWrVttb0> zvh6QTyeIZQpZoy+5ARAwxW-LZwLnh(Ws2M^qDz2=prk!IDD)pE#rcnu3ML!b;3r2q zPyu%TrK*wr+n989;<2WqNl8l!+5!Ydn8t9?g0eEu*>hHIoqY7B4jVl>?P1=lZ{f(3 zUROu{DYF_s*brO70dS zl0ut8DZ&a*m8HIdNVI6zag_0dRG4GdN&r-y+~Kf@-G?xRJYR;}4ujJ~cK7+rrH`iB z+Zs$!hH{L%GNzokv_7&_%*4aK2a-c0>Z0_fTCz=IdPTm(ev}Hb|MI`7MpKu#>%!RT zGOb|#BLw-?X-BAK+N*UEkaITY(bk1srnEBHN0d z&I;Z)o}v&~(i-WU9lx}pR*>9uyWHiNhLN6Wk&Qv1>PNJpjA)e1IPF>^==Mq{^kq)jyWrOeTwu>=5YaU_P0AsAr8k=$ zH$EAcZu%hpV9l3Kf0$tpiao4EAV5HB;F9kOag&*Iox6mQH(o|Qbrtr2AA=h~9xwSdLLZ%y*>x!`>`{N{p@S5P zO)8giI0iU=Oie+P8D8e6NmW%{UFw%@Qyq!zl-88UPM^)ixCT*b61_Yg&otyQbkyZ` z<)vuFZK)-yHFTcERO+0cZH}mAK1xdXZAtpoqGGh_0~wK@t$pEYQVz z#6e%6dbg5tl^B8egc=QYo2%R$ZK;BpY%?jY;B`jo`@Htl71vD`;QGcra7=JLLD``7 zte&w}^+yPSTz6>$Tb>f5-JmxIet}50g;DX~f@4&m`K&J%uezgHpazF@813MF=I0K# zwZMQ!N2TFM6P*dqG#jfk&690L3;!75jc%<~g_ims{lPl536&Iqfu>X&EiHF52AM2&|KTUo zuzLyuZ<989r#NL(!cnRx*~oRM&HFnJ9Y%*pISgAxDl;6m%KUcK3v^mXJL#;YWMFz1 z-`HX8`;%UP`^3V=%imqqkg&mmVR@}`RZXLxbeteKFT=5O@;SA>m3s8t+soac=O-qe zyFbg)Fuv6(F6q;awd0e-F@5raumN$c;zC%~n0Ve2NbLtK-K;fG>U34lK6M^kmF2G& zk)+CXHCGJV+R`TaJTDUII#W!$1n|UPNV-@O7D~Fz@>`R_ReWW7RxOA$q>%^ycxMJ{ zLya|cLJt1{jB}#Dmv>5Amjm9yYkc2}!AC;SsYi8?8D_P_j=IC8pE1`VHx7x9&Y7UbCs-fNix$IE)f& z%*I|(DN7W-`;E?;@=zqLbyD}lxSixcliB3HZ@vw-QAo^%`||vsb3-uf$oM7rKjjQ! z%UMFO54nTku*E^iB#-cWEu6NC;DLCj&j^^$5UEdT{OFEj3#K6C$*Tbr{HF)c_Jna} z{{fb&LgA&I(B&i1y_gF?-bpC5s_4bR_7$qQg+$?(H#-03hJ+SCJJDreP^ThC9v|+Y zL7xYW4J)3$g8cX4O`&Md0LpRdCtisn(qdhtr4P#I6Y3L;<-h;i^-Lak#BEluXaz-J zc-7zd!~p@3=L7*EPB!wwOlGV`0-!u~Rxt!mt@yS4aoUc^r&NVy@#p^{^N@45iQwB( zZD`3;6K~D8{Yr}=r($U~Lm#3IRmQc{BCvuBEn#r4$Sj4B{;$qbpT%CTt*?1Mg=ux+ zrF!2xpO+n{>&$;VFHxtvZ%ZbkEvkIeGNZaw@!nqSo|U;=XTDv*uP0PJ!0}7sgW`((})@6D|;$_@JOtNV?UQinTx ztIFKH;{TG~f)b}LZiwDij1ISs;XQmOizh}ZyF2<>!valh>%$~o`Bbj+=@OcRe!LQ{ zao&|tAHAxRSQBKF@f~w801}d?7t+nstsoQ9eJEkygv|7-@#Z^fF4NPknecHhp?`k5 zb9s$SLH7Lm-P65OFu(odEmY4VQJ>T)l6R%p zt7oi3TAoe`M*3QKk1rjtA%oHKnr=3A%1$+qP}nwvCBx=fw7jZDW#& zHL<8*T@Mb*)MG`MPC(T3( zzWE>nM5Vr;lnDjO5Q!V*&kXVrCqE7v;q5S=3hb2ym<356yjKczdIU~QCf=dndN0Ul zTn`g{G({HN-fBP9_`GollfMB3&UPEdUwMBXobdq$wlQy{_|puf6l?z9-dn{(MMl1t>#!4^PHQI=tS9oW1h>2^zPK8$$1QZm<7w zE?^uWHKk+7gOix!LS-B<7_sJ{s6SifWWT<))*iUNGBVA0Y+tq6nOp_-sp<0A3YmXcOt$_R|N!Dpy$8Tl&!JK4!$X+Rv=N{;O^eH`e(TxB0T7Ey@=`!}*?MXO7ij4(cC6BffqHIw#0fzIOcp zV`&|l+1VBo`6B{`Y|~4?83OWVI;{pV;K?wFp@Qr)Mha=Q!eF_ zql$279;UB4mF6P7ZNmc!=#00h?5aI=EvV{n17v0aBLaDVu*>qsO@+yA%^diVx&fq4 z7FFVyGA`vw%gSl5@Rvh;zEI)J_a=lF#uF~|yq=!~_RQ1eNsLpOjr%J+0w!WZ99?@4 zRUo^DPwc~EF;uMpWNl-dUky+-v_$;?m-4`M-_WSJ)?lG_M=unHpaddzRwf#jB1Y76 zf$zMl4c#)w#Ak2lVN*P$?3KALZ$?1Imtup;J;nQn3XY2iH&0m|CFME;;kiwRk*Rtu zPO&R99xaa>T^kK#KVOF667{h4L_q#cy}v4Kd6|7KxUzEc#-0a2y6G%wRB{W| z`DMLFX{dseQ=02*$FgEh#o(Z)UxEMJH%(N|#@#7h1MhVWz! z{ak$Kg90_`mq?;TKB(JFo*Z#$4kW?A0?a>S^Zik)5Ek3_o6@QDV_B@xFPRT>Jt63v z#9*dw|5?~c!ahmoHNIN773Vb~_Ku~%)0N8Z&BzD9FA1>Brd@}NkugZ^Ep`{cznY+$ z%EeAZ>SM&HKFWE0nVt#zSvHl4eXf82F<4#qsB0T3HHd`}!U}NYxALu%XNax>dRi$j z{|rT36BA4}F(ZL$iro%h;c1YX8l9FH6nc^r12c`qJ%bLnaQsx{ZWpa`^}g>isl1g zP;_fFXphQc!Tu8|CcfULKs347U5jEwryPV$y6>RAWB!^Y*dSMqYd@EW@B$aGT*!T* z7)o@o9rOW4_gb+5X+JxI=#ip8R_%S80k8SW9|BX0Mk*I;Z_PwZG813N- zHbUGm(7C8w1NSZB>kG+un`?ctG9ygwtgW54XTnhFBL4U#jCfH>FWd+*Qgu^+7Ik`5 zH1QILxLZ)j5e7Q;VdYBF*Rx{qU8d`d>l(GiZTz^$7uC5Zk7)~QM@48k?bGbhx!Whj zKJ3;gX>!o-MLwe0$Fb?Lu1j{6whN`00%o$kFu(4pi|3MJH=%HHO{~#P#T-(&aKnB< zrWIM8a72XR#v_^?G2|m!*Zo2UjG#qm^|705mj1S=uE!hzZy^)UAq$JKXw8kJm&{tz zaL`*wXiZ^5nV2iL6B5rU`XpiMuGt&rm|MGXvhXSAAm7iJp5*!2}6rEiTKfDF#SJm5pZi6uDl)Hw5wqjheZIM&S6Yz`R}%7Pi*j?SUB zs%f-Hp1u=x_H%~_4bsYG3gw3hLaoJ9sl65Rqt|G0z~{0c7Ya7Hj)iF&%+V}E@Ovc& z_(zJjEXC(pGj9X)~rpsbY+w;T?^&b)D_ zFclEt83QqG>rmA%@%183yfvlyKede_-+60fa`U6VWQiAddCu=K zg=SoKEkpTaxPFCzm76Z34$J^fZF%CR`aK$?0hF~|*Vgc3FI$v$(7z?p zjen`&!$VhVlseS9!#Q4^+DO&?iWTQ}&cJSoF{GgGs@eEUBv@=xb8WQ}>49g;>degb zw7AjB=EG}|c9ECb75z!runjX|SA#HEZL0igt2;BJ6PfQu?};YuCVFY$vM>OmX4;3j zkRf~tyldY*9Z*>hPQS!Nkkj)$X67qBs%?d0ZJ`o&5xQ&Ip%I0p$9+ok zr%pnEbk9MC_?PBU*PllR0WlI^9H2GWl2{lKeZ**|GWD{3kW+@xc=#;2Sp#xy1P7vBw!rp(x~(G;ODqCAiC(A7kY4-Js!=t_6!t zM96+;YwCG1RIG^KMD%_P6>fyooYx0_;7EHu-h|01zGQZ*C5%@bEiK&`L-Xtx!52|L zF9|Dcq@KE2v^>mPgRP>SJ4q34r1!~6E^*6NUjWK?L?FU-?bTV*J#SgtTyQJxV!z1^ z=?XgjzKPxAViu9bAr2*wRlJ;#^YWN?#`&Z#8t2olG~PMbB-D%wbX0Db7z$(cd5y#* z5y$+XPQ;wE_zEA$gNs)OFI9}H@oq|wSCM|yuBcAS$@GFg!oFP4i?{R$B_554HjJ*B z`2}!rV1sMJ@Y?I^dx=l?(`g#kXS;oJCQb~eEHBR{(8@e&nLY-A((cE(t1rrN zm=HWf>#8(*IWUp_N9j`|0@bN8lUZ9!S)kkuPNgd77RF}m0X{~h(q%F)^)XTYK{Wbx z{sV2-kN0$ZY0_*+Bm zl55$t3`?zTVI6BOy!lNbCNf%F#1}l=rl#DkEB`ZX5aTuW5kqw?D>{lZu6ygiqcwOQ zE*m0Db$-;-gOaWjN3%|7W4z7St3)gRjJ;R%`|+j6ib@s7r8%ZldCrI4#7pf@Rw)47 z8{70U)E#Da@X43CV=VeHq{-AZJwBdyM;)bbJUr6f?=dGjYMk7M4iWmS&Zh@uvLMA9tsyBdMlkQwrm41CFa)p9eB3-#H z?h|txb4$vWJ=rVsY^`8jMNk|KN)5;df-$-K`q!goZx|i9J?CN`4r;JSge$Ae7h(9R zlVZ&42`HCDYrtdu2tD*2UemJ+#jvA4fe}QYGHA~1l^`!^sRTj&{ z|#4F)+%Y6_z=e+^ss17tLZ!#Uutbq1{W-^8m+Nb>uV^=CsAFgo5(M;_!O1Hm{atl3I-N>kDXv{2KE1 zyAW1C=G~lKv1yFNjiCj(+q+|WL8X73=45tc3tY`Xvw#^Dk$b)rur@!2bgC;KD3J^ID zG~T7G7$BLYNn3~GxC1O)uQapRl|&obXFf@n#34FXK-e?XkK$h!#djuE7S>mqPLtqZ z*Dmz;%#o4C!DH<)*(bKOTZs=pOs4~D+Y`{fUKw=;L!C->h6;hKZIK9yM>hSUTaapOtgn6Y zUr0)4q#usk#t%=<%^F;wPxlY+buu5jBcWQq)KJCZk+Ew1LgyHdNmCIsy|Slj+Ll;v z$qGn#>hLoFfGI-Jj-qY4^BMhb>AhLeqxh6`iNLq|7dc*K8((y8r zs^(cPW>x_Qp$MoVOKg_Pv)vj>DIHufIf=X{$8Y}*$`<09GZ6$|!Kp2v(4xSYhKx>k z1Kx}l&j;00Y(HAvwt2MF+`LzX$d8mDwg>OEuP8-| zZoYLdOg>C{VX1q;?bD+pT*Oa^+7;&pgKuuqQ8y_myutFC(np zj48I}aRV+jtfk$>O&3vZ9r23NJt_94rxRKrfv2d-eZ2ZzvHqB5O^kL{+q^G{t_6#% zeo-?5JTLm*j%T85U`#eo28rUOtyub~pa*!`jWxH8epQ`8QuMKglT3nQ`ivlJN8LHM z0W;&Vk=CzB1?rtgSM3YK(9*_9@p4GP9kM1Ig@8h{cwc?nwS?-hLKtog7T6;FpeaE@ zQ9*pu9uPR1aJY0*kNOaNh-)FlE54^ksVD%|!l5I@lo3S~JjiLN4APbO_Oi2u>V@w0 zGg#%-BZv=lSm z06?zxL%4AzSn$W(_mk~HvJoAz7aEu@4A(d5iXTCQ4d@@!t02~*Vp(xcc}D|Z;FEZb zq-Vwzu$<;{JkR4pAWe()hw~vekzhM%!};?P)%?0jiZ5U;_{6%9O%E8BzIvIS2%1L{ zATR#R#w-##M&&!kRp9fQqQHeAk{do8rvpg#fD{>rwKJ2h_aY>|A?+Pw@)3fx zWc#`Mg2si`URmQGksFEXPe`*ol*orX)+V8Eno)m1=Va#vx7FIxMYq1TDO53r>kN=3 zB&WSS7*$Wug8E9~ybpoQWFjs!X9{Olhm*_>&eVhwVU+M_i^FHQyj)gVC%*PwUsm7h zlmE3icMMXez8aj4Uej}~;Sqt@QQu~b#!z76`J6S6q@|$3GEXPt%6}?7CJ<)n=-;UMiS0-)lp@hEd;A=(J>5nrC$F0wycd;J*UVVf+A4*rv?bhOr%L zx;&>^tM|H0S~kC`Qi%o1269k4BKv*-~Ovy@|sg~O>oTk7AdWR-jt>XAVaV1yM({;bW7~c4Fx<=L8(lPu0K`~^k zP(3R=N~7&YS@x?+39JUR3>~cprCU|AtQ=7L=Uk&FX%^O%8w@X~b=TX}duLQd5U^U;)cl4m3@{4 zkuz^_&g;|WWbSz;$6`lEQ3?Bz=-P0o>#b4!6Ea81u;%&C=+H-xZcdLrnj$VCSk+xI zPSr_Dm2!N8>0RJ1GoPATro2z`?cJHW-1q#+a|$oP40?d@Yzcik*ofkOUQ5$NJ*=%P zK%WKheP-Edk(O^0<~z~wQC1O2=t>mQc9PqeUFsv0O||`4?d)NsIzM9|Lcm@*C8QFD zE92qZMf&fw8GdUs$+8k07WdKqdEtIseNX}Dh44zc9v|oqA8gEP$LwJ%@WjSbsay5W%R?173^hLb2{`BOgV(k75`JR|e7U4|~L+mJ71xtz^|yj6N3 zKI$4hwADr`Esk*A&YWlEeUo;}ilTI?=CdCD*^Eq5eIrC|OIEpl!tk~mRqq?W1MxO= zT-SX&)w2eJ!3|hzPbJY>KKw9{-f#}zvA{2mr@0p4ZU9kAxWU&av&W7Lk z_y=En#~H{N@J2F5+Q;kt6uv?=KD_!dfHU;N=P4q}DaKnU%qg5T%qjAkQ0s#UdD~oi z+v*e&l{w-X91DOmAWzy&Fp#M8XOzqc^|~+4C}|Q{ZG&sO)v95L4j{4MRAgnd_{o8( z-nScjhYn;{uaSpWzpGhv>!?}|AAUYRmjq4DI=fZm)l6?uvkfM&E^`6R!!=}Q)cuxz z*i;8|(kUS9WkdIE_3JM>T-U~0hO8LYI&GankCIhh_zv~DwoiRY#PXWkzcKUI7#8DHu=(ozVr z=i}8TB-1-B#+IwiN|`2CULcZHNEJh!Ju)!txHW4UwLFzOjmgXu8GlAhb?%d2;qM;! z{SG;0IKL+=EXzp;g$%oGs+yXZa;cPYG;AE4^C(}*i+&5W%m=tj*1=`Q_IQ~KOXM@g zh&9LGHrv+&B?vkfs<2e`@VvAz7E|RXO7+wfrX^O4dFgivBT9voC_V{AsK%{$Slj0|Cp3j9aSbF58I#jRL*ABYnEJ*gK!3GYv6?2a4$L2mDIA>!D9y1ZJ z-PdVox@E$9YidVU#Rhl+>2}e*B?fo}$o4d0ZQc|HGzBPkWvApaN6_7Wdv#`9yLD5E zO67O<8PVA2Gh$0Q-XFOrD0#mN-^5gfp(E=wIt^n8BLF~l6w?9XHP`_tf^L>!) zC8B){UAkss?o2A?W8PT70{V?9-w<=qw)(aq@A**Z4|vkFhC3JTIVOs2!;L;z>oV zX9Utkz}N*H?VA-lpVN+$(7a=ka>8)N28yoeqX^Jt(*Tv$C;ml6yfDN2fFfU@Gxp`% zI#1$T0o5T_QmvaZ7R=7+`{`=iWO%z~d;APB{;n2wbB*LrGOys(Wey+;gYSGuV{Ml! zOS(gc;f)sI_l~A^$CI{pPQDG#xyhhD?6mj}PS2lU{5SKCYtI)SzBK6$gc(lY4IHUf z4jlmd%bR1Z`=_zAfIWtN9>H{_MfB-JA%VDWDA%mnEu^A%iC3A4WCNRt2Qb_sFERIt z*$DB83-;me{`VINKS+nrz2>o$x5BRwN1sB>k1B3x;z#EaXgX=`sck5KW$&^ofFul= zLP+n4I8an1-wbrefi8w>5*)A=MravTd$w0s91g#l`tsvc7N#2a>uGtC(QO zpoDD%&4$RrxXaq`#@G!K6{{p}%VN%h3t2~et-S%oxO6M#g0Q@Rg$%zu0>mf(L7oBt zDGRK}O@s$pPMtdEg1lVqsvt(5c{{ge#li!Y!necl%bBlHAO$b_V!Isit|JI(LdaQF zA|6RB3A`QrBfUY4sQFt7V(&M_0SRD4S&C}S!Hfv?Pq0h#djQIg2M`y_ zQesg4c^DMN5E4np@bI=_ev8xDcE^0w(o0q~a6xOzL%X3TBh} zam(7^Km>WD7mJiolv}c4n|=B<@qj#rjssux2^-!ddxx>66mt#klHjU*pI>|rPLVTk-OVxlPO=%sq@V`D4YP(Rq&x0 z0v%Zd_r^7*rMT}X76=opBG0m^rpSjFMFiPh%iAJzi4`{p!!SD}T6tzEC(f)`1)*hx z0{~Q1m-yW|{h`o1fezEX8EP^JnrAq%8}9kmtf)9H%U;DT&W2nva}6ma#j@7KLGi~& zkY2g|{Nf$u#ZRGOe9vi6|1qNYMG$|Y@DV7~hNl$|>_SI`|;@ZpB z)Yq&{gsAUtY}=1LkG+5RdmpzRFU*w%pHPB0#j2vTquLh}wdH6AY9zY##9$KuGAPd2 z>PF;yErH!iLuZr(Blr}lyYXmPJ5f>GvN}=Z78E|*fUT*5lI|O#kM3}tf0 zbFRIHCg)nrXojcfY8D%Gt0b7kl~&4IO2Jkg)F}{@@LMJWp0wcSHqquOz>Mir%-6Fu zv0k?=kb`ZNd?zN^`HwZl8uy%L)X5&kz=Nlx*CXONUVMaK=L=K`lh%cbpO?3vU$b5F zoIa@9#GHDysjaP^Nc@G%$P${vJ1?J)AuDx@xO~z&W@~AA+f6owoVl;7K@Q5?QXM|J z19}9Sa;3v!L`rdhL)S$kU@>JJC#LFDc1?q`9>3J80gt`S4l2N7zc8pJ{&^=u?3}M~ zgsnNg&p*#MmqCBEj&gZxYAMrJB8|0`bFOYQbtuWqy4y4Aysad|Oxlwt=p8a4U0Q*% zwLw~z_f@XVR(5)W%ETf#ZL7!*4~=B5)mEFygD|R!mKsdRO|7I4z-^Epdl*qY)MjV1 zI0qdc7Bn2MXvC|RJeTJE{mkH9FD0{@EsZ^_7KvINcah2o^@bAFxV-YfUOx5-4$@7G zlQCdT=QHhwWvG&+G2Pl9%u=N2Ntcl>P5 z1E`>-CJ6Uhhf{6~(1G4nkAsboN{d8d6Z=LAxnwLy3K=j3{)f!x$_6g{C)RqEa`G%Z zjsJ|P>TQE{u2b$Y>7ZqyHk<20t>nUK- z;wQ_VP1v@I)07Hw6gH=O|UjlM7b=-Xxv+vWN0S)A15A(e4L z_mkd8P+uzT0d@#3xZC|+lK#pgpQ{&fcTb=;ab0*KkttdhZ%LHMdsMi>W-UHw?=ifz z`=bmu=$2YtS;?~DOdT?oawEzParzc-al;4VdURsa#cOzhGaJSStoA#`Z2Q_%m4!$g zb@;Ev7|Md;E>E0+gHha*PmF=m+LUF{A22 z2L&?6;rw+Q=e7Mzgn$XYa;=0v1(k*)@S21}q_}PSC|Ub69NJfhb%696>^IGkZ5}7I zOtc#>+&_K7l5g@O-)~Ce{_N1ADo<)yfiZ@WsnVoF7O0RF_GlyPL89lbOpWgdJrw5g zo~Gh00!BDFiI!6GM~ufBSKv{{zN6pnq2+Ph+q{D10x#So?Nm)=;oH~lLZ;57mVmMN z&-%7yUTb=4y$g2E7d)Gw5N2(fi*a`3(a;yUM16lmRy~`#^@Xw zW#jp)D3~YC2dZlI`~ z7qW~=huPW8cIp`zV@I|bI;XKs6lz&QYnfvcK6Iet}7TPqK4(mv?v3g~ndHVx`L*`GOOUA9Oi*X1kLkkytv zDE;V6{}`x$P}AGq(Sx?>nQU<^^k}o|0i>)5)_X*)^wfLMgZcL?2=sB+axUb_n?t^b z5e}iqUY2W8%h^CJ<%h8N!$}SniMU|(s?*@k6m!7ev_n1`ysU*N;*>YoI}JoZ8b%26 z_Q6JBHBfSZ{}I%2g|iq09rwb6kBAjd)*aJLEiknx@+TZlPk_S<)(o4E@vZed1=xN{ zwdPaOFD;576X;htV>?`<9{SV7!hspd^u;O_vn{!z1*_c2YH$KMrEi?wCK<3IiAa>N zmL+PkhB4W7%v8Zz1f~j^Vy&hMx5^n?Y_#>7t=5_g6}w`}GRGyh6PptQtq6 ze;~To_HiD(!7&W!F|?vN2+BGPx!Mmv*_U&yg{azxN87nTx9%DlMDDleJM+O-5gyM4 zQ`6}3u8@lHMdGCZiagMci%bx{S`q;Ivt7(Eb*WWDiz{GDGiMAWlB3Xw06$RDh~1Q= z5Efz{my%J~We_=4Iw;_Z-P? zo|y&16$jm$bNsStJM~WhXRID6Hcyb8?Lt-a;u`(tqyjUCEjvq<)V(6}+~D zbGD8iwr$_&i=cIW`#$~Cc;FSDJF$Z+&eUy>NJ?*WsI!rdyp8)Q`L| z(x0O&O04-Jl)Qscb{B>nVK99nYYS+FOA~WS`4^)c7inYX;212%OaKtOC}k(r(cn4> z`X;bBhNsFHxPVnFo7zSTSG;%ca3-W^x4z-Vy)SZe1;$PHZ>fdJe-W{)5zkD#j( z%mO6tB9NArhn#?xUVyZ!-WmVaEsdOB0<&OD6Usv_;%In>nZDFks552Ek(d}_Qa|UH zbF_iFQHLSnbH3+@Tt-A*eZ1V0n{%$F80B6h=5I>jlVV~wK$s{V12rkNw&R)a1#pR8 z%lZM1e$k7^5dmKS%i;3HBurkNuEj!D@;&CUK^gkDUT@ec^1#6Zyl>C@fe`<e1f=9shLYzW(7eF^jtF~B`agPh%;%V3GeZCCm^+68dYofH{?!QsCVe``MgKo1 z6~R9uO#ckuDe)J`c|l6>ALX6R&%3hw%r*)C145Gi3$l_T`g=$JNb&pwl#%-cl6|W3 zKmo^oqX4ll@xX8mfusgBK>bTPFe-~rlMJZx1px?si~=0~^vYQScP}l$h-`tfR~BG5 zcEGP!0$`-}z{@L1FungY1i(N$T%heW3c)`Fsefj*bOt&)i2(DDP=L=aCm z0p|lTfdsAue@M&@Z zzuwY;^@IZZL&$-DK25I7&t5{H%$*1rRo1782`spi17j=%vKBA{@$TusZi<1T4_H8h zdm@7WN4Wt3A^Yz|eYT~+>m{Ec0$|fU8<k~{XdsT@Xx;Se`3gMKYLNpE|Wq{rB@`RXuCYxyBgl z><%p92CU(j0Q~gDra$G3KpD{EZeUQZBHl%z6J<&bf!0?3ajZ)Xo&2Z2)ZjvNlVVH4 zA0mH9Yd}0y*7T$NE-Th$&M|mRwGA8f``7f$FQ+~pJ~qF=udjOyVWM<$c2Z3xvHCE| z5%Q766A7Vf7kKAwtZWh({9$|~Zb@?QJLQltDf|SUF>KpeEnC5j=>;HZCC;ASZX)X! zs@%!SMp$1fgc(SkVTOiMiZ|4 z5jHQL1+#xl5IU+B z6H#S>cAV^J_19u!WRL+*$Hm3M`|;R)I!_uSJe_tz@%^bS4mz=?gzMzk;X=)s-(-V7 zgWfrw!_gx8LZKe}!1UA%TGK6FM0d?AwuQAa`q74=`3%MDSPTHc^1m(4I;=!W$vnt> zGJ$M{zf#m1X1TIh#>;4V%x}Yg@JglLQHu9GyiGW~6BgmI6L%XOo~(_08hU^g6Yf;N2|X_dj6K;D8&9t0{p%lPCJP$?BYe>z z<1D`Nuc^95(GVaDu0E$TYJN(8ja~T|>j{(z#UUiQa=ITnO_b>ibW5=1gUXPo` zzh2wLK<+&!nXf!ZeQW3M3sX`n5edG}g`Cs%`H#TGI_u*IId`T7r6kYg7O&+?xNxB% z3|OhB{Xiu@EM04RbY9LFTuvw^xuP`l+7dE9{UMA2T@_%D1ZUXe-m9%HN-y#a8lM6F@&_ZPxMV8lEOia670ShaHsp1a=mL+Ti*p9DT48nWVl*TWE>a#m&x|)f^OFr zqqreScC}o{i3#;wiWm(oU1I(8GmCl7lDJ3kdbX~({nYHiDXRBlkJphO51Ku?iX87JRU^YGBHCrydn4*4YhczR9Nz7~sIA+IgYF`h~6ZAji%Tqp2MsCx0_bE0> zvAv4JkHR4*i7a}jx$w{JH)_`MXZ$QnDs*aj%5c~kXmYKIF#2B2+ZL^8xI_&q66kt0v7lFvQ^T~kcQUa)|oFNh>dGRbZWn$ zHInpr6%DTg;ZpvN{LXgN(|_~#Y4!D*&ghxhQSi&hDu@LY$guGhJ3~XMS3_7<|$Hyir zfk89c-k5)AK^H!bo(gmfL@_cJswK3D?3rNFO5%YHm3FvJ$uH>QN5g`$L{?v zyHIrfHD55Fs0Z1uDN$ebaA0XZj{_|;FQh;}uIlWrvSbbB~ zi`G}R8oRPpx3wypk7s!0rc%?Oy{V+vJTszq#@TL3@6!W8s%N<RpP?gS`!f@4AxMZbGib$tfc2}#W%7sVn z%2FP2F<^k8QX+Dt+zQ8&+sF*RG80m(>-iPsup%FyfCIVHdJ%)@(9|lBQ=ul$<-S!3NM zK43(ntb$6&5dkru$Qci9-SHmWAUA6I)sGQr2-3-@l~1)1w=4*e@ zAq$TupiyE-lvZP#ZCEe0%=Xy9`0qBaT;B*`tD>X=`{&RCWkHqZnnOfPE%T1Nk4L+P z`%hyPV(c4;K~AVU9DB3pEytRk;H72V2Egx_{gD@y_9Qi1Bh6apGUQ?ZPM#q3x{%Q; zykDqC#_k)=JLCO3rfWo|hE%k78M#%T9vyWwM>Ft6oB?WhtEF4PPiR(_{)^1N(c2X1 z>&E70n2$XV)5@MO!2X9w`dBwPUK!icIQ3>kbCIqrYXp*Wqs>1i=f}mGYcbj}G{7Dy zAg7V&k6-ZDh@3M~pcpY(oOHk08b%aT^!jadPefl$)N95VB{%6Agsj_EE7Vn zsn&8&A}v&jjcV?O&XqXA&QVH31xWAhO}I+q2RD--2RF|uKa|id&JbL0ka&F#F?Szu z$9K{~#q+cdoZye+XW&1LoU_((8(Hl(HU>T07)k{78Al8~kjOrCkiQ+lAFLqGL#q{n zi0Ah}E<#v2V-@Ak{UMu-oVWQBP5y@X-v)5&aEmGj3IYjo0}cWrnPP%LkP;*dnF2<` z1bk{&=v6{g6+x5A_L~f#7qE<&?*?Bkok&k} zcN7pXYom~I`P@#n-EMetKLhWM>4I==aWXgNj76Ae_*bUM(D--_*i|@HSX3;exk~6l zDaDGkdCjHUdV-C$&!x3`2=gDqc>f4Q0<5p`>nC$0TB`Yn=B(aS0TFSS&k|ez!Y`(U z^P(LKO8D%3sL1NP|Ik2IUv-JL;$Odqz#6*qbF@T8BjKAo6WE|Vg>{4N{A1ASQ{Hl; zzJRwB;$Ot(8=YejI&K@@DI_4dXwFj2vF%YI7Vt8<$oe5)Z&zYZoDh$Vy=vb51Gwo2 zMx`20<#u)-<0XVD<}GC%&=SOM^()^!u6piF5=`EW7T{wHc-(!M*ADQ2Y)gFU@vmcT zGfn4|3RVNBnzw_}l_glVD^HK4aQHf%jc^AOBu=qwFIu>1Z5EL}!S_Aj3DuAMr^zv` z1iaqEj;VJ1-emAPVOJh%m(cJzfZ-(BpEydBZQ@2K&}p)SC8_Z^OJQQ2e`>xsSvEmk zHkEJUUlbQiUu%5G&UuXQ>YUpql2PnF#iYGV}A1iLX0^|}&^0i>drOvAE76fd%*kVw zX-Nv3lNzX}%wvC0EWp_QG8V^)z9ywPRUfT72mduX7%+yjjsvbPF5x_gvH}h!wf{?H zTt^`APUsf@8xl#Xr@hKo4wrX7#c0>hV{d2oX7~O2;_Dg7N)Tcp!Ubo#K|vC|KfS>~ zlBUHKD7ySZGA9-Sl^dBm!%J+!3@SFnh_i0i9t%tE!+{>G^8;>p<}oOicjMzsT6(f# z%o^M;vqMXgj4<^M?<2h(pgLsy$m1f6{(~gHsTFLR#QRt}DCx4}W*yxxkCg8vSu!g->6+C0q;cyzN>^2A?5w~WyH6<7?cq0019=-7~0nNf2?ZnPI7UBUo2X#NKq9DZi(W3B0P-)!sXICls6_)zo zdgYO=8L#aSg}Ql*DAfF?rZyNI#O-7{C7UQLxf!q0o^ip-{+8LR_Lwg{>3;K7W`QvP zgPmJCJG#T{+n&M2|JcN9xm8Dlvo`lL{=tOt)`I6cA~rvkM0lP)?fi}>SE(}9)R%j* zX&c=8!E%I%3$F2xav7H+p#FZrNNqcKs3`20eHOu!u&p$gL9pIM`B1lgSz(+tPJo8m zD$ES&*vqw}12^}MeSElOx4;`=hCYfmU?^mk(+uVA75dj)NmaN1((uNaoafgHPAMzX zF|`|mmvTE7RA~{s-@ZJcD3edKh}a}L#D1=>F1x-WgK^r$K*0|N z*z{tJ!f7BpB&|baka7eZm+?xG7iR4y>Ow?a3w%pK=C{_To@#Bi$N5TFDPNUMXI1sp zn#Qd9^5mAhmKvuI*Ud)h_+)ecfz#z~AOzDv(7VrAlWq-I4slDNx=)5CCS9Wt{yCBny z#;S_r&)WnQg3xfsUaI)dGj? z@H{H^c92>dNv;UtL-{EKhd(w!gZZy%5psUBWx;jsoARh25EB%%i^2 z#nnCv!IaG$oSkbGH|VDX4{#jRnt3a;KfD&2S0%29zZZqg8Im%|b2-HvilV!uq*!g@ zEODVd^d_Cx+-!_EYd_pz0sCA}xQ=AKtnRHY`%f5s4I|`SSO&s%0xOw|sblvzuelZm zj1`{OTQ%0GT|00`-uyNUXyrRkuF^fDs*5GP2^K>09B>(<+prqh;-vSVHIpOk0WilS zoTlcky}U}?24E$^xGVU9$%!({Irkz+OOYZ<n%HBptG>=$c;rjV14YBBe%*DsL+45wzFIEma4SXR|AGy;;9Yxzy;w2NYTu2WO#| zr3o^ruf%=Q1I5!8d)R3ei^+X4OFzp|aK&_5OyKve53x(Em$69~A;js0j?Z2w;$nz@ z9AKnIWhm1in)P{O02~L?;o>q~>+0TP?`Z^tX{yfDZ7A%x1uH@WNXFt@~{mW}CUBduKaZ{-&j7k9XW?KXp7 zTRIf~@YmhgSmTZ-A7b@Ctga|3$2R$EmA{_*ZjhMP3I*Qj>84xlJCMN>&zaw8nd1C|}Y!i{;(DhwG3aHmzL9Q^pd&Pf2(VbirC@PKuF~A+EXi8f`@g1z~b&+`y zTx?ZOpZpM8-u1JNQWmjN6Ji-eUMD)JsEKes4PS514ecrLC_3hs{e-dwu!pR}Vkmzb zNj#h*(|y10A85Yy<*aH+QtueV27Md3+?^zTkp1uAtQPojP?B=ZDgziOEgPece_P@0 ztYP5L{;Zc5--K%lhK9B+dODXSr=^TCteKyw+BR z?GaB1ROf)&i^1mg8Rp^D5G0&K)O54bMG$PtxpZ@bd1u{p_;1RxhLzfe-B4>PApzxw z7iKx%w-W`e4f5+8%Z0N{F=T{&$!C{>N9W>l*A_8Cj2h2Kd;>t@`C#CN9_96%h1f>=)L6v09Cmluf&8dZe&(31MBhp=EM;G&&IS)pT+P^yaLR3Aj7SFg zx6$|yDI-ot=psOl3FFqwfMRk_{z)di_ut5VCA+7a(i{D^xb$IBWNI4EvG`!W zbux^*!(}@jXAZAIa}b@PM7#Mv^apggmNQ8&u7g;GMUXJU#gTuSE3L1E3&R7eaqT31}tObr!fms}D< zk8B0U_2_g5)>upemHAbOdX5?WR+HmA*Zu6)RiR9Zh@a0(uFJ24r-=IR1&OB?(``L` z@JLi4`-Ar>7LXRJl`2gzXB*ZWbYkd$h;X`}3Rj)XQ zAMd!IFC-9F_!K5Znz?|XJXZNnIR}kx3v8skhevzA_~LZGh2x}x!ScF0-K#-7rCU~~ zmYIHe&CZ-Exm?`2YK>)&WjCL$(JZrVIi5zn@8d7RcFqd}TY%~W7h#Ns?6Gs@ObmCZ z;Fl9|Rw|lO9y2;_(GTWdB-PSCnQLXpy5TGv>Y;Jex}kyl`H(r)Uls+8EaV&95fd3j z*tv!O_!o9%;*ebo2O8#kq}#+LVlT0%i4b2&(V?b2Z^aRPNIQPYp<8vtqU2ja1vsb= zzQi)C{9ByrBXPP%tQ4roSxQEk;(sHI5*XnOPY(U*XX;~RP@Oo`gg%`gbwl4^N2R4*d7&#i6agknUz&v6k!GgWH z#7<@l1&9y|V+#C17Pa5pKVFd^d(wuW$VtO!Fh3nI=XNb{@)-E}?-edcB9+3NnXE9s z|Bac>R51iZV+d516jOp;M%s-pj*3*1+h1cu4aJUh4ab*L9@u*1!byg(ND!gsgMu8c zt+K)6tNq)z-?#Y8a1XDU+vRw5RyTPyLGyAWpFq;>ca#%v;F&GeRs9}6O{`_Vwu>a6FN={o#)u-E1Wi~x4(^x zS$?FDBxdkT*p!D=V=jmArQd{~{fL;J@g^O57uL~-;~~21%pc4!0Wn|@r4I165%mUs z>51VcB?A2xi+Q45;z^#se4f}Qy6{=0bUHn;oY5v5@%G!i`#5eBlR1*3Dg9*OTv6+M%@_3bKR*{SqOA z6bcYxUBkjcnpuGT;bg;feCxZuO(01$N_A@_4UVed4?;A>-OT{qB2y@1Wo2pA_iAam zB?JIpkj#-*0oXy6DVb|YqAHoCasp02i1Q!JX0uoMg(q7lv z?a%#xop0B(_4HQ7{#h7B^dtCU*Ze;4pFO&*!^~QF`K6DtUm?q&-BC^2z ze^wj%m!;=c=`<#-s76bOc46s+sxUMSN#cJRWmV=%;;935PE*Ha@(#nDQE&H_>vz`jQ?qT6W;0)JIz|F->;Oo;DS&&4{skDh?BqJ6A1VS^f`po2UVT4bo z!rDqhLE(S)S-Sz>wy`qoC;?>a`4yl8KkTv9n%9Qp#qiy^;X%!&`kXzqiPFb#=%|YD zd=*5}9f1BjZwoqL%R!@em~200;Q=Q$`$9Kx6-C4t#j*DKm7)1KMqr#ZC*A?|Nx8$X zX_IXqDm}lyOEp}?P7;M9mu3ZNq>-6mzikFv=WG_;&V4MVDvjcuaA5R_Gzvhz^b3^c ze!7H*$$=jjdMxgE3dNa@S;Xd&Pm<^bm_J3Ewq?u{F3c4m6PutNr z@~LsvkBst-*nC_D%xr=cFb_PLZFtMaI#q4drjJ;xUNOx)|5jR{aG`IBgk;50Tf-#K(u+^81DSJcS8sk~@+(8yQjpemR)cu*+-Q7S%l@hIHA(s{@i zkO*&Bo;tH^q@sak>IV|~J9%+y9>?Dl4ENkgdPCffYP0zF9b$R1gs1LH z8|FqP4c@D4dhByM*WA@%S`%efa`^?bi#PCKx&7A3@igY<{F@9-lIdO$7FuxGaX+v= z&^jV%erq`k4V~Q45jQP&D0=?7r$J{C-3<$~g0#*imBs!>{9j&c;K%SGQf9?v0sjt# zlW}C1&_#@C%iw4{shhFnc-!2h(X*D5~|36vc)0+fY`^!yhGrvESYUjKft@ z7CvAd=Ou3$X3UHvvP(==D~Hwz4c6?g^v1QMs5l`BOL|DR*N;&UW*p1)=#lhzQl;BP zcEWd`f}CPSy8723iY6$}sAZuDHRTt_PPtq5j7_)qFC53UM7SdpVy4kPAd72$$q)7j z{iqgScZ1?`1?z#|>7tlZP>5{h3reBEZ!jFU^NfExxh5vXr|O&U($DDwgaUdG~qA36Crxh1TwmnUc-TN(rA6x3tl6m2jvIo0qAJM^V}!ymq( zmSkl*O2jY$^5W1pzsuNntU-NI~R50T|8fP2Ajab$pD~S3AE0CTF%M zXCXw12dJkfNH;^NQHF3aIb=a`!G}o|lXJ``n9(dLMYk(LJSs=mYC}9|YRlSeAvl6m z&h0K#?W)@ZYx^{fwx0dvv}zqNbl&)$=j1JuW1>FIu6dq+-T0sA0VjN3hJs&@CLnCb zmG~`(fYSM$)xVdRcwhg5eK7(@|ANE%7wMDRJ@yZSVIkK$O2M_lLo@;&?xKA)f?*eS ztZ`?4tas-Sq+rS-vq*Cv3cYb^7n_4M7EOM`#g%R?0ax_!x?(xkUek&slXDjRxY%1+ zLW`s%!^w5?)OeehAiim91z30V1F-s76FRe1!0eaqzFLABdZ-%4-rYHi$fQkePG-z7 zYZMax`bd4Ts^YSFQ~V~YL`r40{4$G{;<^gOGKNJVr35eL60B-XvF@z8Y!qcFZ#r#+ z(LRUboh5A#tJsxmgqCI1lf1!PvQCv&<>Y3kHcfLct5gc@YHqb>?n&CK>?4FB zpi{AnWusba#^5t;if^Tqz5plN+{&t$QfjDErp_ldZsA&Y{$DY!MZtqdr*Qg(DxHU+ zj)=)As!ru}xNDNu`RWm^0wX3i$9@Bj0V?c>sii!#rGykeHq82X@u2fX^2FbGVRqyM zaSk1Z%ocKFHoGAfHhj3T(2ShVC~zO(>HN{d4*ZZ2u|1MZZ}{nGN|@bJ^5QVKqjHjB z`z|D9h67rX7rq_?eFf5t#nEA2Q%bLv=3I3Lm8 z&7q&p!#5v@05MdH!5P{)O}4ley=Gm&W3I^_9)bb0lMXdp#&Ed}am2%l3@g#L2HBo9 z3*!cpY9Xa_i1T$YQ&CCFTeJpjEg91CpOOREvL@FF8rJ&zR7?P8LjOy-l+IoQKqTq_FWW(XbgJ_0ZuCP62qIg+oW1|m7OUL-dQIV_$HNpdQde1nsndQV+ znjniOCzZjU6Ze6`)NwB2=;O&;<`O95OY&6?QJ~((jcY9W#d% z*OFqT{zZR{d_Wr%nWUq}r#7HlHE9uYEM_Q3PNjG*haxIY8f3b<-xrpp%N>-Y_HvF{ zj4{)nUO3i(mXoCL$@U5~FHL6DjddH$$|8G+0HwjbUL-Fd4aFU0 ziiglWQ!?t3s^a6tUhqUkVT_fAbdQf0&zZGmwYpTH(3e`VZ`4o3pOiy$^kFVLnswyr z{)w6aC7Qdv;t+AD@~>~k5ssC_t%{>YQ-b%97L$O&eCRG{!+sxdr;Kq+9xlPjBViAB zi?l{-+spym0#|$6T4YHse^NUoH+RcjaUKH3SDPV)xbW9(mMUaYD8c>K%cK*3aMd%% zEhbA-n{(>?_=CQTNPJ9rPUlokwh=w1U|w`PmmOQ`zXTw?kz1C@A}EN4O?#%i0uoiL@5-dMp6++qi)*2x@sOkrM`Rh1x73yb75TNx&OFSFA;} zY1&L|5QjfYWQY)#Adv-5a8NT8al8HtS4~?~7uYWlEW;_aqBI-P(dl`eeIQUoxXYB2 zXicO==u>FnxyIR3xuY}2Vo*^3&A`IDhv?KqF|e9I+?4Td`McVZJ*w3ZqaklvV=v~z zawv$mxPdIN}_w>feJLX(DN#CZMmuH&z`TbHfQVz~E4L({LU`o-XRU2xGm>4+jiun0!`525&!$i#1e6tE`U>|E>#Q!GltK=N2&G)8yz@^T_@#$Gap^J z))%Z+Er_uIJ+qGw(05Y0A8{?7J@nX5REm49-<|2qfz|HOuV%S%EN*gCNOT;i8}>_@ zECBJ}gfKCKFK^@5o6xjp>?5#sAki^x#_X4hMv4>NTcnO(35K5d?3(b;QQH$s+Em&S z9q~=cC#8JMoNFZ2e&rQ-cCXhQpQ^~&zpfOcUa4aJb`xZ@XI1IoL;KR(MAnXq6%O^K zCZIBUZ#nka+Wg3I@9mI>4qs;$%hL$kL3jX%&r0I>kzY1{9ja4|@eVT2?+B;pu)`m| z49Mr!aAB2->>Ec;w#AXz^iYcw+taq3icH@#D-FZ)DFG3eS|PDa`u(?6{|K}+BPX8E zJt_@1#}Gy(BKS#^mMTIe8DicgLQxTXRr1-WV^VfDBa?OJxO@j^<^d#J*zNoyy8)o4 zu<$7;0ZdFH{wp6EyfpuWls(mq;^9Gba`KEom8l;IyJkA^_}K&pgJ#;X{G2Ov26TBp zi^3LF?d?yJ^&!m2Wv30!KjoqxI$Z5GznYL-x^WE5+?s=j+>%{&uAhx_SnhKzNQK0> zAF$jntxxcF?H|Fa4F#}e_JWjRy(IwC%4iJ(ay47~Xe|?U&85D{g@wCGlA6!2cAkaR zitFt~@B23`{BBxqeGs(m9me_;<*;_8cg&xZp`Un zb?)-YhBc9J;5g*+1;WDHl+D8YLT)OSWP9U1pk^Ut-_k9otE;<0HO|#4t{JfHf)Lci zg~jCS{QGd7o5LMvid6wuM`dh5?J}J7EHfq0bT>v;Y3Es3d^)T*%S~46)jLcF!y(I=8sLBBro3@_^ROR znNEG5Oa*t2ptmX&X%mq(xe_2?H#a<6B~~~uj9C_`2%+lrmV|R=2au>d>DrEE7Y!a+ zwITjvF=-2(5@Qc3-??l;_VL~`cM!%Iu04peeAeCLpvPruH*x^3ZX4{RB0qbJZld$9 z_eDT>K6A#r%SWzaD7@q<*w)hdx!-USsQw^}vAKxkKXjVU#_CAj76XwU)%3BONvWPf z6EBZ>A+;4A0oP_NVWoz>8W~(!IGjxx>%U|E@;cWk+~XyUDSXz7PFQoA4OVRa>ME}U zzc~t98#!%Z{GFe)j0oWWVQ(oW48kj~sLJT2_rQz%Bd7U|`Q^>h{?=Z_>GZ2h>^=b7 z##`^?!LyG+nA7hUqaXmH<-)X$0QJWQR_DDY&Fi+Z8NzZfe6u4(V7P4D;01Tf&Zlut z0d~|*P){O9P2Uw+7pW(qJkz^IVwxV(%)SU5Y;`NtkNex>$-w^R_{MQtYH))6-AbJ$ z!(P94!sax5SNVgy36Vt08D#7SeD&4nZNz~pPY{X+MP%YQUKlWa!W)(pvU4AOehim4 zTtVxVHNO+O*nO;$&(~i7W#&m%k7b6pvgG2i~R=eKMD`7b=rRn9~%59w<@$%1*SWpP^%?bXerpY2DO%${w?JteBWwJAWm! zsPH?1#!p%Jyb>tc4c#`BFQ!xc7R*Sjm?~a*@-byt^m&Y$+MWgW1){mZ+ql zu4lNAAi=>n#(FLgN6C0BP;Wh~?h$lCn(`#uJ5i{TQ*my_WvqA8`ip)b!^J#^y!s4;QX4`F0C=38UMSYx?fI~1`WNa;ZTj)?O{ z$k^8^@kfe#fy#CUon?hDil$fDZ1GDHtHiC^vA?`{+iZ>oakvyd0X1IXnzbv!pL{NX< z1VREE_pLFd&{eHR>&g=iKD>p{e@pB;DTt9U6h=6&{1?zNcHz_6-XA#72^Ouk3XcNqusnb+X1vcB3r_o zPuU|6Z8U*HYS5a~UJY*UQ0+2Z#~e>SqFQ4yIj|;maD_Th1bC5{nIQ!9ruS*x=SfUb zkqYh4!oBhZg&v9UsA+fQg;3M~V@1o8WCA!8-xdgcBFJn{XqP+dQKpaVv*?gt028Jz~~escDay5(iNj7EK{TDK}}3Ln6}LdGz9nst;&Z z8-i|mgbQNSK{0Qhcz~9RaYxQ{u~a&B8UJ~ViuB+8a6>xazZONYMc=|ow7c5{WBB$* z?C|Fi{6uD)(0pX`ulor3IDVol7R%*ql?5m&r6eLK&cs*cq^mGGFeWtc#SKbx8jI3v zusce~TFpzFCP?(H8QQ^lTG_uz*Ma5=rwL88YVdyo9hp+`r+Jwudt9H!`Bf?S9I_R=WQDAvmUl!Uj+lTT(osusoB^`0q@)cgNtk3Az1c zF1{rgTdT)0xH;7MNFtNM<{iHSTf7rHIDa@8j$tKank45JHUyFgUMjak zwT?Y{7@hu{+{=9oMgKFvR{WBSS``<#eq#MN;^JaRuZWRC8Ozz1`J_1fgxcwrHoM-;t$w!alwNy;C;jw&xSD|h`-QZg4!8}tg z!;hR;EI=t*SG2r2>4;0Qty3g3AQ(#(Ch6SK+TXwSglJX_A85<$CEYF-{~J}fg-=d3t?1>syx z*JaKOOqHjX`w=yrJgt#EQuJJNPQBF>ND<@zM+rMl=)wIJ4uE?`vgzz^qI|>Cz4g)` z?Yy{!x$+A0`J!1op)P*Xo`Nf0w9I97oI`BBm(FF4R4bp^AE9ZE=~I7A=T~bvyw!!8 zR8eOZrXmuNmje>d2uSM3sBW+(1=%~oC_@3GceKojdL~jU6I@Q0^9+J zG0ksA?7y(Sf&Rle*05Y0pME8SEKD7?Ag2CaC=x>WI>(Nt{DIVuStyi1PzJCYMIZOc zL(Fb^vn1zRB+N;o#la`owLp~7L{iOW*PS6cgH(suEB!W?wp@EAs_t6*_Qoqyzi_$n zH2eC4ckMQ<=H7@aPglaZCpi0h3%^`CIKGW*^3Q+vu>IB~$2s1UDGy4`I0kxXFp}8m z)dK&SsZc2a&QgHh|0}_lVWqDflPY7N&_J{>Opx|r+sQ-QimF!Gltzr7v8E4Nc(Uc9 zK5Fg5kte^{9yqa%vFU{sk&`<%oy>FwoUmF2e!RUQ4AAD8CymyGiekdd=&;@x58gxR zl-w;O7lkH=vJMZpRhIY+Ceo*8!&m-umST=oFGX#=1_I?yy?QVbEo*S!_^n+TYW>UP zvkW#(yfqO#w(RWs(4gz>%>T$(glY2M?%EMbi1w!v6kEjD7ye!v^sPV)qs)L6`yHmI z%UXk8?e`Jn$NFeEEv)XVI-s#-r(9#JB`c7II<{5iq+GGQ+C&%;Ve;Zi&(YwNozGnNhTF68iv*ywu?MfEka)$l4-o|Y+giU^}duk$J zF_l23z)m(iVmuLE?UU^&>Cv{Z$|Ka6AsGXU>kn(kCxz}#a*UMrml?O+Zg`}Hoq@|8 zb~U`x_p>XuB$MP*Su2%)_M-yk>EqRElrhK;?_s>N*F>3~RaH;q zcC(Z2Pa`b>(;O7Px&xWAdl~*a!{}+h}?f?I`{dSoLG}zJ@&U&C5hyQ+!CgKci@w=rDi34W*_KhSFE{EihuCUZmrLL z3iTwj++&Y|u!W^ijqnt~xup9e!JtiyT3|ZEwbQskrgVq_pk6Y3&`)SSktHm%$#6Gl8Gf78(nthd*4k-&5>K*Q4EiE zg?5_%o!VE4da~^E%+U3LEX>N2-%kC_^}5s7+s(5O2>yVV$41ODJS5I9lUw*u5{!4| z8e{SBkY-p(jTMv3B)1-b&nSkx-b^0Hih0mDc@P2vEK_wcGzOk=bzg^nynC89Zyau> zh)qs5Jh%mRQWw%W9ElaSOye@RG8st=V}`l`eFk>LXt@@1n#KL1D2srZfu_Oav?@?R zDN`}zt{C(plghz2u>TB}ozbK&YwESkETMa?DUsoGvkTfl<`9{Te_nas+F2n>3&LlS4mc*htNr~^i3~3NqE(TVVVfM1Ma~_eIeSfFI75Re}2Y>+Ed$P+^xA^Gg+Ft$#wX3Hkrd7!P4by#ru$l zx!y9v(;b!j7?Aa>R~$Wc`v^V%B|dv<{}3SD90(xX9D+d**}gy%*}a5y3XNL93a;Nm z^r_#bMbzH`aS=`~YQ}zxF%LXjTvo@fYnzlb-m$qmox1(X`8D$019ch?j0SDubT}r;*iBQI06^U{F&3CK{LGBnYm)$vpw{KW)X zh{u*qaQsH^__HiJtx`y9A6hc_(d(r9@Eg;GamFzyECdv|dqT2*P;@y&2}ehjiIoQHVMj zIk`8W>2#Ll$?}S6{$5Wluq{2qN($m{pw(O(ey*;;-6NgrHpiJqR9cR`-m9`*sW(g0 zFuu+>E-Bo#rT41T5q`>oJQ3bI@j}S?n=j!6NNsI++L&v@k~yMg_V33l^g<&lRPt4c zZWi^zh_$~jUp_y*-}$Q!2p)cp6=`PxWM^Z!!kCPBF1tOn0^dlkr!0%973tzODptsopDYsZBgHB^b?5fHv-QMi-E zUzqWi^JdEo?r0*+Ed18m;)l-fq?~)A3=DdX-yyXvj?;%E2Ts}a&RUC1x`|bWBTuLR z#iGRJgqf9!5*txdox~+6K{u7ycs3>2r&ohjGy;9W>pU^=D;#Y@+BwMegFS#aZwwhS zX#_`qfLRq=1oGr`Rd#8ME#ihHo`@wlpE=4X$_ynV z5aR!@y&?d$x-kCgtE)mMv-gxKQ06294T#d@<`z<@;$o=enc(u;@Y)v1J>hGm6vTlWQSZDb6svJn(mC?gX z;w3=TxqoA%nPI%!&~T{X?jWB)&$L{Ok2GhW_=%i=e-?7*_OOA;P?=Axom$X}PtAm%p+#-3jIjU6cwsCMQ6dub!A6gc1fypG0~DjtnRGdiTc?-Y$UvhS^NsKCFPs z$@me^WvK|^;%h;MXVe?gPF0N z?fU{H?>qkc4G#1Fsp>3%;)u3&4THP8LvVL@_uvxTo!}N2+xjoqEAu|GaRZ3S*u)8K`bnzKOgKa862W#|sM2Q0hn3Uq(C z7{7lVSDFZyOBmrQpvLD}g@x<*x%3?Zc1S4cT+GIe95=G~>l5Aqy2cQ$p0HF=_n#97vv{Xsl z_2dJ(%qCcxw3dRGAGwYO--`BYey*EqI45c$>gz+W3huI!;iiUn#%7$aLb*9v3G&xolLap0>4GK z@j$GN*WvycKkw6JW7nLG9*(YC!9V3pH6s3o+0WsC5syk!7ej!bs5H$TI*cO+opCL; zzCse^fGk@H7edh&Ga)+vWG(O;l5oTHd+;~O%yOp$DNMvEe)n{GqlsZF*}3*idhI@H z^AH)%brK|*YW%HJHIqwy_XQc)pFl2+798xPHadUXWnG?ika7k;D=7gqlcwA_ub1@r zdFXP{&kVdn6=Yb6V?(mKIn=oDDt!3wukB|!QTpk+m>RSWW8jL$coczP|1B{yHrNKF z^^gU8&4Gg*t3q46&q?UAOD5l8gRk0fT)6u}1;K|=$TaGkADb4W%%Fm#B!JSe*6@0m zpd!Oa6M~gx^ccA}6$wB_EC)_P?#Fajk@;0(*ySY??B_9LxE-b&ZYfw;fGNaEZ?W9Z z@cIeS2-4sy<~}w%Lbfxy?1aFx_`y|x*|`v7T6qp9jju@|DVb(7?CH!eG*5Gy&l+8h zRbM^8F!tpT5oH7_gW>9GoIpm};Yf!1O{25~qK{^yWgpO~+jaA%S(nwyE0EdwL!30c zKldt?xJ0aM&=1ycCR-5a38i5O*0PK$+gT3P>!y1@WKHxy>~~O27sP(<)ig}wRNBRr z%aKHq$VG*rl$FywL80@QG^{g$)G(eHOk>J}B_@)*1Pdw21lI-z;E;-&jIZWa_0rpSSA7mp= zY4%6fSDnyAb5@>5=Tji(VLG&@QJBH2*IT9d#Z0;Q1}$-PDQPDU=b^MOJ-_5unLk?& zJZi>Qg3o#87MvE77KLnnubDpISzVT$FGU~oW?sqGR>)#s1~C4_i_tCZz~R{`G{gU{ zE$-s^yxBhQl6sEv)_Qo3lC-ZDfTii0Zc2yEfn()i7M1a+7BB|f{1XW1VWwf3P^+de z<&}b!6y9Xr(kUtJ5k~uysJ}ev!@ZJgTX43?N(3|OzqhI_ zsE`L~Z(%4Bo2itEVg!ZfoN{oLg?~rEvg_D~ERcyBo#J#Sl8d<@Xys_0V6>-ceP)`5dl2>|jwH~b+=fqshaPwn^QIdTGV^Ti z8BzI7>A~8Nw6PZUN=A6is)VG6;#e}?*nJ}5PPBsTSPCo{pUH1sUePRlAORuxUGTL; zKEk~Tq9QxSdq&rcb2q7smlm$PdEqm_b)ERpIu%W>VLYrJ7aua2XM*1h2BvVi7cSXjq-L*w5-) zq9A6ft4bIGNCMU02vz_tSz-F^eHzfm>oq1zs4eB@ z@mighTiklDogFW5lyrl{W9cm1P0|dWwlOGh#Ja$N$km}-j? zY``YYW?#ckjy5RzMFrfp_H13V40I@GOpetB-1a9QVGpY6k-=rTjyBAN>)HrTAXhx? zjs+{5lV)GZRr2S&0QY?3JgpBZBe52ll7*daQZZ++teaus3k5iw5W=xmxQO%El^)7a`2Q7ALgm-8h!U^Y(ne^KbVI#U}z#)(&OI zJDMZDDt*AHcv3>&{(4=K_-i*KDFP6MMhTKL1F6)&UtMqCUz!7YI1}H)F1sD+?HsvM zwnbTk?(?UESMwaPnd@-|!F3FkpxHG`X_-S6%)#&Q8Y130A{gi2agh>GlFZi|_=nIj zwOXpd3C|nC_-6?4odNmsLdj^GmJ30Dm3 zp^Rl(mgvZ7rg?OPuqj8wp}kBq5<%s(y*A39AfzGg1#VM{I=3eH zr#^4k3i-u(AteXe|4|m>-P1 zBXT7m&IZ-{Z`Ubnyz&hjqacZm48@VyU>ux?>kb!B8u`*$ z6tcI(Z7o)f{5l1?jg>WYf1To^3 z-<_=Hk8jxi0(ZX&7?QJDyYNQ#(tSnb(7qlF+`@y0 zGG6G;Wc?tFFKF@juW~+#NK9N0>>e|@;?1~G6^qJ%ucLp^)ph}|*{{=dgk_%K=1}uw z1yk2-(#`kOv*gNxB5=4sc1PG1MXV;pYlZU0#XlnFvM&dZmD^_C%RR9Rwzz!R@(o#^ z=+} zr7EYu@;hHinSeF0V{y^VS_`oB3u!ar0?;%DO@ZA~5#pvo<3+5q7lQov3dG(!cl(yT?b(xcB+F_-Ld` zm66hh_Bn0T?$LPQU z{0+si%bDJMog9=Z86uvtvJ#wP9>-<@Hv-={&B;l}tM8!u__j-Xf#2KA)XS_#9;<=1OL|`w zg{mpfY;ju3s^xvMcEcN6EJj35M--uDj)8VE zyH~>{jkyBn+K>r{rG;rBb1SYHD*{O|i>(6MIJi^k!p#!|E5f^#*dRw;?j7LyG*I&~ zC!S!yeWH7M1JHiqalYa&v7bn@H|TP{rCu&~7tP3qkg?Y)*Zm4k%i<|wqoC_Yfl(4WW|6uE z1IoaVykI1l6mgiCB;j-@SYWd^ILaF8@*D1UUPx>^3V$OR|F)Ub9mQ@0TKKHO3SztkrL_O9a;xo~2 zlCE0m`)9ZXfw}{QXWHLn<&o^T$s&mTEI9mcC9^#kg6rhIpwb#~8{qp}-QHG}Mw5ni zIZ|iJGmHHg-XrGK2bsQLw&}_*syR+Ee7^<@-EtE&tjmfTcE}xt56B4WX_1~RfCnQ$3*fB;!?xeos|dU_fV?S1>I_e5iuA8g zp@Hcs)BHLeXt!xJHCZ;RJCKc4`R(*$NjQnCq4O-XuE^}^bxi(QRYrclRHsz3puDKu zen8iKi?)cpKXIuDpE2-LNycrIr8<0Co1($PtV3So;5T?5W3tjsBaVtM&lDXWi<;=xuTdL#5h;7fAWS}>n zliW&C-J|?)fwu(b5K7nAgCl2JIri-qLuphbM=~#o^*Un*u z4?aO(8`voaX8h1Vz?(8-Db{BR2FG9^)695+rSPsSI+Fd}nO}~4!7{v;?j0}}tyjn$ zxz;m=LNVt%%eS^*N#m{d(KI#P_voO;g3;Uq`GV@jC%)` z{s5K^NVk%P&ogIrM{Y~TGjp@_#6s0;*<0-|?NaSPNd#d4>P2()x)kY>pJGSo_ntZx zC;?TOy^^8@I4P?_Rmwb0H_U0f6#5hQjxRZ6HW>hyYJ49a9*kN>mX2d`!{0s~Rv9&p zU+JDV*$ipn)K9ARQ|X1!V7_D~2P8KS?ym->l`-%x>@Ip{UxE^~Bt992U6)9E8*J!5 zA&+|jtFqLhzVLP$Y}L4ar-VQ&8RxK$x>0fEC++wSY5bB|{3k-)MMhe)W>7}Uq%aGy z4YsBwaQ{XE-xPzn_kqJG$+ht*gCA;S4B;T7GC2v#A?-#fLtVF4@oSfgmTc9WU_9}~ z$E1k>@D)v@&GjGJCH6gfj|qwuw+v4&%Ir0AAoqA&@S0?kY;rWcGp{_oSEH0dj_@G8 zhvsXwo#9Vj(7Nh*1Mp-yB42@A)2S{z5Hc_I>ISQ|^73E#Ii zDV+JdPl>)k39i$JNrAf_uRm@H1l<_1v%D1^XGS!xYk3<xs<)1$j0{6LQ zVMvWe#~e27`Wg6h506iG<%}!Z=5gnvVS2d3(pQ-dzhqUrlYoOq0Uzw!Cl&^LJgawM zMi}_*ZQxwho1t$?%Y8L8zvbH*;(Gg(`0H)L9PT!drU=SMrv!D81RxJJY8U}%*5trkJ(cV#X{ zR0s%~zpsi&$8do_qIn!)b7rcs9hf2cx_Yc3gnFhCTzP~PzGA7CC>$oiJDFUF2|2xt0UNN=D}EKk*CbYB`l@Q|utEPBoL zH8<&klmS{1(FXF)r$GI|)+w&C{+GM1+_MjVu z5ZQN#0Q~-hrKk6geOFA>>V%fk2yx4j#~5L29^D9O%i|s>IhYM_%AUD#wKd>omKUVV+)3u}*B-W$n09lTz9b+CG_3LKuZe5%M{7}00v zmW6EEE)TqCH{@j2YsB44u7*G46BTrGGIQwet}L<{4ohw@VfbEbWQE2XTTw=;sfZYM zSb_g+N$nh02^-hpVkmZ*Qt@@c781^U^;_#?I4%(8@y9Jd`YcDC+j52F0NdPXA{D!I ztes^veALZ(+PS(SWw$rQ30s4uagJNEMiZOL!>C1jG7;YLnk!PrTCKiCv6|hoIAJ_8ic?D`fKpOrtVOfH zB+W^({5z{CP3#z+U}mZkT4w-~6-&8Z9SPW&Y52j!2QOCr+dA(zdhf7NvB6J(er#Ul zh<)PW-g5wVH;!l?yJOC*BUSAsCC+n81K}14rp#4KXzjKL0l}=yy8No$*L-};fC-VFURL?clu+XR7EJEll&uXnW1^x;X#RVt`pGOIrWl)r(CzIRGxcu?=y!2HJ;XZd9~s6t$n<} zpTb`#`<(nv8LMggUEB9VZH%Y^eHZBxgW;aIhhUO8*0VVSuPWPu3-|pLdbIEvL_m1Y zl=X!c9xuD%#?Rf)v+F&~Q-v=mYD8}QzF6r4B+6X)wET)4N`q1wMrydoTD`!a{S7xs zG~1J$?YF#u-TUa+8^xbk1?HV)J@%4FE;^t6vP5|X4Vi6p5F4bo0QE7pDgwHfQ^EDI zoejKcw!T7FR^#95IeP347u%2o^joH>1BdZanlo`wmqP{jHtbf~$F)0H(`@6%;x-sz z_FO)(WD0J#;|K}3o8sk26Bh#grrA5yad0zD*5t{$(kFZdWv?iR9bi_;p# zUURB8U3pfDyE{eJ)?Kg^;I^nV?`xVb7lPTUf~&7wr1@9m`WVu1;=nlV!gC&>K+ZsO z_Sj8b~rcPhN}w>rfhab6|WO%{Og{!~n->G3Tr2}7_s zyIQH2U@5UL^Xud#e3$Ht_kmpT0j_T&wD%A9<{pTXq-Sk)knt<(~InierO=! z2p`()B!L$UCcaa=5mbrcsL4Vs7M`-q7^R%epvuJ^1oYi+z~zsU_uv zU!W}l-V*VwsYk8mmq(M+mjQ9C5px7Q_>qC%Xe&o8gF29C4+twG?0)iPx;!JYZny5D zL9~mY-*1Xq$lSoG2et3{#84@DQUsoADj1^$F8bd*V83}|Ct%1x_|>0cgQUpt+^+Zy z^eJBPFfh_HPz?oz1SU1`anCg=B|?*(DX{-QFrP#XfA-)1bf9rFO3xu-xjUz6cjMM} z0wM`z#ayC-exoCqHg`8kC+>eS$Pw7m7+yq+?nfM8st$qy_9DR_v{Q~TzI-N$ zP_qtp(mHb8?P_-M!H%TL(?XclnIIAq_vPiE6VWSN%Al-LTYKNK(xX(;d$~^zR7)St zXG`s7UlcBu-W}Vhl&}3c2RJ%o!`~j+FZ_SJ0Dt&xJgkd6?}ng3+Tcb@btw$yLU!p( zKpIhPH)Fm6`Dny@4S)LNMlQl#!eTh5e8zT8{us-vs2gZbxlU@8~ zLS%I3$0H|3uRN*fL`UA{G8AOawo5XhsAH@?Ywqr^)eq0vTGxkt)w?A~-3&9g`;bK#`3Z}oCI2V%~u zFJfM*I$obtt5n76{CiwK+A7eEB$bxi+KePI0~GY{ELJp=_erUf)L`D-s~nu8TH4WF z!+tT>0}WZWl8H^-b;iVQI_{vR*HIyLZe=^*3hUpU=)Op$e;})AWNvA#w0;m{nwegh zCvuCbxNmBb^=ukkfxRxmAumA|E+H%}Erros!LU|ho}SCy)0iu1)E8`q4l}f~xAVoC zEmq?yrj2OEfb=-)V4vYKqq_=S;c}v**I#T}1d@JY&W$a|$O0Ej?+tW_d)`+{?xT+9 z*E$j7*0u29y}Cv^M$8o;GgGk{SCZ0B;&XtE$Z@2yJKp1B z7-L*%jVdg(HbvH|amZ@UHk6@QWiXmd$Bq=+@!Z`@4X;tEk1p#$-ZlT3WJlLxlv0@O zUh#K>x|WFkj6s75ZaC|3N*+_Fklbp+0S;)Q*i(IpW|vr|d#DpvvEeBW%o-yoE=Kd+ zG~QnG>yWT*nfE+0$G!n57ulC*tXmn{F&y-5MB zSk5qX!e#K&lJTOd#PbFhE7`MfEB%ZI+_{*k9z&MnFoq16zIzF zOGLGQy6=pTy^0JrJAvV0+Lh4lF!1B@;>FerM>sm(6%>K!;0_1NwyXvFxgEr6Y7@iG zkH|5;*ldf}(D8j6cgFql*t~}Cle)TFxH7Uh9lM2@>;$5%>`tjyNZOzTo3C_^QFfmm zsTF~#RCPhX@!*ZR{1kzyHYegpHIX~yy{*qq`n?CbciClsXJxoIH5+MMR zIoEfXA!Dk|Dn1;wJmL%l0;+tKT&XMlE~!5=`;^JKzy}Ii6QrPJtyhyIYh~@#`^BQu zg1eXA6j&+DI-KJqCEQ+@)+4=erSjzVx>$!P zmmu=QyfY|7tcyQ1Wa)^0qh#@=pXO~lM4#?7ymc*HHN0gg1PU6sXB?{F{fZ>tDCI)C z4zr7MADYos=+X77kKlU1oR6l=g4CKte=b#ElHKZeT~3lB?)`o-C`a){PK( z9=)f${WLYSlnz52WHUn84}xC{p`N8XM^fnK)Sc47j|Ybfg(WvSFy+`6O*N<~P}OCz z5vql7vwT8P0phdPxrY%F9txWi;hY!3h-@1ms}`gL;$dDEYS1C^=18y^01@}@cE??W z3^qO!#tfk4#~vc8*9gTi($t6YZ<*krfy%-CjWlZJH)$(fjLhqejz+`#hSE{`JW-X7 z`>xsT{ptp`H`>cx`Y}4zH~l=d0f;CdUB??jN26J6;DXXNKkdg~ww7mvg7$Yg&GQ<% ze)k{3i2AAc60B&A-|y)Fiyto;>(TA&mjrB1w+Vj}|(ZfOGKn(V>no5cP;4~?a|MM9qai$5$YH}In)H_N|kJ%wEE zdx$Z6Fc7ko*OZyo|CG!w&B?BIv=@OJI>X*t!GUulJ9dnILly;;_GbzLJoz@!^eyTP z3FJ6(Fmdx-3yB*J!WKSFbNv27JBI|e?BPdEz|QNBeLkBXBJuZxY^0Y|Imm3u@`1iG z`~1gsxuzr*Sya zJh;m-lFd&fn=g^uzqV+wix*k~8f!T zn3ir71+XJq3a*|ATML^!$z&d9uh&(qV~yQRUJXAQSBDwbpX|E&S8!O65W-Z+>9)&z zGMbzw&w;!+q_q|G&ugeXvj@*#c7abnsgu&v1r4nWX-*X5c47i`^q;+i-j&%PL5+I^ zjT(Ca(EpQqY5vF(`frjLkz+&XzZp03j;)~oqr4A7IQb0oR}&o+aAHOLSLF3Qz~=T{ ztx)Jax6J=;#X-v)pe;Ho5FsZKNaPfq_&;)*74P8SJ1G3W)O%SRw8#yDJf{bNPHBk$ z(LVeKTI2f*y`7R1|DzoD4|FQ{7s3_B0Og;f6aUqZdmpmpJz9hFAMi-{9b^Sfp5YSz z73g}0yx*aJ=d~mD4yh9VRYZCR+TODbaQxHDtmNM-OgN_?{*Oe?uXo7)eK|_>ABaxo zFLZIvLj3>ra^Bag{(;Qo-yurSrwcX!i~(rtf)Z5wZem)zo4NoVYmnfj6#&r|Bw!~9 zV!K8M_3j~qo-a`WzwAJWS3&?3d(h<-5yX8zN~@GT(#HRJE;r&|R8PTpVB zD4!67cZ3cKy(0uH7l88bxQPD=xcT2f-^=2lfkM#boeF@j93*xxO8k%K_&?n5ig%6} z)Oybbz#aNK%-cN=p#R5TlXUF;SNMUB_@C9pf0~z${1?RfJMp;(LcsYH=<>k;@HP+n syvPdje?%w#=c($S<~7S8@>K@hkBTtwU;THn!}mQ03j*TT&VOqE4-{M+YybcN diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d0d481b2f0..742d9bda1f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://cache-redirector.jetbrains.com/services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://cache-redirector.jetbrains.com/services.gradle.org/distributions/gradle-8.4-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index fcb6fca147..1aa94a4269 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ From b81495b1d490a778b159539be3cade29b3f24b72 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Tue, 17 Oct 2023 22:07:54 +0200 Subject: [PATCH 029/347] JetBrains Runtime resolver refactoring --- ...ry.kt => IntelliJPlatformPluginLibrary.kt} | 4 +- .../gradleplugin/IntelliJPluginConstants.kt | 110 ++-- .../transform/ExtractorTransformer.kt | 61 ++- .../transform/ProductInfoTransformer.kt | 2 +- .../gradleplugin/dependencies/dependencies.kt | 42 +- .../dependencies/intellijPlatform.kt | 80 +-- .../dependencies/intellijPlatformLocal.kt | 16 +- .../dependencies/jetbrainsRuntime.kt | 114 ++++ .../dependency/BuiltinPluginsRegistry.kt | 2 +- .../dependency/IdeaDependencyManager.kt | 1 + .../extensions/IntelliJPlatformExtension.kt | 12 + .../intellij/platform/gradleplugin/jbr/Jbr.kt | 11 - .../platform/gradleplugin/jbr/JbrResolver.kt | 330 ----------- .../jbr/JetBrainsRuntimeResolver.kt | 121 +++++ .../gradleplugin/model/ProductInfo.kt | 28 +- .../IntelliJPlatformAbstractProjectPlugin.kt | 69 ++- .../plugins/IntelliJPlatformBasePlugin.kt | 81 ++- .../plugins/IntelliJPlatformPlugin.kt | 513 ++++++++---------- .../plugins/IntelliJPlatformTasksPlugin.kt | 287 ++++++++-- .../IntelliJPlatformArgumentProvider.kt | 4 +- .../LaunchSystemArgumentProvider.kt | 18 +- .../gradleplugin/repositories/repositories.kt | 4 +- ...> InitializeIntelliJPlatformPluginTask.kt} | 2 +- .../gradleplugin/tasks/PatchPluginXmlTask.kt | 9 +- .../platform/gradleplugin/tasks/RunIdeTask.kt | 157 +++++- .../tasks/RunPluginVerifierTask.kt | 142 +---- .../tasks/base/JetBrainsRuntimeAware.kt | 21 + ...onAwareTask.kt => PlatformVersionAware.kt} | 22 +- .../gradleplugin/tasks/base/RunIdeBase.kt | 133 +---- .../gradleplugin/tasks/base/SandboxAware.kt | 44 ++ .../intellij/platform/gradleplugin/utils.kt | 22 - .../gradleplugin/jbr/JbrResolverTest.kt | 6 +- .../gradleplugin/tasks/BuildPluginTaskSpec.kt | 22 +- .../tasks/PatchPluginXmlTaskSpec.kt | 36 +- .../tasks/PrepareSandboxTaskSpec.kt | 76 ++- .../tasks/RunPluginVerifierTaskSpec.kt | 4 +- 36 files changed, 1385 insertions(+), 1221 deletions(-) rename src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/{IntelliJPluginLibrary.kt => IntelliJPlatformPluginLibrary.kt} (66%) create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsRuntime.kt delete mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/Jbr.kt delete mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolver.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JetBrainsRuntimeResolver.kt rename src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/{InitializeIntelliJPluginTask.kt => InitializeIntelliJPlatformPluginTask.kt} (97%) create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/JetBrainsRuntimeAware.kt rename src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/{IdeVersionAwareTask.kt => PlatformVersionAware.kt} (55%) create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/SandboxAware.kt diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginLibrary.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformPluginLibrary.kt similarity index 66% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginLibrary.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformPluginLibrary.kt index 6766571b5c..fdf4ce2167 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginLibrary.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformPluginLibrary.kt @@ -4,7 +4,7 @@ package org.jetbrains.intellij.platform.gradleplugin import org.gradle.api.component.SoftwareComponent -class IntelliJPluginLibrary : SoftwareComponent { +class IntelliJPlatformPluginLibrary : SoftwareComponent { - override fun getName() = "intellij-plugin" + override fun getName() = "intellij-platform-plugin" } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index 77d40354e6..0c2807c87a 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -11,6 +11,7 @@ object IntelliJPluginConstants { const val PLUGIN_TASKS_ID = "$PLUGIN_ID.tasks" const val PLUGIN_GROUP_NAME = "intellij" + const val JETBRAINS_RUNTIME_VENDOR = "JetBrains" object Extensions { const val IDEA_VERSION = "ideaVersion" @@ -18,13 +19,20 @@ object IntelliJPluginConstants { const val PLUGIN_CONFIGURATION = "pluginConfiguration" const val PRODUCT_DESCRIPTOR = "productDescriptor" const val VENDOR = "vendor" + + const val INTELLIJ_PLATFORM_REPOSITORY_SETTINGS = "intellijPlatformRepositorySettings" + const val INTELLIJ_PLATFORM_DEPENDENCY_SETTINGS = "intellijPlatformDependencySettings" } object Configurations { - const val INTELLIJ_PLATFORM = "intellijPlatform" + const val INTELLIJ_PLATFORM_DEPENDENCY = "intellijPlatformDependency" const val INTELLIJ_PLATFORM_LOCAL_INSTANCE = "intellijPlatformLocalInstance" + const val INTELLIJ_PLATFORM = "intellijPlatform" const val INTELLIJ_PLATFORM_PRODUCT_INFO = "intellijPlatformProductInfo" const val INTELLIJ_PLATFORM_DEPENDENCIES = "intellijPlatformDependencies" + const val JETBRAINS_RUNTIME = "jetbrainsRuntime" + const val JETBRAINS_RUNTIME_DEPENDENCY = "jetbrainsRuntimeDependency" + const val JETBRAINS_RUNTIME_LOCAL_INSTANCE = "jetbrainsRuntimeLocalInstance" const val TEST_FIXTURES_COMPILE_ONLY = "testFixturesCompileOnly" object Attributes { @@ -39,37 +47,44 @@ object IntelliJPluginConstants { } object Tasks { + const val BUILD_PLUGIN = "buildPlugin" + const val INITIALIZE_INTELLIJ_PLATFORM_PLUGIN = "initializeIntellijPlatformPlugin" + const val INSTRUMENTED_JAR = "instrumentedJar" + const val PATCH_PLUGIN_XML = "patchPluginXml" + const val PREPARE_SANDBOX = "prepareSandbox" + const val PREPARE_TESTING_SANDBOX = "prepareTestingSandbox" + const val PREPARE_UI_TESTING_SANDBOX = "prepareUiTestingSandbox" + const val RUN_IDE = "runIde" const val SETUP_DEPENDENCIES = "setupDependencies" } - const val INTELLIJ_PLATFORM_REPOSITORY_SETTINGS_NAME = "intellijPlatformRepositorySettings" - const val INTELLIJ_PLATFORM_DEPENDENCY_SETTINGS_NAME = "intellijPlatformDependencySettings" + object Sandbox { + const val CONTAINER = "idea-sandbox" + const val CONFIG = "config" + const val PLUGINS = "plugins" + const val SYSTEM = "system" + } - @Deprecated("Check it") - const val DEFAULT_SANDBOX = "idea-sandbox" + object Locations { + const val CACHE_REDIRECTOR = "https://cache-redirector.jetbrains.com" + const val JETBRAINS_RUNTIME_REPOSITORY = "$CACHE_REDIRECTOR/intellij-jbr" + } - const val BUILD_PLUGIN_TASK_NAME = "buildPlugin" const val BUILD_SEARCHABLE_OPTIONS_TASK_NAME = "buildSearchableOptions" const val CLASSPATH_INDEX_CLEANUP_TASK_NAME = "classpathIndexCleanup" const val DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML_TASK_NAME = "downloadAndroidStudioProductReleasesXml" const val DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME = "downloadIdeaProductReleasesXml" const val DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME = "downloadRobotServerPlugin" const val DOWNLOAD_ZIP_SIGNER_TASK_NAME = "downloadZipSigner" - const val INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME = "initializeIntelliJPlugin" const val INSTRUMENT_CODE_TASK_NAME = "instrumentCode" const val INSTRUMENT_TEST_CODE_TASK_NAME = "instrumentTestCode" - const val INSTRUMENTED_JAR_TASK_NAME = "instrumentedJar" const val JAR_SEARCHABLE_OPTIONS_TASK_NAME = "jarSearchableOptions" const val LIST_BUNDLED_PLUGINS_TASK_NAME = "listBundledPlugins" const val LIST_PRODUCTS_RELEASES_TASK_NAME = "listProductsReleases" - const val PATCH_PLUGIN_XML_TASK_NAME = "patchPluginXml" - const val PREPARE_SANDBOX_TASK_NAME = "prepareSandbox" - const val PREPARE_TESTING_SANDBOX_TASK_NAME = "prepareTestingSandbox" - const val PREPARE_UI_TESTING_SANDBOX_TASK_NAME = "prepareUiTestingSandbox" const val PRINT_BUNDLED_PLUGINS_TASK_NAME = "printBundledPlugins" const val PRINT_PRODUCTS_RELEASES_TASK_NAME = "printProductsReleases" const val PUBLISH_PLUGIN_TASK_NAME = "publishPlugin" - const val RUN_IDE_TASK_NAME = "runIde" + const val RUN_IDE_FOR_UI_TESTS_TASK_NAME = "runIdeForUiTests" const val RUN_IDE_PERFORMANCE_TEST_TASK_NAME = "runIdePerformanceTest" const val RUN_PLUGIN_VERIFIER_TASK_NAME = "runPluginVerifier" @@ -81,36 +96,36 @@ object IntelliJPluginConstants { const val COMPILE_KOTLIN_TASK_NAME = "compileKotlin" val TASKS = listOf( - BUILD_PLUGIN_TASK_NAME, - BUILD_SEARCHABLE_OPTIONS_TASK_NAME, - CLASSPATH_INDEX_CLEANUP_TASK_NAME, - DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML_TASK_NAME, - DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME, - DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME, - DOWNLOAD_ZIP_SIGNER_TASK_NAME, - INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME, - INSTRUMENT_CODE_TASK_NAME, - INSTRUMENTED_JAR_TASK_NAME, - INSTRUMENT_TEST_CODE_TASK_NAME, - JAR_SEARCHABLE_OPTIONS_TASK_NAME, - LIST_BUNDLED_PLUGINS_TASK_NAME, - LIST_PRODUCTS_RELEASES_TASK_NAME, - PATCH_PLUGIN_XML_TASK_NAME, - PREPARE_SANDBOX_TASK_NAME, - PREPARE_TESTING_SANDBOX_TASK_NAME, - PREPARE_UI_TESTING_SANDBOX_TASK_NAME, - PRINT_BUNDLED_PLUGINS_TASK_NAME, - PRINT_PRODUCTS_RELEASES_TASK_NAME, - PUBLISH_PLUGIN_TASK_NAME, - RUN_IDE_TASK_NAME, - RUN_IDE_FOR_UI_TESTS_TASK_NAME, - RUN_IDE_PERFORMANCE_TEST_TASK_NAME, - RUN_PLUGIN_VERIFIER_TASK_NAME, +// Tasks.BUILD_PLUGIN, +// BUILD_SEARCHABLE_OPTIONS_TASK_NAME, +// CLASSPATH_INDEX_CLEANUP_TASK_NAME, +// DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML_TASK_NAME, +// DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME, +// DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME, +// DOWNLOAD_ZIP_SIGNER_TASK_NAME, + Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN, +// INSTRUMENT_CODE_TASK_NAME, + Tasks.INSTRUMENTED_JAR, +// INSTRUMENT_TEST_CODE_TASK_NAME, +// JAR_SEARCHABLE_OPTIONS_TASK_NAME, +// LIST_BUNDLED_PLUGINS_TASK_NAME, +// LIST_PRODUCTS_RELEASES_TASK_NAME, + Tasks.PATCH_PLUGIN_XML, +// Tasks.PREPARE_SANDBOX, +// Tasks.PREPARE_TESTING_SANDBOX, +// Tasks.PREPARE_UI_TESTING_SANDBOX, +// PRINT_BUNDLED_PLUGINS_TASK_NAME, +// PRINT_PRODUCTS_RELEASES_TASK_NAME, +// PUBLISH_PLUGIN_TASK_NAME, + Tasks.RUN_IDE, +// RUN_IDE_FOR_UI_TESTS_TASK_NAME, +// RUN_IDE_PERFORMANCE_TEST_TASK_NAME, +// RUN_PLUGIN_VERIFIER_TASK_NAME, Tasks.SETUP_DEPENDENCIES, - SIGN_PLUGIN_TASK_NAME, - VERIFY_PLUGIN_TASK_NAME, - VERIFY_PLUGIN_CONFIGURATION_TASK_NAME, - VERIFY_PLUGIN_SIGNATURE_TASK_NAME, +// SIGN_PLUGIN_TASK_NAME, +// VERIFY_PLUGIN_TASK_NAME, +// VERIFY_PLUGIN_CONFIGURATION_TASK_NAME, +// VERIFY_PLUGIN_SIGNATURE_TASK_NAME, ) const val KOTLIN_GRADLE_PLUGIN_ID = "org.jetbrains.kotlin.jvm" @@ -139,7 +154,6 @@ object IntelliJPluginConstants { const val DEFAULT_IDEA_VERSION = "LATEST-EAP-SNAPSHOT" const val MINIMAL_SUPPORTED_GRADLE_VERSION = "8.0" const val MINIMAL_SUPPORTED_INTELLIJ_PLATFORM_VERSION = "223" - const val JETBRAINS_JAVA_TOOLCHAIN_VENDOR_NAME = "JetBrains" const val RELEASE_SUFFIX_EAP = "-EAP-SNAPSHOT" const val RELEASE_SUFFIX_EAP_CANDIDATE = "-EAP-CANDIDATE-SNAPSHOT" @@ -149,12 +163,10 @@ object IntelliJPluginConstants { const val MARKETPLACE_HOST = "https://plugins.jetbrains.com" const val IDEA_PRODUCTS_RELEASES_URL = "https://www.jetbrains.com/updates/updates.xml" const val ANDROID_STUDIO_PRODUCTS_RELEASES_URL = "https://jb.gg/android-studio-releases-list.xml" - const val CACHE_REDIRECTOR = "https://cache-redirector.jetbrains.com" - const val INTELLIJ_DEPENDENCIES = "$CACHE_REDIRECTOR/intellij-dependencies" - const val DEFAULT_INTELLIJ_REPOSITORY = "$CACHE_REDIRECTOR/www.jetbrains.com/intellij-repository" - const val DEFAULT_INTELLIJ_PLUGINS_REPOSITORY = "$CACHE_REDIRECTOR/plugins.jetbrains.com/maven" - const val DEFAULT_JBR_REPOSITORY = "$CACHE_REDIRECTOR/intellij-jbr" - const val PLUGIN_VERIFIER_REPOSITORY = "$CACHE_REDIRECTOR/packages.jetbrains.team/maven/p/intellij-plugin-verifier/intellij-plugin-verifier" + const val INTELLIJ_DEPENDENCIES = "${Locations.CACHE_REDIRECTOR}/intellij-dependencies" + const val DEFAULT_INTELLIJ_REPOSITORY = "${Locations.CACHE_REDIRECTOR}/www.jetbrains.com/intellij-repository" + const val DEFAULT_INTELLIJ_PLUGINS_REPOSITORY = "${Locations.CACHE_REDIRECTOR}/plugins.jetbrains.com/maven" + const val PLUGIN_VERIFIER_REPOSITORY = "${Locations.CACHE_REDIRECTOR}/packages.jetbrains.team/maven/p/intellij-plugin-verifier/intellij-plugin-verifier" const val JAVA_COMPILER_ANT_TASKS_MAVEN_METADATA = "$DEFAULT_INTELLIJ_REPOSITORY/releases/com/jetbrains/intellij/java/java-compiler-ant-tasks/maven-metadata.xml" const val GITHUB_REPOSITORY = "https://github.com/jetbrains/gradle-intellij-plugin" diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ExtractorTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ExtractorTransformer.kt index 7771978775..0835005899 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ExtractorTransformer.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ExtractorTransformer.kt @@ -10,15 +10,18 @@ import org.gradle.api.artifacts.transform.TransformOutputs import org.gradle.api.artifacts.transform.TransformParameters import org.gradle.api.artifacts.type.ArtifactTypeDefinition.ZIP_TYPE import org.gradle.api.file.ArchiveOperations +import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.FileSystemLocation import org.gradle.api.file.FileSystemOperations import org.gradle.api.provider.Provider import org.gradle.api.tasks.Classpath +import org.gradle.api.tasks.Internal import org.gradle.kotlin.dsl.registerTransform import org.gradle.work.DisableCachingByDefault import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes import org.jetbrains.intellij.platform.gradleplugin.asPath +import java.io.File import java.io.File.separator import javax.inject.Inject import kotlin.io.path.name @@ -27,46 +30,61 @@ import kotlin.io.path.pathString // TODO: Allow for providing custom IDE dir? @DisableCachingByDefault(because = "Not worth caching") -abstract class IntelliJPlatformExtractTransformer @Inject constructor( +abstract class ExtractorTransformer @Inject constructor( private val archiveOperations: ArchiveOperations, private val fileSystemOperations: FileSystemOperations, -) : TransformAction { +) : TransformAction { + + interface Parameters : TransformParameters { + + @get:Internal + val intellijPlatform: ConfigurableFileCollection + + @get:Internal + val jetbrainsRuntime: ConfigurableFileCollection + } @get:Classpath @get:InputArtifact abstract val inputArtifact: Provider override fun transform(outputs: TransformOutputs) { - val input = inputArtifact.get().asPath - val extension = input.name.removePrefix(input.nameWithoutExtension.removeSuffix(".tar")) - val (groupId, artifactId, version) = input.pathString.split(separator).dropLast(2).takeLast(3) + val (file, path) = with(inputArtifact.get()) { asFile to asPath } + val extension = path.name.removePrefix(path.nameWithoutExtension.removeSuffix(".tar")) + val (groupId, artifactId, version) = path.pathString.split(separator).dropLast(2).takeLast(3) + // TODO: if a local ZIP file, i.e. with local plugin will be passed to PLUGIN configuration — that most likely will fail - val targetDirectory = listOf( - { // check if input is an IntelliJ Platform SDK artifact + val targetDirectory = when (file) { + in parameters.intellijPlatform -> { IntelliJPlatformType.values().find { groupId == it.groupId && artifactId == it.artifactId }?.let { "$it-$version" } - }, - { // check if input is an IntelliJ Platform Plugin fetched from JetBrains Marketplace + } + + in parameters.jetbrainsRuntime -> version + + in emptyList() -> { val marketplaceGroup = "com.jetbrains.plugins" val channel = when { groupId == marketplaceGroup -> "" groupId.endsWith(".$marketplaceGroup") -> groupId.dropLast(marketplaceGroup.length + 1) - else -> return@listOf null - } + else -> null + } ?: return "$artifactId-$version" + "@$channel".takeIf { channel.isNotEmpty() }.orEmpty() - }, - ).firstNotNullOfOrNull { it() }?.let { outputs.dir(it) } ?: return + } + + else -> null + }?.let { outputs.dir(it) } ?: return when (extension) { ".zip", ".sit" -> { fileSystemOperations.copy { - from(archiveOperations.zipTree(input)) + from(archiveOperations.zipTree(path)) into(targetDirectory) } } ".tar.gz" -> { fileSystemOperations.copy { - from(archiveOperations.tarTree(input)) + from(archiveOperations.tarTree(path)) into(targetDirectory) } } @@ -79,11 +97,17 @@ abstract class IntelliJPlatformExtractTransformer @Inject constructor( internal fun DependencyHandler.applyExtractorTransformer( compileClasspathConfiguration: Configuration, testCompileClasspathConfiguration: Configuration, + intellijPlatformDependencyConfiguration: Configuration, + jetbrainsRuntimeDependencyConfiguration: Configuration, ) { artifactTypes.maybeCreate(ZIP_TYPE) .attributes .attribute(Attributes.extracted, false) + artifactTypes.maybeCreate("tar.gz") + .attributes + .attribute(Attributes.extracted, false) + compileClasspathConfiguration .attributes .attribute(Attributes.extracted, true) @@ -92,10 +116,15 @@ internal fun DependencyHandler.applyExtractorTransformer( .attributes .attribute(Attributes.extracted, true) - registerTransform(IntelliJPlatformExtractTransformer::class) { + registerTransform(ExtractorTransformer::class) { from .attribute(Attributes.extracted, false) to .attribute(Attributes.extracted, true) + + parameters { + intellijPlatform.from(intellijPlatformDependencyConfiguration) + jetbrainsRuntime.from(jetbrainsRuntimeDependencyConfiguration) + } } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ProductInfoTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ProductInfoTransformer.kt index accf1905eb..4966b7549a 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ProductInfoTransformer.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ProductInfoTransformer.kt @@ -16,7 +16,7 @@ import org.gradle.kotlin.dsl.registerTransform import org.gradle.work.DisableCachingByDefault import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.resolveProductInfoPath +import org.jetbrains.intellij.platform.gradleplugin.model.resolveProductInfoPath @DisableCachingByDefault(because = "Not worth caching") abstract class ProductInfoTransformer : TransformAction { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/dependencies.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/dependencies.kt index d74f08f6de..80a4799ba3 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/dependencies.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/dependencies.kt @@ -5,17 +5,13 @@ package org.jetbrains.intellij.platform.gradleplugin.dependencies import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.dsl.DependencyHandler import org.gradle.api.file.DirectoryProperty -import org.gradle.api.file.ProjectLayout +import org.gradle.api.invocation.Gradle import org.gradle.api.model.ObjectFactory import org.gradle.api.plugins.ExtensionAware -import org.gradle.api.provider.ProviderFactory -import org.gradle.kotlin.dsl.create import org.gradle.kotlin.dsl.getByType import org.gradle.kotlin.dsl.newInstance -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Dependencies -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_DEPENDENCY_SETTINGS_NAME -import org.jetbrains.intellij.platform.gradleplugin.model.ProductInfo +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions +import org.jetbrains.kotlin.gradle.utils.projectCacheDir internal typealias DependencyAction = (Dependency.(settings: IntelliJPlatformDependencySettings) -> Unit) @@ -24,39 +20,13 @@ interface IntelliJPlatformDependencySettings { val ivyDirectory: DirectoryProperty } -internal fun DependencyHandler.applyIntelliJPlatformSettings(objects: ObjectFactory, providers: ProviderFactory, layout: ProjectLayout) { +internal fun DependencyHandler.applyIntelliJPlatformSettings(objects: ObjectFactory, gradle: Gradle) { val settings = objects.newInstance(IntelliJPlatformDependencySettings::class) - settings.ivyDirectory.convention(layout.projectDirectory.dir(".gradle/intellijPlatform/ivy")) + settings.ivyDirectory.dir(gradle.projectCacheDir.resolve("intellijPlatform/ivy").path) - (this as ExtensionAware).extensions.add(INTELLIJ_PLATFORM_DEPENDENCY_SETTINGS_NAME, settings) + (this as ExtensionAware).extensions.add(Extensions.INTELLIJ_PLATFORM_DEPENDENCY_SETTINGS, settings) } internal val DependencyHandler.intellijPlatformDependencySettings: IntelliJPlatformDependencySettings get() = (this as ExtensionAware).extensions.getByType() - - -internal fun DependencyHandler.create( - type: IntelliJPlatformType, - version: String, - settings: IntelliJPlatformDependencySettings = intellijPlatformDependencySettings, - action: DependencyAction = {}, -) = create( - group = type.groupId, - name = type.artifactId, - version = version, -).apply { - action(this, settings) -} - -internal fun DependencyHandler.create( - productInfo: ProductInfo, - settings: IntelliJPlatformDependencySettings = intellijPlatformDependencySettings, - action: DependencyAction = {}, -) = create( - group = Dependencies.INTELLIJ_PLATFORM_LOCAL_GROUP, - name = productInfo.productCode, - version = productInfo.version, -).apply { - action(this, settings) -} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt index 267b6be12e..555fc432a8 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt @@ -4,36 +4,50 @@ package org.jetbrains.intellij.platform.gradleplugin.dependencies +import org.gradle.api.artifacts.dsl.DependencyHandler import org.gradle.api.provider.Provider -import org.gradle.kotlin.dsl.DependencyHandlerScope +import org.gradle.kotlin.dsl.create import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations -internal fun DependencyHandlerScope.intellijPlatform( +internal fun DependencyHandler.intellijPlatform( type: IntelliJPlatformType, version: String, - configurationName: String = Configurations.INTELLIJ_PLATFORM, + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, ) = add(configurationName, create(type, version)) -internal fun DependencyHandlerScope.intellijPlatform( +internal fun DependencyHandler.intellijPlatform( type: IntelliJPlatformType, versionProvider: Provider, - configurationName: String = Configurations.INTELLIJ_PLATFORM, + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, ) = addProvider(configurationName, versionProvider.map { version -> create(type, version) }) -internal fun DependencyHandlerScope.intellijPlatform( +internal fun DependencyHandler.intellijPlatform( typeProvider: Provider, version: String, - configurationName: String = Configurations.INTELLIJ_PLATFORM, + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, ) = addProvider(configurationName, typeProvider.map { type -> create(type, version) }) -internal fun DependencyHandlerScope.intellijPlatform( +internal fun DependencyHandler.intellijPlatform( typeProvider: Provider, versionProvider: Provider, - configurationName: String = Configurations.INTELLIJ_PLATFORM, + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, ) = addProvider(configurationName, typeProvider.zip(versionProvider) { type, version -> create(type, version) }) +internal fun DependencyHandler.create( + type: IntelliJPlatformType, + version: String, + settings: IntelliJPlatformDependencySettings = intellijPlatformDependencySettings, + action: DependencyAction = {}, +) = create( + group = type.groupId, + name = type.artifactId, + version = version, +).apply { + action(this, settings) +} + // return when (type) { // IntellijIdeaUltimate -> create( // group = "com.jetbrains.intellij.idea", @@ -100,38 +114,38 @@ internal fun DependencyHandlerScope.intellijPlatform( // } // } -fun DependencyHandlerScope.intellijPlatform(type: String, version: String) = intellijPlatform(IntelliJPlatformType.fromCode(type), version) -fun DependencyHandlerScope.intellijPlatform(type: Provider, version: String) = intellijPlatform(type.map { IntelliJPlatformType.fromCode(it) }, version) -fun DependencyHandlerScope.intellijPlatform(type: String, version: Provider) = intellijPlatform(IntelliJPlatformType.fromCode(type), version) -fun DependencyHandlerScope.intellijPlatform(type: Provider, version: Provider) = +fun DependencyHandler.intellijPlatform(type: String, version: String) = intellijPlatform(IntelliJPlatformType.fromCode(type), version) +fun DependencyHandler.intellijPlatform(type: Provider, version: String) = intellijPlatform(type.map { IntelliJPlatformType.fromCode(it) }, version) +fun DependencyHandler.intellijPlatform(type: String, version: Provider) = intellijPlatform(IntelliJPlatformType.fromCode(type), version) +fun DependencyHandler.intellijPlatform(type: Provider, version: Provider) = intellijPlatform(type.map { IntelliJPlatformType.fromCode(it) }, version) -fun DependencyHandlerScope.androidStudio(version: String) = intellijPlatform(AndroidStudio, version) -fun DependencyHandlerScope.androidStudio(version: Provider) = intellijPlatform(AndroidStudio, version) +fun DependencyHandler.androidStudio(version: String) = intellijPlatform(AndroidStudio, version) +fun DependencyHandler.androidStudio(version: Provider) = intellijPlatform(AndroidStudio, version) -fun DependencyHandlerScope.clion(version: String) = intellijPlatform(CLion, version) -fun DependencyHandlerScope.clion(version: Provider) = intellijPlatform(CLion, version) +fun DependencyHandler.clion(version: String) = intellijPlatform(CLion, version) +fun DependencyHandler.clion(version: Provider) = intellijPlatform(CLion, version) -fun DependencyHandlerScope.gateway(version: String) = intellijPlatform(Gateway, version) -fun DependencyHandlerScope.gateway(version: Provider) = intellijPlatform(Gateway, version) +fun DependencyHandler.gateway(version: String) = intellijPlatform(Gateway, version) +fun DependencyHandler.gateway(version: Provider) = intellijPlatform(Gateway, version) -fun DependencyHandlerScope.goland(version: String) = intellijPlatform(GoLand, version) -fun DependencyHandlerScope.goland(version: Provider) = intellijPlatform(GoLand, version) +fun DependencyHandler.goland(version: String) = intellijPlatform(GoLand, version) +fun DependencyHandler.goland(version: Provider) = intellijPlatform(GoLand, version) -fun DependencyHandlerScope.intellijIdeaCommunity(version: String) = intellijPlatform(IntellijIdeaCommunity, version) -fun DependencyHandlerScope.intellijIdeaCommunity(version: Provider) = intellijPlatform(IntellijIdeaCommunity, version) +fun DependencyHandler.intellijIdeaCommunity(version: String) = intellijPlatform(IntellijIdeaCommunity, version) +fun DependencyHandler.intellijIdeaCommunity(version: Provider) = intellijPlatform(IntellijIdeaCommunity, version) -fun DependencyHandlerScope.intellijIdeaUltimate(version: String) = intellijPlatform(IntellijIdeaUltimate, version) -fun DependencyHandlerScope.intellijIdeaUltimate(version: Provider) = intellijPlatform(IntellijIdeaUltimate, version) +fun DependencyHandler.intellijIdeaUltimate(version: String) = intellijPlatform(IntellijIdeaUltimate, version) +fun DependencyHandler.intellijIdeaUltimate(version: Provider) = intellijPlatform(IntellijIdeaUltimate, version) -fun DependencyHandlerScope.phpstorm(version: String) = intellijPlatform(PhpStorm, version) -fun DependencyHandlerScope.phpstorm(version: Provider) = intellijPlatform(PhpStorm, version) +fun DependencyHandler.phpstorm(version: String) = intellijPlatform(PhpStorm, version) +fun DependencyHandler.phpstorm(version: Provider) = intellijPlatform(PhpStorm, version) -fun DependencyHandlerScope.pycharmProfessional(version: String) = intellijPlatform(PyCharmProfessional, version) -fun DependencyHandlerScope.pycharmProfessional(version: Provider) = intellijPlatform(PyCharmProfessional, version) +fun DependencyHandler.pycharmProfessional(version: String) = intellijPlatform(PyCharmProfessional, version) +fun DependencyHandler.pycharmProfessional(version: Provider) = intellijPlatform(PyCharmProfessional, version) -fun DependencyHandlerScope.pycharmCommunity(version: String) = intellijPlatform(PyCharmCommunity, version) -fun DependencyHandlerScope.pycharmCommunity(version: Provider) = intellijPlatform(PyCharmCommunity, version) +fun DependencyHandler.pycharmCommunity(version: String) = intellijPlatform(PyCharmCommunity, version) +fun DependencyHandler.pycharmCommunity(version: Provider) = intellijPlatform(PyCharmCommunity, version) -fun DependencyHandlerScope.rider(version: String) = intellijPlatform(Rider, version) -fun DependencyHandlerScope.rider(version: Provider) = intellijPlatform(Rider, version) +fun DependencyHandler.rider(version: String) = intellijPlatform(Rider, version) +fun DependencyHandler.rider(version: Provider) = intellijPlatform(Rider, version) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt index ec10da9c82..739230a816 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt @@ -9,13 +9,14 @@ import org.gradle.api.Project import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.dsl.DependencyHandler import org.gradle.internal.os.OperatingSystem +import org.gradle.kotlin.dsl.create import org.jetbrains.intellij.platform.gradleplugin.BuildException import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.INTELLIJ_PLATFORM_LOCAL_INSTANCE +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Dependencies import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MINIMAL_SUPPORTED_INTELLIJ_PLATFORM_VERSION import org.jetbrains.intellij.platform.gradleplugin.Version import org.jetbrains.intellij.platform.gradleplugin.asPath import org.jetbrains.intellij.platform.gradleplugin.model.* -import org.jetbrains.intellij.platform.gradleplugin.productInfo import java.nio.file.Path import java.time.LocalDateTime import java.time.format.DateTimeFormatter @@ -88,3 +89,16 @@ val Project.intellijPlatformLocal: DependencyHandler.(String) -> Dependency? add(INTELLIJ_PLATFORM_LOCAL_INSTANCE, dependency) } + + +internal fun DependencyHandler.create( + productInfo: ProductInfo, + settings: IntelliJPlatformDependencySettings = intellijPlatformDependencySettings, + action: DependencyAction = {}, +) = create( + group = Dependencies.INTELLIJ_PLATFORM_LOCAL_GROUP, + name = productInfo.productCode, + version = productInfo.version, +).apply { + action(this, settings) +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsRuntime.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsRuntime.kt new file mode 100644 index 0000000000..a2773c3338 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsRuntime.kt @@ -0,0 +1,114 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.dependencies + +import org.gradle.api.Project +import org.gradle.api.artifacts.Dependency +import org.gradle.api.artifacts.dsl.DependencyHandler +import org.gradle.internal.os.OperatingSystem +import org.gradle.kotlin.dsl.create +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Locations +import org.jetbrains.intellij.platform.gradleplugin.Version +import java.net.URI + +val Project.jetbrainsRuntime: DependencyHandler.(String, String, String) -> Dependency? + get() = { version, variant, architecture -> + jetbrainsRuntimeExplicit(from(version, variant, architecture)) + } + +val Project.jetbrainsRuntimeExplicit: DependencyHandler.(String) -> Dependency? + get() = { artifactName -> + val dependency = create( + group = "com.jetbrains", + name = "jbr", + version = artifactName, + ext = "tar.gz", + ) + + this@jetbrainsRuntimeExplicit.repositories.ivy { + url = URI(Locations.JETBRAINS_RUNTIME_REPOSITORY) + patternLayout { artifact("[revision].tar.gz") } + metadataSources { artifact() } + } + + add(Configurations.JETBRAINS_RUNTIME_DEPENDENCY, dependency) + } + +private fun from(jbrVersion: String, jbrVariant: String?, jbrArch: String?, operatingSystem: OperatingSystem = OperatingSystem.current()): String { + val version = "8".takeIf { jbrVersion.startsWith('u') }.orEmpty() + jbrVersion + var prefix = getPrefix(version, jbrVariant) + val lastIndexOfB = version.lastIndexOf('b') + val lastIndexOfDash = version.lastIndexOf('-') + 1 + val majorVersion = when (lastIndexOfB > -1) { + true -> version.substring(lastIndexOfDash, lastIndexOfB) + false -> version.substring(lastIndexOfDash) + } + val buildNumberString = when (lastIndexOfB > -1) { + (lastIndexOfDash == lastIndexOfB) -> version.substring(0, lastIndexOfDash - 1) + true -> version.substring(lastIndexOfB + 1) + else -> "" + } + val buildNumber = Version.parse(buildNumberString) + val isJava8 = majorVersion.startsWith("8") + val isJava17 = majorVersion.startsWith("17") + + val oldFormat = prefix == "jbrex" || isJava8 && buildNumber < Version.parse("1483.24") + if (oldFormat) { + return "jbrex${majorVersion}b${buildNumberString}_${platform(operatingSystem)}_${arch(false)}" + } + + val arch = jbrArch ?: arch(isJava8) + if (prefix.isEmpty()) { + prefix = when { + isJava17 -> "jbr_jcef-" + isJava8 -> "jbrx-" + operatingSystem.isMacOsX && arch == "aarch64" -> "jbr_jcef-" + buildNumber < Version.parse("1319.6") -> "jbr-" + else -> "jbr_jcef-" + } + } + + return "$prefix$majorVersion-${platform(operatingSystem)}-$arch-b$buildNumberString" +} + +private fun getPrefix(version: String, variant: String?) = when { + !variant.isNullOrEmpty() -> when (variant) { + "sdk" -> "jbrsdk-" + else -> "jbr_$variant-" + } + + version.startsWith("jbrsdk-") -> "jbrsdk-" + version.startsWith("jbr_jcef-") -> "jbr_jcef-" + version.startsWith("jbr_dcevm-") -> "jbr_dcevm-" + version.startsWith("jbr_fd-") -> "jbr_fd-" + version.startsWith("jbr_nomod-") -> "jbr_nomod-" + version.startsWith("jbr-") -> "jbr-" + version.startsWith("jbrx-") -> "jbrx-" + version.startsWith("jbrex8") -> "jbrex" + else -> "" +} + +internal fun platform(operatingSystem: OperatingSystem) = when { + operatingSystem.isWindows -> "windows" + operatingSystem.isMacOsX -> "osx" + else -> "linux" +} + +internal fun arch(newFormat: Boolean): String { + val arch = System.getProperty("os.arch") + if ("aarch64" == arch || "arm64" == arch) { + return "aarch64" + } + if ("x86_64" == arch || "amd64" == arch) { + return "x64" + } + val name = System.getProperty("os.name") + if (name.contains("Windows") && System.getenv("ProgramFiles(x86)") != null) { + return "x64" + } + return when (newFormat) { + true -> "i586" + false -> "x86" + } +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/BuiltinPluginsRegistry.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/BuiltinPluginsRegistry.kt index d109bd4279..be36f7aa17 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/BuiltinPluginsRegistry.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/BuiltinPluginsRegistry.kt @@ -10,7 +10,7 @@ import org.jetbrains.intellij.platform.gradleplugin.debug import org.jetbrains.intellij.platform.gradleplugin.model.PluginsCache import org.jetbrains.intellij.platform.gradleplugin.model.PluginsCachePlugin import org.jetbrains.intellij.platform.gradleplugin.model.XmlExtractor -import org.jetbrains.intellij.platform.gradleplugin.productInfo +import org.jetbrains.intellij.platform.gradleplugin.model.productInfo import org.jetbrains.intellij.platform.gradleplugin.warn import java.io.File import java.io.Serializable diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt index 8dbc010163..50b04c021c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt @@ -14,6 +14,7 @@ import org.gradle.kotlin.dsl.create import org.jetbrains.intellij.platform.gradleplugin.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT +import org.jetbrains.intellij.platform.gradleplugin.model.productInfo import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader import java.io.File diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt index f1cc78c0ba..252b7b6277 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt @@ -2,6 +2,7 @@ package org.jetbrains.intellij.platform.gradleplugin.extensions +import org.gradle.api.file.DirectoryProperty import org.gradle.api.plugins.ExtensionAware import org.gradle.api.provider.Property import org.gradle.kotlin.dsl.getByName @@ -13,6 +14,15 @@ annotation class IntelliJPlatform @IntelliJPlatform interface IntelliJPlatformExtension : ExtensionAware { + /** + * Instrument Java classes with nullability assertions and compile forms created by IntelliJ GUI Designer. + * + * Default value: `true` + */ + val instrumentCode: Property + + val sandboxContainer: DirectoryProperty + val pluginConfiguration get() = extensions.getByName(Extensions.PLUGIN_CONFIGURATION) @@ -21,8 +31,10 @@ interface IntelliJPlatformExtension : ExtensionAware { val productDescriptor get() = extensions.getByName(Extensions.PRODUCT_DESCRIPTOR) + val ideaVersion get() = extensions.getByName(Extensions.IDEA_VERSION) + val vendor get() = extensions.getByName(Extensions.VENDOR) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/Jbr.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/Jbr.kt deleted file mode 100644 index 632362e49c..0000000000 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/Jbr.kt +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -package org.jetbrains.intellij.platform.gradleplugin.jbr - -import java.nio.file.Path - -data class Jbr( - val version: String, - val javaHome: Path, - val javaExecutable: String?, -) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolver.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolver.kt deleted file mode 100644 index 83d86b49e3..0000000000 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolver.kt +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -package org.jetbrains.intellij.platform.gradleplugin.jbr - -import com.jetbrains.plugin.structure.base.utils.exists -import com.jetbrains.plugin.structure.base.utils.listFiles -import com.jetbrains.plugin.structure.base.utils.simpleName -import org.gradle.api.provider.Provider -import org.gradle.internal.jvm.Jvm -import org.gradle.internal.os.OperatingSystem -import org.gradle.jvm.toolchain.JavaToolchainService -import org.gradle.jvm.toolchain.JavaToolchainSpec -import org.gradle.jvm.toolchain.internal.DefaultJvmVendorSpec -import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_JBR_REPOSITORY -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JETBRAINS_JAVA_TOOLCHAIN_VENDOR_NAME -import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils -import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader -import org.jetbrains.intellij.platform.gradleplugin.utils.ivyRepository -import java.io.File -import java.io.FileReader -import java.io.IOException -import java.nio.file.Path -import java.util.* -import javax.inject.Inject - -abstract class JbrResolver @Inject constructor( - private val jreRepository: Provider, - private val archiveUtils: ArchiveUtils, - private val dependenciesDownloader: DependenciesDownloader, - private val javaToolchainSpec: JavaToolchainSpec, - private val javaToolchainService: JavaToolchainService, - private val context: String?, -) { - - private val operatingSystem = OperatingSystem.current() - - fun resolveRuntimeDir( - runtimeDir: String? = null, - jbrVersion: String? = null, - jbrVariant: String? = null, - jbrArch: String? = null, - ideDir: File? = null, - validate: (executable: Path) -> Boolean = { true }, - ) = resolveRuntime(runtimeDir, jbrVersion, jbrVariant, jbrArch, ideDir, false, validate) - - fun resolveRuntime( - runtimeDir: String? = null, - jbrVersion: String? = null, - jbrVariant: String? = null, - jbrArch: String? = null, - ideDir: File? = null, - resolveExecutable: Boolean = true, - validate: (executable: Path) -> Boolean = { true }, - ): Path? { - debug(context, "Resolving runtime directory.") - - return listOf( - { - runtimeDir?.let { path -> - Path.of(path) - .let(::getJbrRoot) - .run { - when (resolveExecutable) { - true -> resolve("bin/java") - else -> this - } - } - .takeIf(Path::exists) - .also { debug(context, "Runtime specified with runtimeDir='$path' resolved as: $it") } - .ifNull { debug(context, "Cannot resolve runtime with runtimeDir='$path'") } - } - }, - { - jbrVersion?.let { version -> - resolve(version, jbrVariant, jbrArch)?.run { - when (resolveExecutable) { - true -> javaExecutable?.let { Path.of(it) } - else -> javaHome.let(::getJbrRoot) - } - } - .also { debug(context, "Runtime specified with jbrVersion='$version', jbrVariant='$jbrVariant', jbrArch='$jbrArch' resolved as: $it") } - .ifNull { debug(context, "Cannot resolve runtime with jbrVersion='$version', jbrVariant='$jbrVariant', jbrArch='$jbrArch'") } - } - }, - { - @Suppress("UnstableApiUsage") - javaToolchainSpec.vendor.orNull - ?.takeUnless { it == DefaultJvmVendorSpec.any() } - ?.takeIf { it.matches(JETBRAINS_JAVA_TOOLCHAIN_VENDOR_NAME) } - ?.let { javaToolchainService.launcherFor(javaToolchainSpec).get() } - ?.let { javaLauncher -> - val path = javaLauncher.metadata.installationPath.asPath.let(::getJbrRoot) - - path - .run { - when (resolveExecutable) { - true -> resolve("bin/java") - else -> this - } - } - .takeIf(Path::exists) - .also { debug(context, "Runtime specified with gradle project java toolchain='$path' resolved as: $it") } - .ifNull { debug(context, "Cannot resolve runtime specified with gradle project java toolchain='$path'") } - } - }, - { - ideDir?.let { file -> - file - .toPath() - .let(::getJbrRoot) - .run { - resolve("bin/java").takeIf(Path::exists)?.let { executable -> - when (resolveExecutable) { - true -> executable - else -> takeIf { executable.exists() } - } - } - } - .also { debug(context, "Runtime specified with ideDir='$file' resolved as: $it") } - .ifNull { debug(context, "Cannot resolve runtime with ideDir='$file'") } - } - }, - { - ideDir?.let { file -> - getBuiltinJbrVersion(file) - ?.let { version -> - resolve(version, jbrVariant, jbrArch)?.run { - when (resolveExecutable) { - true -> javaExecutable?.let { Path.of(it) } - else -> javaHome.let(::getJbrRoot) - } - } - .also { debug(context, "Runtime specified with ideDir='$file', version='$version' resolved as: $it") } - .ifNull { debug(context, "Cannot resolve runtime with ideDir='$file', version='$version'") } - } - .ifNull { debug(context, "Cannot resolve runtime with ideDir='$file'") } - } - }, - { - Jvm.current() - .run { - when (resolveExecutable) { - true -> javaExecutable.toPath() - false -> javaHome.toPath().let(::getJbrRoot) - } - } - .also { debug(context, "Using current JVM: $it") } - .ifNull { debug(context, "Cannot resolve current JVM") } - }, - ) - .asSequence() - .mapNotNull { it()?.takeIf(validate) } - .firstOrNull() - ?.also { info(context, "Resolved JVM Runtime directory: $it") } - } - - fun resolve(version: String?, variant: String?, arch: String?): Jbr? { - if (version.isNullOrEmpty()) { - return null - } - val jbrArtifact = JbrArtifact.from(version, variant, arch, operatingSystem) - - return getJavaArchive(jbrArtifact)?.let { - val javaDir = Path.of(it.toString().replaceAfter(jbrArtifact.name, "")).resolve("extracted") - archiveUtils.extract(it, javaDir, context) - fromDir(javaDir, version) - } - } - - private fun fromDir(javaDir: Path, version: String) = - findJavaExecutable(javaDir) - ?.let { Jbr(version, javaDir, it.toFile().canonicalPath) } - .ifNull { warn(context, "Cannot find java executable in: $javaDir") } - - private fun getJavaArchive(jbrArtifact: JbrArtifact): Path? { - val url = jreRepository - .orNull - .takeUnless { it.isNullOrBlank() } - .or(jbrArtifact.repositoryUrl) - - return try { - dependenciesDownloader.downloadFromRepository(context, { - create( - group = "com.jetbrains", - name = "jbre", - version = jbrArtifact.name, - ext = "tar.gz", - ) - }, { - ivyRepository(url, "[revision].tar.gz") - }, true).first().toPath() - } catch (e: Exception) { - warn(context, "Cannot download JetBrains Java Runtime '${jbrArtifact.name}'") - null - } - } - - private fun findJavaExecutable(javaHome: Path): Path? { - val root = getJbrRoot(javaHome) - val jre = root.resolve("jre") - val java = jre - .takeIf { it.exists() } - .or(root) - .resolve("bin/java" + ".exe".takeIf { operatingSystem.isWindows }.orEmpty()) - return java.takeIf { java.exists() } - } - - private fun getJbrRoot(javaHome: Path): Path { - val jbr = javaHome.listFiles().firstOrNull { it.simpleName.startsWith("jbr") }?.takeIf(Path::exists) - return when { - operatingSystem.isMacOsX -> when { - javaHome.endsWith("Contents/Home") -> javaHome - jbr != null -> jbr.resolve("Contents/Home") - else -> javaHome.resolve("jdk/Contents/Home") - } - - else -> when { - jbr != null -> jbr - else -> javaHome - } - } - } - - private fun getBuiltinJbrVersion(ideDirectory: File): String? { - val dependenciesFile = File(ideDirectory, "dependencies.txt") - if (dependenciesFile.exists()) { - val properties = Properties() - val reader = FileReader(dependenciesFile) - try { - properties.load(reader) - return properties.getProperty("runtimeBuild") ?: properties.getProperty("jdkBuild") - } catch (ignore: IOException) { - } finally { - reader.close() - } - } - return null - } - - internal class JbrArtifact(val name: String, val repositoryUrl: String) { - - companion object { - fun from(jbrVersion: String, jbrVariant: String?, jbrArch: String?, operatingSystem: OperatingSystem): JbrArtifact { - val version = "8".takeIf { jbrVersion.startsWith('u') }.orEmpty() + jbrVersion - var prefix = getPrefix(version, jbrVariant) - val lastIndexOfB = version.lastIndexOf('b') - val lastIndexOfDash = version.lastIndexOf('-') + 1 - val majorVersion = when (lastIndexOfB > -1) { - true -> version.substring(lastIndexOfDash, lastIndexOfB) - false -> version.substring(lastIndexOfDash) - } - val buildNumberString = when (lastIndexOfB > -1) { - (lastIndexOfDash == lastIndexOfB) -> version.substring(0, lastIndexOfDash - 1) - true -> version.substring(lastIndexOfB + 1) - else -> "" - } - val buildNumber = Version.parse(buildNumberString) - val isJava8 = majorVersion.startsWith("8") - val isJava17 = majorVersion.startsWith("17") - - val oldFormat = prefix == "jbrex" || isJava8 && buildNumber < Version.parse("1483.24") - if (oldFormat) { - return JbrArtifact( - "jbrex${majorVersion}b${buildNumberString}_${platform(operatingSystem)}_${arch(false)}", - DEFAULT_JBR_REPOSITORY, - ) - } - - val arch = jbrArch ?: arch(isJava8) - if (prefix.isEmpty()) { - prefix = when { - isJava17 -> "jbr_jcef-" - isJava8 -> "jbrx-" - operatingSystem.isMacOsX && arch == "aarch64" -> "jbr_jcef-" - buildNumber < Version.parse("1319.6") -> "jbr-" - else -> "jbr_jcef-" - } - } - - return JbrArtifact( - "$prefix$majorVersion-${platform(operatingSystem)}-$arch-b$buildNumberString", - DEFAULT_JBR_REPOSITORY, - ) - } - - private fun getPrefix(version: String, variant: String?) = when { - !variant.isNullOrEmpty() -> when (variant) { - "sdk" -> "jbrsdk-" - else -> "jbr_$variant-" - } - - version.startsWith("jbrsdk-") -> "jbrsdk-" - version.startsWith("jbr_jcef-") -> "jbr_jcef-" - version.startsWith("jbr_dcevm-") -> "jbr_dcevm-" - version.startsWith("jbr_fd-") -> "jbr_fd-" - version.startsWith("jbr_nomod-") -> "jbr_nomod-" - version.startsWith("jbr-") -> "jbr-" - version.startsWith("jbrx-") -> "jbrx-" - version.startsWith("jbrex8") -> "jbrex" - else -> "" - } - - internal fun platform(operatingSystem: OperatingSystem) = when { - operatingSystem.isWindows -> "windows" - operatingSystem.isMacOsX -> "osx" - else -> "linux" - } - - internal fun arch(newFormat: Boolean): String { - val arch = System.getProperty("os.arch") - if ("aarch64" == arch || "arm64" == arch) { - return "aarch64" - } - if ("x86_64" == arch || "amd64" == arch) { - return "x64" - } - val name = System.getProperty("os.name") - if (name.contains("Windows") && System.getenv("ProgramFiles(x86)") != null) { - return "x64" - } - return when (newFormat) { - true -> "i586" - false -> "x86" - } - } - } - } -} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JetBrainsRuntimeResolver.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JetBrainsRuntimeResolver.kt new file mode 100644 index 0000000000..39db358834 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JetBrainsRuntimeResolver.kt @@ -0,0 +1,121 @@ +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.jbr + +import com.jetbrains.plugin.structure.base.utils.exists +import com.jetbrains.plugin.structure.base.utils.listFiles +import com.jetbrains.plugin.structure.base.utils.simpleName +import org.gradle.api.artifacts.Configuration +import org.gradle.internal.jvm.Jvm +import org.gradle.internal.os.OperatingSystem +import org.gradle.jvm.toolchain.JavaToolchainService +import org.gradle.jvm.toolchain.JavaToolchainSpec +import org.gradle.jvm.toolchain.internal.DefaultJvmVendorSpec +import org.jetbrains.intellij.platform.gradleplugin.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JETBRAINS_RUNTIME_VENDOR +import java.io.File +import java.io.FileReader +import java.io.IOException +import java.nio.file.Path +import java.util.* + +class JetBrainsRuntimeResolver( + val jetbrainsRuntimeConfiguration: Configuration, + val intellijPlatformConfiguration: Configuration, + val javaToolchainSpec: JavaToolchainSpec, + val javaToolchainService: JavaToolchainService, + val context: String? = null, +) { + fun resolveExecutable(validate: (executable: Path) -> Boolean = { true }) = resolveDirectory(validate)?.findJavaExecutable() + + fun resolveDirectory(validate: (executable: Path) -> Boolean = { true }): Path? { + debug(context, "Resolving runtime directory.") + + return listOf( + /** + * Use JetBrains Runtime provided via [IntelliJPluginConstants.Configurations.JETBRAINS_RUNTIME_DEPENDENCY] configuration. + * To add a custom JetBrains Runtime, use [org.jetbrains.intellij.platform.gradleplugin.dependencies.jetbrainsRuntime] + * or [org.jetbrains.intellij.platform.gradleplugin.dependencies.jetbrainsRuntimeExplicit]. + */ + { + jetbrainsRuntimeConfiguration.singleOrNull()?.let { file -> + file.toPath().getJbrRoot() + .also { debug(context, "JetBrains Runtime specified with dependencies resolved as: $it") } + .ifNull { debug(context, "Cannot resolve JetBrains Runtime: $file") } + } + }, + { + javaToolchainSpec.vendor.orNull + ?.takeUnless { it == DefaultJvmVendorSpec.any() } + ?.takeIf { + @Suppress("UnstableApiUsage") + it.matches(JETBRAINS_RUNTIME_VENDOR) + } + ?.let { javaToolchainService.launcherFor(javaToolchainSpec).get() } + ?.let { javaLauncher -> + javaLauncher.metadata.installationPath.asPath.getJbrRoot() + .also { debug(context, "JetBrains Runtime specified with Java Toolchain resolved as: $it") } + .ifNull { debug(context, "Cannot resolve JetBrains Runtime specified with Java Toolchain") } + } + }, + { + intellijPlatformConfiguration.singleOrNull()?.let { file -> + file.toPath().getJbrRoot() + .also { debug(context, "JetBrains Runtime bundled within IntelliJ Platform resolved as: $it") } + .ifNull { debug(context, "Cannot resolve JetBrains Runtime bundled within IntelliJ Platform: $file") } + } + }, + { + Jvm.current().javaHome.toPath().getJbrRoot() + .also { debug(context, "Using current JVM: $it") } + .ifNull { debug(context, "Cannot resolve current JVM") } + }, + ) + .asSequence() + .mapNotNull { it()?.takeIf(validate) } + .firstOrNull() + ?.also { info(context, "Resolved JetBrains Runtime directory: $it") } + } + + private fun getBuiltinJbrVersion(ideDirectory: File): String? { + val dependenciesFile = File(ideDirectory, "dependencies.txt") + if (dependenciesFile.exists()) { + val properties = Properties() + val reader = FileReader(dependenciesFile) + try { + properties.load(reader) + return properties.getProperty("runtimeBuild") ?: properties.getProperty("jdkBuild") + } catch (ignore: IOException) { + } finally { + reader.close() + } + } + return null + } +} + +internal fun Path.findJavaExecutable() = getJbrRoot().let { root -> + root + .resolve("jre") + .takeIf { it.exists() } + .or(root) + .resolve("bin/java" + ".exe".takeIf { OperatingSystem.current().isWindows }.orEmpty()) + .takeIf { it.exists() } +} + +internal fun Path.getJbrRoot(): Path { + val jbr = listFiles().firstOrNull { it.simpleName.startsWith("jbr") }?.takeIf { it.exists() } + + return when { + OperatingSystem.current().isMacOsX -> when { + endsWith("Contents/Home") -> this + jbr != null -> jbr.resolve("Contents/Home") + else -> resolve("jdk/Contents/Home") + } + + else -> when { + jbr != null -> jbr + else -> this + } + } +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt index fa9d538c87..b26afd0000 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt @@ -2,14 +2,19 @@ package org.jetbrains.intellij.platform.gradleplugin.model +import com.jetbrains.plugin.structure.base.utils.readText import kotlinx.serialization.Serializable +import kotlinx.serialization.json.Json import org.gradle.api.GradleException import org.gradle.internal.os.OperatingSystem +import java.nio.file.Path +import kotlin.io.path.exists +import kotlin.io.path.name @Serializable data class ProductInfo( val name: String? = null, - val version: String? = null, + val version: String = "", val versionSuffix: String? = null, val buildNumber: String = "", val productCode: String = "", @@ -45,11 +50,7 @@ data class ProductInfo( } == it.os && arch == it.arch } ?: throw GradleException("Could not find launch information for the current OS: $name ($arch)") }.run { - copy( - additionalJvmArguments = additionalJvmArguments.map { - it.removePrefix("\"").removeSuffix("\"") - } - ) + copy(additionalJvmArguments = additionalJvmArguments.map { it.trim('"') }) } } @@ -75,3 +76,18 @@ data class CustomProperty( enum class OS { Linux, Windows, macOS } + + +internal fun ProductInfo.getBootClasspath(ideDir: Path) = + currentLaunch + .bootClassPathJarNames + .map { "$ideDir/lib/$it" } + +internal fun Path.resolveProductInfoPath(name: String = "product-info.json") = + listOf(this, resolve(name), resolve("Resources").resolve(name)) + .find { it.name == name && it.exists() } + ?: throw GradleException("Could not resolve $name file in: $this") + +private val json = Json { ignoreUnknownKeys = true } +internal fun Path.productInfo() = resolveProductInfoPath() + .run { json.decodeFromString(readText()) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt index 78c8e4759f..d50689db55 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt @@ -6,18 +6,22 @@ import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.plugins.ExtensionAware +import org.gradle.api.plugins.JavaPluginExtension import org.gradle.api.tasks.TaskContainer -import org.gradle.kotlin.dsl.assign -import org.gradle.kotlin.dsl.create -import org.gradle.kotlin.dsl.getByName -import org.gradle.kotlin.dsl.register +import org.gradle.jvm.toolchain.JavaToolchainService +import org.gradle.kotlin.dsl.* +import org.gradle.kotlin.dsl.support.serviceOf import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension import org.jetbrains.intellij.platform.gradleplugin.info +import org.jetbrains.intellij.platform.gradleplugin.jbr.JetBrainsRuntimeResolver import org.jetbrains.intellij.platform.gradleplugin.logCategory -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.IdeVersionAwareTask +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.JetBrainsRuntimeAware +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.PlatformVersionAware +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.SandboxAware abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plugin { @@ -34,15 +38,56 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu protected abstract fun Project.configure() - protected inline fun TaskContainer.configureTask(name: String, noinline configuration: T.() -> Unit = {}) { - info(context, "Configuring task: $name") - val task = findByName(name) as? T ?: register(name).get() + protected inline fun TaskContainer.configureTask(vararg names: String, noinline configuration: T.() -> Unit = {}) { + names.forEach { name -> + info(context, "Configuring task: $name") + val task = findByName(name) as? T ?: register(name).get() + val extension = task.project.intelliJPlatformExtension - with(task) { - if (this is IdeVersionAwareTask) { - intelliJPlatformProductInfo = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) + with(task) { + if (this is PlatformVersionAware) { + intelliJPlatformProductInfo = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) + } + + if (this is SandboxAware) { + sandboxDirectory.convention(extension.sandboxContainer.map { + it.dir("$platformType-$platformVersion") + }) + configDirectory.convention(sandboxDirectory.map { + it.dir(Sandbox.CONFIG).apply { + asFile.mkdirs() + } + }) + pluginsDirectory.convention(sandboxDirectory.map { + it.dir(Sandbox.PLUGINS).apply { + asFile.mkdirs() + } + }) + systemDirectory.convention(sandboxDirectory.map { + it.dir(Sandbox.SYSTEM).apply { + asFile.mkdirs() + } + }) + } + + if (this is JetBrainsRuntimeAware) { + val jbrResolver = JetBrainsRuntimeResolver( + jetbrainsRuntimeConfiguration = project.configurations.getByName(Configurations.JETBRAINS_RUNTIME), + intellijPlatformConfiguration = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM), + javaToolchainSpec = project.extensions.getByType().toolchain, + javaToolchainService = project.serviceOf(), + ) + + jetbrainsRuntimeDirectory.convention(project.layout.dir(project.provider { + jbrResolver.resolveDirectory()?.toFile() + })) + jetbrainsRuntimeExecutable.convention(project.layout.file(project.provider { + jbrResolver.resolveExecutable()?.toFile() + })) + } + + configuration() } - configuration() } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt index d3bb5458d0..832ba81729 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt @@ -14,6 +14,7 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Conf import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_TEST_FIXTURES_PLUGIN_ID import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_BASE_ID +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyCollectorTransformer import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyExtractorTransformer import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyProductInfoTransformer @@ -34,12 +35,17 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi } with(configurations) { - val intellijPlatformConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM) + val intellijPlatformDependencyConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM_DEPENDENCY) .apply { isVisible = false isCanBeConsumed = false isCanBeResolved = true - description = "IntelliJ Platform dependency" + description = "IntelliJ Platform dependency archive" + + attributes { +// attribute(Attributes.artifactType, ArtifactType.INTELLIJ_PLATFORM) + attribute(Attributes.extracted, false) + } } val intellijPlatformLocalConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM_LOCAL_INSTANCE) @@ -47,27 +53,78 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi isVisible = false isCanBeConsumed = false isCanBeResolved = true - description = "IntelliJ Platform local IDE dependency" + description = "IntelliJ Platform local instance" attributes { attribute(Attributes.extracted, true) } } - maybeCreate(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) + val intellijPlatformConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM) .apply { isVisible = false isCanBeConsumed = false isCanBeResolved = true - description = "IntelliJ Platform dependency build number" + description = "IntelliJ Platform" attributes { attribute(Attributes.extracted, true) + } + + extendsFrom(intellijPlatformDependencyConfiguration, intellijPlatformLocalConfiguration) + } + + maybeCreate(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) + .apply { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + description = "IntelliJ Platform product info" + + attributes { attribute(Attributes.productInfo, true) } extendsFrom(intellijPlatformConfiguration) - extendsFrom(intellijPlatformLocalConfiguration) + } + + val jetbrainsRuntimeDependencyConfiguration = maybeCreate(Configurations.JETBRAINS_RUNTIME_DEPENDENCY) + .apply { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + description = "JetBrains Runtime dependency archive" + + attributes { + attribute(Attributes.extracted, false) + } + } + + val jetbrainsRuntimeLocalConfiguration = maybeCreate(Configurations.JETBRAINS_RUNTIME_LOCAL_INSTANCE) + .apply { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + description = "JetBrains Runtime local instance" + + attributes { + attribute(Attributes.extracted, true) + } + } + + maybeCreate(Configurations.JETBRAINS_RUNTIME) + .apply { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + description = "JetBrains Runtime" + + attributes { + attribute(Attributes.extracted, true) + } + + extendsFrom(jetbrainsRuntimeDependencyConfiguration) + extendsFrom(jetbrainsRuntimeLocalConfiguration) } val intellijPlatformDependenciesConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM_DEPENDENCIES) @@ -75,12 +132,11 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi isVisible = false isCanBeConsumed = false isCanBeResolved = true - description = "IntelliJ Platform Dependencies dependency" + description = "IntelliJ Platform extra dependencies" } fun Configuration.extend() = extendsFrom( intellijPlatformConfiguration, - intellijPlatformLocalConfiguration, intellijPlatformDependenciesConfiguration, ) @@ -102,17 +158,19 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi } with(dependencies) { - applyIntelliJPlatformSettings(objects, providers, layout) + applyIntelliJPlatformSettings(objects, gradle) attributesSchema { - attribute(Attributes.productInfo) attribute(Attributes.collected) attribute(Attributes.extracted) + attribute(Attributes.productInfo) } applyExtractorTransformer( configurations.getByName(COMPILE_CLASSPATH_CONFIGURATION_NAME), configurations.getByName(TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME), + configurations.getByName(Configurations.INTELLIJ_PLATFORM_DEPENDENCY), + configurations.getByName(Configurations.JETBRAINS_RUNTIME_DEPENDENCY), ) applyCollectorTransformer( configurations.getByName(COMPILE_CLASSPATH_CONFIGURATION_NAME), @@ -123,6 +181,9 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi with(IntelliJPluginConstants.Extensions) { this@configure.configureExtension(INTELLIJ_PLATFORM) { + instrumentCode.convention(true) + sandboxContainer.convention(project.layout.buildDirectory.dir(Sandbox.CONTAINER)) + configureExtension(PLUGIN_CONFIGURATION) { configureExtension(PRODUCT_DESCRIPTOR) configureExtension(IDEA_VERSION) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt index 098e4ca0f7..79c5e86c11 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt @@ -9,11 +9,9 @@ import com.jetbrains.plugin.structure.intellij.version.IdeVersion import org.gradle.api.GradleException import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.DependencySet import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.DuplicatesStrategy -import org.gradle.api.internal.plugins.DefaultArtifactPublicationSet import org.gradle.api.logging.LogLevel import org.gradle.api.plugins.JavaPlugin import org.gradle.api.plugins.JavaPlugin.* @@ -26,8 +24,6 @@ import org.gradle.api.tasks.bundling.Jar import org.gradle.api.tasks.bundling.Zip import org.gradle.api.tasks.compile.JavaCompile import org.gradle.api.tasks.testing.Test -import org.gradle.internal.jvm.Jvm -import org.gradle.internal.os.OperatingSystem import org.gradle.jvm.toolchain.JavaToolchainService import org.gradle.kotlin.dsl.* import org.gradle.kotlin.dsl.support.serviceOf @@ -37,12 +33,10 @@ import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.NO_SEARCHABLE_O import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.PAID_PLUGIN_SEARCHABLE_OPTIONS_WARNING import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANDROID_STUDIO_PRODUCTS_RELEASES_URL -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_SEARCHABLE_OPTIONS_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.CLASSPATH_INDEX_CLEANUP_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.COMPILE_KOTLIN_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_IDEA_VERSION -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_SANDBOX import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME @@ -51,10 +45,8 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Exte import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PLUGINS_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PRODUCTS_RELEASES_URL -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_PREFIX -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENT_CODE_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENT_TEST_CODE_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES @@ -64,13 +56,8 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.KOTL import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.LIST_BUNDLED_PLUGINS_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MARKETPLACE_HOST -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PATCH_PLUGIN_XML_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PERFORMANCE_TEST_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_SANDBOX_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_TESTING_SANDBOX_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_UI_TESTING_SANDBOX_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PRINT_BUNDLED_PLUGINS_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PRINT_PRODUCTS_RELEASES_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PUBLISH_PLUGIN_TASK_NAME @@ -79,21 +66,20 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELE import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_FOR_UI_TESTS_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_PERFORMANCE_TEST_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SEARCHABLE_OPTIONS_DIR_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SIGN_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_CONFIGURATION_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_SIGNATURE_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERSION_LATEST import org.jetbrains.intellij.platform.gradleplugin.dependency.* -import org.jetbrains.intellij.platform.gradleplugin.jbr.JbrResolver import org.jetbrains.intellij.platform.gradleplugin.model.MavenMetadata import org.jetbrains.intellij.platform.gradleplugin.model.XmlExtractor +import org.jetbrains.intellij.platform.gradleplugin.model.productInfo import org.jetbrains.intellij.platform.gradleplugin.performanceTest.ProfilerName -import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.IntelliJPlatformArgumentProvider -import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.LaunchSystemArgumentProvider import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.PluginPathArgumentProvider import org.jetbrains.intellij.platform.gradleplugin.tasks.* import org.jetbrains.intellij.platform.gradleplugin.tasks.base.RunIdeBase @@ -117,7 +103,6 @@ abstract class IntelliJPlatformPlugin : Plugin { private lateinit var archiveUtils: ArchiveUtils private lateinit var dependenciesDownloader: DependenciesDownloader - private lateinit var jbrResolver: JbrResolver private lateinit var context: String override fun apply(project: Project) { @@ -150,7 +135,7 @@ abstract class IntelliJPlatformPlugin : Plugin { instrumentCode.convention(true) sandboxDir.convention( project.layout.buildDirectory - .dir(DEFAULT_SANDBOX) + .dir(Sandbox.CONTAINER) .map { it.asFile.canonicalPath } ) configureDefaultDependencies.convention(true) @@ -160,15 +145,6 @@ abstract class IntelliJPlatformPlugin : Plugin { val gradleProjectJavaToolchainSpec = project.extensions.getByType().toolchain val gradleProjectJavaService = project.serviceOf() - jbrResolver = project.objects.newInstance( - extension.jreRepository, - archiveUtils, - dependenciesDownloader, - gradleProjectJavaToolchainSpec, - gradleProjectJavaService, - context, - ) - val ideaDependencyProvider = null as Provider // prepareIdeaDependencyProvider(project, extension).memoize() configureTasks(project, extension, ideaDependencyProvider) } @@ -181,16 +157,15 @@ abstract class IntelliJPlatformPlugin : Plugin { private fun configureTasks(project: Project, extension: IntelliJPluginExtension, ideaDependencyProvider: Provider) { info(context, "Configuring plugin") project.tasks.withType { - prepareConventionMappingsForRunIdeTask(project, extension, ideaDependencyProvider, PREPARE_SANDBOX_TASK_NAME) + prepareConventionMappingsForRunIdeTask(project, extension, ideaDependencyProvider, Tasks.PREPARE_SANDBOX) } project.tasks.withType { - prepareConventionMappingsForRunIdeTask(project, extension, ideaDependencyProvider, PREPARE_UI_TESTING_SANDBOX_TASK_NAME) + prepareConventionMappingsForRunIdeTask(project, extension, ideaDependencyProvider, Tasks.PREPARE_UI_TESTING_SANDBOX) } configureClassPathIndexCleanupTask(project, ideaDependencyProvider) configureInstrumentation(project, extension, ideaDependencyProvider) configureDownloadRobotServerPluginTask(project) - configurePrepareSandboxTasks(project, extension, ideaDependencyProvider) configureListProductsReleasesTask(project, extension) configureListBundledPluginsTask(project, ideaDependencyProvider) configurePluginVerificationTask(project) @@ -199,8 +174,6 @@ abstract class IntelliJPlatformPlugin : Plugin { configureRunIdeForUiTestsTask(project) configureBuildSearchableOptionsTask(project) configureJarSearchableOptionsTask(project) - configureBuildPluginTask(project) - configureRunPluginVerifierTask(project, extension) configureDownloadZipSignerTask(project) configureSignPluginTask(project) configurePublishPluginTask(project) @@ -388,7 +361,7 @@ abstract class IntelliJPlatformPlugin : Plugin { if (dependency.plugins.findPlugin(IntelliJPlatformPlugin::class) == null) { throw BuildException("Cannot use '$dependency' as a plugin dependency. IntelliJ Plugin not found: ${dependency.plugins}") } - dependency.tasks.named(PREPARE_SANDBOX_TASK_NAME) { + dependency.tasks.named(Tasks.PREPARE_SANDBOX) { task.dependsOn(this) } } @@ -400,7 +373,7 @@ abstract class IntelliJPlatformPlugin : Plugin { } dependencies.add(project.dependencies.create(dependency)) - val prepareSandboxTaskProvider = dependency.tasks.named(PREPARE_SANDBOX_TASK_NAME) + val prepareSandboxTaskProvider = dependency.tasks.named(Tasks.PREPARE_SANDBOX) val dependencyDirectory = prepareSandboxTaskProvider.flatMap { prepareSandboxTask -> prepareSandboxTask.pluginName.map { pluginName -> prepareSandboxTask.destinationDir.resolve(pluginName) @@ -414,124 +387,124 @@ abstract class IntelliJPlatformPlugin : Plugin { } } - private fun configurePrepareSandboxTasks(project: Project, extension: IntelliJPluginExtension, ideaDependencyProvider: Provider) { - val jarTaskProvider = project.tasks.named(JAR_TASK_NAME) - val instrumentedJarTaskProvider = project.tasks.named(INSTRUMENTED_JAR_TASK_NAME) - val downloadPluginTaskProvider = project.tasks.named(DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME) - val runtimeConfiguration = project.configurations.getByName(RUNTIME_CLASSPATH_CONFIGURATION_NAME) - - val ideaDependencyJarFiles = ideaDependencyProvider.map { - project.files(it.jarFiles) - } - val pluginJarProvider = extension.instrumentCode.flatMap { instrumentCode -> - when (instrumentCode) { - true -> instrumentedJarTaskProvider - false -> jarTaskProvider - } - }.flatMap { jarTask -> jarTask.archiveFile } - - val gradleVersion = project.provider { - project.gradle.gradleVersion - } - val projectVersion = project.provider { - project.version - } - val buildSdk = project.provider { - extension.localPath.flatMap { - ideaDependencyProvider.map { ideaDependency -> - ideaDependency.classes.toPath().let { - // Fall back on build number if product-info.json is not present, this is the case for recent versions of Android Studio. - it.productInfo().run { "$productCode-$projectVersion" } - } - } - }.orElse(extension.getVersionType().zip(extension.getVersionNumber()) { type, version -> - "$type-$version" - }) - } - - listOf(jarTaskProvider, instrumentedJarTaskProvider).forEach { - it.configure { - exclude("**/classpath.index") - - manifest.attributes( - "Created-By" to gradleVersion.map { version -> "Gradle $version" }, - "Build-JVM" to Jvm.current(), - "Version" to projectVersion, - "Build-Plugin" to PLUGIN_NAME, - "Build-Plugin-Version" to getCurrentPluginVersion().or("0.0.0"), - "Build-OS" to OperatingSystem.current(), - "Build-SDK" to buildSdk.get(), - ) - } - } - - project.tasks.register(PREPARE_SANDBOX_TASK_NAME) { - testSuffix.convention("") - } - project.tasks.register(PREPARE_TESTING_SANDBOX_TASK_NAME) { - testSuffix.convention("-test") - } - project.tasks.register(PREPARE_UI_TESTING_SANDBOX_TASK_NAME) { - testSuffix.convention("-uiTest") - - from(downloadPluginTaskProvider.flatMap { downloadPluginTask -> - downloadPluginTask.outputDir - }) - - dependsOn(DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME) - } - - project.tasks.withType { - pluginName.convention(extension.pluginName) - pluginJar.convention(pluginJarProvider) - defaultDestinationDir.convention(extension.sandboxDir.flatMap { - testSuffix.map { testSuffixValue -> - project.file("$it/plugins$testSuffixValue") - } - }) - configDir.convention(extension.sandboxDir.flatMap { - testSuffix.map { testSuffixValue -> - "$it/config$testSuffixValue" - } - }) - librariesToIgnore.convention(ideaDependencyJarFiles) - pluginDependencies.convention(project.provider { - extension.getPluginDependenciesList(project) - }) - runtimeClasspathFiles.convention(runtimeConfiguration) - - intoChild(pluginName.map { "$it/lib" }) - .from(runtimeClasspathFiles.map { files -> - val librariesToIgnore = librariesToIgnore.get().toSet() + Jvm.current().toolsJar - val pluginDirectories = pluginDependencies.get().map { it.artifact } - - listOf(pluginJar.get().asFile) + files.filter { file -> - !(librariesToIgnore.contains(file) || pluginDirectories.any { p -> - file.toPath() == p || file.canonicalPath.startsWith("$p${File.separator}") - }) - } - }) - .eachFile { - name = ensureName(file.toPath()) - } - - dependsOn(runtimeConfiguration) - dependsOn(jarTaskProvider) - dependsOn(instrumentedJarTaskProvider) - - project.afterEvaluate { - extension.plugins.get().filterIsInstance().forEach { dependency -> - if (dependency.state.executed) { - configureProjectPluginTasksDependency(dependency, this@withType) - } else { - dependency.afterEvaluate { - configureProjectPluginTasksDependency(dependency, this@withType) - } - } - } - } - } - } +// private fun configurePrepareSandboxTasks(project: Project, extension: IntelliJPluginExtension, ideaDependencyProvider: Provider) { +// val jarTaskProvider = project.tasks.named(JAR_TASK_NAME) +// val instrumentedJarTaskProvider = project.tasks.named(INSTRUMENTED_JAR_TASK_NAME) +// val downloadPluginTaskProvider = project.tasks.named(DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME) +// val runtimeConfiguration = project.configurations.getByName(RUNTIME_CLASSPATH_CONFIGURATION_NAME) +// +// val ideaDependencyJarFiles = ideaDependencyProvider.map { +// project.files(it.jarFiles) +// } +// val pluginJarProvider = extension.instrumentCode.flatMap { instrumentCode -> +// when (instrumentCode) { +// true -> instrumentedJarTaskProvider +// false -> jarTaskProvider +// } +// }.flatMap { jarTask -> jarTask.archiveFile } +// +// val gradleVersion = project.provider { +// project.gradle.gradleVersion +// } +// val projectVersion = project.provider { +// project.version +// } +// val buildSdk = project.provider { +// extension.localPath.flatMap { +// ideaDependencyProvider.map { ideaDependency -> +// ideaDependency.classes.toPath().let { +// // Fall back on build number if product-info.json is not present, this is the case for recent versions of Android Studio. +// it.productInfo().run { "$productCode-$projectVersion" } +// } +// } +// }.orElse(extension.getVersionType().zip(extension.getVersionNumber()) { type, version -> +// "$type-$version" +// }) +// } +// +// listOf(jarTaskProvider, instrumentedJarTaskProvider).forEach { +// it.configure { +// exclude("**/classpath.index") +// +// manifest.attributes( +// "Created-By" to gradleVersion.map { version -> "Gradle $version" }, +// "Build-JVM" to Jvm.current(), +// "Version" to projectVersion, +// "Build-Plugin" to PLUGIN_NAME, +// "Build-Plugin-Version" to getCurrentPluginVersion().or("0.0.0"), +// "Build-OS" to OperatingSystem.current(), +// "Build-SDK" to buildSdk.get(), +// ) +// } +// } +// +// project.tasks.register(Tasks.PREPARE_SANDBOX) { +// testSuffix.convention("") +// } +// project.tasks.register(Tasks.PREPARE_TESTING_SANDBOX) { +// testSuffix.convention("-test") +// } +// project.tasks.register(Tasks.PREPARE_UI_TESTING_SANDBOX) { +// testSuffix.convention("-uiTest") +// +// from(downloadPluginTaskProvider.flatMap { downloadPluginTask -> +// downloadPluginTask.outputDir +// }) +// +// dependsOn(DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME) +// } +// +// project.tasks.withType { +// pluginName.convention(extension.pluginName) +// pluginJar.convention(pluginJarProvider) +// defaultDestinationDir.convention(extension.sandboxDir.flatMap { +// testSuffix.map { testSuffixValue -> +// project.file("$it/plugins$testSuffixValue") +// } +// }) +// configDir.convention(extension.sandboxDir.flatMap { +// testSuffix.map { testSuffixValue -> +// "$it/config$testSuffixValue" +// } +// }) +// librariesToIgnore.convention(ideaDependencyJarFiles) +// pluginDependencies.convention(project.provider { +// extension.getPluginDependenciesList(project) +// }) +// runtimeClasspathFiles.convention(runtimeConfiguration) +// +// intoChild(pluginName.map { "$it/lib" }) +// .from(runtimeClasspathFiles.map { files -> +// val librariesToIgnore = librariesToIgnore.get().toSet() + Jvm.current().toolsJar +// val pluginDirectories = pluginDependencies.get().map { it.artifact } +// +// listOf(pluginJar.get().asFile) + files.filter { file -> +// !(librariesToIgnore.contains(file) || pluginDirectories.any { p -> +// file.toPath() == p || file.canonicalPath.startsWith("$p${File.separator}") +// }) +// } +// }) +// .eachFile { +// name = ensureName(file.toPath()) +// } +// +// dependsOn(runtimeConfiguration) +// dependsOn(jarTaskProvider) +// dependsOn(instrumentedJarTaskProvider) +// +// project.afterEvaluate { +// extension.plugins.get().filterIsInstance().forEach { dependency -> +// if (dependency.state.executed) { +// configureProjectPluginTasksDependency(dependency, this@withType) +// } else { +// dependency.afterEvaluate { +// configureProjectPluginTasksDependency(dependency, this@withType) +// } +// } +// } +// } +// } +// } private fun configureDownloadRobotServerPluginTask(project: Project) { info(context, "Configuring robot-server download Task") @@ -564,7 +537,7 @@ abstract class IntelliJPlatformPlugin : Plugin { info(context, "Configuring run plugin verifier task") val listProductsReleasesTaskProvider = project.tasks.named(LIST_PRODUCTS_RELEASES_TASK_NAME) - val runIdeTaskProvider = project.tasks.named(RUN_IDE_TASK_NAME) + val runIdeTaskProvider = project.tasks.named(Tasks.RUN_IDE) val userHomeProvider = project.providers.systemProperty("user.home") project.tasks.register(RUN_PLUGIN_VERIFIER_TASK_NAME) @@ -598,9 +571,9 @@ abstract class IntelliJPlatformPlugin : Plugin { }) teamCityOutputFormat.convention(false) subsystemsToCheck.convention("all") - ideDir.convention(runIdeTaskProvider.flatMap { runIdeTask -> - runIdeTask.ideDir - }) +// ideDir.convention(runIdeTaskProvider.flatMap { runIdeTask -> +// runIdeTask.ideDir +// }) productsReleasesFile.convention(listProductsReleasesTaskProvider.flatMap { listProductsReleasesTask -> listProductsReleasesTask.outputFile.asFile }) @@ -619,13 +592,9 @@ abstract class IntelliJPlatformPlugin : Plugin { mavenRepository(PLUGIN_VERIFIER_REPOSITORY) }).first().canonicalPath }) - jreRepository.convention(extension.jreRepository) offline.convention(project.gradle.startParameter.isOffline) - resolvedRuntimeDir.convention(project.provider { - resolveRuntimeDir(jbrResolver).toFile() - }) - dependsOn(BUILD_PLUGIN_TASK_NAME) + dependsOn(Tasks.BUILD_PLUGIN) dependsOn(VERIFY_PLUGIN_TASK_NAME) dependsOn(LIST_PRODUCTS_RELEASES_TASK_NAME) @@ -641,7 +610,7 @@ abstract class IntelliJPlatformPlugin : Plugin { private fun configurePluginVerificationTask(project: Project) { info(context, "Configuring plugin verification task") - val prepareSandboxTaskProvider = project.tasks.named(PREPARE_SANDBOX_TASK_NAME) + val prepareSandboxTaskProvider = project.tasks.named(Tasks.PREPARE_SANDBOX) project.tasks.register(VERIFY_PLUGIN_TASK_NAME) project.tasks.withType { @@ -659,14 +628,14 @@ abstract class IntelliJPlatformPlugin : Plugin { ) ) - dependsOn(PREPARE_SANDBOX_TASK_NAME) + dependsOn(Tasks.PREPARE_SANDBOX) } } private fun configureVerifyPluginConfigurationTask(project: Project, ideaDependencyProvider: Provider) { info(context, "Configuring plugin configuration verification task") - val patchPluginXmlTaskProvider = project.tasks.named(PATCH_PLUGIN_XML_TASK_NAME) + val patchPluginXmlTaskProvider = project.tasks.named(Tasks.PATCH_PLUGIN_XML) val runPluginVerifierTaskProvider = project.tasks.named(RUN_PLUGIN_VERIFIER_TASK_NAME) val compileJavaTaskProvider = project.tasks.named(COMPILE_JAVA_TASK_NAME) val stdlibDefaultDependencyProvider = project.providers.gradleProperty("kotlin.stdlib.default.dependency").map { @@ -728,16 +697,16 @@ abstract class IntelliJPlatformPlugin : Plugin { kotlinIncrementalUseClasspathSnapshot.convention(incrementalUseClasspathSnapshot) } - dependsOn(PATCH_PLUGIN_XML_TASK_NAME) + dependsOn(Tasks.PATCH_PLUGIN_XML) } } private fun configureRunIdeTask(project: Project) { info(context, "Configuring run IDE task") - project.tasks.register(RUN_IDE_TASK_NAME) + project.tasks.register(Tasks.RUN_IDE) project.tasks.withType { - dependsOn(PREPARE_SANDBOX_TASK_NAME) + dependsOn(Tasks.PREPARE_SANDBOX) finalizedBy(CLASSPATH_INDEX_CLEANUP_TASK_NAME) } } @@ -774,7 +743,7 @@ abstract class IntelliJPlatformPlugin : Plugin { project.tasks.register(RUN_IDE_FOR_UI_TESTS_TASK_NAME) project.tasks.withType { - dependsOn(PREPARE_UI_TESTING_SANDBOX_TASK_NAME) + dependsOn(Tasks.PREPARE_UI_TESTING_SANDBOX) finalizedBy(CLASSPATH_INDEX_CLEANUP_TASK_NAME) } } @@ -791,7 +760,7 @@ abstract class IntelliJPlatformPlugin : Plugin { } }) - dependsOn(PREPARE_SANDBOX_TASK_NAME) + dependsOn(Tasks.PREPARE_SANDBOX) } } @@ -803,45 +772,45 @@ abstract class IntelliJPlatformPlugin : Plugin { ) { val taskContext = logCategory() val prepareSandboxTaskProvider = project.tasks.named(prepareSandBoxTaskName) - val initializeIntelliJPluginTaskProvider = project.tasks.named(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) + val initializeIntelliJPlatformPluginTaskProvider = project.tasks.named(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) val pluginIds = sourcePluginXmlFiles(project).mapNotNull { parsePluginXml(it, taskContext)?.id } - ideDir.convention(ideaDependencyProvider.map { - project.file(it.classes.path) - }) +// ideDir.convention(ideaDependencyProvider.map { +// project.file(it.classes.path) +// }) requiredPluginIds.convention(project.provider { pluginIds }) - configDir.convention(prepareSandboxTaskProvider.flatMap { prepareSandboxTask -> - prepareSandboxTask.configDir.map { project.file(it) } - }) - pluginsDir.convention(prepareSandboxTaskProvider.map { prepareSandboxTask -> - project.layout.projectDirectory.dir(prepareSandboxTask.destinationDir.path) - }) - systemDir.convention(extension.sandboxDir.map { - project.file("$it/system") - }) - autoReloadPlugins.convention(true) - projectWorkingDir.convention(ideDir.map { - it.resolve("bin") - }) - projectExecutable.convention(project.provider { - jbrResolver.resolveRuntime( - jbrVersion = jbrVersion.orNull, - jbrVariant = jbrVariant.orNull, - jbrArch = jbrArch.orNull, - ideDir = ideDir.orNull, - ).toString() - }) - coroutinesJavaAgentPath.convention(initializeIntelliJPluginTaskProvider.flatMap { - it.coroutinesJavaAgentPath - }) +// configDir.convention(prepareSandboxTaskProvider.flatMap { prepareSandboxTask -> +// prepareSandboxTask.configDir.map { project.file(it) } +// }) +// pluginsDir.convention(prepareSandboxTaskProvider.map { prepareSandboxTask -> +// project.layout.projectDirectory.dir(prepareSandboxTask.destinationDir.path) +// }) +// systemDir.convention(extension.sandboxDir.map { +// project.file("$it/system") +// }) +// autoReloadPlugins.convention(true) +// projectWorkingDir.convention(ideDir.map { +// it.resolve("bin") +// }) +// projectExecutable.convention(project.provider { +// jbrResolver.resolveRuntime( +// jbrVersion = jbrVersion.orNull, +// jbrVariant = jbrVariant.orNull, +// jbrArch = jbrArch.orNull, +// ideDir = ideDir.orNull, +// ).toString() +// }) +// coroutinesJavaAgentPath.convention(initializeIntelliJPlatformPluginTaskProvider.flatMap { +// it.coroutinesJavaAgentPath +// }) } private fun configureJarSearchableOptionsTask(project: Project) { info(context, "Configuring jar searchable options task") - val prepareSandboxTaskProvider = project.tasks.named(PREPARE_SANDBOX_TASK_NAME) + val prepareSandboxTaskProvider = project.tasks.named(Tasks.PREPARE_SANDBOX) project.tasks.register(JAR_SEARCHABLE_OPTIONS_TASK_NAME) project.tasks.withType { @@ -857,7 +826,7 @@ abstract class IntelliJPlatformPlugin : Plugin { noSearchableOptionsWarning.convention(project.isBuildFeatureEnabled(NO_SEARCHABLE_OPTIONS_WARNING)) dependsOn(BUILD_SEARCHABLE_OPTIONS_TASK_NAME) - dependsOn(PREPARE_SANDBOX_TASK_NAME) + dependsOn(Tasks.PREPARE_SANDBOX) onlyIf { inputDir.get().asFile.isDirectory } } } @@ -915,9 +884,8 @@ abstract class IntelliJPlatformPlugin : Plugin { } version == DEFAULT_IDEA_VERSION && types.contains(type) -> { - productInfo.buildNumber?.let { buildNumber -> - Version.parse(buildNumber).let { v -> "${v.major}.${v.minor}$RELEASE_SUFFIX_EAP_CANDIDATE" } - } ?: version + val buildNumber = Version.parse(productInfo.buildNumber) + "${buildNumber.major}.${buildNumber.minor}$RELEASE_SUFFIX_EAP_CANDIDATE" } else -> { @@ -1035,7 +1003,7 @@ abstract class IntelliJPlatformPlugin : Plugin { } val instrumentTaskProvider = project.tasks.named(INSTRUMENT_CODE_TASK_NAME) - val instrumentedJarTaskProvider = project.tasks.register(INSTRUMENTED_JAR_TASK_NAME) { + val instrumentedJarTaskProvider = project.tasks.register(Tasks.INSTRUMENTED_JAR) { duplicatesStrategy = DuplicatesStrategy.EXCLUDE archiveBaseName.convention(jarTaskProvider.flatMap { jarTask -> @@ -1057,8 +1025,8 @@ abstract class IntelliJPlatformPlugin : Plugin { private fun configureTestTasks(project: Project, extension: IntelliJPluginExtension, ideaDependencyProvider: Provider) { info(context, "Configuring tests tasks") - val runIdeTaskProvider = project.tasks.named(RUN_IDE_TASK_NAME) - val prepareTestingSandboxTaskProvider = project.tasks.named(PREPARE_TESTING_SANDBOX_TASK_NAME) +// val runIdeTaskProvider = project.tasks.named(Tasks.RUN_IDE) + val prepareTestingSandboxTaskProvider = project.tasks.named(Tasks.PREPARE_TESTING_SANDBOX) val instrumentedCodeTaskProvider = project.tasks.named(INSTRUMENT_CODE_TASK_NAME) val instrumentedTestCodeTaskProvider = project.tasks.named(INSTRUMENT_TEST_CODE_TASK_NAME) val instrumentedCodeOutputsProvider = project.provider { @@ -1067,8 +1035,8 @@ abstract class IntelliJPlatformPlugin : Plugin { val instrumentedTestCodeOutputsProvider = project.provider { project.files(instrumentedTestCodeTaskProvider.map { it.outputDir.asFile }) } - val initializeIntellijPluginTaskProvider = project.tasks.named(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) - val coroutinesJavaAgentPathProvider = initializeIntellijPluginTaskProvider.flatMap { + val initializeIntellijPlatformPluginTaskProvider = project.tasks.named(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) + val coroutinesJavaAgentPathProvider = initializeIntellijPlatformPluginTaskProvider.flatMap { it.coroutinesJavaAgentPath } @@ -1077,18 +1045,18 @@ abstract class IntelliJPlatformPlugin : Plugin { val buildNumberProvider = ideaDependencyProvider.map { it.buildNumber } - val ideDirProvider = runIdeTaskProvider.flatMap { runIdeTask -> - runIdeTask.ideDir.map { it.toPath() } - } - val jbrArchProvider = runIdeTaskProvider.flatMap { runIdeTask -> - runIdeTask.jbrArch - } - val jbrVersionProvider = runIdeTaskProvider.flatMap { runIdeTask -> - runIdeTask.jbrVersion - } - val jbrVariantProvider = runIdeTaskProvider.flatMap { runIdeTask -> - runIdeTask.jbrVariant - } +// val ideDirProvider = runIdeTaskProvider.flatMap { runIdeTask -> +// runIdeTask.ideDir.map { it.toPath() } +// } +// val jbrArchProvider = runIdeTaskProvider.flatMap { runIdeTask -> +// runIdeTask.jbrArch +// } +// val jbrVersionProvider = runIdeTaskProvider.flatMap { runIdeTask -> +// runIdeTask.jbrVersion +// } +// val jbrVariantProvider = runIdeTaskProvider.flatMap { runIdeTask -> +// runIdeTask.jbrVariant +// } val ideaDependencyLibrariesProvider = ideaDependencyProvider .map { it.classes } @@ -1113,9 +1081,9 @@ abstract class IntelliJPlatformPlugin : Plugin { val ideaPluginsConfigurationFiles = project.provider { project.files(project.configurations.getByName(IDEA_PLUGINS_CONFIGURATION_NAME).resolve()) } - val ideaClasspathFiles = ideDirProvider.map { - project.files(getIdeaClasspath(it)) - } +// val ideaClasspathFiles = ideDirProvider.map { +// project.files(getIdeaClasspath(it)) +// } testTasks.configureEach { enableAssertions = true @@ -1141,38 +1109,38 @@ abstract class IntelliJPlatformPlugin : Plugin { .withPathSensitivity(PathSensitivity.RELATIVE) .withNormalizer(ClasspathNormalizer::class) - dependsOn(PREPARE_TESTING_SANDBOX_TASK_NAME) + dependsOn(Tasks.PREPARE_TESTING_SANDBOX) finalizedBy(CLASSPATH_INDEX_CLEANUP_TASK_NAME) - jbrResolver.resolveRuntime( - jbrVersion = jbrVersionProvider.orNull, - jbrVariant = jbrVariantProvider.orNull, - jbrArch = jbrArchProvider.orNull, - ideDir = ideDirProvider.map { it.toFile() }.orNull, - )?.let { - executable = it.toString() - } +// jbrResolver.resolveRuntime( +// jbrVersion = jbrVersionProvider.orNull, +// jbrVariant = jbrVariantProvider.orNull, +// jbrArch = jbrArchProvider.orNull, +// ideDir = ideDirProvider.map { it.toFile() }.orNull, +// )?.let { +// executable = it.toString() +// } classpath = instrumentedCodeOutputsProvider.get() + instrumentedTestCodeOutputsProvider.get() + classpath testClassesDirs = instrumentedTestCodeOutputsProvider.get() + testClassesDirs - jvmArgumentProviders.add(IntelliJPlatformArgumentProvider(ideDirProvider.get(), coroutinesJavaAgentPathProvider.get(), this)) +// jvmArgumentProviders.add(IntelliJPlatformArgumentProvider(ideDirProvider.get(), coroutinesJavaAgentPathProvider.get(), this)) doFirst { - classpath += ideaDependencyLibrariesProvider.get() + - ideaConfigurationFiles.get() + - ideaPluginsConfigurationFiles.get() + - ideaClasspathFiles.get() - - - jvmArgumentProviders.add( - LaunchSystemArgumentProvider( - ideDirProvider.get(), - configDirectoryProvider.get(), - systemDirectoryProvider.get(), - pluginsDirectoryProvider.get(), - pluginIds, - ) - ) +// classpath += ideaDependencyLibrariesProvider.get() + +// ideaConfigurationFiles.get() + +// ideaPluginsConfigurationFiles.get() + +// ideaClasspathFiles.get() + + +// jvmArgumentProviders.add( +// LaunchSystemArgumentProvider( +// ideDirProvider.get(), +// configDirectoryProvider.get(), +// systemDirectoryProvider.get(), +// pluginsDirectoryProvider.get(), +// pluginIds, +// ) +// ) jvmArgumentProviders.add(PluginPathArgumentProvider(pluginsDirectoryProvider.get())) systemProperty("java.system.class.loader", "com.intellij.util.lang.PathClassLoader") @@ -1180,41 +1148,6 @@ abstract class IntelliJPlatformPlugin : Plugin { } } - private fun configureBuildPluginTask(project: Project) { - info(context, "Configuring building plugin task") - - val prepareSandboxTaskProvider = project.tasks.named(PREPARE_SANDBOX_TASK_NAME) - val jarSearchableOptionsTaskProvider = project.tasks.named(JAR_SEARCHABLE_OPTIONS_TASK_NAME) - val buildPluginTaskProvider = project.tasks.register(BUILD_PLUGIN_TASK_NAME) - - project.tasks.withType { - archiveBaseName.convention(prepareSandboxTaskProvider.flatMap { prepareSandboxTask -> - prepareSandboxTask.pluginName - }) - - from(prepareSandboxTaskProvider.flatMap { prepareSandboxTask -> - prepareSandboxTask.pluginName.map { - prepareSandboxTask.destinationDir.resolve(it) - } - }) - from(jarSearchableOptionsTaskProvider.flatMap { jarSearchableOptionsTask -> - jarSearchableOptionsTask.archiveFile - }) { - into("lib") - } - into(prepareSandboxTaskProvider.flatMap { prepareSandboxTask -> - prepareSandboxTask.pluginName - }) - - dependsOn(JAR_SEARCHABLE_OPTIONS_TASK_NAME) - dependsOn(PREPARE_SANDBOX_TASK_NAME) - } - - val publishArtifact = project.artifacts.add(Dependency.ARCHIVES_CONFIGURATION, buildPluginTaskProvider) - project.extensions.getByType().addCandidate(publishArtifact) - project.components.add(IntelliJPluginLibrary()) - } - private fun configureDownloadZipSignerTask(project: Project) { project.tasks.register(DOWNLOAD_ZIP_SIGNER_TASK_NAME) project.tasks.withType { @@ -1245,7 +1178,7 @@ abstract class IntelliJPlatformPlugin : Plugin { info(context, "Configuring sign plugin task") val signPluginTaskProvider = project.tasks.register(SIGN_PLUGIN_TASK_NAME) - val buildPluginTaskProvider = project.tasks.named(BUILD_PLUGIN_TASK_NAME) + val buildPluginTaskProvider = project.tasks.named(Tasks.BUILD_PLUGIN) val downloadZipSignerTaskProvider = project.tasks.named(DOWNLOAD_ZIP_SIGNER_TASK_NAME) val cliPathProvider = downloadZipSignerTaskProvider.flatMap { downloadZipSignerTask -> downloadZipSignerTask.cli.map { @@ -1266,7 +1199,7 @@ abstract class IntelliJPlatformPlugin : Plugin { ) onlyIf { (privateKey.isSpecified || privateKeyFile.isSpecified) && (certificateChain.isSpecified || certificateChainFile.isSpecified) } - dependsOn(BUILD_PLUGIN_TASK_NAME) + dependsOn(Tasks.BUILD_PLUGIN) dependsOn(DOWNLOAD_ZIP_SIGNER_TASK_NAME) } @@ -1322,7 +1255,7 @@ abstract class IntelliJPlatformPlugin : Plugin { } ) - dependsOn(BUILD_PLUGIN_TASK_NAME) + dependsOn(Tasks.BUILD_PLUGIN) dependsOn(VERIFY_PLUGIN_TASK_NAME) dependsOn(SIGN_PLUGIN_TASK_NAME) onlyIf { !isOffline } @@ -1342,7 +1275,7 @@ abstract class IntelliJPlatformPlugin : Plugin { } val patchPluginXmlTaskProvider = - project.tasks.named(PATCH_PLUGIN_XML_TASK_NAME) + project.tasks.named(Tasks.PATCH_PLUGIN_XML) val downloadIdeaProductReleasesXmlTaskProvider = project.tasks.register(DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME) val downloadAndroidStudioProductReleasesXmlTaskProvider = @@ -1387,7 +1320,7 @@ abstract class IntelliJPlatformPlugin : Plugin { dependsOn(DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME) dependsOn(DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML_TASK_NAME) - dependsOn(PATCH_PLUGIN_XML_TASK_NAME) + dependsOn(Tasks.PATCH_PLUGIN_XML) } project.tasks.register(PRINT_PRODUCTS_RELEASES_TASK_NAME) @@ -1425,7 +1358,7 @@ abstract class IntelliJPlatformPlugin : Plugin { private fun configureProcessResources(project: Project) { info(context, "Configuring resources task") - val patchPluginXmlTaskProvider = project.tasks.named(PATCH_PLUGIN_XML_TASK_NAME) + val patchPluginXmlTaskProvider = project.tasks.named(Tasks.PATCH_PLUGIN_XML) project.tasks.named(PROCESS_RESOURCES_TASK_NAME) { from(patchPluginXmlTaskProvider) { @@ -1499,7 +1432,7 @@ abstract class IntelliJPlatformPlugin : Plugin { } } - private fun Project.resolveBuildTaskOutput() = tasks.named(BUILD_PLUGIN_TASK_NAME).flatMap { it.archiveFile } + private fun Project.resolveBuildTaskOutput() = tasks.named(Tasks.BUILD_PLUGIN).flatMap { it.archiveFile } /** * Strips an [IdeVersion] of components other than SNAPSHOT and * that exceeds a patch, i.e. "excess" in the following diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt index a7cd68e703..7611e926eb 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt @@ -3,19 +3,23 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins import org.gradle.api.Project +import org.gradle.api.artifacts.Dependency +import org.gradle.api.internal.plugins.DefaultArtifactPublicationSet +import org.gradle.api.plugins.JavaPlugin import org.gradle.api.tasks.SourceSet.MAIN_SOURCE_SET_NAME -import org.gradle.kotlin.dsl.apply +import org.gradle.api.tasks.TaskContainer +import org.gradle.api.tasks.bundling.Jar +import org.gradle.internal.jvm.Jvm +import org.gradle.internal.os.OperatingSystem +import org.gradle.kotlin.dsl.* +import org.jetbrains.intellij.platform.gradleplugin.* import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.SELF_UPDATE_CHECK -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PATCH_PLUGIN_XML_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_TASKS_ID import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks -import org.jetbrains.intellij.platform.gradleplugin.isBuildFeatureEnabled -import org.jetbrains.intellij.platform.gradleplugin.sourceSets -import org.jetbrains.intellij.platform.gradleplugin.tasks.InitializeIntelliJPluginTask -import org.jetbrains.intellij.platform.gradleplugin.tasks.PatchPluginXmlTask -import org.jetbrains.intellij.platform.gradleplugin.tasks.SetupDependenciesTask +import org.jetbrains.intellij.platform.gradleplugin.tasks.* +import java.io.File import java.time.LocalDate import kotlin.io.path.exists @@ -27,63 +31,236 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug } with(tasks) { - configureTask(Tasks.SETUP_DEPENDENCIES) + configureSetupDependenciesTask() +// configureBuildPluginTask() + configureInitializeIntelliJPlatformPluginTask() + configurePatchPluginXmlTask() + configureJarTasks() +// configurePrepareSandboxTasks() - configureTask(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) { - offline.convention(project.gradle.startParameter.isOffline) - selfUpdateCheck.convention(project.isBuildFeatureEnabled(SELF_UPDATE_CHECK)) - selfUpdateLockPath.convention(provider { - temporaryDir.toPath().resolve(LocalDate.now().toString()) - }) - coroutinesJavaAgentPath.convention(provider { - temporaryDir.toPath().resolve("coroutines-javaagent.jar") - }) + configureRunIdeTasks() + + // Make all tasks depend on [INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME] + (TASKS - Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN).forEach { + named(it) { dependsOn(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) } + } + } + } - onlyIf { - !selfUpdateLockPath.get().exists() || !coroutinesJavaAgentPath.get().exists() + private fun TaskContainer.configureSetupDependenciesTask() = + configureTask(Tasks.SETUP_DEPENDENCIES) + + private fun TaskContainer.configureBuildPluginTask() = + configureTask(Tasks.BUILD_PLUGIN) { + val prepareSandboxTaskProvider = named(Tasks.PREPARE_SANDBOX) + val jarSearchableOptionsTaskProvider = named(IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME) + + archiveBaseName.convention(prepareSandboxTaskProvider.flatMap { prepareSandboxTask -> + prepareSandboxTask.pluginName + }) + + from(prepareSandboxTaskProvider.flatMap { prepareSandboxTask -> + prepareSandboxTask.pluginName.map { + prepareSandboxTask.destinationDir.resolve(it) } + }) + from(jarSearchableOptionsTaskProvider.flatMap { jarSearchableOptionsTask -> + jarSearchableOptionsTask.archiveFile + }) { + into("lib") } + into(prepareSandboxTaskProvider.flatMap { prepareSandboxTask -> + prepareSandboxTask.pluginName + }) - configureTask(PATCH_PLUGIN_XML_TASK_NAME) { - inputFile.convention(provider { - sourceSets.getByName(MAIN_SOURCE_SET_NAME).resources.srcDirs - .map { it.resolve("META-INF/plugin.xml") } - .firstOrNull { it.exists() } - }) - outputFile.convention(inputFile.map { - temporaryDir.resolve(it.name) - }) + dependsOn(IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME) + dependsOn(Tasks.PREPARE_SANDBOX) - intelliJPlatformExtension.pluginConfiguration.let { - pluginId.convention(it.id) - pluginName.convention(it.name) - pluginVersion.convention(it.version) - pluginDescription.convention(it.description) - changeNotes.convention(it.changeNotes) - - it.productDescriptor.let { productDescriptor -> - productDescriptorCode.convention(productDescriptor.code) - productDescriptorReleaseDate.convention(productDescriptor.releaseDate) - productDescriptorReleaseVersion.convention(productDescriptor.releaseVersion) - productDescriptorOptional.convention(productDescriptor.optional) - } + project.artifacts.add(Dependency.ARCHIVES_CONFIGURATION, this).let { publishArtifact -> + extensions.getByType().addCandidate(publishArtifact) + project.components.add(IntelliJPlatformPluginLibrary()) + } + } - it.ideaVersion.let { ideaVersion -> - sinceBuild.convention(ideaVersion.sinceBuild) - untilBuild.convention(ideaVersion.untilBuild) - } + private fun TaskContainer.configureInitializeIntelliJPlatformPluginTask() = + configureTask(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) { + offline.convention(project.gradle.startParameter.isOffline) + selfUpdateCheck.convention(project.isBuildFeatureEnabled(SELF_UPDATE_CHECK)) + selfUpdateLockPath.convention(project.provider { + temporaryDir.toPath().resolve(LocalDate.now().toString()) + }) + coroutinesJavaAgentPath.convention(project.provider { + temporaryDir.toPath().resolve("coroutines-javaagent.jar") + }) - it.vendor.let { vendor -> - vendorName.convention(vendor.name) - vendorEmail.convention(vendor.email) - vendorUrl.convention(vendor.url) - } + onlyIf { + !selfUpdateLockPath.get().exists() || !coroutinesJavaAgentPath.get().exists() + } + } + + private fun TaskContainer.configurePatchPluginXmlTask() = + configureTask(Tasks.PATCH_PLUGIN_XML) { + inputFile.convention(project.provider { + project.sourceSets.getByName(MAIN_SOURCE_SET_NAME).resources.srcDirs + .map { it.resolve("META-INF/plugin.xml") } + .firstOrNull { it.exists() } + }) + outputFile.convention(inputFile.map { + temporaryDir.resolve(it.name) + }) + + project.intelliJPlatformExtension.pluginConfiguration.let { + pluginId.convention(it.id) + pluginName.convention(it.name) + pluginVersion.convention(it.version) + pluginDescription.convention(it.description) + changeNotes.convention(it.changeNotes) + + it.productDescriptor.let { productDescriptor -> + productDescriptorCode.convention(productDescriptor.code) + productDescriptorReleaseDate.convention(productDescriptor.releaseDate) + productDescriptorReleaseVersion.convention(productDescriptor.releaseVersion) + productDescriptorOptional.convention(productDescriptor.optional) + } + + it.ideaVersion.let { ideaVersion -> + sinceBuild.convention(ideaVersion.sinceBuild) + untilBuild.convention(ideaVersion.untilBuild) + } + + it.vendor.let { vendor -> + vendorName.convention(vendor.name) + vendorEmail.convention(vendor.email) + vendorUrl.convention(vendor.url) } } - // Make all tasks depend on [INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME] - (TASKS - INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME).forEach { -// named(it) { dependsOn(INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME) } + } + + private fun TaskContainer.configureJarTasks() = + configureTask(JavaPlugin.JAR_TASK_NAME, Tasks.INSTRUMENTED_JAR) { + val gradleVersion = project.provider { + project.gradle.gradleVersion + } + val projectVersion = project.provider { + project.version } + val buildSdk = project.provider { +// extension.localPath.flatMap { +// ideaDependencyProvider.map { ideaDependency -> +// ideaDependency.classes.toPath().let { +// // Fall back on build number if product-info.json is not present, this is the case for recent versions of Android Studio. +// it.productInfo().run { "$productCode-$projectVersion" } +// } +// } +// }.orElse(extension.getVersionType().zip(extension.getVersionNumber()) { type, version -> +// "$type-$version" +// }) + "" + } + + exclude("**/classpath.index") + + manifest.attributes( + "Created-By" to gradleVersion.map { version -> "Gradle $version" }, + "Build-JVM" to Jvm.current(), + "Version" to projectVersion, + "Build-Plugin" to IntelliJPluginConstants.PLUGIN_NAME, + "Build-Plugin-Version" to getCurrentPluginVersion().or("0.0.0"), + "Build-OS" to OperatingSystem.current(), + "Build-SDK" to buildSdk.get(), + ) + } + + private fun TaskContainer.configurePrepareSandboxTasks() = + configureTask(Tasks.PREPARE_SANDBOX, Tasks.PREPARE_TESTING_SANDBOX, Tasks.PREPARE_UI_TESTING_SANDBOX) { + val downloadPluginTaskProvider = project.tasks.named(IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME) + val runtimeConfiguration = project.configurations.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME) + +// val ideaDependencyJarFiles = ideaDependencyProvider.map { +// project.files(it.jarFiles) +// } + val pluginJarProvider = project.intelliJPlatformExtension.instrumentCode.flatMap { instrumentCode -> + when (instrumentCode) { + true -> named(Tasks.INSTRUMENTED_JAR) + false -> named(JavaPlugin.JAR_TASK_NAME) + } + }.flatMap { jarTask -> jarTask.archiveFile } + + testSuffix.convention( + when (name) { + Tasks.PREPARE_TESTING_SANDBOX -> "-test" + Tasks.PREPARE_UI_TESTING_SANDBOX -> "-uiTest" + Tasks.PREPARE_SANDBOX -> "" + else -> "" + } + ) + +// project.tasks.register() { +// PREPARE_UI_TESTING_SANDBOX +// from(downloadPluginTaskProvider.flatMap { downloadPluginTask -> +// downloadPluginTask.outputDir +// }) +// +// dependsOn(IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME) +// } + +// pluginName.convention(extension.pluginName) + pluginJar.convention(pluginJarProvider) +// defaultDestinationDir.convention(extension.sandboxDir.flatMap { +// testSuffix.map { testSuffixValue -> +// project.file("$it/plugins$testSuffixValue") +// } +// }) +// configDir.convention(extension.sandboxDir.flatMap { +// testSuffix.map { testSuffixValue -> +// "$it/config$testSuffixValue" +// } +// }) +// librariesToIgnore.convention(ideaDependencyJarFiles) +// pluginDependencies.convention(project.provider { +// extension.getPluginDependenciesList(project) +// }) + runtimeClasspathFiles.convention(runtimeConfiguration) + + intoChild(pluginName.map { "$it/lib" }) + .from(runtimeClasspathFiles.map { files -> + val librariesToIgnore = librariesToIgnore.get().toSet() + Jvm.current().toolsJar + val pluginDirectories = pluginDependencies.get().map { it.artifact } + + listOf(pluginJar.get().asFile) + files.filter { file -> + !(librariesToIgnore.contains(file) || pluginDirectories.any { p -> + file.toPath() == p || file.canonicalPath.startsWith("$p${File.separator}") + }) + } + }) + .eachFile { + name = ensureName(file.toPath()) + } + + dependsOn(runtimeConfiguration) +// dependsOn(jarTaskProvider) +// dependsOn(instrumentedJarTaskProvider) + +// project.afterEvaluate `{ +// extension.plugins.get().filterIsInstance().forEach { dependency -> +// if (dependency.state.executed) { +// configureProjectPluginTasksDependency(dependency, this@withType) +// } else { +// dependency.afterEvaluate { +// configureProjectPluginTasksDependency(dependency, this@withType) +// } +// } +// } +// }` + } + + private fun TaskContainer.configureRunIdeTasks() = + configureTask(Tasks.RUN_IDE) { + val initializeIntelliJPlatformPluginTaskProvider = named(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) + + intelliJPlatform = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM) + coroutinesJavaAgentPath.convention(initializeIntelliJPlatformPluginTaskProvider.flatMap { + it.coroutinesJavaAgentPath + }) } - } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt index 2c9846526a..7a58b4d433 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt @@ -10,7 +10,7 @@ import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.gradle.process.CommandLineArgumentProvider import org.gradle.process.JavaForkOptions -import org.jetbrains.intellij.platform.gradleplugin.productInfo +import org.jetbrains.intellij.platform.gradleplugin.model.productInfo import org.jetbrains.intellij.platform.gradleplugin.resolveIdeHomeVariable import org.jetbrains.intellij.platform.gradleplugin.utils.OpenedPackages import java.nio.file.Path @@ -59,5 +59,5 @@ class IntelliJPlatformArgumentProvider( override fun asArguments() = (defaultHeapSpace + bootclasspath + vmOptions + kotlinxCoroutinesJavaAgent + additionalJvmArguments + heapSpace) - .filterNot { it.isNullOrBlank() } + .filterNot { it.isBlank() } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt index 055e31fbee..21033960c5 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt @@ -2,20 +2,20 @@ package org.jetbrains.intellij.platform.gradleplugin.propertyProviders +import org.gradle.api.file.DirectoryProperty import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.gradle.process.CommandLineArgumentProvider -import org.jetbrains.intellij.platform.gradleplugin.productInfo +import org.jetbrains.intellij.platform.gradleplugin.model.productInfo import org.jetbrains.intellij.platform.gradleplugin.resolveIdeHomeVariable -import java.io.File import java.nio.file.Path class LaunchSystemArgumentProvider( @InputDirectory @PathSensitive(RELATIVE) val ideDirectory: Path, - @InputDirectory @PathSensitive(RELATIVE) val configDirectory: File, - @InputDirectory @PathSensitive(RELATIVE) val systemDirectory: File, - @InputDirectory @PathSensitive(RELATIVE) val pluginsDirectory: File, + @InputDirectory @PathSensitive(RELATIVE) val configDirectory: DirectoryProperty, + @InputDirectory @PathSensitive(RELATIVE) val systemDirectory: DirectoryProperty, + @InputDirectory @PathSensitive(RELATIVE) val pluginsDirectory: DirectoryProperty, private val requirePluginIds: List, ) : CommandLineArgumentProvider { @@ -28,10 +28,10 @@ class LaunchSystemArgumentProvider( .map { it.resolveIdeHomeVariable(ideDirectory) } override fun asArguments() = currentLaunchProperties + listOf( - "-Didea.config.path=${configDirectory.absolutePath}", - "-Didea.system.path=${systemDirectory.absolutePath}", - "-Didea.log.path=${systemDirectory.resolve("log").absolutePath}", - "-Didea.plugins.path=${pluginsDirectory.absolutePath}", + "-Didea.config.path=${configDirectory.asFile.get().absolutePath}", + "-Didea.system.path=${systemDirectory.asFile.get().absolutePath}", + "-Didea.log.path=${systemDirectory.asFile.get().resolve("log").absolutePath}", + "-Didea.plugins.path=${pluginsDirectory.asFile.get().absolutePath}", "-Didea.required.plugins.id=${requirePluginIds.joinToString(",")}", ) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt index 51fcd4357e..a7ed7f2f4d 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt @@ -12,7 +12,7 @@ import org.gradle.kotlin.dsl.getByType import org.gradle.kotlin.dsl.maven import org.gradle.kotlin.dsl.newInstance import org.jetbrains.intellij.platform.gradleplugin.BuildFeature -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_PLATFORM_REPOSITORY_SETTINGS_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions internal typealias Action = (MavenArtifactRepository.() -> Unit) @@ -26,7 +26,7 @@ internal fun RepositoryHandler.applyIntelliJPlatformSettings(objects: ObjectFact settings.useCacheRedirector.convention(BuildFeature.USE_CACHE_REDIRECTOR.getValue(providers)) - (this as ExtensionAware).extensions.add(INTELLIJ_PLATFORM_REPOSITORY_SETTINGS_NAME, settings) + (this as ExtensionAware).extensions.add(Extensions.INTELLIJ_PLATFORM_REPOSITORY_SETTINGS, settings) } internal val RepositoryHandler.intellijPlatformRepositorySettings: IntelliJPlatformRepositorySettings diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPlatformPluginTask.kt similarity index 97% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPluginTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPlatformPluginTask.kt index 8bf7a109c2..6b7330dea8 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPlatformPluginTask.kt @@ -24,7 +24,7 @@ import java.util.jar.Manifest * Initializes the IntelliJ Platform Gradle Plugin and performs various checks, like if the plugin is up to date. */ @UntrackedTask(because = "Should always be run to initialize the plugin") -abstract class InitializeIntelliJPluginTask : DefaultTask() { +abstract class InitializeIntelliJPlatformPluginTask : DefaultTask() { @get:Internal abstract val offline: Property diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt index 4705fbc072..a5e6bac9ba 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt @@ -3,6 +3,7 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks import com.jetbrains.plugin.structure.intellij.utils.JDOMUtil +import org.gradle.api.DefaultTask import org.gradle.api.Project import org.gradle.api.provider.Property import org.gradle.api.provider.Provider @@ -12,7 +13,7 @@ import org.jdom2.Element import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension import org.jetbrains.intellij.platform.gradleplugin.logCategory -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.IdeVersionAwareTask +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.PlatformVersionAware import org.jetbrains.intellij.platform.gradleplugin.transformXml import org.jetbrains.intellij.platform.gradleplugin.warn import java.io.File @@ -26,7 +27,7 @@ import kotlin.io.path.inputStream * @see Plugin Configuration File */ @CacheableTask -abstract class PatchPluginXmlTask : IdeVersionAwareTask() { +abstract class PatchPluginXmlTask : DefaultTask(), PlatformVersionAware { @get:SkipWhenEmpty @get:InputFile @@ -147,10 +148,10 @@ abstract class PatchPluginXmlTask : IdeVersionAwareTask() { val inputPath = inputFile.get().toPath() val outputPath = outputFile.get().toPath() - val sinceBuildValue = sinceBuild.orNull ?: with(ideVersion) { + val sinceBuildValue = sinceBuild.orNull ?: with(platformVersion) { "$baselineVersion.$build" } - val untilBuildValue = untilBuild.orNull ?: with(ideVersion) { + val untilBuildValue = untilBuild.orNull ?: with(platformVersion) { "$baselineVersion.*" } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt index 0825bd2a96..47070a2e6e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt @@ -2,10 +2,28 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks -import org.gradle.api.tasks.JavaExec -import org.gradle.api.tasks.UntrackedTask +import org.gradle.api.GradleException +import org.gradle.api.file.ConfigurableFileCollection +import org.gradle.api.provider.Property +import org.gradle.api.tasks.* +import org.gradle.internal.jvm.Jvm +import org.gradle.internal.os.OperatingSystem +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.asPath +import org.jetbrains.intellij.platform.gradleplugin.isSpecified +import org.jetbrains.intellij.platform.gradleplugin.model.getBootClasspath +import org.jetbrains.intellij.platform.gradleplugin.model.productInfo +import org.jetbrains.intellij.platform.gradleplugin.or +import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.IntelliJPlatformArgumentProvider +import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.LaunchSystemArgumentProvider +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.JetBrainsRuntimeAware +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.PlatformVersionAware import org.jetbrains.intellij.platform.gradleplugin.tasks.base.RunIdeBase +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.SandboxAware +import java.io.File +import java.nio.file.Path +import kotlin.io.path.absolutePathString /** * Runs the IDE instance with the developed plugin installed. @@ -16,10 +34,143 @@ import org.jetbrains.intellij.platform.gradleplugin.tasks.base.RunIdeBase * @see [JavaExec] */ @UntrackedTask(because = "Should always run guest IDE") -abstract class RunIdeTask : RunIdeBase() { +abstract class RunIdeTask : JavaExec(), JetBrainsRuntimeAware, PlatformVersionAware, SandboxAware { + + @get:Input + @get:Optional + abstract val type: Property + + @get:Input + @get:Optional + abstract val version: Property + + @get:Input + @get:Optional + abstract val localPath: Property + + @get:InputFiles + @get:PathSensitive(PathSensitivity.RELATIVE) + abstract val intelliJPlatform: ConfigurableFileCollection + + @get:InputFiles + val intellijPlatformDirectory + get() = when { + !type.isSpecified && !version.isSpecified -> intelliJPlatform.singleFile.toPath() + else -> throw GradleException("Foo") + } + + /** + * Represents the path to the coroutines Java agent file. + */ + @get:Internal + abstract val coroutinesJavaAgentPath: Property init { group = PLUGIN_GROUP_NAME description = "Runs the IDE instance with the developed plugin installed." + + mainClass.set("com.intellij.idea.Main") + enableAssertions = true + } + + /** + * Executes the task, configures and runs the IDE. + */ + @TaskAction + override fun exec() { + workingDir = intellijPlatformDirectory.resolve("bin").toFile() + jvmArgumentProviders.add(IntelliJPlatformArgumentProvider(intellijPlatformDirectory, coroutinesJavaAgentPath.get(), this)) + configureSystemProperties() + configureClasspath() + + super.exec() + } + + override fun getExecutable(): String = jetbrainsRuntimeExecutable.get().asPath.absolutePathString() + + /** + * Prepares the classpath for the IDE based on the IDEA version. + */ + private fun configureClasspath() { + executable + .takeUnless(String?::isNullOrEmpty) + ?.let { + resolveToolsJar(it) + .takeIf(File::exists) + .or(Jvm.current().toolsJar) + } + ?.let { + classpath += objectFactory.fileCollection().from(it) + } + + classpath += objectFactory.fileCollection().from( + productInfo.getBootClasspath(intellijPlatformDirectory) + ) + } + + /** + * Configures the system properties for the IDE based on the IDEA version. + */ + private fun configureSystemProperties() { + systemProperties(systemProperties) + + jvmArgumentProviders.add( + LaunchSystemArgumentProvider( + intellijPlatformDirectory, + configDirectory, + systemDirectory, + pluginsDirectory, + emptyList(), +// requiredPluginIds.get(), + ) + ) + + val operatingSystem = OperatingSystem.current() + val userDefinedSystemProperties = systemProperties + + if (operatingSystem.isMacOsX) { + systemPropertyIfNotDefined("idea.smooth.progress", false, userDefinedSystemProperties) + systemPropertyIfNotDefined("apple.laf.useScreenMenuBar", true, userDefinedSystemProperties) + systemPropertyIfNotDefined("apple.awt.fileDialogForDirectories", true, userDefinedSystemProperties) + } else if (operatingSystem.isUnix) { + systemPropertyIfNotDefined("sun.awt.disablegrab", true, userDefinedSystemProperties) + } + + systemPropertyIfNotDefined("idea.classpath.index.enabled", false, userDefinedSystemProperties) + systemPropertyIfNotDefined("idea.is.internal", true, userDefinedSystemProperties) + systemPropertyIfNotDefined("jdk.module.illegalAccess.silent", true, userDefinedSystemProperties) + systemPropertyIfNotDefined("idea.auto.reload.plugins", true, userDefinedSystemProperties) + + if (!systemProperties.containsKey("idea.platform.prefix")) { + val prefix = intellijPlatformDirectory.productInfo().productCode + + systemProperty("idea.platform.prefix", prefix) +// info(context, "Using idea.platform.prefix=$prefix") + } + + systemProperty("java.system.class.loader", "com.intellij.util.lang.PathClassLoader") + systemPropertyIfNotDefined("idea.vendor.name", "JetBrains", userDefinedSystemProperties) + systemPropertyIfNotDefined("idea.plugin.in.sandbox.mode", true, userDefinedSystemProperties) + } + + /** + * Helper function to set system property if it is not defined yet. + */ + private fun systemPropertyIfNotDefined(name: String, value: Any, userDefinedSystemProperties: Map) { + if (!userDefinedSystemProperties.containsKey(name)) { + systemProperty(name, value) + } + } + + /** + * Resolves the path to the `tools.jar` library. + */ + private fun resolveToolsJar(javaExec: String): File { + val binDir = File(javaExec).parent + val path = when { + OperatingSystem.current().isMacOsX -> "../../lib/tools.jar" + else -> "../lib/tools.jar" + } + return File(binDir, path) } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt index 00b2ce32fb..95ad8c040e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt @@ -21,12 +21,11 @@ import org.gradle.process.internal.ExecException import org.jetbrains.intellij.platform.gradleplugin.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.AndroidStudio import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.IntellijIdeaCommunity -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.CACHE_REDIRECTOR import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERSION_LATEST import org.jetbrains.intellij.platform.gradleplugin.Version -import org.jetbrains.intellij.platform.gradleplugin.jbr.JbrResolver +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.JetBrainsRuntimeAware import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader import org.jetbrains.intellij.platform.gradleplugin.utils.LatestVersionResolver @@ -40,6 +39,7 @@ import java.nio.file.Files import java.nio.file.Path import java.util.* import javax.inject.Inject +import kotlin.io.path.pathString /** * Runs the [IntelliJ Plugin Verifier](https://github.com/JetBrains/intellij-plugin-verifier) tool to check the binary compatibility with specified IDE builds (see also [Verifying Plugin Compatibility](https://plugins.jetbrains.com/docs/intellij/verifying-plugin-compatibility.html)). @@ -58,7 +58,7 @@ abstract class RunPluginVerifierTask @Inject constructor( private val objectFactory: ObjectFactory, private val execOperations: ExecOperations, private val providers: ProviderFactory, -) : DefaultTask() { +) : DefaultTask(), JetBrainsRuntimeAware { /** * Defines the verification level at which the task should fail if any reported issue matches. @@ -168,80 +168,6 @@ abstract class RunPluginVerifierTask @Inject constructor( @get:Internal abstract val downloadPath: Property - /** - * Custom JBR version to use for running the IDE. - * - * All JetBrains Java versions are available at JetBrains Space Packages, and [GitHub](https://github.com/JetBrains/JetBrainsRuntime/releases). - * - * Accepted values: - * - `8u112b752.4` - * - `8u202b1483.24` - * - `11_0_2b159` - */ - @get:Input - @get:Optional - abstract val jbrVersion: Property - - /** - * JetBrains Runtime variant to use when running the IDE with the plugin. - * See [JetBrains Runtime Releases](https://github.com/JetBrains/JetBrainsRuntime/releases). - * - * Default value: `null` - * - * Acceptable values: - * - `jcef` - * - `sdk` - * - `fd` - * - `dcevm` - * - `nomod` - * - * Note: For `JBR 17`, `dcevm` is bundled by default. As a consequence, separated `dcevm` and `nomod` variants are no longer available. - * - * **Accepted values:** - * - `8u112b752.4` - * - `8u202b1483.24` - * - `11_0_2b159` - * - * All JetBrains Java versions are available at JetBrains Space Packages, and [GitHub](https://github.com/JetBrains/JetBrainsRuntime/releases). - */ - @get:Input - @get:Optional - abstract val jbrVariant: Property - - /** - * JetBrains Runtime architecture. - * By default, it's resolved based on the current OS and JRE architecture, see [JbrResolver.JbrArtifact.arch]. - */ - @get:Input - @get:Optional - abstract val jbrArch: Property - - /** - * URL of repository for downloading JetBrains Runtime. - */ - @get:Input - @get:Optional - abstract val jreRepository: Property - - /** - * The path to directory containing JVM runtime, overrides [jbrVersion]. - */ - @get:Input - @get:Optional - abstract val runtimeDir: Property - - /** - * Resolves the Java Runtime directory. - * [runtimeDir] property is used if provided with the task configuration. - * Otherwise, [jbrVersion] is used for resolving the JBR. - * If it's not set, or it's impossible to resolve a valid version, built-in JBR will be used. - * As a last fallback, current JVM will be used. - * - * @return path to the Java Runtime directory - */ - @get:Internal - abstract val resolvedRuntimeDir: Property - /** * The list of classes prefixes from the external libraries. * The Plugin Verifier will not report `No such class` for classes of these packages. @@ -298,8 +224,6 @@ abstract class RunPluginVerifierTask @Inject constructor( */ @TaskAction fun runPluginVerifier() { - validateRuntimeDir(resolvedRuntimeDir.get()) - val file = distributionFile.orNull?.asPath if (file == null || !file.exists()) { throw IllegalStateException("Plugin file does not exist: $file") @@ -420,59 +344,6 @@ abstract class RunPluginVerifierTask @Inject constructor( ?.takeIf(Path::exists) ?: throw InvalidUserDataException("Provided Plugin Verifier path doesn't exist: '$path'. Downloading Plugin Verifier: $verifierVersion") - /** - * Resolves the Java Runtime directory. - * [runtimeDir] property is used if provided with the task configuration. - * Otherwise, [jbrVersion] is used for resolving the JBR. - * If it's not set, or it's impossible to resolve a valid version, built-in JBR will be used. - * As a last fallback, current JVM will be used. - * - * @return path to the Java Runtime directory - */ - internal fun resolveRuntimeDir(jbrResolver: JbrResolver) = - jbrResolver.resolveRuntimeDir( - runtimeDir = runtimeDir.orNull, - jbrVersion = jbrVersion.orNull, - jbrVariant = jbrVariant.orNull, - jbrArch = jbrArch.orNull, - ideDir = ideDir.orNull, - ) ?: throw InvalidUserDataException( - when { - requiresJava11() -> "Java Runtime directory couldn't be resolved. Note: Plugin Verifier 1.260+ requires Java 11" - else -> "Java Runtime directory couldn't be resolved" - } - ) - - /** - * Verifies if the provided Java Runtime directory points to Java 11 when using Plugin Verifier 1.260+. - * - * @return Java Runtime directory points to Java 8 for Plugin Verifier versions < 1.260, or Java 11 for 1.260+. - */ - private fun validateRuntimeDir(runtimeDirPath: File) = ByteArrayOutputStream().use { os -> - debug(context, "Plugin Verifier JRE verification: $runtimeDirPath") - - if (!requiresJava11()) { - return true - } - - execOperations.exec { - executable = runtimeDirPath.resolve("bin/java").absolutePath - args = listOf("-version") - errorOutput = os - } - val version = Version.parse(os.toString()) - val result = version >= Version(11) - - result.ifFalse { - throw GradleException("Plugin Verifier 1.260+ requires Java 11, but '$version' was provided with 'runtimeDir': $runtimeDirPath") - } - } - - /** - * Checks the Plugin Verifier version, if 1.260+, require Java 11 to run. - */ - private fun requiresJava11() = currentVersion.let(Version::parse) >= Version(1, 260) - /** * Check that the Plugin Verifier supports the Verification reports output formats. * This is available only in version 1.304 and later. @@ -489,7 +360,7 @@ abstract class RunPluginVerifierTask @Inject constructor( private fun getOptions(): List { val args = mutableListOf( "-verification-reports-dir", verificationReportsDir.get(), - "-runtime-dir", resolvedRuntimeDir.get().absolutePath, + "-runtime-dir", jetbrainsRuntimeDirectory.get().asPath.pathString, ) externalPrefixes.get().takeIf { it.isNotEmpty() }?.let { @@ -559,11 +430,12 @@ abstract class RunPluginVerifierTask @Inject constructor( ): Path { debug(context, "Resolving IDE path for: $ideVersion") val (version, code) = ideVersion.trim().split('-', limit = 2).reversed() + null - val type = when(code) { + val type = when (code) { null -> run { debug(context, "IDE type not specified, setting type to $IntellijIdeaCommunity") IntellijIdeaCommunity } + else -> IntelliJPlatformType.fromCode(code) } @@ -624,7 +496,7 @@ abstract class RunPluginVerifierTask @Inject constructor( val redirectUrl = URL(getHeaderField("Location")) disconnect() debug(context, "Resolved IDE download URL: $url") - return "$CACHE_REDIRECTOR/${redirectUrl.host}${redirectUrl.file}" + return "${IntelliJPluginConstants.Locations.CACHE_REDIRECTOR}/${redirectUrl.host}${redirectUrl.file}" } else { debug(context, "IDE download URL has no redirection provided. Skipping") } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/JetBrainsRuntimeAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/JetBrainsRuntimeAware.kt new file mode 100644 index 0000000000..55cb3cfc14 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/JetBrainsRuntimeAware.kt @@ -0,0 +1,21 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.tasks.base + +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.file.RegularFileProperty +import org.gradle.api.tasks.InputDirectory +import org.gradle.api.tasks.InputFile +import org.gradle.api.tasks.PathSensitive +import org.gradle.api.tasks.PathSensitivity + +interface JetBrainsRuntimeAware { + + @get:InputDirectory + @get:PathSensitive(PathSensitivity.RELATIVE) + val jetbrainsRuntimeDirectory: DirectoryProperty + + @get:InputFile + @get:PathSensitive(PathSensitivity.RELATIVE) + val jetbrainsRuntimeExecutable: RegularFileProperty +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/IdeVersionAwareTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/PlatformVersionAware.kt similarity index 55% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/IdeVersionAwareTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/PlatformVersionAware.kt index 10026ef481..a386217063 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/IdeVersionAwareTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/PlatformVersionAware.kt @@ -3,28 +3,34 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks.base import com.jetbrains.plugin.structure.intellij.version.IdeVersion -import org.gradle.api.DefaultTask import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.tasks.InputFiles import org.gradle.api.tasks.Internal import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType import org.jetbrains.intellij.platform.gradleplugin.model.ProductInfo -import org.jetbrains.intellij.platform.gradleplugin.productInfo +import org.jetbrains.intellij.platform.gradleplugin.model.productInfo -abstract class IdeVersionAwareTask : DefaultTask() { +interface PlatformVersionAware { @get:InputFiles @get:PathSensitive(PathSensitivity.RELATIVE) - abstract val intelliJPlatformProductInfo: ConfigurableFileCollection + val intelliJPlatformProductInfo: ConfigurableFileCollection @get:Internal val productInfo: ProductInfo - get() = intelliJPlatformProductInfo.also { - println("intelliJPlatformProductInfo = \n${intelliJPlatformProductInfo.joinToString("\n")}") - }.single().toPath().productInfo() + get() = intelliJPlatformProductInfo.single().toPath().productInfo() @get:Internal - val ideVersion: IdeVersion + val platformBuild: IdeVersion get() = IdeVersion.createIdeVersion(productInfo.buildNumber) + + @get:Internal + val platformVersion: IdeVersion + get() = IdeVersion.createIdeVersion(productInfo.version) + + @get:Internal + val platformType: IntelliJPlatformType + get() = IntelliJPlatformType.fromCode(productInfo.productCode) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt index b9652eb4b5..aeb122bac1 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt @@ -2,18 +2,14 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks.base -import org.gradle.api.GradleException -import org.gradle.api.file.DirectoryProperty import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.api.tasks.* import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.GITHUB_REPOSITORY -import org.jetbrains.intellij.platform.gradleplugin.jbr.JbrResolver +import org.jetbrains.intellij.platform.gradleplugin.model.productInfo import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.IntelliJPlatformArgumentProvider -import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.LaunchSystemArgumentProvider import java.io.File import java.nio.file.Path @@ -34,73 +30,16 @@ abstract class RunIdeBase : JavaExec() { @get:Input abstract val ideDir: Property - /** - * Custom JBR version to use for running the IDE. - * - * All JetBrains Java versions are available at JetBrains Space Packages, and [GitHub](https://github.com/JetBrains/JetBrainsRuntime/releases). - * - * Accepted values: - * - `8u112b752.4` - * - `8u202b1483.24` - * - `11_0_2b159` - */ - @get:Input - @get:Optional - abstract val jbrVersion: Property - - /** - * JetBrains Runtime variant to use when running the IDE with the plugin. - * See [JetBrains Runtime Releases](https://github.com/JetBrains/JetBrainsRuntime/releases). - * - * Default value: `null` - * - * Acceptable values: - * - `jcef` - * - `sdk` - * - `fd` - * - `dcevm` - * - `nomod` - * - * Note: For `JBR 17`, `dcevm` is bundled by default. As a consequence, separated `dcevm` and `nomod` variants are no longer available. - * - * **Accepted values:** - * - `8u112b752.4` - * - `8u202b1483.24` - * - `11_0_2b159` - * - * All JetBrains Java versions are available at JetBrains Space Packages and [GitHub](https://github.com/JetBrains/JetBrainsRuntime/releases). - */ - @get:Input - @get:Optional - abstract val jbrVariant: Property - /** - * JetBrains Runtime architecture. - * By default, it's resolved based on the current OS and JRE architecture, see [JbrResolver.JbrArtifact.arch]. - */ - @get:Input - @get:Optional - abstract val jbrArch: Property - - /** - * Path to the `plugins` directory within the sandbox prepared with [PrepareSandboxTask]. - * Provided to the `idea.plugins.path` system property. - * - * Default value: [PrepareSandboxTask.getDestinationDir] - */ - @get:InputDirectory - @get:Classpath - abstract val pluginsDir: DirectoryProperty - - /** - * Enables auto-reload of dynamic plugins. - * Dynamic plugins will be reloaded automatically when their JARs are modified. - * This allows a much faster development cycle by avoiding a full restart of the development instance after code changes. - * Enabled by default in 2020.2 and higher. - */ - @get:Input - @get:Optional - abstract val autoReloadPlugins: Property +// /** +// * Enables auto-reload of dynamic plugins. +// * Dynamic plugins will be reloaded automatically when their JARs are modified. +// * This allows a much faster development cycle by avoiding a full restart of the development instance after code changes. +// * Enabled by default in 2020.2 and higher. +// */ +// @get:Input +// @get:Optional +// abstract val autoReloadPlugins: Property /** * List of plugins required to be present when running the IDE. @@ -109,23 +48,6 @@ abstract class RunIdeBase : JavaExec() { @get:Internal abstract val requiredPluginIds: ListProperty - /** - * Path to the `config` directory within the sandbox prepared with [PrepareSandboxTask]. - * Provided to the `idea.config.path` system property. - * - * Default value: [PrepareSandboxTask.configDir] - */ - @get:Internal - abstract val configDir: Property - - /** - * Path to the `system` directory within the sandbox prepared with [PrepareSandboxTask]. - * Provided to the `idea.system.path` system property. - * - * Default value: [IntelliJPluginExtension.sandboxDir]/system - */ - @get:Internal - abstract val systemDir: Property /** * The IDEA binary working directory. @@ -186,8 +108,8 @@ abstract class RunIdeBase : JavaExec() { classpath += objectFactory.fileCollection().from(it) } - classpath += getIdeaClasspath(ideDirPath) - .let { objectFactory.fileCollection().from(it) } +// classpath += getIdeaClasspath(ideDirPath) +// .let { objectFactory.fileCollection().from(it) } } /** @@ -196,15 +118,15 @@ abstract class RunIdeBase : JavaExec() { private fun configureSystemProperties() { systemProperties(systemProperties) - jvmArgumentProviders.add( - LaunchSystemArgumentProvider( - ideDirPath, - configDir.get(), - systemDir.get(), - pluginsDir.get().asFile, - requiredPluginIds.get(), - ) - ) +// jvmArgumentProviders.add( +// LaunchSystemArgumentProvider( +// ideDirPath, +// configDir.get(), +// systemDir.get(), +// pluginsDir.get().asFile, +// requiredPluginIds.get(), +// ) +// ) val operatingSystem = OperatingSystem.current() val userDefinedSystemProperties = systemProperties @@ -221,19 +143,12 @@ abstract class RunIdeBase : JavaExec() { systemPropertyIfNotDefined("idea.is.internal", true, userDefinedSystemProperties) systemPropertyIfNotDefined("jdk.module.illegalAccess.silent", true, userDefinedSystemProperties) - if (!userDefinedSystemProperties.containsKey("idea.auto.reload.plugins") && autoReloadPlugins.get()) { - systemProperty("idea.auto.reload.plugins", "true") - } +// if (!userDefinedSystemProperties.containsKey("idea.auto.reload.plugins") && autoReloadPlugins.get()) { +// systemProperty("idea.auto.reload.plugins", "true") +// } if (!systemProperties.containsKey("idea.platform.prefix")) { val prefix = ideDir.get().toPath().productInfo().productCode - ?: throw TaskExecutionException( - this, - GradleException( - "Cannot find IDE platform prefix. Please create a bug report at $GITHUB_REPOSITORY. " + - "As a workaround specify `idea.platform.prefix` system property for task `${this.name}` manually." - ) - ) systemProperty("idea.platform.prefix", prefix) info(context, "Using idea.platform.prefix=$prefix") diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/SandboxAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/SandboxAware.kt new file mode 100644 index 0000000000..513d9449d7 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/SandboxAware.kt @@ -0,0 +1,44 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.tasks.base + +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.tasks.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginExtension + +interface SandboxAware : PlatformVersionAware { + + @get:InputDirectory + @get:PathSensitive(PathSensitivity.RELATIVE) + val sandboxDirectory: DirectoryProperty + + /** + * Path to the `config` directory within the sandbox prepared with [PrepareSandboxTask]. + * Provided to the `idea.config.path` system property. + * + * Default value: [PrepareSandboxTask.configDir] + */ + @get:InputDirectory + @get:PathSensitive(PathSensitivity.RELATIVE) + val configDirectory: DirectoryProperty + + /** + * Path to the `plugins` directory within the sandbox prepared with [PrepareSandboxTask]. + * Provided to the `idea.plugins.path` system property. + * + * Default value: [PrepareSandboxTask.getDestinationDir] + */ + @get:InputDirectory + @get:PathSensitive(PathSensitivity.RELATIVE) + val pluginsDirectory: DirectoryProperty + + /** + * Path to the `system` directory within the sandbox prepared with [PrepareSandboxTask]. + * Provided to the `idea.system.path` system property. + * + * Default value: [IntelliJPluginExtension.sandboxDir]/system + */ + @get:InputDirectory + @get:PathSensitive(PathSensitivity.RELATIVE) + val systemDirectory: DirectoryProperty +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt index f7d3dcc354..ed4cdfe7fd 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt @@ -13,8 +13,6 @@ import com.jetbrains.plugin.structure.intellij.extractor.PluginBeanExtractor import com.jetbrains.plugin.structure.intellij.plugin.IdePlugin import com.jetbrains.plugin.structure.intellij.plugin.IdePluginManager import com.jetbrains.plugin.structure.intellij.utils.JDOMUtil -import kotlinx.serialization.json.Json -import org.gradle.api.GradleException import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.file.FileSystemLocation @@ -33,7 +31,6 @@ import org.jdom2.output.Format import org.jdom2.output.XMLOutputter import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MINIMAL_SUPPORTED_GRADLE_VERSION import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_NAME -import org.jetbrains.intellij.platform.gradleplugin.model.ProductInfo import org.jetbrains.intellij.platform.gradleplugin.plugins.IntelliJPlatformPlugin import java.io.File import java.io.StringWriter @@ -100,20 +97,6 @@ internal fun String.resolveIdeHomeVariable(ideDir: Path) = } } -fun getIdeaClasspath(ideDir: Path) = ideDir - .productInfo() - .currentLaunch - .bootClassPathJarNames - .map { "$ideDir/lib/$it" } - -internal fun Path.resolveProductInfoPath(name: String = "product-info.json") = - listOf(this, resolve(name), resolve("Resources").resolve(name)) - .find { it.name == name && it.exists() } - ?: throw GradleException("Could not resolve $name file in: $this") - -private val json = Json { ignoreUnknownKeys = true } -internal fun Path.productInfo() = resolveProductInfoPath() - .run { json.decodeFromString(readText()) } fun collectJars(directory: Path, filter: Predicate = Predicate { true }) = collectFiles(directory) { it.isJar() && filter.test(it) } @@ -251,8 +234,3 @@ internal val Property.isSpecified internal val Project.sourceSets get() = extensions.getByName("sourceSets") as SourceSetContainer - -internal val Project.gradleIntelliJPlatform - get() = layout.projectDirectory.asPath - .resolve(".gradle") - .resolve("intellijPlatform") diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolverTest.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolverTest.kt index c9e0ad419f..aaaa582c1e 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolverTest.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolverTest.kt @@ -11,8 +11,8 @@ const val TASK_NAME = "testJbrResolver" class JbrResolverTest : IntelliJPluginSpecBase() { private val operatingSystem = OperatingSystem.current() - private val platform = JbrResolver.JbrArtifact.platform(operatingSystem) - private val arch = JbrResolver.JbrArtifact.arch(true) + private val platform = ""//JetBrainsRuntimeResolver.JbrArtifact.platform(operatingSystem) + private val arch = ""//JetBrainsRuntimeResolver.JbrArtifact.arch(true) @Test fun `resolve 11_0_11b1536_2`() = testJbrResolving("11_0_11b1536.2", "jbr_jcef-11_0_11-$platform-$arch-b1536.2") @@ -35,7 +35,7 @@ class JbrResolverTest : IntelliJPluginSpecBase() { private fun testJbrResolving(version: String, expected: String, variant: String? = null) { buildFile.groovy( """ - runIde { + runIde { jbrVersion = "$version" ${"jbrVariant = \"$variant\"".takeIf { variant != null }.orEmpty()} } diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTaskSpec.kt index e6295a5955..d9aa372a9b 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTaskSpec.kt @@ -4,8 +4,8 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import java.io.File import java.util.jar.Manifest @@ -61,7 +61,7 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(BUILD_PLUGIN_TASK_NAME) + build(Tasks.BUILD_PLUGIN) val distribution = File(buildDirectory, "distributions/myPluginName-0.42.123.zip") assertTrue(distribution.exists()) @@ -138,7 +138,7 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(BUILD_PLUGIN_TASK_NAME) + build(Tasks.BUILD_PLUGIN) val distribution = buildDirectory.resolve("distributions/myPluginName-0.42.123.zip") assertTrue(distribution.exists()) @@ -216,7 +216,7 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(BUILD_PLUGIN_TASK_NAME) + build(Tasks.BUILD_PLUGIN) val distribution = File(buildDirectory, "distributions/myPluginName-0.42.123.zip") assertTrue(distribution.exists()) @@ -250,7 +250,7 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(BUILD_PLUGIN_TASK_NAME) + build(Tasks.BUILD_PLUGIN) assertEquals( setOf( @@ -296,7 +296,7 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(BUILD_PLUGIN_TASK_NAME) + build(Tasks.BUILD_PLUGIN) val distribution = File(buildDirectory, "distributions/myPluginName-0.42.123.zip") assertTrue(distribution.exists()) @@ -341,7 +341,7 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(BUILD_PLUGIN_TASK_NAME) + build(Tasks.BUILD_PLUGIN) val distribution = File(buildDirectory, "distributions/myPluginName-0.42.123.zip") assertTrue(distribution.exists()) @@ -374,7 +374,7 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(BUILD_PLUGIN_TASK_NAME) + build(Tasks.BUILD_PLUGIN) val distribution = File(buildDirectory, "distributions/myPluginName-0.42.123.zip") assertTrue(distribution.exists()) @@ -422,7 +422,7 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(BUILD_PLUGIN_TASK_NAME) + build(Tasks.BUILD_PLUGIN) buildFile.groovy( """ @@ -437,7 +437,7 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(BUILD_PLUGIN_TASK_NAME) + build(Tasks.BUILD_PLUGIN) val distribution = File(buildDirectory, "distributions/myPluginName-0.42.123.zip") assertTrue(distribution.exists()) @@ -481,7 +481,7 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(BUILD_PLUGIN_TASK_NAME) + build(Tasks.BUILD_PLUGIN) val archive = buildDirectory.resolve("distributions").resolve("projectName-0.42.123.zip") val artifact = extractFile(ZipFile(archive), "projectName/lib/projectName-0.42.123.jar") diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTaskSpec.kt index ca8135e72f..99e46a4168 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTaskSpec.kt @@ -3,8 +3,8 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks import org.gradle.testkit.runner.TaskOutcome -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PATCH_PLUGIN_XML_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_XML_DIR_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import java.io.File import kotlin.test.Test @@ -33,7 +33,7 @@ class PatchPluginXmlTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PATCH_PLUGIN_XML_TASK_NAME).let { + build(Tasks.PATCH_PLUGIN_XML).let { assertFileContent( patchedPluginXml.value, """ @@ -67,7 +67,7 @@ class PatchPluginXmlTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PATCH_PLUGIN_XML_TASK_NAME).let { + build(Tasks.PATCH_PLUGIN_XML).let { assertFileContent( patchedPluginXml.value, """ @@ -100,7 +100,7 @@ class PatchPluginXmlTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PATCH_PLUGIN_XML_TASK_NAME).let { + build(Tasks.PATCH_PLUGIN_XML).let { assertFileContent( patchedPluginXml.value, """ @@ -135,7 +135,7 @@ class PatchPluginXmlTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PATCH_PLUGIN_XML_TASK_NAME).let { + build(Tasks.PATCH_PLUGIN_XML).let { assertFileContent( patchedPluginXml.value, """ @@ -171,7 +171,7 @@ class PatchPluginXmlTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PATCH_PLUGIN_XML_TASK_NAME).let { + build(Tasks.PATCH_PLUGIN_XML).let { assertFileContent( patchedPluginXml.value, """ @@ -207,7 +207,7 @@ class PatchPluginXmlTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PATCH_PLUGIN_XML_TASK_NAME).let { + build(Tasks.PATCH_PLUGIN_XML).let { assertFileContent( patchedPluginXml.value, """ @@ -242,7 +242,7 @@ class PatchPluginXmlTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PATCH_PLUGIN_XML_TASK_NAME).let { + build(Tasks.PATCH_PLUGIN_XML).let { assertFileContent( patchedPluginXml.value, """ @@ -277,7 +277,7 @@ class PatchPluginXmlTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PATCH_PLUGIN_XML_TASK_NAME).let { + build(Tasks.PATCH_PLUGIN_XML).let { assertFileContent( patchedPluginXml.value, """ @@ -315,7 +315,7 @@ class PatchPluginXmlTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PATCH_PLUGIN_XML_TASK_NAME).let { + build(Tasks.PATCH_PLUGIN_XML).let { assertFileContent( patchedPluginXml.value, """ @@ -354,7 +354,7 @@ class PatchPluginXmlTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PATCH_PLUGIN_XML_TASK_NAME).let { + build(Tasks.PATCH_PLUGIN_XML).let { assertFileContent( patchedPluginXml.value, """ @@ -387,7 +387,7 @@ class PatchPluginXmlTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PATCH_PLUGIN_XML_TASK_NAME).let { + build(Tasks.PATCH_PLUGIN_XML).let { assertFileContent( patchedPluginXml.value, """ @@ -419,9 +419,9 @@ class PatchPluginXmlTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PATCH_PLUGIN_XML_TASK_NAME) - build(PATCH_PLUGIN_XML_TASK_NAME).let { - assertEquals(TaskOutcome.UP_TO_DATE, it.task(":$PATCH_PLUGIN_XML_TASK_NAME")?.outcome) + build(Tasks.PATCH_PLUGIN_XML) + build(Tasks.PATCH_PLUGIN_XML).let { + assertEquals(TaskOutcome.UP_TO_DATE, it.task(":${Tasks.PATCH_PLUGIN_XML}")?.outcome) assertFileContent( patchedPluginXml.value, """ @@ -451,7 +451,7 @@ class PatchPluginXmlTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PATCH_PLUGIN_XML_TASK_NAME) + build(Tasks.PATCH_PLUGIN_XML) buildFile.groovy( """ @@ -461,8 +461,8 @@ class PatchPluginXmlTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PATCH_PLUGIN_XML_TASK_NAME).let { - assertNotEquals(TaskOutcome.UP_TO_DATE, it.task(":$PATCH_PLUGIN_XML_TASK_NAME")?.outcome) + build(Tasks.PATCH_PLUGIN_XML).let { + assertNotEquals(TaskOutcome.UP_TO_DATE, it.task(":${Tasks.PATCH_PLUGIN_XML}")?.outcome) assertFileContent( patchedPluginXml.value, """ diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTaskSpec.kt index 7241a9d6d1..4540b5d650 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTaskSpec.kt @@ -2,10 +2,8 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_SANDBOX -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_SANDBOX_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_TESTING_SANDBOX_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PREPARE_UI_TESTING_SANDBOX_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_SANDBOX_CONTAINER +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import java.io.File import java.nio.file.Files.createTempDirectory @@ -17,7 +15,7 @@ import kotlin.test.assertTrue @Suppress("GroovyUnusedAssignment", "PluginXmlValidity") class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { - private val sandbox get() = File(buildDirectory, DEFAULT_SANDBOX) + private val sandbox get() = File(buildDirectory, DEFAULT_SANDBOX_CONTAINER) @Test fun `prepare sandbox for two plugins`() { @@ -81,7 +79,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { file("nestedProject/src/main/resources/META-INF/plugin.xml").xml(pluginXml.readText()) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) assertEquals( setOf( @@ -176,7 +174,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { file("nestedProject/src/main/resources/META-INF/plugin.xml").xml(pluginXml.readText()) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) assertEquals( setOf( @@ -227,7 +225,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) assertEquals( setOf( @@ -276,7 +274,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) assertEquals( setOf( @@ -351,7 +349,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PREPARE_UI_TESTING_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_UI_TESTING_SANDBOX) assertTrue( collectPaths(sandbox).containsAll( @@ -384,7 +382,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) assertEquals( setOf( @@ -415,7 +413,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) assertEquals( setOf( @@ -448,7 +446,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) assertEquals( setOf( @@ -521,7 +519,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) val sandbox = File(sandboxPath) assertEquals( @@ -542,7 +540,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) assertEquals( setOf( @@ -561,10 +559,10 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) assertFileContent( - File(buildDirectory, "$DEFAULT_SANDBOX/config/options/updates.xml"), + File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), """ @@ -583,7 +581,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - val updatesFile = File(directory("build/$DEFAULT_SANDBOX/config/options"), "updates.xml") + val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") updatesFile.xml( """ @@ -594,10 +592,10 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) assertFileContent( - File(buildDirectory, "$DEFAULT_SANDBOX/config/options/updates.xml"), + File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), """ @@ -619,7 +617,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - val updatesFile = File(directory("build/$DEFAULT_SANDBOX/config/options"), "updates.xml") + val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") updatesFile.xml( """ @@ -630,10 +628,10 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) assertFileContent( - File(buildDirectory, "$DEFAULT_SANDBOX/config/options/updates.xml"), + File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), """ @@ -653,7 +651,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - val updatesFile = File(directory("build/$DEFAULT_SANDBOX/config/options"), "updates.xml") + val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") updatesFile.xml( """ @@ -665,10 +663,10 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) assertFileContent( - File(buildDirectory, "$DEFAULT_SANDBOX/config/options/updates.xml"), + File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), """ @@ -687,7 +685,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - val updatesFile = File(directory("build/$DEFAULT_SANDBOX/config/options"), "updates.xml") + val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") updatesFile.xml( """ @@ -699,10 +697,10 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) assertFileContent( - File(buildDirectory, "$DEFAULT_SANDBOX/config/options/updates.xml"), + File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), """ @@ -721,14 +719,14 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - val updatesFile = File(directory("build/$DEFAULT_SANDBOX/config/options"), "updates.xml") + val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") updatesFile.xml("") - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) assertFileContent( - File(buildDirectory, "$DEFAULT_SANDBOX/config/options/updates.xml"), + File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), """ @@ -747,7 +745,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - val updatesFile = File(directory("build/$DEFAULT_SANDBOX/config/options"), "updates.xml") + val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") updatesFile.xml( """ @@ -772,10 +770,10 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) assertFileContent( - File(buildDirectory, "$DEFAULT_SANDBOX/config/options/updates.xml"), + File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), """ @@ -813,7 +811,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) buildFile.groovy( """ @@ -821,7 +819,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) assertEquals( setOf( @@ -856,7 +854,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(PREPARE_SANDBOX_TASK_NAME) + build(Tasks.PREPARE_SANDBOX) assertEquals( setOf( @@ -888,7 +886,7 @@ class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { pluginName = 'myPluginName' } - $PREPARE_TESTING_SANDBOX_TASK_NAME { + ${Tasks.PREPARE_TESTING_SANDBOX} { from("additional") } """.trimIndent() diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTaskSpec.kt index 5578cd70e1..8f86190b17 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTaskSpec.kt @@ -4,9 +4,9 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks import org.apache.commons.io.FileUtils import org.gradle.kotlin.dsl.support.listFilesOrdered -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase import org.junit.Assert import java.net.URL @@ -518,7 +518,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { } """.trimIndent() ) - build(BUILD_PLUGIN_TASK_NAME) + build(Tasks.BUILD_PLUGIN) } private fun writeJavaFileWithDeprecation() { From 00bcdef9c6662d7efaf279b3ec17beb36c0b5973 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Wed, 18 Oct 2023 14:36:18 +0200 Subject: [PATCH 030/347] runIde with prepareSandbox --- .../gradleplugin/IntelliJPluginConstants.kt | 9 +-- .../transform/CollectorTransformer.kt | 2 +- .../transform/ExtractorTransformer.kt | 3 +- .../transform/ProductInfoTransformer.kt | 2 +- .../dependencies/intellijPlatformLocal.kt | 65 +++++++++---------- .../IntelliJPlatformAbstractProjectPlugin.kt | 29 ++++----- .../plugins/IntelliJPlatformBasePlugin.kt | 11 +--- .../plugins/IntelliJPlatformPlugin.kt | 5 +- .../plugins/IntelliJPlatformTasksPlugin.kt | 56 +++++++--------- .../LaunchSystemArgumentProvider.kt | 21 ++++-- .../tasks/BuildSearchableOptionsTask.kt | 4 +- .../tasks/DownloadRobotServerPluginTask.kt | 2 +- .../gradleplugin/tasks/InstrumentCodeTask.kt | 2 +- .../tasks/JarSearchableOptionsTask.kt | 2 +- .../tasks/ListBundledPluginsTask.kt | 2 +- .../tasks/ListProductsReleasesTask.kt | 2 +- .../gradleplugin/tasks/PrepareSandboxTask.kt | 39 +++++------ .../gradleplugin/tasks/PublishPluginTask.kt | 4 +- .../platform/gradleplugin/tasks/RunIdeTask.kt | 6 +- .../tasks/RunPluginVerifierTask.kt | 2 +- .../gradleplugin/tasks/SignPluginTask.kt | 3 +- .../gradleplugin/tasks/base/RunIdeBase.kt | 2 +- .../gradleplugin/tasks/base/SandboxAware.kt | 35 +--------- .../intellij/platform/gradleplugin/utils.kt | 21 +++++- 24 files changed, 151 insertions(+), 178 deletions(-) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index 0c2807c87a..f8a014b79d 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -63,6 +63,7 @@ object IntelliJPluginConstants { const val CONFIG = "config" const val PLUGINS = "plugins" const val SYSTEM = "system" + const val LOG = "system/log" } object Locations { @@ -96,7 +97,7 @@ object IntelliJPluginConstants { const val COMPILE_KOTLIN_TASK_NAME = "compileKotlin" val TASKS = listOf( -// Tasks.BUILD_PLUGIN, + Tasks.BUILD_PLUGIN, // BUILD_SEARCHABLE_OPTIONS_TASK_NAME, // CLASSPATH_INDEX_CLEANUP_TASK_NAME, // DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML_TASK_NAME, @@ -111,9 +112,9 @@ object IntelliJPluginConstants { // LIST_BUNDLED_PLUGINS_TASK_NAME, // LIST_PRODUCTS_RELEASES_TASK_NAME, Tasks.PATCH_PLUGIN_XML, -// Tasks.PREPARE_SANDBOX, -// Tasks.PREPARE_TESTING_SANDBOX, -// Tasks.PREPARE_UI_TESTING_SANDBOX, + Tasks.PREPARE_SANDBOX, + Tasks.PREPARE_TESTING_SANDBOX, + Tasks.PREPARE_UI_TESTING_SANDBOX, // PRINT_BUNDLED_PLUGINS_TASK_NAME, // PRINT_PRODUCTS_RELEASES_TASK_NAME, // PUBLISH_PLUGIN_TASK_NAME, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/CollectorTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/CollectorTransformer.kt index 059683c161..e09fdad241 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/CollectorTransformer.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/CollectorTransformer.kt @@ -30,7 +30,7 @@ abstract class CollectorTransformer : TransformAction abstract val inputArtifact: Provider override fun transform(outputs: TransformOutputs) { - val input = inputArtifact.get().asPath + val input = inputArtifact.asPath if (input.name.startsWith("org")) { // FIXME // Plugin dependency diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ExtractorTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ExtractorTransformer.kt index 0835005899..3901c93110 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ExtractorTransformer.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ExtractorTransformer.kt @@ -20,6 +20,7 @@ import org.gradle.kotlin.dsl.registerTransform import org.gradle.work.DisableCachingByDefault import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes +import org.jetbrains.intellij.platform.gradleplugin.asFile import org.jetbrains.intellij.platform.gradleplugin.asPath import java.io.File import java.io.File.separator @@ -49,7 +50,7 @@ abstract class ExtractorTransformer @Inject constructor( abstract val inputArtifact: Provider override fun transform(outputs: TransformOutputs) { - val (file, path) = with(inputArtifact.get()) { asFile to asPath } + val (file, path) = with(inputArtifact) { asFile to asPath } val extension = path.name.removePrefix(path.nameWithoutExtension.removeSuffix(".tar")) val (groupId, artifactId, version) = path.pathString.split(separator).dropLast(2).takeLast(3) // TODO: if a local ZIP file, i.e. with local plugin will be passed to PLUGIN configuration — that most likely will fail diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ProductInfoTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ProductInfoTransformer.kt index 4966b7549a..824262f6bb 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ProductInfoTransformer.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ProductInfoTransformer.kt @@ -26,7 +26,7 @@ abstract class ProductInfoTransformer : TransformAction override fun transform(outputs: TransformOutputs) { - val input = inputArtifact.get().asPath + val input = inputArtifact.asPath val productInfo = input.resolveProductInfoPath() outputs.file(productInfo) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt index 739230a816..be694b0579 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt @@ -38,43 +38,41 @@ val Project.intellijPlatformLocal: DependencyHandler.(String) -> Dependency? } val ivyFileName = "${productInfo.productCode}-${productInfo.version}.xml" - val dependency = create(productInfo) { - val targetFile = it.ivyDirectory.file(ivyFileName).get().asPath - - if (targetFile.notExists()) { - targetFile.parent.createDirectories() - targetFile.createFile() - - val extractor = XmlExtractor() - val ivyModule = IvyModule( - info = IvyModuleInfo( - organisation = group, - module = name, - revision = version, - publication = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")), - ), - configurations = mutableListOf( - IvyModuleConfiguration( - name = "default", - visibility = "public", + val dependency = create(productInfo) { settings -> + settings.ivyDirectory.asPath + .resolve(ivyFileName) + .takeIf { it.notExists() } + ?.run { + val extractor = XmlExtractor() + val ivyModule = IvyModule( + info = IvyModuleInfo( + organisation = group, + module = name, + revision = version, + publication = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")), ), - ), - publications = mutableListOf( - IvyModulePublication( - name = ideaDir.pathString, - type = "directory", - ext = null, - conf = "default", - ) - ), - ) - extractor.marshal(ivyModule, targetFile) - } + configurations = mutableListOf( + IvyModuleConfiguration( + name = "default", + visibility = "public", + ), + ), + publications = mutableListOf( + IvyModulePublication( + name = ideaDir.pathString, + type = "directory", + ext = null, + conf = "default", + ) + ), + ) + extractor.marshal(ivyModule, createFile()) + } this@intellijPlatformLocal.repositories.ivy { - val ivyDirectory = it.ivyDirectory.get().asFile + val ivyDirectory = settings.ivyDirectory.asPath - url = ivyDirectory.toURI() + url = ivyDirectory.toUri() ivyPattern("$ivyDirectory/[module]-[revision].[ext]") artifactPattern(ideaDir.absolutePathString()) // artifactPattern("$ivyDirectory/[artifact]") @@ -90,7 +88,6 @@ val Project.intellijPlatformLocal: DependencyHandler.(String) -> Dependency? add(INTELLIJ_PLATFORM_LOCAL_INSTANCE, dependency) } - internal fun DependencyHandler.create( productInfo: ProductInfo, settings: IntelliJPlatformDependencySettings = intellijPlatformDependencySettings, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt index d50689db55..0a40710451 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt @@ -13,15 +13,17 @@ import org.gradle.kotlin.dsl.* import org.gradle.kotlin.dsl.support.serviceOf import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension import org.jetbrains.intellij.platform.gradleplugin.info import org.jetbrains.intellij.platform.gradleplugin.jbr.JetBrainsRuntimeResolver import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.tasks.PrepareSandboxTask import org.jetbrains.intellij.platform.gradleplugin.tasks.base.JetBrainsRuntimeAware import org.jetbrains.intellij.platform.gradleplugin.tasks.base.PlatformVersionAware import org.jetbrains.intellij.platform.gradleplugin.tasks.base.SandboxAware +import kotlin.io.path.createDirectories abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plugin { @@ -50,24 +52,19 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu } if (this is SandboxAware) { + val prepareSandboxTaskProvider = named(Tasks.PREPARE_SANDBOX) + sandboxDirectory.convention(extension.sandboxContainer.map { - it.dir("$platformType-$platformVersion") - }) - configDirectory.convention(sandboxDirectory.map { - it.dir(Sandbox.CONFIG).apply { - asFile.mkdirs() - } - }) - pluginsDirectory.convention(sandboxDirectory.map { - it.dir(Sandbox.PLUGINS).apply { - asFile.mkdirs() - } - }) - systemDirectory.convention(sandboxDirectory.map { - it.dir(Sandbox.SYSTEM).apply { - asFile.mkdirs() + it.dir("$platformType-$platformVersion").also { directory -> + directory.asFile.toPath().createDirectories() } }) + + prepareSandboxTaskProvider.configure { + sandboxDirectory.convention(this@with.sandboxDirectory) + } + + dependsOn(prepareSandboxTaskProvider) } if (this is JetBrainsRuntimeAware) { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt index 832ba81729..cd6b81af33 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt @@ -41,11 +41,6 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi isCanBeConsumed = false isCanBeResolved = true description = "IntelliJ Platform dependency archive" - - attributes { -// attribute(Attributes.artifactType, ArtifactType.INTELLIJ_PLATFORM) - attribute(Attributes.extracted, false) - } } val intellijPlatformLocalConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM_LOCAL_INSTANCE) @@ -54,10 +49,6 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi isCanBeConsumed = false isCanBeResolved = true description = "IntelliJ Platform local instance" - - attributes { - attribute(Attributes.extracted, true) - } } val intellijPlatformConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM) @@ -185,6 +176,8 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi sandboxContainer.convention(project.layout.buildDirectory.dir(Sandbox.CONTAINER)) configureExtension(PLUGIN_CONFIGURATION) { + name.convention(project.name) + configureExtension(PRODUCT_DESCRIPTOR) configureExtension(IDEA_VERSION) configureExtension(VENDOR) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt index 79c5e86c11..d001d26702 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt @@ -4,6 +4,7 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins import com.jetbrains.plugin.structure.base.utils.extension import com.jetbrains.plugin.structure.base.utils.hasExtension +import com.jetbrains.plugin.structure.base.utils.isDirectory import com.jetbrains.plugin.structure.base.utils.nameWithoutExtension import com.jetbrains.plugin.structure.intellij.version.IdeVersion import org.gradle.api.GradleException @@ -478,7 +479,7 @@ abstract class IntelliJPlatformPlugin : Plugin { // val librariesToIgnore = librariesToIgnore.get().toSet() + Jvm.current().toolsJar // val pluginDirectories = pluginDependencies.get().map { it.artifact } // -// listOf(pluginJar.get().asFile) + files.filter { file -> +// listOf(pluginJar.asFile) + files.filter { file -> // !(librariesToIgnore.contains(file) || pluginDirectories.any { p -> // file.toPath() == p || file.canonicalPath.startsWith("$p${File.separator}") // }) @@ -827,7 +828,7 @@ abstract class IntelliJPlatformPlugin : Plugin { dependsOn(BUILD_SEARCHABLE_OPTIONS_TASK_NAME) dependsOn(Tasks.PREPARE_SANDBOX) - onlyIf { inputDir.get().asFile.isDirectory } + onlyIf { inputDir.asPath.isDirectory } } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt index 7611e926eb..b42a8284f8 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt @@ -3,19 +3,21 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins import org.gradle.api.Project -import org.gradle.api.artifacts.Dependency -import org.gradle.api.internal.plugins.DefaultArtifactPublicationSet import org.gradle.api.plugins.JavaPlugin import org.gradle.api.tasks.SourceSet.MAIN_SOURCE_SET_NAME import org.gradle.api.tasks.TaskContainer import org.gradle.api.tasks.bundling.Jar import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem -import org.gradle.kotlin.dsl.* +import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.assign +import org.gradle.kotlin.dsl.attributes +import org.gradle.kotlin.dsl.named import org.jetbrains.intellij.platform.gradleplugin.* import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.SELF_UPDATE_CHECK import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_TASKS_ID +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradleplugin.tasks.* @@ -32,11 +34,11 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug with(tasks) { configureSetupDependenciesTask() -// configureBuildPluginTask() + configurePrepareSandboxTasks() + configureBuildPluginTask() configureInitializeIntelliJPlatformPluginTask() configurePatchPluginXmlTask() configureJarTasks() -// configurePrepareSandboxTasks() configureRunIdeTasks() @@ -53,7 +55,7 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug private fun TaskContainer.configureBuildPluginTask() = configureTask(Tasks.BUILD_PLUGIN) { val prepareSandboxTaskProvider = named(Tasks.PREPARE_SANDBOX) - val jarSearchableOptionsTaskProvider = named(IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME) +// val jarSearchableOptionsTaskProvider = named(IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME) archiveBaseName.convention(prepareSandboxTaskProvider.flatMap { prepareSandboxTask -> prepareSandboxTask.pluginName @@ -64,11 +66,11 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug prepareSandboxTask.destinationDir.resolve(it) } }) - from(jarSearchableOptionsTaskProvider.flatMap { jarSearchableOptionsTask -> - jarSearchableOptionsTask.archiveFile - }) { - into("lib") - } +// from(jarSearchableOptionsTaskProvider.flatMap { jarSearchableOptionsTask -> +// jarSearchableOptionsTask.archiveFile +// }) { +// into("lib") +// } into(prepareSandboxTaskProvider.flatMap { prepareSandboxTask -> prepareSandboxTask.pluginName }) @@ -76,10 +78,10 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug dependsOn(IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME) dependsOn(Tasks.PREPARE_SANDBOX) - project.artifacts.add(Dependency.ARCHIVES_CONFIGURATION, this).let { publishArtifact -> - extensions.getByType().addCandidate(publishArtifact) - project.components.add(IntelliJPlatformPluginLibrary()) - } +// project.artifacts.add(Dependency.ARCHIVES_CONFIGURATION, this).let { publishArtifact -> +// extensions.getByType().addCandidate(publishArtifact) +// project.components.add(IntelliJPlatformPluginLibrary()) +// } } private fun TaskContainer.configureInitializeIntelliJPlatformPluginTask() = @@ -173,8 +175,9 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug private fun TaskContainer.configurePrepareSandboxTasks() = configureTask(Tasks.PREPARE_SANDBOX, Tasks.PREPARE_TESTING_SANDBOX, Tasks.PREPARE_UI_TESTING_SANDBOX) { - val downloadPluginTaskProvider = project.tasks.named(IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME) +// val downloadPluginTaskProvider = project.tasks.named(IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME) val runtimeConfiguration = project.configurations.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME) + val jarTaskProvider = named(JavaPlugin.JAR_TASK_NAME) // val ideaDependencyJarFiles = ideaDependencyProvider.map { // project.files(it.jarFiles) @@ -182,9 +185,9 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug val pluginJarProvider = project.intelliJPlatformExtension.instrumentCode.flatMap { instrumentCode -> when (instrumentCode) { true -> named(Tasks.INSTRUMENTED_JAR) - false -> named(JavaPlugin.JAR_TASK_NAME) + false -> jarTaskProvider } - }.flatMap { jarTask -> jarTask.archiveFile } + }.flatMap { it.archiveFile } testSuffix.convention( when (name) { @@ -204,18 +207,9 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug // dependsOn(IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME) // } -// pluginName.convention(extension.pluginName) + pluginName.convention(project.intelliJPlatformExtension.pluginConfiguration.name) pluginJar.convention(pluginJarProvider) -// defaultDestinationDir.convention(extension.sandboxDir.flatMap { -// testSuffix.map { testSuffixValue -> -// project.file("$it/plugins$testSuffixValue") -// } -// }) -// configDir.convention(extension.sandboxDir.flatMap { -// testSuffix.map { testSuffixValue -> -// "$it/config$testSuffixValue" -// } -// }) + defaultDestinationDir.convention(sandboxDirectory.dir(Sandbox.PLUGINS)) // librariesToIgnore.convention(ideaDependencyJarFiles) // pluginDependencies.convention(project.provider { // extension.getPluginDependenciesList(project) @@ -227,7 +221,7 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug val librariesToIgnore = librariesToIgnore.get().toSet() + Jvm.current().toolsJar val pluginDirectories = pluginDependencies.get().map { it.artifact } - listOf(pluginJar.get().asFile) + files.filter { file -> + listOf(pluginJar.asFile) + files.filter { file -> !(librariesToIgnore.contains(file) || pluginDirectories.any { p -> file.toPath() == p || file.canonicalPath.startsWith("$p${File.separator}") }) @@ -238,7 +232,7 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug } dependsOn(runtimeConfiguration) -// dependsOn(jarTaskProvider) + dependsOn(jarTaskProvider) // dependsOn(instrumentedJarTaskProvider) // project.afterEvaluate `{ diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt index 21033960c5..981ffe0172 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt @@ -7,15 +7,16 @@ import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.gradle.process.CommandLineArgumentProvider +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox +import org.jetbrains.intellij.platform.gradleplugin.asPath import org.jetbrains.intellij.platform.gradleplugin.model.productInfo import org.jetbrains.intellij.platform.gradleplugin.resolveIdeHomeVariable import java.nio.file.Path +import kotlin.io.path.pathString class LaunchSystemArgumentProvider( @InputDirectory @PathSensitive(RELATIVE) val ideDirectory: Path, - @InputDirectory @PathSensitive(RELATIVE) val configDirectory: DirectoryProperty, - @InputDirectory @PathSensitive(RELATIVE) val systemDirectory: DirectoryProperty, - @InputDirectory @PathSensitive(RELATIVE) val pluginsDirectory: DirectoryProperty, + @InputDirectory @PathSensitive(RELATIVE) val sandboxDirectory: DirectoryProperty, private val requirePluginIds: List, ) : CommandLineArgumentProvider { @@ -27,11 +28,17 @@ class LaunchSystemArgumentProvider( .filter { it.startsWith("-D") } .map { it.resolveIdeHomeVariable(ideDirectory) } + private fun resolveInSandboxDirectory(directoryName: String) = sandboxDirectory.map { + it.dir(directoryName).apply { + asFile.mkdirs() + } + }.asPath.pathString + override fun asArguments() = currentLaunchProperties + listOf( - "-Didea.config.path=${configDirectory.asFile.get().absolutePath}", - "-Didea.system.path=${systemDirectory.asFile.get().absolutePath}", - "-Didea.log.path=${systemDirectory.asFile.get().resolve("log").absolutePath}", - "-Didea.plugins.path=${pluginsDirectory.asFile.get().absolutePath}", + "-Didea.config.path=${resolveInSandboxDirectory(Sandbox.CONFIG)}", + "-Didea.system.path=${resolveInSandboxDirectory(Sandbox.SYSTEM)}", + "-Didea.log.path=${resolveInSandboxDirectory(Sandbox.LOG)}", + "-Didea.plugins.path=${resolveInSandboxDirectory(Sandbox.PLUGINS)}", "-Didea.required.plugins.id=${requirePluginIds.joinToString(",")}", ) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTask.kt index 535ffd4a70..bf16af1c7e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTask.kt @@ -9,9 +9,11 @@ import org.gradle.api.tasks.Internal import org.gradle.api.tasks.OutputDirectory import org.jetbrains.intellij.platform.gradleplugin.BuildFeature import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.asPath import org.jetbrains.intellij.platform.gradleplugin.logCategory import org.jetbrains.intellij.platform.gradleplugin.tasks.base.RunIdeBase import org.jetbrains.intellij.platform.gradleplugin.warn +import kotlin.io.path.pathString /** * Builds an index of UI components (searchable options) for the plugin. @@ -59,7 +61,7 @@ abstract class BuildSearchableOptionsTask : RunIdeBase() { ) } - args = args + listOf(outputDir.get().asFile.canonicalPath, "true") + args = args + listOf(outputDir.asPath.pathString, "true") super.exec() } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadRobotServerPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadRobotServerPluginTask.kt index 0dff2b4fb2..1cf4dd14ec 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadRobotServerPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadRobotServerPluginTask.kt @@ -69,7 +69,7 @@ abstract class DownloadRobotServerPluginTask @Inject constructor( @TaskAction fun downloadRobotServerPlugin() { val archive = pluginArchive.get().toPath() - val target = outputDir.get().asPath + val target = outputDir.asPath archiveUtils.extract(archive, target, context) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentCodeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentCodeTask.kt index b95e52e4c1..c03a71e71a 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentCodeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentCodeTask.kt @@ -130,7 +130,7 @@ abstract class InstrumentCodeTask : DefaultTask() { info(context, "Compiling forms and instrumenting code with nullability preconditions") val instrumentNotNull = prepareNotNullInstrumenting(classpath) - val outputDirPath = outputDir.get().asPath + val outputDirPath = outputDir.asPath val temporaryDirPath = temporaryDir .toPath() .also { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/JarSearchableOptionsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/JarSearchableOptionsTask.kt index d3f25f8d4a..886b648ea8 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/JarSearchableOptionsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/JarSearchableOptionsTask.kt @@ -83,7 +83,7 @@ abstract class JarSearchableOptionsTask : Jar() { } } } - inputDir.get().asPath + inputDir.asPath }) this.eachFile { path = "search/$name" } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListBundledPluginsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListBundledPluginsTask.kt index 58c2bf2eba..4806bdb369 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListBundledPluginsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListBundledPluginsTask.kt @@ -54,7 +54,7 @@ abstract class ListBundledPluginsTask : DefaultTask() { @TaskAction fun listBundledPlugins() { - outputFile.get().asPath.outputStream().use { os -> + outputFile.asPath.outputStream().use { os -> BuiltinPluginsRegistry .resolveBundledPlugins(ideDir.get().toPath(), context) .joinToString("\n") diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTask.kt index f17ff8a466..ea93a885a7 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTask.kt @@ -207,7 +207,7 @@ abstract class ListProductsReleasesTask : DefaultTask() { false -> emptyList() } - outputFile.get().asPath.outputStream().use { os -> + outputFile.asPath.outputStream().use { os -> (result + androidStudioResult) .joinToString("\n") .apply { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTask.kt index 2fa6285deb..ebaf330add 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTask.kt @@ -7,10 +7,7 @@ import com.jetbrains.plugin.structure.intellij.utils.JDOMUtil import groovy.lang.Closure import org.gradle.api.GradleException import org.gradle.api.Task -import org.gradle.api.file.CopySpec -import org.gradle.api.file.DuplicatesStrategy -import org.gradle.api.file.FileCollection -import org.gradle.api.file.RegularFileProperty +import org.gradle.api.file.* import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.api.tasks.* @@ -18,10 +15,14 @@ import org.gradle.work.DisableCachingByDefault import org.jdom2.Element import org.jetbrains.intellij.platform.gradleplugin.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginDependency import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginProjectDependency import java.io.File import java.nio.file.Path +import kotlin.io.path.createDirectories +import kotlin.io.path.createFile +import kotlin.io.path.notExists /** * Prepares sandbox directory with installed plugin and its dependencies. @@ -40,10 +41,11 @@ abstract class PrepareSandboxTask : Sync() { /** * The directory with the plugin configuration. * - * Default value: [IntelliJPluginExtension.sandboxDir]/config + * Default value: [IntelliJPluginExtension.sandboxDir] */ - @get:Input - abstract val configDir: Property + @get:InputDirectory + @get:PathSensitive(PathSensitivity.RELATIVE) + abstract val sandboxDirectory: DirectoryProperty /** * The input plugin JAR file used to prepare the sandbox. @@ -77,7 +79,7 @@ abstract class PrepareSandboxTask : Sync() { * Default sandbox destination directory. */ @get:Internal - abstract val defaultDestinationDir: Property + abstract val defaultDestinationDir: DirectoryProperty @get:InputFiles @get:Classpath @@ -106,7 +108,7 @@ abstract class PrepareSandboxTask : Sync() { fun intoChild(destinationDir: Any): CopySpec = mainSpec.addChild().into(destinationDir) - override fun getDestinationDir(): File = defaultDestinationDir.get() + override fun getDestinationDir() = defaultDestinationDir.asFile.get() override fun configure(closure: Closure<*>): Task = super.configure(closure) @@ -132,21 +134,14 @@ abstract class PrepareSandboxTask : Sync() { } private fun disableIdeUpdate() { - val optionsDir = Path.of(configDir.get()) - .resolve("options") - .takeIf { it.createDir().exists() } - .ifNull { error(context, "Cannot disable update checking in host IDE") } - ?: return - - val updatesConfig = optionsDir.resolve("updates.xml") - .also { - if (!it.exists()) { - it.create() + val updatesConfig = sandboxDirectory.dir("${Sandbox.CONFIG}/options").asPath + .createDirectories() + .resolve("updates.xml") + .apply { + if (notExists()) { + createFile() } } - .takeIf(Path::exists) - .ifNull { error(context, "Cannot disable update checking in host IDE") } - ?: return if (updatesConfig.readText().trim().isEmpty()) { updatesConfig.writeText("") diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PublishPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PublishPluginTask.kt index b7b049fce8..c77504521a 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PublishPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PublishPluginTask.kt @@ -16,9 +16,9 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUG import org.jetbrains.intellij.platform.gradleplugin.asPath import org.jetbrains.intellij.platform.gradleplugin.info import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.utils.ToolboxEnterprisePluginRepositoryService import org.jetbrains.intellij.pluginRepository.PluginRepositoryFactory import org.jetbrains.intellij.pluginRepository.model.StringPluginId -import org.jetbrains.intellij.platform.gradleplugin.utils.ToolboxEnterprisePluginRepositoryService /** * Publishes plugin to the remote [JetBrains Marketplace](https://plugins.jetbrains.com) repository. @@ -89,7 +89,7 @@ abstract class PublishPluginTask : DefaultTask() { fun publishPlugin() { validateInput() - val path = distributionFile.get().asPath + val path = distributionFile.asPath when (val creationResult = IdePluginManager.createManager().createPlugin(path)) { is PluginCreationSuccess -> { if (creationResult.unacceptableWarnings.isNotEmpty()) { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt index 47070a2e6e..8844467990 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt @@ -86,7 +86,7 @@ abstract class RunIdeTask : JavaExec(), JetBrainsRuntimeAware, PlatformVersionAw super.exec() } - override fun getExecutable(): String = jetbrainsRuntimeExecutable.get().asPath.absolutePathString() + override fun getExecutable(): String = jetbrainsRuntimeExecutable.asPath.absolutePathString() /** * Prepares the classpath for the IDE based on the IDEA version. @@ -117,9 +117,7 @@ abstract class RunIdeTask : JavaExec(), JetBrainsRuntimeAware, PlatformVersionAw jvmArgumentProviders.add( LaunchSystemArgumentProvider( intellijPlatformDirectory, - configDirectory, - systemDirectory, - pluginsDirectory, + sandboxDirectory, emptyList(), // requiredPluginIds.get(), ) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt index 95ad8c040e..96e1cd8116 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt @@ -360,7 +360,7 @@ abstract class RunPluginVerifierTask @Inject constructor( private fun getOptions(): List { val args = mutableListOf( "-verification-reports-dir", verificationReportsDir.get(), - "-runtime-dir", jetbrainsRuntimeDirectory.get().asPath.pathString, + "-runtime-dir", jetbrainsRuntimeDirectory.asPath.pathString, ) externalPrefixes.get().takeIf { it.isNotEmpty() }?.let { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTask.kt index 588b7b45a0..9488092319 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTask.kt @@ -16,6 +16,7 @@ import org.jetbrains.intellij.platform.gradleplugin.logCategory import org.jetbrains.intellij.platform.gradleplugin.tasks.base.ZipSigningToolBase import java.util.* import javax.inject.Inject +import kotlin.io.path.pathString /** * Signs the ZIP archive with the provided key using [Marketplace ZIP Signer](https://github.com/JetBrains/marketplace-zip-signer) library. @@ -149,7 +150,7 @@ abstract class SignPluginTask @Inject constructor( */ override fun collectArguments(): List { val arguments = mutableListOf( - "-out", outputArchiveFile.get().asPath.toAbsolutePath().toString(), + "-out", outputArchiveFile.asPath.pathString, ) privateKey.orNull?.let { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt index aeb122bac1..0f403f8ee4 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt @@ -123,7 +123,7 @@ abstract class RunIdeBase : JavaExec() { // ideDirPath, // configDir.get(), // systemDir.get(), -// pluginsDir.get().asFile, +// pluginsDir.asFile, // requiredPluginIds.get(), // ) // ) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/SandboxAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/SandboxAware.kt index 513d9449d7..c1afe0a8b3 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/SandboxAware.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/SandboxAware.kt @@ -3,42 +3,13 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks.base import org.gradle.api.file.DirectoryProperty -import org.gradle.api.tasks.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginExtension +import org.gradle.api.tasks.InputDirectory +import org.gradle.api.tasks.PathSensitive +import org.gradle.api.tasks.PathSensitivity interface SandboxAware : PlatformVersionAware { @get:InputDirectory @get:PathSensitive(PathSensitivity.RELATIVE) val sandboxDirectory: DirectoryProperty - - /** - * Path to the `config` directory within the sandbox prepared with [PrepareSandboxTask]. - * Provided to the `idea.config.path` system property. - * - * Default value: [PrepareSandboxTask.configDir] - */ - @get:InputDirectory - @get:PathSensitive(PathSensitivity.RELATIVE) - val configDirectory: DirectoryProperty - - /** - * Path to the `plugins` directory within the sandbox prepared with [PrepareSandboxTask]. - * Provided to the `idea.plugins.path` system property. - * - * Default value: [PrepareSandboxTask.getDestinationDir] - */ - @get:InputDirectory - @get:PathSensitive(PathSensitivity.RELATIVE) - val pluginsDirectory: DirectoryProperty - - /** - * Path to the `system` directory within the sandbox prepared with [PrepareSandboxTask]. - * Provided to the `idea.system.path` system property. - * - * Default value: [IntelliJPluginExtension.sandboxDir]/system - */ - @get:InputDirectory - @get:PathSensitive(PathSensitivity.RELATIVE) - val systemDirectory: DirectoryProperty } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt index ed4cdfe7fd..73666f45cd 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt @@ -22,6 +22,7 @@ import org.gradle.api.logging.Logging import org.gradle.api.plugins.JavaPluginExtension import org.gradle.api.plugins.PluginInstantiationException import org.gradle.api.provider.Property +import org.gradle.api.provider.Provider import org.gradle.api.tasks.SourceSet import org.gradle.api.tasks.SourceSetContainer import org.gradle.kotlin.dsl.getByName @@ -44,6 +45,7 @@ import java.time.format.DateTimeFormatterBuilder import java.time.temporal.ChronoField import java.util.function.Predicate import java.util.jar.Manifest +import kotlin.io.path.absolute import kotlin.io.path.exists import kotlin.io.path.name @@ -188,9 +190,6 @@ fun Boolean.ifFalse(block: () -> Unit): Boolean { return this } -internal val FileSystemLocation.asPath - get() = asFile.toPath().toAbsolutePath() - internal fun URL.resolveRedirection() = with(openConnection() as HttpURLConnection) { instanceFollowRedirects = false inputStream.use { @@ -232,5 +231,21 @@ internal val Property.isSpecified else -> true } + +internal val FileSystemLocation.asPath + get() = asFile.toPath().absolute() + +internal val Provider.asFile + get() = get().asFile + +internal val Provider.asPath + get() = get().asFile.toPath().absolute() + +internal val Provider.asFileOrNull + get() = orNull?.asFile + +internal val Provider.asPathOrNull + get() = orNull?.asFile?.toPath()?.absolute() + internal val Project.sourceSets get() = extensions.getByName("sourceSets") as SourceSetContainer From 121e40110a667f7141f3653f77aac129fd8a9a50 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 23 Oct 2023 09:52:35 +0200 Subject: [PATCH 031/347] testIde task --- gradle.properties | 2 +- .../gradleplugin/IntelliJPluginConstants.kt | 2 + .../gradleplugin/model/ProductInfo.kt | 1 - .../IntelliJPlatformAbstractProjectPlugin.kt | 97 ++++++++----- .../plugins/IntelliJPlatformPlugin.kt | 25 ++-- .../plugins/IntelliJPlatformTasksPlugin.kt | 133 +++++++++++++++--- .../IntelliJPlatformArgumentProvider.kt | 29 ++-- .../LaunchSystemArgumentProvider.kt | 10 +- .../PluginPathArgumentProvider.kt | 12 +- .../InitializeIntelliJPlatformPluginTask.kt | 14 +- .../platform/gradleplugin/tasks/RunIdeTask.kt | 112 ++------------- .../gradleplugin/tasks/TestIdeTask.kt | 47 +++++++ .../tasks/base/CoroutinesJavaAgentAware.kt | 15 ++ .../tasks/base/CustomPlatformAware.kt | 32 +++++ .../gradleplugin/tasks/base/RunIdeBase.kt | 4 +- .../intellij/platform/gradleplugin/utils.kt | 13 +- 16 files changed, 344 insertions(+), 204 deletions(-) create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/TestIdeTask.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CoroutinesJavaAgentAware.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformAware.kt diff --git a/gradle.properties b/gradle.properties index ab799315b2..5ea8f9a9f2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ version=2.0.0 -snapshotVersion=2.0.1 +snapshotVersion=2.0.0 snapshot=false group=org.jetbrains.intellij.platform artifactId=intellij-platform-gradle-plugin diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index f8a014b79d..fe1fffaa92 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -56,6 +56,7 @@ object IntelliJPluginConstants { const val PREPARE_UI_TESTING_SANDBOX = "prepareUiTestingSandbox" const val RUN_IDE = "runIde" const val SETUP_DEPENDENCIES = "setupDependencies" + const val TEST_IDE = "testIde" } object Sandbox { @@ -124,6 +125,7 @@ object IntelliJPluginConstants { // RUN_PLUGIN_VERIFIER_TASK_NAME, Tasks.SETUP_DEPENDENCIES, // SIGN_PLUGIN_TASK_NAME, + Tasks.TEST_IDE, // VERIFY_PLUGIN_TASK_NAME, // VERIFY_PLUGIN_CONFIGURATION_TASK_NAME, // VERIFY_PLUGIN_SIGNATURE_TASK_NAME, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt index b26afd0000..805b8aa2b5 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt @@ -77,7 +77,6 @@ enum class OS { Linux, Windows, macOS } - internal fun ProductInfo.getBootClasspath(ideDir: Path) = currentLaunch .bootClassPathJarNames diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt index 0a40710451..f6f5152ecf 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt @@ -2,12 +2,14 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins +import org.gradle.api.GradleException import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.plugins.ExtensionAware import org.gradle.api.plugins.JavaPluginExtension import org.gradle.api.tasks.TaskContainer +import org.gradle.api.tasks.testing.Test import org.gradle.jvm.toolchain.JavaToolchainService import org.gradle.kotlin.dsl.* import org.gradle.kotlin.dsl.support.serviceOf @@ -17,12 +19,12 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Task import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension import org.jetbrains.intellij.platform.gradleplugin.info +import org.jetbrains.intellij.platform.gradleplugin.isSpecified import org.jetbrains.intellij.platform.gradleplugin.jbr.JetBrainsRuntimeResolver import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.tasks.InitializeIntelliJPlatformPluginTask import org.jetbrains.intellij.platform.gradleplugin.tasks.PrepareSandboxTask -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.JetBrainsRuntimeAware -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.PlatformVersionAware -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.SandboxAware +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.* import kotlin.io.path.createDirectories abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plugin { @@ -43,49 +45,78 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu protected inline fun TaskContainer.configureTask(vararg names: String, noinline configuration: T.() -> Unit = {}) { names.forEach { name -> info(context, "Configuring task: $name") - val task = findByName(name) as? T ?: register(name).get() - val extension = task.project.intelliJPlatformExtension + maybeCreate(name) + } - with(task) { - if (this is PlatformVersionAware) { - intelliJPlatformProductInfo = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) - } + withType { + if (this is CoroutinesJavaAgentAware) { + val initializeIntelliJPlatformPluginTaskProvider = named(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) - if (this is SandboxAware) { - val prepareSandboxTaskProvider = named(Tasks.PREPARE_SANDBOX) + coroutinesJavaAgentFile.convention(initializeIntelliJPlatformPluginTaskProvider.flatMap { + it.coroutinesJavaAgent + }) + + dependsOn(initializeIntelliJPlatformPluginTaskProvider) + } - sandboxDirectory.convention(extension.sandboxContainer.map { - it.dir("$platformType-$platformVersion").also { directory -> - directory.asFile.toPath().createDirectories() + if (this is CustomPlatformAware) { + intelliJPlatform = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM) + intellijPlatformDirectory.convention( + project.layout.dir( + project.provider { + when { + !type.isSpecified() && !version.isSpecified() -> intelliJPlatform.singleFile + else -> throw GradleException("Foo") + } } - }) + ) + ) + } + + if (this is PlatformVersionAware) { + intelliJPlatformProductInfo = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) + } + + if (this is SandboxAware) { + val prepareSandboxTaskProvider = named(Tasks.PREPARE_SANDBOX) - prepareSandboxTaskProvider.configure { - sandboxDirectory.convention(this@with.sandboxDirectory) + sandboxDirectory.convention(project.intelliJPlatformExtension.sandboxContainer.map { + it.dir("$platformType-$platformVersion").also { directory -> + directory.asFile.toPath().createDirectories() } + }) - dependsOn(prepareSandboxTaskProvider) + prepareSandboxTaskProvider.configure { + sandboxDirectory.convention(this@withType.sandboxDirectory) } - if (this is JetBrainsRuntimeAware) { - val jbrResolver = JetBrainsRuntimeResolver( - jetbrainsRuntimeConfiguration = project.configurations.getByName(Configurations.JETBRAINS_RUNTIME), - intellijPlatformConfiguration = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM), - javaToolchainSpec = project.extensions.getByType().toolchain, - javaToolchainService = project.serviceOf(), - ) + dependsOn(prepareSandboxTaskProvider) + } - jetbrainsRuntimeDirectory.convention(project.layout.dir(project.provider { - jbrResolver.resolveDirectory()?.toFile() - })) - jetbrainsRuntimeExecutable.convention(project.layout.file(project.provider { - jbrResolver.resolveExecutable()?.toFile() - })) - } + val jbrResolver = JetBrainsRuntimeResolver( + jetbrainsRuntimeConfiguration = project.configurations.getByName(Configurations.JETBRAINS_RUNTIME), + intellijPlatformConfiguration = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM), + javaToolchainSpec = project.extensions.getByType().toolchain, + javaToolchainService = project.serviceOf(), + ) + + if (this is JetBrainsRuntimeAware) { + jetbrainsRuntimeDirectory.convention(project.layout.dir(project.provider { + jbrResolver.resolveDirectory()?.toFile() + })) + jetbrainsRuntimeExecutable.convention(project.layout.file(project.provider { + jbrResolver.resolveExecutable()?.toFile() + })) + } - configuration() + if (this is Test) { + executable(project.provider { + jbrResolver.resolveExecutable()?.toFile() + }) } } + + withType(configuration) } protected inline fun Any.configureExtension(name: String, noinline configuration: T.() -> Unit = {}) { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt index d001d26702..acad0d1a9b 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt @@ -81,7 +81,6 @@ import org.jetbrains.intellij.platform.gradleplugin.model.MavenMetadata import org.jetbrains.intellij.platform.gradleplugin.model.XmlExtractor import org.jetbrains.intellij.platform.gradleplugin.model.productInfo import org.jetbrains.intellij.platform.gradleplugin.performanceTest.ProfilerName -import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.PluginPathArgumentProvider import org.jetbrains.intellij.platform.gradleplugin.tasks.* import org.jetbrains.intellij.platform.gradleplugin.tasks.base.RunIdeBase import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils @@ -112,10 +111,12 @@ abstract class IntelliJPlatformPlugin : Plugin { info(context, "Configuring plugin: org.jetbrains.intellij.platform") checkGradleVersion() - project.applyConfigurations() project.applyPlugins() return + + project.applyConfigurations() + archiveUtils = project.objects.newInstance() dependenciesDownloader = project.objects.newInstance(project.gradle.startParameter.isOffline) @@ -123,7 +124,7 @@ abstract class IntelliJPlatformPlugin : Plugin { val extension = project.extensions.create(INTELLIJ_PLATFORM, dependenciesDownloader).apply { version.convention(project.provider { - if (!localPath.isSpecified) { + if (!localPath.isSpecified()) { throw GradleException("The value for the 'intellij.version' property was not specified, see: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#intellij-extension-version") } null @@ -157,12 +158,12 @@ abstract class IntelliJPlatformPlugin : Plugin { private fun configureTasks(project: Project, extension: IntelliJPluginExtension, ideaDependencyProvider: Provider) { info(context, "Configuring plugin") - project.tasks.withType { - prepareConventionMappingsForRunIdeTask(project, extension, ideaDependencyProvider, Tasks.PREPARE_SANDBOX) - } - project.tasks.withType { - prepareConventionMappingsForRunIdeTask(project, extension, ideaDependencyProvider, Tasks.PREPARE_UI_TESTING_SANDBOX) - } +// project.tasks.withType { +// prepareConventionMappingsForRunIdeTask(project, extension, ideaDependencyProvider, Tasks.PREPARE_SANDBOX) +// } +// project.tasks.withType { +// prepareConventionMappingsForRunIdeTask(project, extension, ideaDependencyProvider, Tasks.PREPARE_UI_TESTING_SANDBOX) +// } configureClassPathIndexCleanupTask(project, ideaDependencyProvider) configureInstrumentation(project, extension, ideaDependencyProvider) @@ -1038,7 +1039,7 @@ abstract class IntelliJPlatformPlugin : Plugin { } val initializeIntellijPlatformPluginTaskProvider = project.tasks.named(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) val coroutinesJavaAgentPathProvider = initializeIntellijPlatformPluginTaskProvider.flatMap { - it.coroutinesJavaAgentPath + it.coroutinesJavaAgent } val testTasks = project.tasks.withType() @@ -1143,7 +1144,7 @@ abstract class IntelliJPlatformPlugin : Plugin { // ) // ) - jvmArgumentProviders.add(PluginPathArgumentProvider(pluginsDirectoryProvider.get())) +// jvmArgumentProviders.add(PluginPathArgumentProvider(pluginsDirectoryProvider.get())) systemProperty("java.system.class.loader", "com.intellij.util.lang.PathClassLoader") } } @@ -1199,7 +1200,7 @@ abstract class IntelliJPlatformPlugin : Plugin { }) ) - onlyIf { (privateKey.isSpecified || privateKeyFile.isSpecified) && (certificateChain.isSpecified || certificateChainFile.isSpecified) } + onlyIf { (privateKey.isSpecified() || privateKeyFile.isSpecified()) && (certificateChain.isSpecified() || certificateChainFile.isSpecified()) } dependsOn(Tasks.BUILD_PLUGIN) dependsOn(DOWNLOAD_ZIP_SIGNER_TASK_NAME) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt index b42a8284f8..e436aa9f6c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt @@ -4,15 +4,15 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins import org.gradle.api.Project import org.gradle.api.plugins.JavaPlugin +import org.gradle.api.tasks.ClasspathNormalizer +import org.gradle.api.tasks.PathSensitivity import org.gradle.api.tasks.SourceSet.MAIN_SOURCE_SET_NAME import org.gradle.api.tasks.TaskContainer import org.gradle.api.tasks.bundling.Jar import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem -import org.gradle.kotlin.dsl.apply -import org.gradle.kotlin.dsl.assign -import org.gradle.kotlin.dsl.attributes -import org.gradle.kotlin.dsl.named +import org.gradle.kotlin.dsl.* +import org.gradle.process.JavaForkOptions import org.jetbrains.intellij.platform.gradleplugin.* import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.SELF_UPDATE_CHECK import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations @@ -20,6 +20,9 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUG import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.IntelliJPlatformArgumentProvider +import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.LaunchSystemArgumentProvider +import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.PluginPathArgumentProvider import org.jetbrains.intellij.platform.gradleplugin.tasks.* import java.io.File import java.time.LocalDate @@ -38,9 +41,9 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug configureBuildPluginTask() configureInitializeIntelliJPlatformPluginTask() configurePatchPluginXmlTask() - configureJarTasks() - - configureRunIdeTasks() + configureJarTask() + configureTestIdeTask() + configureRunIdeTask() // Make all tasks depend on [INITIALIZE_INTELLIJ_PLUGIN_TASK_NAME] (TASKS - Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN).forEach { @@ -88,15 +91,19 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug configureTask(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) { offline.convention(project.gradle.startParameter.isOffline) selfUpdateCheck.convention(project.isBuildFeatureEnabled(SELF_UPDATE_CHECK)) - selfUpdateLockPath.convention(project.provider { - temporaryDir.toPath().resolve(LocalDate.now().toString()) - }) - coroutinesJavaAgentPath.convention(project.provider { - temporaryDir.toPath().resolve("coroutines-javaagent.jar") - }) + selfUpdateLock.convention( + project.layout.file(project.provider { + temporaryDir.resolve(LocalDate.now().toString()) + }) + ) + coroutinesJavaAgent.convention( + project.layout.file(project.provider { + temporaryDir.resolve("coroutines-javaagent.jar") + }) + ) onlyIf { - !selfUpdateLockPath.get().exists() || !coroutinesJavaAgentPath.get().exists() + !selfUpdateLock.asPath.exists() || !coroutinesJavaAgent.asPath.exists() } } @@ -138,7 +145,7 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug } } - private fun TaskContainer.configureJarTasks() = + private fun TaskContainer.configureJarTask() = configureTask(JavaPlugin.JAR_TASK_NAME, Tasks.INSTRUMENTED_JAR) { val gradleVersion = project.provider { project.gradle.gradleVersion @@ -248,13 +255,97 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug // }` } - private fun TaskContainer.configureRunIdeTasks() = - configureTask(Tasks.RUN_IDE) { - val initializeIntelliJPlatformPluginTaskProvider = named(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) + // TODO: define `inputs.property` for tasks to consider system properties in terms of the configuration cache + // see: https://docs.gradle.org/current/kotlin-dsl/gradle/org.gradle.api.tasks/-task-inputs/property.html + private fun TaskContainer.configureTestIdeTask() = + configureTask(Tasks.TEST_IDE) { + val sandboxDirectoryProvider = named(Tasks.PREPARE_TESTING_SANDBOX).get().sandboxDirectory + + enableAssertions = true + + jvmArgumentProviders.addAll( + listOf( + IntelliJPlatformArgumentProvider(intellijPlatformDirectory, coroutinesJavaAgentFile, this), + LaunchSystemArgumentProvider(intellijPlatformDirectory, sandboxDirectory, emptyList()), + PluginPathArgumentProvider(sandboxDirectory), + ) + ) + + outputs + .dir(sandboxDirectoryProvider.dir(Sandbox.SYSTEM)) + .withPropertyName("System directory") + inputs + .dir(sandboxDirectoryProvider.dir(Sandbox.CONFIG)) + .withPropertyName("Config Directory") + .withPathSensitivity(PathSensitivity.RELATIVE) + inputs + .files(sandboxDirectoryProvider.dir(Sandbox.PLUGINS)) + .withPropertyName("Plugins directory") + .withPathSensitivity(PathSensitivity.RELATIVE) + .withNormalizer(ClasspathNormalizer::class) + +// systemProperty("idea.use.core.classloader.for.plugin.path", "true") +// systemProperty("idea.force.use.core.classloader", "true") +// systemProperty("idea.use.core.classloader.for", pluginIds.joinToString(",")) + systemProperty("java.system.class.loader", "com.intellij.util.lang.PathClassLoader") + + dependsOn(sandboxDirectoryProvider) +// finalizedBy(IntelliJPluginConstants.CLASSPATH_INDEX_CLEANUP_TASK_NAME) + +// classpath = instrumentedCodeOutputsProvider.get() + instrumentedTestCodeOutputsProvider.get() + classpath +// testClassesDirs = instrumentedTestCodeOutputsProvider.get() + testClassesDirs + +// doFirst { +// classpath += ideaDependencyLibrariesProvider.get() + +// ideaConfigurationFiles.get() + +// ideaPluginsConfigurationFiles.get() + +// ideaClasspathFiles.get() +// } + } + // TODO: define `inputs.property` for tasks to consider system properties in terms of the configuration cache + // see: https://docs.gradle.org/current/kotlin-dsl/gradle/org.gradle.api.tasks/-task-inputs/property.html + private fun TaskContainer.configureRunIdeTask() = + configureTask(Tasks.RUN_IDE) { intelliJPlatform = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM) - coroutinesJavaAgentPath.convention(initializeIntelliJPlatformPluginTaskProvider.flatMap { - it.coroutinesJavaAgentPath - }) + + mainClass.set("com.intellij.idea.Main") + enableAssertions = true + + jvmArgumentProviders.addAll( + listOf( + IntelliJPlatformArgumentProvider(intellijPlatformDirectory, coroutinesJavaAgentFile, this), + LaunchSystemArgumentProvider(intellijPlatformDirectory, sandboxDirectory, emptyList()), + ) + ) + + systemProperty("java.system.class.loader", "com.intellij.util.lang.PathClassLoader") + + systemPropertyDefault("idea.auto.reload.plugins", true) + systemPropertyDefault("idea.classpath.index.enabled", false) + systemPropertyDefault("idea.is.internal", true) + systemPropertyDefault("idea.plugin.in.sandbox.mode", true) + systemPropertyDefault("idea.vendor.name", "JetBrains") + systemPropertyDefault("ide.no.platform.update", false) + systemPropertyDefault("jdk.module.illegalAccess.silent", true) + + val os = OperatingSystem.current() + when { + os.isMacOsX -> { + systemPropertyDefault("idea.smooth.progress", false) + systemPropertyDefault("apple.laf.useScreenMenuBar", true) + systemPropertyDefault("apple.awt.fileDialogForDirectories", true) + } + + os.isUnix -> { + systemPropertyDefault("sun.awt.disablegrab", true) + } + } } + + private fun JavaForkOptions.systemPropertyDefault(name: String, defaultValue: Any) { + if (!systemProperties.containsKey(name)) { + systemProperty(name, defaultValue) + } + } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt index 7a58b4d433..07e1c93665 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt @@ -4,50 +4,57 @@ package org.jetbrains.intellij.platform.gradleplugin.propertyProviders import com.jetbrains.plugin.structure.base.utils.exists import com.jetbrains.plugin.structure.base.utils.readLines +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.file.RegularFileProperty import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.InputFile import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.gradle.process.CommandLineArgumentProvider import org.gradle.process.JavaForkOptions +import org.jetbrains.intellij.platform.gradleplugin.asPath import org.jetbrains.intellij.platform.gradleplugin.model.productInfo import org.jetbrains.intellij.platform.gradleplugin.resolveIdeHomeVariable import org.jetbrains.intellij.platform.gradleplugin.utils.OpenedPackages -import java.nio.file.Path class IntelliJPlatformArgumentProvider( - @InputDirectory @PathSensitive(RELATIVE) val ideDirectory: Path, - @InputFile @PathSensitive(RELATIVE) val coroutinesJavaAgentPath: Path, + @InputDirectory @PathSensitive(RELATIVE) val intellijPlatformDirectory: DirectoryProperty, + @InputFile @PathSensitive(RELATIVE) val coroutinesJavaAgentFile: RegularFileProperty, private val options: JavaForkOptions, ) : CommandLineArgumentProvider { + private val intellijPlatformPath + get() = intellijPlatformDirectory.asPath + + private val productInfo by lazy { + intellijPlatformPath.productInfo() + } + private val bootclasspath - get() = ideDirectory + get() = intellijPlatformPath .resolve("lib/boot.jar") .takeIf { it.exists() } ?.let { listOf("-Xbootclasspath/a:$it") } .orEmpty() private val vmOptions - get() = ideDirectory - .productInfo() + get() = productInfo .currentLaunch .vmOptionsFilePath ?.removePrefix("../") - ?.let { ideDirectory.resolve(it).readLines() } + ?.let { intellijPlatformPath.resolve(it).readLines() } .orEmpty() .filter { !it.contains("kotlinx.coroutines.debug=off") } - private val kotlinxCoroutinesJavaAgent = "-javaagent:$coroutinesJavaAgentPath" + private val kotlinxCoroutinesJavaAgent = "-javaagent:${coroutinesJavaAgentFile.asPath}" private val additionalJvmArguments - get() = ideDirectory - .productInfo() + get() = productInfo .currentLaunch .additionalJvmArguments .filterNot { it.startsWith("-D") } .takeIf { it.isNotEmpty() } - ?.map { it.resolveIdeHomeVariable(ideDirectory) } + ?.map { it.resolveIdeHomeVariable(intellijPlatformPath) } ?: OpenedPackages private val defaultHeapSpace = listOf("-Xmx512m", "-Xms256m") diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt index 981ffe0172..2ce0cdce3e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt @@ -11,22 +11,24 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sand import org.jetbrains.intellij.platform.gradleplugin.asPath import org.jetbrains.intellij.platform.gradleplugin.model.productInfo import org.jetbrains.intellij.platform.gradleplugin.resolveIdeHomeVariable -import java.nio.file.Path import kotlin.io.path.pathString class LaunchSystemArgumentProvider( - @InputDirectory @PathSensitive(RELATIVE) val ideDirectory: Path, + @InputDirectory @PathSensitive(RELATIVE) val intellijPlatformDirectory: DirectoryProperty, @InputDirectory @PathSensitive(RELATIVE) val sandboxDirectory: DirectoryProperty, private val requirePluginIds: List, ) : CommandLineArgumentProvider { + private val intellijPlatformPath + get() = intellijPlatformDirectory.asPath + private val currentLaunchProperties - get() = ideDirectory + get() = intellijPlatformPath .productInfo() .currentLaunch .additionalJvmArguments .filter { it.startsWith("-D") } - .map { it.resolveIdeHomeVariable(ideDirectory) } + .map { it.resolveIdeHomeVariable(intellijPlatformPath) } private fun resolveInSandboxDirectory(directoryName: String) = sandboxDirectory.map { it.dir(directoryName).apply { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/PluginPathArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/PluginPathArgumentProvider.kt index 9b80ed5d46..bd611b6ee5 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/PluginPathArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/PluginPathArgumentProvider.kt @@ -2,18 +2,26 @@ package org.jetbrains.intellij.platform.gradleplugin.propertyProviders +import com.jetbrains.plugin.structure.base.utils.listFiles +import org.gradle.api.file.DirectoryProperty import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.gradle.process.CommandLineArgumentProvider +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox +import org.jetbrains.intellij.platform.gradleplugin.asPath import java.io.File class PluginPathArgumentProvider( - @InputDirectory @PathSensitive(RELATIVE) val pluginsDirectory: File, + @InputDirectory @PathSensitive(RELATIVE) val sandboxDirectory: DirectoryProperty, ) : CommandLineArgumentProvider { private val paths - get() = pluginsDirectory.listFiles()?.joinToString("${File.pathSeparator},") { it.absolutePath }.orEmpty() + get() = sandboxDirectory.map { + it.dir(Sandbox.PLUGINS).apply { + asFile.mkdirs() + } + }.asPath.listFiles().joinToString("${File.pathSeparator},") override fun asArguments() = listOf( "-Dplugin.path=$paths", diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPlatformPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPlatformPluginTask.kt index 6b7330dea8..643676e4a2 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPlatformPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPlatformPluginTask.kt @@ -6,6 +6,7 @@ import com.jetbrains.plugin.structure.base.utils.create import com.jetbrains.plugin.structure.base.utils.exists import com.jetbrains.plugin.structure.base.utils.outputStream import org.gradle.api.DefaultTask +import org.gradle.api.file.RegularFileProperty import org.gradle.api.provider.Property import org.gradle.api.tasks.Internal import org.gradle.api.tasks.TaskAction @@ -16,7 +17,6 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUG import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_ID import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_NAME import org.jetbrains.intellij.platform.gradleplugin.utils.LatestVersionResolver -import java.nio.file.Path import java.util.jar.JarOutputStream import java.util.jar.Manifest @@ -33,10 +33,10 @@ abstract class InitializeIntelliJPlatformPluginTask : DefaultTask() { abstract val selfUpdateCheck: Property @get:Internal - abstract val selfUpdateLockPath: Property + abstract val selfUpdateLock: RegularFileProperty @get:Internal - abstract val coroutinesJavaAgentPath: Property + abstract val coroutinesJavaAgent: RegularFileProperty init { group = PLUGIN_GROUP_NAME @@ -55,7 +55,7 @@ abstract class InitializeIntelliJPlatformPluginTask : DefaultTask() { * Checks if the plugin is up-to-date. */ private fun checkPluginVersion() { - if (!selfUpdateCheck.get() || selfUpdateLockPath.get().exists() || offline.get()) { + if (!selfUpdateCheck.get() || selfUpdateLock.asPath.exists() || offline.get()) { return } @@ -68,7 +68,7 @@ abstract class InitializeIntelliJPlatformPluginTask : DefaultTask() { warn(context, "$PLUGIN_NAME is outdated: $version. Update `$PLUGIN_ID` to: $latestVersion") } - with(selfUpdateLockPath.get()) { + with(selfUpdateLock.asPath) { if (!exists()) { create() } @@ -82,7 +82,7 @@ abstract class InitializeIntelliJPlatformPluginTask : DefaultTask() { * Creates a Java Agent file for the Coroutines library required to enable coroutines debugging. */ private fun createCoroutinesJavaAgentFile() { - if (coroutinesJavaAgentPath.get().exists()) { + if (coroutinesJavaAgent.asPath.exists()) { return } @@ -96,6 +96,6 @@ abstract class InitializeIntelliJPlatformPluginTask : DefaultTask() { """.trimIndent().byteInputStream() ) - JarOutputStream(coroutinesJavaAgentPath.get().outputStream(), manifest).close() + JarOutputStream(coroutinesJavaAgent.asPath.outputStream(), manifest).close() } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt index 8844467990..8e7f562418 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt @@ -2,27 +2,18 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks -import org.gradle.api.GradleException -import org.gradle.api.file.ConfigurableFileCollection -import org.gradle.api.provider.Property -import org.gradle.api.tasks.* +import org.gradle.api.tasks.JavaExec +import org.gradle.api.tasks.TaskAction +import org.gradle.api.tasks.UntrackedTask import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.asFile import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.isSpecified import org.jetbrains.intellij.platform.gradleplugin.model.getBootClasspath -import org.jetbrains.intellij.platform.gradleplugin.model.productInfo import org.jetbrains.intellij.platform.gradleplugin.or -import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.IntelliJPlatformArgumentProvider -import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.LaunchSystemArgumentProvider -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.JetBrainsRuntimeAware -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.PlatformVersionAware -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.RunIdeBase -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.SandboxAware +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.* import java.io.File -import java.nio.file.Path import kotlin.io.path.absolutePathString /** @@ -34,43 +25,11 @@ import kotlin.io.path.absolutePathString * @see [JavaExec] */ @UntrackedTask(because = "Should always run guest IDE") -abstract class RunIdeTask : JavaExec(), JetBrainsRuntimeAware, PlatformVersionAware, SandboxAware { - - @get:Input - @get:Optional - abstract val type: Property - - @get:Input - @get:Optional - abstract val version: Property - - @get:Input - @get:Optional - abstract val localPath: Property - - @get:InputFiles - @get:PathSensitive(PathSensitivity.RELATIVE) - abstract val intelliJPlatform: ConfigurableFileCollection - - @get:InputFiles - val intellijPlatformDirectory - get() = when { - !type.isSpecified && !version.isSpecified -> intelliJPlatform.singleFile.toPath() - else -> throw GradleException("Foo") - } - - /** - * Represents the path to the coroutines Java agent file. - */ - @get:Internal - abstract val coroutinesJavaAgentPath: Property +abstract class RunIdeTask : JavaExec(), CoroutinesJavaAgentAware, CustomPlatformAware, JetBrainsRuntimeAware, PlatformVersionAware, SandboxAware { init { group = PLUGIN_GROUP_NAME description = "Runs the IDE instance with the developed plugin installed." - - mainClass.set("com.intellij.idea.Main") - enableAssertions = true } /** @@ -78,9 +37,8 @@ abstract class RunIdeTask : JavaExec(), JetBrainsRuntimeAware, PlatformVersionAw */ @TaskAction override fun exec() { - workingDir = intellijPlatformDirectory.resolve("bin").toFile() - jvmArgumentProviders.add(IntelliJPlatformArgumentProvider(intellijPlatformDirectory, coroutinesJavaAgentPath.get(), this)) - configureSystemProperties() + workingDir = intellijPlatformDirectory.dir("bin").asFile + configureClasspath() super.exec() @@ -104,60 +62,8 @@ abstract class RunIdeTask : JavaExec(), JetBrainsRuntimeAware, PlatformVersionAw } classpath += objectFactory.fileCollection().from( - productInfo.getBootClasspath(intellijPlatformDirectory) - ) - } - - /** - * Configures the system properties for the IDE based on the IDEA version. - */ - private fun configureSystemProperties() { - systemProperties(systemProperties) - - jvmArgumentProviders.add( - LaunchSystemArgumentProvider( - intellijPlatformDirectory, - sandboxDirectory, - emptyList(), -// requiredPluginIds.get(), - ) + productInfo.getBootClasspath(intellijPlatformDirectory.asPath) ) - - val operatingSystem = OperatingSystem.current() - val userDefinedSystemProperties = systemProperties - - if (operatingSystem.isMacOsX) { - systemPropertyIfNotDefined("idea.smooth.progress", false, userDefinedSystemProperties) - systemPropertyIfNotDefined("apple.laf.useScreenMenuBar", true, userDefinedSystemProperties) - systemPropertyIfNotDefined("apple.awt.fileDialogForDirectories", true, userDefinedSystemProperties) - } else if (operatingSystem.isUnix) { - systemPropertyIfNotDefined("sun.awt.disablegrab", true, userDefinedSystemProperties) - } - - systemPropertyIfNotDefined("idea.classpath.index.enabled", false, userDefinedSystemProperties) - systemPropertyIfNotDefined("idea.is.internal", true, userDefinedSystemProperties) - systemPropertyIfNotDefined("jdk.module.illegalAccess.silent", true, userDefinedSystemProperties) - systemPropertyIfNotDefined("idea.auto.reload.plugins", true, userDefinedSystemProperties) - - if (!systemProperties.containsKey("idea.platform.prefix")) { - val prefix = intellijPlatformDirectory.productInfo().productCode - - systemProperty("idea.platform.prefix", prefix) -// info(context, "Using idea.platform.prefix=$prefix") - } - - systemProperty("java.system.class.loader", "com.intellij.util.lang.PathClassLoader") - systemPropertyIfNotDefined("idea.vendor.name", "JetBrains", userDefinedSystemProperties) - systemPropertyIfNotDefined("idea.plugin.in.sandbox.mode", true, userDefinedSystemProperties) - } - - /** - * Helper function to set system property if it is not defined yet. - */ - private fun systemPropertyIfNotDefined(name: String, value: Any, userDefinedSystemProperties: Map) { - if (!userDefinedSystemProperties.containsKey(name)) { - systemProperty(name, value) - } } /** diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/TestIdeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/TestIdeTask.kt new file mode 100644 index 0000000000..1055abad73 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/TestIdeTask.kt @@ -0,0 +1,47 @@ +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.tasks + +import org.gradle.api.tasks.JavaExec +import org.gradle.api.tasks.TaskAction +import org.gradle.api.tasks.UntrackedTask +import org.gradle.api.tasks.testing.Test +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.asPath +import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.IntelliJPlatformArgumentProvider +import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.LaunchSystemArgumentProvider +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.* +import kotlin.io.path.absolutePathString + +/** + * Runs the IDE instance with the developed plugin installed. + * + * `runIde` task extends the [JavaExec] Gradle task – all properties available in the [JavaExec] as well as the following ones can be used to configure the [TestIdeTask] task. + * + * @see [RunIdeBase] + * @see [JavaExec] + */ +@UntrackedTask(because = "Should always run guest IDE") +abstract class TestIdeTask : Test(), CoroutinesJavaAgentAware, CustomPlatformAware, JetBrainsRuntimeAware, PlatformVersionAware, SandboxAware { + + init { + group = PLUGIN_GROUP_NAME + description = "Runs the IDE instance with the developed plugin installed." + } + + @TaskAction + override fun executeTests() { + jvmArgumentProviders.addAll( + listOf( + IntelliJPlatformArgumentProvider(intellijPlatformDirectory, coroutinesJavaAgentFile, this), + LaunchSystemArgumentProvider(intellijPlatformDirectory, sandboxDirectory, emptyList()), + ) + ) + +// jvmArgumentProviders.add(PluginPathArgumentProvider(pluginsDirectoryProvider.get())) + + super.executeTests() + } + + override fun getExecutable(): String = jetbrainsRuntimeExecutable.asPath.absolutePathString() +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CoroutinesJavaAgentAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CoroutinesJavaAgentAware.kt new file mode 100644 index 0000000000..693da5eec4 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CoroutinesJavaAgentAware.kt @@ -0,0 +1,15 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.tasks.base + +import org.gradle.api.file.RegularFileProperty +import org.gradle.api.tasks.Internal + +interface CoroutinesJavaAgentAware { + + /** + * Represents the path to the coroutines Java agent file. + */ + @get:Internal + val coroutinesJavaAgentFile: RegularFileProperty +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformAware.kt new file mode 100644 index 0000000000..297d148455 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformAware.kt @@ -0,0 +1,32 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.tasks.base + +import org.gradle.api.file.ConfigurableFileCollection +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.provider.Property +import org.gradle.api.tasks.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType +import java.io.File + +interface CustomPlatformAware { + + @get:Input + @get:Optional + val type: Property + + @get:Input + @get:Optional + val version: Property + + @get:Input + @get:Optional + val localPath: Property + + @get:InputFiles + @get:PathSensitive(PathSensitivity.RELATIVE) + val intelliJPlatform: ConfigurableFileCollection + + @get:InputDirectory + val intellijPlatformDirectory: DirectoryProperty +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt index 0f403f8ee4..b9a3d6fe5f 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt @@ -9,7 +9,6 @@ import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem import org.jetbrains.intellij.platform.gradleplugin.* import org.jetbrains.intellij.platform.gradleplugin.model.productInfo -import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.IntelliJPlatformArgumentProvider import java.io.File import java.nio.file.Path @@ -83,8 +82,9 @@ abstract class RunIdeBase : JavaExec() { */ @TaskAction override fun exec() { + throw Exception("OBSOLETE") workingDir = projectWorkingDir.get() - jvmArgumentProviders.add(IntelliJPlatformArgumentProvider(ideDir.get().toPath(), coroutinesJavaAgentPath.get(), this)) +// jvmArgumentProviders.add(IntelliJPlatformArgumentProvider(ideDir.get().toPath(), coroutinesJavaAgentPath.get(), this)) configureSystemProperties() configureClasspath() diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt index 73666f45cd..b1eb6cf451 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt @@ -223,13 +223,12 @@ internal fun getCurrentPluginVersion() = IntelliJPlatformPlugin::class.java } }.getOrNull() -internal val Property.isSpecified - get() = isPresent && when (val value = orNull) { - null -> false - is String -> value.isNotEmpty() - is RegularFile -> value.asFile.exists() - else -> true - } +fun Property.isSpecified() = isPresent && when (val value = orNull) { + null -> false + is String -> value.isNotEmpty() + is RegularFile -> value.asFile.exists() + else -> true +} internal val FileSystemLocation.asPath From 80195de74e740afaa889eb2548eb6ec2674a276f Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Wed, 25 Oct 2023 15:44:58 +0200 Subject: [PATCH 032/347] `PlatformVersionAware` + `CustomPlatformVersionAware` for `runIde` and `testIde` tasks --- .../transform/ExtractorTransformer.kt | 37 +++--- .../dependencies/intellijPlatform.kt | 117 ++++++++++-------- .../IntelliJPlatformAbstractProjectPlugin.kt | 75 ++++++++--- .../plugins/IntelliJPlatformTasksPlugin.kt | 23 ++-- .../IntelliJPlatformArgumentProvider.kt | 19 ++- .../LaunchSystemArgumentProvider.kt | 6 +- .../platform/gradleplugin/tasks/RunIdeTask.kt | 7 +- .../gradleplugin/tasks/TestIdeTask.kt | 8 +- .../tasks/base/CustomPlatformAware.kt | 32 ----- .../tasks/base/CustomPlatformVersionAware.kt | 42 +++++++ .../tasks/base/PlatformVersionAware.kt | 4 + 11 files changed, 232 insertions(+), 138 deletions(-) delete mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformAware.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformVersionAware.kt diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ExtractorTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ExtractorTransformer.kt index 3901c93110..c9d2afbf66 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ExtractorTransformer.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ExtractorTransformer.kt @@ -20,9 +20,7 @@ import org.gradle.kotlin.dsl.registerTransform import org.gradle.work.DisableCachingByDefault import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes -import org.jetbrains.intellij.platform.gradleplugin.asFile import org.jetbrains.intellij.platform.gradleplugin.asPath -import java.io.File import java.io.File.separator import javax.inject.Inject import kotlin.io.path.name @@ -50,30 +48,35 @@ abstract class ExtractorTransformer @Inject constructor( abstract val inputArtifact: Provider override fun transform(outputs: TransformOutputs) { - val (file, path) = with(inputArtifact) { asFile to asPath } + val path = inputArtifact.asPath val extension = path.name.removePrefix(path.nameWithoutExtension.removeSuffix(".tar")) val (groupId, artifactId, version) = path.pathString.split(separator).dropLast(2).takeLast(3) // TODO: if a local ZIP file, i.e. with local plugin will be passed to PLUGIN configuration — that most likely will fail - val targetDirectory = when (file) { - in parameters.intellijPlatform -> { - IntelliJPlatformType.values().find { groupId == it.groupId && artifactId == it.artifactId }?.let { "$it-$version" } - } - - in parameters.jetbrainsRuntime -> version - - in emptyList() -> { + val targetDirectory = listOf( + { + IntelliJPlatformType.values() + .find { groupId == it.groupId && artifactId == it.artifactId } + ?.let { "$it-$version" } + }, + { + version + .takeIf { groupId == "com.jetbrains" && artifactId == "jbr" } + }, + { val marketplaceGroup = "com.jetbrains.plugins" val channel = when { groupId == marketplaceGroup -> "" groupId.endsWith(".$marketplaceGroup") -> groupId.dropLast(marketplaceGroup.length + 1) else -> null - } ?: return - "$artifactId-$version" + "@$channel".takeIf { channel.isNotEmpty() }.orEmpty() - } - - else -> null - }?.let { outputs.dir(it) } ?: return + } +// "$artifactId-$version" + "@$channel".takeIf { channel.isNotEmpty() }.orEmpty() + null + }, + ) + .firstNotNullOfOrNull { it() } + ?.let { outputs.dir(it) } + ?: return when (extension) { ".zip", ".sit" -> { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt index 555fc432a8..a32c6b4a93 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt @@ -11,31 +11,82 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations -internal fun DependencyHandler.intellijPlatform( +fun DependencyHandler.intellijPlatform( + typeProvider: Provider, + versionProvider: Provider, + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, +) = addProvider(configurationName, typeProvider.zip(versionProvider) { type, version -> + create(type, version) +}) + +fun DependencyHandler.intellijPlatform( + typeProvider: Provider, + version: String, + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, +) = addProvider(configurationName, typeProvider.map { type -> create(type, version) }) + +fun DependencyHandler.intellijPlatform( type: IntelliJPlatformType, version: String, configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, ) = add(configurationName, create(type, version)) -internal fun DependencyHandler.intellijPlatform( - type: IntelliJPlatformType, +fun DependencyHandler.intellijPlatform( + typeStringProvider: Provider, versionProvider: Provider, - configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, -) = addProvider(configurationName, versionProvider.map { version -> create(type, version) }) +) = intellijPlatform(typeStringProvider.map { IntelliJPlatformType.fromCode(it) }, versionProvider) -internal fun DependencyHandler.intellijPlatform( - typeProvider: Provider, +fun DependencyHandler.intellijPlatform( + typeStringProvider: Provider, version: String, - configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, -) = addProvider(configurationName, typeProvider.map { type -> create(type, version) }) +) = intellijPlatform(typeStringProvider.map { IntelliJPlatformType.fromCode(it) }, version) -internal fun DependencyHandler.intellijPlatform( - typeProvider: Provider, +fun DependencyHandler.intellijPlatform( + type: IntelliJPlatformType, versionProvider: Provider, - configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, -) = addProvider(configurationName, typeProvider.zip(versionProvider) { type, version -> create(type, version) }) +) = intellijPlatform(versionProvider.map { type }, versionProvider) + +fun DependencyHandler.intellijPlatform( + typeString: String, + versionProvider: Provider, +) = intellijPlatform(versionProvider.map { IntelliJPlatformType.fromCode(typeString) }, versionProvider) + +fun DependencyHandler.intellijPlatform( + typeString: String, + version: String, +) = intellijPlatform(IntelliJPlatformType.fromCode(typeString), version) + +fun DependencyHandler.androidStudio(version: String) = intellijPlatform(AndroidStudio, version) +fun DependencyHandler.androidStudio(version: Provider) = intellijPlatform(AndroidStudio, version) + +fun DependencyHandler.clion(version: String) = intellijPlatform(CLion, version) +fun DependencyHandler.clion(version: Provider) = intellijPlatform(CLion, version) + +fun DependencyHandler.gateway(version: String) = intellijPlatform(Gateway, version) +fun DependencyHandler.gateway(version: Provider) = intellijPlatform(Gateway, version) + +fun DependencyHandler.goland(version: String) = intellijPlatform(GoLand, version) +fun DependencyHandler.goland(version: Provider) = intellijPlatform(GoLand, version) + +fun DependencyHandler.intellijIdeaCommunity(version: String) = intellijPlatform(IntellijIdeaCommunity, version) +fun DependencyHandler.intellijIdeaCommunity(version: Provider) = intellijPlatform(IntellijIdeaCommunity, version) + +fun DependencyHandler.intellijIdeaUltimate(version: String) = intellijPlatform(IntellijIdeaUltimate, version) +fun DependencyHandler.intellijIdeaUltimate(version: Provider) = intellijPlatform(IntellijIdeaUltimate, version) + +fun DependencyHandler.phpstorm(version: String) = intellijPlatform(PhpStorm, version) +fun DependencyHandler.phpstorm(version: Provider) = intellijPlatform(PhpStorm, version) -internal fun DependencyHandler.create( +fun DependencyHandler.pycharmProfessional(version: String) = intellijPlatform(PyCharmProfessional, version) +fun DependencyHandler.pycharmProfessional(version: Provider) = intellijPlatform(PyCharmProfessional, version) + +fun DependencyHandler.pycharmCommunity(version: String) = intellijPlatform(PyCharmCommunity, version) +fun DependencyHandler.pycharmCommunity(version: Provider) = intellijPlatform(PyCharmCommunity, version) + +fun DependencyHandler.rider(version: String) = intellijPlatform(Rider, version) +fun DependencyHandler.rider(version: Provider) = intellijPlatform(Rider, version) + +fun DependencyHandler.create( type: IntelliJPlatformType, version: String, settings: IntelliJPlatformDependencySettings = intellijPlatformDependencySettings, @@ -48,6 +99,8 @@ internal fun DependencyHandler.create( action(this, settings) } +// TODO: review the below rules if nothing is missing anymore +// // return when (type) { // IntellijIdeaUltimate -> create( // group = "com.jetbrains.intellij.idea", @@ -113,39 +166,3 @@ internal fun DependencyHandler.create( // } // } // } - -fun DependencyHandler.intellijPlatform(type: String, version: String) = intellijPlatform(IntelliJPlatformType.fromCode(type), version) -fun DependencyHandler.intellijPlatform(type: Provider, version: String) = intellijPlatform(type.map { IntelliJPlatformType.fromCode(it) }, version) -fun DependencyHandler.intellijPlatform(type: String, version: Provider) = intellijPlatform(IntelliJPlatformType.fromCode(type), version) -fun DependencyHandler.intellijPlatform(type: Provider, version: Provider) = - intellijPlatform(type.map { IntelliJPlatformType.fromCode(it) }, version) - -fun DependencyHandler.androidStudio(version: String) = intellijPlatform(AndroidStudio, version) -fun DependencyHandler.androidStudio(version: Provider) = intellijPlatform(AndroidStudio, version) - -fun DependencyHandler.clion(version: String) = intellijPlatform(CLion, version) -fun DependencyHandler.clion(version: Provider) = intellijPlatform(CLion, version) - -fun DependencyHandler.gateway(version: String) = intellijPlatform(Gateway, version) -fun DependencyHandler.gateway(version: Provider) = intellijPlatform(Gateway, version) - -fun DependencyHandler.goland(version: String) = intellijPlatform(GoLand, version) -fun DependencyHandler.goland(version: Provider) = intellijPlatform(GoLand, version) - -fun DependencyHandler.intellijIdeaCommunity(version: String) = intellijPlatform(IntellijIdeaCommunity, version) -fun DependencyHandler.intellijIdeaCommunity(version: Provider) = intellijPlatform(IntellijIdeaCommunity, version) - -fun DependencyHandler.intellijIdeaUltimate(version: String) = intellijPlatform(IntellijIdeaUltimate, version) -fun DependencyHandler.intellijIdeaUltimate(version: Provider) = intellijPlatform(IntellijIdeaUltimate, version) - -fun DependencyHandler.phpstorm(version: String) = intellijPlatform(PhpStorm, version) -fun DependencyHandler.phpstorm(version: Provider) = intellijPlatform(PhpStorm, version) - -fun DependencyHandler.pycharmProfessional(version: String) = intellijPlatform(PyCharmProfessional, version) -fun DependencyHandler.pycharmProfessional(version: Provider) = intellijPlatform(PyCharmProfessional, version) - -fun DependencyHandler.pycharmCommunity(version: String) = intellijPlatform(PyCharmCommunity, version) -fun DependencyHandler.pycharmCommunity(version: Provider) = intellijPlatform(PyCharmCommunity, version) - -fun DependencyHandler.rider(version: String) = intellijPlatform(Rider, version) -fun DependencyHandler.rider(version: Provider) = intellijPlatform(Rider, version) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt index f6f5152ecf..f5217b1dd5 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt @@ -2,7 +2,6 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins -import org.gradle.api.GradleException import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.Task @@ -14,9 +13,11 @@ import org.gradle.jvm.toolchain.JavaToolchainService import org.gradle.kotlin.dsl.* import org.gradle.kotlin.dsl.support.serviceOf import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion +import org.jetbrains.intellij.platform.gradleplugin.dependencies.create import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension import org.jetbrains.intellij.platform.gradleplugin.info import org.jetbrains.intellij.platform.gradleplugin.isSpecified @@ -25,6 +26,7 @@ import org.jetbrains.intellij.platform.gradleplugin.logCategory import org.jetbrains.intellij.platform.gradleplugin.tasks.InitializeIntelliJPlatformPluginTask import org.jetbrains.intellij.platform.gradleplugin.tasks.PrepareSandboxTask import org.jetbrains.intellij.platform.gradleplugin.tasks.base.* +import java.util.* import kotlin.io.path.createDirectories abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plugin { @@ -49,6 +51,11 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu } withType { + if (this is PlatformVersionAware) { + intelliJPlatform = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM) + intelliJPlatformProductInfo = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) + } + if (this is CoroutinesJavaAgentAware) { val initializeIntelliJPlatformPluginTaskProvider = named(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) @@ -59,22 +66,60 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu dependsOn(initializeIntelliJPlatformPluginTaskProvider) } - if (this is CustomPlatformAware) { - intelliJPlatform = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM) - intellijPlatformDirectory.convention( - project.layout.dir( - project.provider { - when { - !type.isSpecified() && !version.isSpecified() -> intelliJPlatform.singleFile - else -> throw GradleException("Foo") - } + if (this is CustomPlatformVersionAware) { + val suffix = UUID.randomUUID().toString().substring(0, 8) + val intellijPlatformDependencyConfiguration = project.configurations.create("${Configurations.INTELLIJ_PLATFORM_DEPENDENCY}_$suffix") { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + + dependencies.addLater(project.provider { + project.dependencies.create(type.get(), version.get()) + }) + } + val intellijPlatformConfiguration = project.configurations.create("${Configurations.INTELLIJ_PLATFORM}_$suffix") { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + + attributes { + attribute(Attributes.extracted, true) + } + + extendsFrom(intellijPlatformDependencyConfiguration) + } + val intellijPlatformProductInfoConfiguration = project.configurations.create("${Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO}_$suffix") { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + + attributes { + attribute(Attributes.productInfo, true) + } + + extendsFrom(intellijPlatformConfiguration) + } + + type.convention(project.provider { + platformType + }) + version.convention(project.provider { + platformVersion.toString() + }) + customIntelliJPlatform.from( + project.provider { + when { + type.isSpecified() || version.isSpecified() -> intellijPlatformConfiguration + else -> intelliJPlatform } - ) + } ) - } - - if (this is PlatformVersionAware) { - intelliJPlatformProductInfo = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) + customIntelliJPlatformProductInfo.from(project.provider { + when { + type.isSpecified() || version.isSpecified() -> intellijPlatformProductInfoConfiguration + else -> intelliJPlatformProductInfo + } + }) } if (this is SandboxAware) { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt index e436aa9f6c..ed72ec3332 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt @@ -11,11 +11,13 @@ import org.gradle.api.tasks.TaskContainer import org.gradle.api.tasks.bundling.Jar import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem -import org.gradle.kotlin.dsl.* +import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.attributes +import org.gradle.kotlin.dsl.named +import org.gradle.kotlin.dsl.withNormalizer import org.gradle.process.JavaForkOptions import org.jetbrains.intellij.platform.gradleplugin.* import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.SELF_UPDATE_CHECK -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_TASKS_ID import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS @@ -265,8 +267,8 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug jvmArgumentProviders.addAll( listOf( - IntelliJPlatformArgumentProvider(intellijPlatformDirectory, coroutinesJavaAgentFile, this), - LaunchSystemArgumentProvider(intellijPlatformDirectory, sandboxDirectory, emptyList()), + IntelliJPlatformArgumentProvider(customIntelliJPlatform, coroutinesJavaAgentFile, this), + LaunchSystemArgumentProvider(customIntelliJPlatform, sandboxDirectory, emptyList()), PluginPathArgumentProvider(sandboxDirectory), ) ) @@ -307,18 +309,25 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug // see: https://docs.gradle.org/current/kotlin-dsl/gradle/org.gradle.api.tasks/-task-inputs/property.html private fun TaskContainer.configureRunIdeTask() = configureTask(Tasks.RUN_IDE) { - intelliJPlatform = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM) +// intelliJPlatform = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM) mainClass.set("com.intellij.idea.Main") enableAssertions = true jvmArgumentProviders.addAll( listOf( - IntelliJPlatformArgumentProvider(intellijPlatformDirectory, coroutinesJavaAgentFile, this), - LaunchSystemArgumentProvider(intellijPlatformDirectory, sandboxDirectory, emptyList()), + IntelliJPlatformArgumentProvider(customIntelliJPlatform, coroutinesJavaAgentFile, this), + LaunchSystemArgumentProvider(customIntelliJPlatform, sandboxDirectory, emptyList()), ) ) +// classpath += intelliJPlatform.map { +// +// } +// .map { +// project.files(productInfo.getBootClasspath(intellijPlatformDirectory.asPath)) +// } + systemProperty("java.system.class.loader", "com.intellij.util.lang.PathClassLoader") systemPropertyDefault("idea.auto.reload.plugins", true) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt index 07e1c93665..d8bd52be2e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt @@ -4,27 +4,28 @@ package org.jetbrains.intellij.platform.gradleplugin.propertyProviders import com.jetbrains.plugin.structure.base.utils.exists import com.jetbrains.plugin.structure.base.utils.readLines -import org.gradle.api.file.DirectoryProperty +import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.RegularFileProperty -import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.InputFile +import org.gradle.api.tasks.InputFiles import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.gradle.process.CommandLineArgumentProvider import org.gradle.process.JavaForkOptions +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType import org.jetbrains.intellij.platform.gradleplugin.asPath import org.jetbrains.intellij.platform.gradleplugin.model.productInfo import org.jetbrains.intellij.platform.gradleplugin.resolveIdeHomeVariable import org.jetbrains.intellij.platform.gradleplugin.utils.OpenedPackages class IntelliJPlatformArgumentProvider( - @InputDirectory @PathSensitive(RELATIVE) val intellijPlatformDirectory: DirectoryProperty, + @InputFiles @PathSensitive(RELATIVE) val intellijPlatform: ConfigurableFileCollection, @InputFile @PathSensitive(RELATIVE) val coroutinesJavaAgentFile: RegularFileProperty, private val options: JavaForkOptions, ) : CommandLineArgumentProvider { private val intellijPlatformPath - get() = intellijPlatformDirectory.asPath + get() = intellijPlatform.singleFile.toPath() private val productInfo by lazy { intellijPlatformPath.productInfo() @@ -46,7 +47,13 @@ class IntelliJPlatformArgumentProvider( .orEmpty() .filter { !it.contains("kotlinx.coroutines.debug=off") } - private val kotlinxCoroutinesJavaAgent = "-javaagent:${coroutinesJavaAgentFile.asPath}" + private val kotlinxCoroutinesJavaAgent + get() = "-javaagent:${coroutinesJavaAgentFile.asPath}".takeIf { + IntelliJPlatformType.fromCode(productInfo.productCode) in listOf( + IntelliJPlatformType.IntellijIdeaCommunity, + IntelliJPlatformType.IntellijIdeaUltimate, + ) + } private val additionalJvmArguments get() = productInfo @@ -66,5 +73,5 @@ class IntelliJPlatformArgumentProvider( override fun asArguments() = (defaultHeapSpace + bootclasspath + vmOptions + kotlinxCoroutinesJavaAgent + additionalJvmArguments + heapSpace) - .filterNot { it.isBlank() } + .filterNot { it.isNullOrBlank() } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt index 2ce0cdce3e..3ff6871bdf 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt @@ -2,8 +2,10 @@ package org.jetbrains.intellij.platform.gradleplugin.propertyProviders +import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.DirectoryProperty import org.gradle.api.tasks.InputDirectory +import org.gradle.api.tasks.InputFiles import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.gradle.process.CommandLineArgumentProvider @@ -14,13 +16,13 @@ import org.jetbrains.intellij.platform.gradleplugin.resolveIdeHomeVariable import kotlin.io.path.pathString class LaunchSystemArgumentProvider( - @InputDirectory @PathSensitive(RELATIVE) val intellijPlatformDirectory: DirectoryProperty, + @InputFiles @PathSensitive(RELATIVE) val intellijPlatform: ConfigurableFileCollection, @InputDirectory @PathSensitive(RELATIVE) val sandboxDirectory: DirectoryProperty, private val requirePluginIds: List, ) : CommandLineArgumentProvider { private val intellijPlatformPath - get() = intellijPlatformDirectory.asPath + get() = intellijPlatform.singleFile.toPath() private val currentLaunchProperties get() = intellijPlatformPath diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt index 8e7f562418..3909e15b74 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt @@ -8,7 +8,6 @@ import org.gradle.api.tasks.UntrackedTask import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.asFile import org.jetbrains.intellij.platform.gradleplugin.asPath import org.jetbrains.intellij.platform.gradleplugin.model.getBootClasspath import org.jetbrains.intellij.platform.gradleplugin.or @@ -25,7 +24,7 @@ import kotlin.io.path.absolutePathString * @see [JavaExec] */ @UntrackedTask(because = "Should always run guest IDE") -abstract class RunIdeTask : JavaExec(), CoroutinesJavaAgentAware, CustomPlatformAware, JetBrainsRuntimeAware, PlatformVersionAware, SandboxAware { +abstract class RunIdeTask : JavaExec(), CoroutinesJavaAgentAware, CustomPlatformVersionAware, JetBrainsRuntimeAware, SandboxAware { init { group = PLUGIN_GROUP_NAME @@ -37,7 +36,7 @@ abstract class RunIdeTask : JavaExec(), CoroutinesJavaAgentAware, CustomPlatform */ @TaskAction override fun exec() { - workingDir = intellijPlatformDirectory.dir("bin").asFile + workingDir = intelliJPlatform.singleFile configureClasspath() @@ -62,7 +61,7 @@ abstract class RunIdeTask : JavaExec(), CoroutinesJavaAgentAware, CustomPlatform } classpath += objectFactory.fileCollection().from( - productInfo.getBootClasspath(intellijPlatformDirectory.asPath) + customProductInfo.getBootClasspath(customIntelliJPlatformDirectory) ) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/TestIdeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/TestIdeTask.kt index 1055abad73..cc3113147e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/TestIdeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/TestIdeTask.kt @@ -22,7 +22,7 @@ import kotlin.io.path.absolutePathString * @see [JavaExec] */ @UntrackedTask(because = "Should always run guest IDE") -abstract class TestIdeTask : Test(), CoroutinesJavaAgentAware, CustomPlatformAware, JetBrainsRuntimeAware, PlatformVersionAware, SandboxAware { +abstract class TestIdeTask : Test(), CoroutinesJavaAgentAware, CustomPlatformVersionAware, JetBrainsRuntimeAware, SandboxAware { init { group = PLUGIN_GROUP_NAME @@ -33,13 +33,11 @@ abstract class TestIdeTask : Test(), CoroutinesJavaAgentAware, CustomPlatformAwa override fun executeTests() { jvmArgumentProviders.addAll( listOf( - IntelliJPlatformArgumentProvider(intellijPlatformDirectory, coroutinesJavaAgentFile, this), - LaunchSystemArgumentProvider(intellijPlatformDirectory, sandboxDirectory, emptyList()), + IntelliJPlatformArgumentProvider(intelliJPlatform, coroutinesJavaAgentFile, this), + LaunchSystemArgumentProvider(intelliJPlatform, sandboxDirectory, emptyList()), ) ) -// jvmArgumentProviders.add(PluginPathArgumentProvider(pluginsDirectoryProvider.get())) - super.executeTests() } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformAware.kt deleted file mode 100644 index 297d148455..0000000000 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformAware.kt +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -package org.jetbrains.intellij.platform.gradleplugin.tasks.base - -import org.gradle.api.file.ConfigurableFileCollection -import org.gradle.api.file.DirectoryProperty -import org.gradle.api.provider.Property -import org.gradle.api.tasks.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType -import java.io.File - -interface CustomPlatformAware { - - @get:Input - @get:Optional - val type: Property - - @get:Input - @get:Optional - val version: Property - - @get:Input - @get:Optional - val localPath: Property - - @get:InputFiles - @get:PathSensitive(PathSensitivity.RELATIVE) - val intelliJPlatform: ConfigurableFileCollection - - @get:InputDirectory - val intellijPlatformDirectory: DirectoryProperty -} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformVersionAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformVersionAware.kt new file mode 100644 index 0000000000..fa9827b3c3 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformVersionAware.kt @@ -0,0 +1,42 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.tasks.base + +import org.gradle.api.file.ConfigurableFileCollection +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.provider.Property +import org.gradle.api.tasks.* +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType +import org.jetbrains.intellij.platform.gradleplugin.model.ProductInfo +import org.jetbrains.intellij.platform.gradleplugin.model.productInfo + +interface CustomPlatformVersionAware : PlatformVersionAware { + + @get:InputFiles + @get:PathSensitive(PathSensitivity.RELATIVE) + val customIntelliJPlatform: ConfigurableFileCollection + + @get:InputFiles + @get:PathSensitive(PathSensitivity.RELATIVE) + val customIntelliJPlatformProductInfo: ConfigurableFileCollection + + @get:Internal + val customIntelliJPlatformDirectory + get() = customIntelliJPlatform.single().toPath() + + @get:Internal + val customProductInfo: ProductInfo + get() = customIntelliJPlatformProductInfo.single().toPath().productInfo() + + @get:Input + @get:Optional + val type: Property + + @get:Input + @get:Optional + val version: Property + + @get:InputDirectory + @get:Optional + val localPath: DirectoryProperty +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/PlatformVersionAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/PlatformVersionAware.kt index a386217063..e83d3ab4d0 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/PlatformVersionAware.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/PlatformVersionAware.kt @@ -14,6 +14,10 @@ import org.jetbrains.intellij.platform.gradleplugin.model.productInfo interface PlatformVersionAware { + @get:InputFiles + @get:PathSensitive(PathSensitivity.RELATIVE) + val intelliJPlatform: ConfigurableFileCollection + @get:InputFiles @get:PathSensitive(PathSensitivity.RELATIVE) val intelliJPlatformProductInfo: ConfigurableFileCollection From 88d57bfce2c852d417d05826fc53699f376ea84e Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Thu, 26 Oct 2023 13:33:52 +0200 Subject: [PATCH 033/347] `CustomPlatformVersionAware` cleanup --- .../gradleplugin/model/ProductInfo.kt | 2 +- .../IntelliJPlatformAbstractProjectPlugin.kt | 34 +++++++++---------- .../plugins/IntelliJPlatformTasksPlugin.kt | 8 ++--- .../platform/gradleplugin/tasks/RunIdeTask.kt | 2 +- .../tasks/base/CustomPlatformVersionAware.kt | 23 ++----------- 5 files changed, 26 insertions(+), 43 deletions(-) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt index 805b8aa2b5..d77c6c77d9 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt @@ -88,5 +88,5 @@ internal fun Path.resolveProductInfoPath(name: String = "product-info.json") = ?: throw GradleException("Could not resolve $name file in: $this") private val json = Json { ignoreUnknownKeys = true } -internal fun Path.productInfo() = resolveProductInfoPath() +fun Path.productInfo() = resolveProductInfoPath() .run { json.decodeFromString(readText()) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt index f5217b1dd5..9842ca1c15 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt @@ -2,6 +2,7 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins +import com.jetbrains.plugin.structure.intellij.version.IdeVersion import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.Task @@ -12,17 +13,15 @@ import org.gradle.api.tasks.testing.Test import org.gradle.jvm.toolchain.JavaToolchainService import org.gradle.kotlin.dsl.* import org.gradle.kotlin.dsl.support.serviceOf +import org.jetbrains.intellij.platform.gradleplugin.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks -import org.jetbrains.intellij.platform.gradleplugin.checkGradleVersion import org.jetbrains.intellij.platform.gradleplugin.dependencies.create import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension -import org.jetbrains.intellij.platform.gradleplugin.info -import org.jetbrains.intellij.platform.gradleplugin.isSpecified import org.jetbrains.intellij.platform.gradleplugin.jbr.JetBrainsRuntimeResolver -import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradleplugin.model.productInfo import org.jetbrains.intellij.platform.gradleplugin.tasks.InitializeIntelliJPlatformPluginTask import org.jetbrains.intellij.platform.gradleplugin.tasks.PrepareSandboxTask import org.jetbrains.intellij.platform.gradleplugin.tasks.base.* @@ -99,25 +98,26 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu extendsFrom(intellijPlatformConfiguration) } + val baseIntellijPlatformProductInfoProvider = project.provider { + project.configurations.getByName(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO).single().toPath().productInfo() + } - type.convention(project.provider { - platformType + type.convention(baseIntellijPlatformProductInfoProvider.map { + IntelliJPlatformType.fromCode(it.productCode) }) - version.convention(project.provider { - platformVersion.toString() + version.convention(baseIntellijPlatformProductInfoProvider.map { + IdeVersion.createIdeVersion(it.version).toString() }) - customIntelliJPlatform.from( - project.provider { - when { - type.isSpecified() || version.isSpecified() -> intellijPlatformConfiguration - else -> intelliJPlatform - } + intelliJPlatform.setFrom(project.provider { + when { + type.isSpecified() || version.isSpecified() -> intellijPlatformConfiguration + else -> project.configurations.getByName(Configurations.INTELLIJ_PLATFORM_DEPENDENCY) } - ) - customIntelliJPlatformProductInfo.from(project.provider { + }) + intelliJPlatformProductInfo.setFrom(project.provider { when { type.isSpecified() || version.isSpecified() -> intellijPlatformProductInfoConfiguration - else -> intelliJPlatformProductInfo + else -> project.configurations.getByName(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) } }) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt index ed72ec3332..7cd9919f6f 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt @@ -267,8 +267,8 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug jvmArgumentProviders.addAll( listOf( - IntelliJPlatformArgumentProvider(customIntelliJPlatform, coroutinesJavaAgentFile, this), - LaunchSystemArgumentProvider(customIntelliJPlatform, sandboxDirectory, emptyList()), + IntelliJPlatformArgumentProvider(intelliJPlatform, coroutinesJavaAgentFile, this), + LaunchSystemArgumentProvider(intelliJPlatform, sandboxDirectory, emptyList()), PluginPathArgumentProvider(sandboxDirectory), ) ) @@ -316,8 +316,8 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug jvmArgumentProviders.addAll( listOf( - IntelliJPlatformArgumentProvider(customIntelliJPlatform, coroutinesJavaAgentFile, this), - LaunchSystemArgumentProvider(customIntelliJPlatform, sandboxDirectory, emptyList()), + IntelliJPlatformArgumentProvider(intelliJPlatform, coroutinesJavaAgentFile, this), + LaunchSystemArgumentProvider(intelliJPlatform, sandboxDirectory, emptyList()), ) ) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt index 3909e15b74..5ac91d07d2 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt @@ -61,7 +61,7 @@ abstract class RunIdeTask : JavaExec(), CoroutinesJavaAgentAware, CustomPlatform } classpath += objectFactory.fileCollection().from( - customProductInfo.getBootClasspath(customIntelliJPlatformDirectory) + productInfo.getBootClasspath(intelliJPlatform.single().toPath()) ) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformVersionAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformVersionAware.kt index fa9827b3c3..fdd6a81bba 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformVersionAware.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformVersionAware.kt @@ -2,32 +2,15 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks.base -import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.DirectoryProperty import org.gradle.api.provider.Property -import org.gradle.api.tasks.* +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.InputDirectory +import org.gradle.api.tasks.Optional import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType -import org.jetbrains.intellij.platform.gradleplugin.model.ProductInfo -import org.jetbrains.intellij.platform.gradleplugin.model.productInfo interface CustomPlatformVersionAware : PlatformVersionAware { - @get:InputFiles - @get:PathSensitive(PathSensitivity.RELATIVE) - val customIntelliJPlatform: ConfigurableFileCollection - - @get:InputFiles - @get:PathSensitive(PathSensitivity.RELATIVE) - val customIntelliJPlatformProductInfo: ConfigurableFileCollection - - @get:Internal - val customIntelliJPlatformDirectory - get() = customIntelliJPlatform.single().toPath() - - @get:Internal - val customProductInfo: ProductInfo - get() = customIntelliJPlatformProductInfo.single().toPath().productInfo() - @get:Input @get:Optional val type: Property From 7e88ae1be6700442484fb975ac4f5c1f14b7107e Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Thu, 26 Oct 2023 13:45:50 +0200 Subject: [PATCH 034/347] `JetBrainsRuntimeAware` use possible custom IntelliJ Platform --- .../jbr/JetBrainsRuntimeResolver.kt | 10 ++++---- .../IntelliJPlatformAbstractProjectPlugin.kt | 24 +++++++++---------- .../tasks/base/JetBrainsRuntimeAware.kt | 12 ++++++---- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JetBrainsRuntimeResolver.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JetBrainsRuntimeResolver.kt index 39db358834..bec84c66fb 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JetBrainsRuntimeResolver.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JetBrainsRuntimeResolver.kt @@ -5,7 +5,7 @@ package org.jetbrains.intellij.platform.gradleplugin.jbr import com.jetbrains.plugin.structure.base.utils.exists import com.jetbrains.plugin.structure.base.utils.listFiles import com.jetbrains.plugin.structure.base.utils.simpleName -import org.gradle.api.artifacts.Configuration +import org.gradle.api.file.ConfigurableFileCollection import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem import org.gradle.jvm.toolchain.JavaToolchainService @@ -20,8 +20,8 @@ import java.nio.file.Path import java.util.* class JetBrainsRuntimeResolver( - val jetbrainsRuntimeConfiguration: Configuration, - val intellijPlatformConfiguration: Configuration, + val jetbrainsRuntime: ConfigurableFileCollection, + val intellijPlatform: ConfigurableFileCollection, val javaToolchainSpec: JavaToolchainSpec, val javaToolchainService: JavaToolchainService, val context: String? = null, @@ -38,7 +38,7 @@ class JetBrainsRuntimeResolver( * or [org.jetbrains.intellij.platform.gradleplugin.dependencies.jetbrainsRuntimeExplicit]. */ { - jetbrainsRuntimeConfiguration.singleOrNull()?.let { file -> + jetbrainsRuntime.singleOrNull()?.let { file -> file.toPath().getJbrRoot() .also { debug(context, "JetBrains Runtime specified with dependencies resolved as: $it") } .ifNull { debug(context, "Cannot resolve JetBrains Runtime: $file") } @@ -59,7 +59,7 @@ class JetBrainsRuntimeResolver( } }, { - intellijPlatformConfiguration.singleOrNull()?.let { file -> + intellijPlatform.singleOrNull()?.let { file -> file.toPath().getJbrRoot() .also { debug(context, "JetBrains Runtime bundled within IntelliJ Platform resolved as: $it") } .ifNull { debug(context, "Cannot resolve JetBrains Runtime bundled within IntelliJ Platform: $file") } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt index 9842ca1c15..c80ca7ba17 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt @@ -9,7 +9,6 @@ import org.gradle.api.Task import org.gradle.api.plugins.ExtensionAware import org.gradle.api.plugins.JavaPluginExtension import org.gradle.api.tasks.TaskContainer -import org.gradle.api.tasks.testing.Test import org.gradle.jvm.toolchain.JavaToolchainService import org.gradle.kotlin.dsl.* import org.gradle.kotlin.dsl.support.serviceOf @@ -24,6 +23,7 @@ import org.jetbrains.intellij.platform.gradleplugin.jbr.JetBrainsRuntimeResolver import org.jetbrains.intellij.platform.gradleplugin.model.productInfo import org.jetbrains.intellij.platform.gradleplugin.tasks.InitializeIntelliJPlatformPluginTask import org.jetbrains.intellij.platform.gradleplugin.tasks.PrepareSandboxTask +import org.jetbrains.intellij.platform.gradleplugin.tasks.TestIdeTask import org.jetbrains.intellij.platform.gradleplugin.tasks.base.* import java.util.* import kotlin.io.path.createDirectories @@ -138,14 +138,16 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu dependsOn(prepareSandboxTaskProvider) } - val jbrResolver = JetBrainsRuntimeResolver( - jetbrainsRuntimeConfiguration = project.configurations.getByName(Configurations.JETBRAINS_RUNTIME), - intellijPlatformConfiguration = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM), - javaToolchainSpec = project.extensions.getByType().toolchain, - javaToolchainService = project.serviceOf(), - ) - if (this is JetBrainsRuntimeAware) { + jetbrainsRuntime = project.configurations.getByName(Configurations.JETBRAINS_RUNTIME) + + val jbrResolver = JetBrainsRuntimeResolver( + jetbrainsRuntime = jetbrainsRuntime, + intellijPlatform = intelliJPlatform, + javaToolchainSpec = project.extensions.getByType().toolchain, + javaToolchainService = project.serviceOf(), + ) + jetbrainsRuntimeDirectory.convention(project.layout.dir(project.provider { jbrResolver.resolveDirectory()?.toFile() })) @@ -154,10 +156,8 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu })) } - if (this is Test) { - executable(project.provider { - jbrResolver.resolveExecutable()?.toFile() - }) + if (this is TestIdeTask) { + executable(jetbrainsRuntimeExecutable) } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/JetBrainsRuntimeAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/JetBrainsRuntimeAware.kt index 55cb3cfc14..29629dfd62 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/JetBrainsRuntimeAware.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/JetBrainsRuntimeAware.kt @@ -2,14 +2,16 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks.base +import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.DirectoryProperty import org.gradle.api.file.RegularFileProperty -import org.gradle.api.tasks.InputDirectory -import org.gradle.api.tasks.InputFile -import org.gradle.api.tasks.PathSensitive -import org.gradle.api.tasks.PathSensitivity +import org.gradle.api.tasks.* -interface JetBrainsRuntimeAware { +interface JetBrainsRuntimeAware : PlatformVersionAware { + + @get:InputFiles + @get:PathSensitive(PathSensitivity.RELATIVE) + val jetbrainsRuntime: ConfigurableFileCollection @get:InputDirectory @get:PathSensitive(PathSensitivity.RELATIVE) From 95b0f6939cbffaab2bbb8a7788bbad32367a8154 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 6 Nov 2023 12:45:55 +0100 Subject: [PATCH 035/347] Migrate `dependencies {}` and `repositories {}` helpers from Kotlin function extensions to extensions (`ExtensionAware`) approach --- .../gradleplugin/IntelliJPluginConstants.kt | 13 +- .../gradleplugin/dependencies/dependencies.kt | 32 -- .../dependencies/intellijPlatform.kt | 168 ------- .../intellijPlatformBundledPlugin.kt | 20 - .../dependencies/intellijPlatformLocal.kt | 101 ----- .../dependencies/intellijPlatformPlugin.kt | 25 -- .../dependencies/jetbrainsRuntime.kt | 114 ----- .../IntelliJPlatformDependenciesExtension.kt | 420 ++++++++++++++++++ .../extensions/IntelliJPlatformExtension.kt | 3 - .../IntelliJPlatformRepositoriesExtension.kt | 65 +++ .../gradleplugin/extensions/extensions.kt | 6 + .../IntelliJPlatformAbstractProjectPlugin.kt | 50 +-- .../plugins/IntelliJPlatformBasePlugin.kt | 60 +-- .../plugins/IntelliJPlatformPlugin.kt | 97 +--- .../plugins/IntelliJPlatformSettingsPlugin.kt | 11 +- .../plugins/IntelliJPlatformTasksPlugin.kt | 325 +++++++++----- .../platform/gradleplugin/plugins/plugins.kt | 13 + .../gradleplugin/repositories/intellij.kt | 28 -- .../repositories/jetbrainsMarketplace.kt | 14 - .../gradleplugin/repositories/repositories.kt | 49 -- .../gradleplugin/tasks/PatchPluginXmlTask.kt | 4 +- .../platform/gradleplugin/tasks/RunIdeTask.kt | 5 +- .../gradleplugin/tasks/TestIdeTask.kt | 9 +- .../tasks/UnbindSetupDependenciesTask.kt | 44 -- .../tasks/VerifyPluginConfigurationTask.kt | 71 ++- .../tasks/base/PlatformVersionAware.kt | 16 +- 26 files changed, 838 insertions(+), 925 deletions(-) delete mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/dependencies.kt delete mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt delete mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformBundledPlugin.kt delete mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt delete mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformPlugin.kt delete mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsRuntime.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformDependenciesExtension.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformRepositoriesExtension.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/extensions.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/plugins.kt delete mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellij.kt delete mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/jetbrainsMarketplace.kt delete mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt delete mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/UnbindSetupDependenciesTask.kt diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt index fe1fffaa92..c53243d5fc 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt @@ -12,6 +12,11 @@ object IntelliJPluginConstants { const val PLUGIN_GROUP_NAME = "intellij" const val JETBRAINS_RUNTIME_VENDOR = "JetBrains" + const val JAVA_TEST_FIXTURES_PLUGIN_ID = "java-test-fixtures" + const val KOTLIN_GRADLE_PLUGIN_ID = "org.jetbrains.kotlin.jvm" + const val KOTLIN_STDLIB_DEFAULT_DEPENDENCY_PROPERTY_NAME = "kotlin.stdlib.default.dependency" + const val KOTLIN_INCREMENTAL_USE_CLASSPATH_SNAPSHOT = "kotlin.incremental.useClasspathSnapshot" + const val COMPILE_KOTLIN_TASK_NAME = "compileKotlin" object Extensions { const val IDEA_VERSION = "ideaVersion" @@ -57,6 +62,7 @@ object IntelliJPluginConstants { const val RUN_IDE = "runIde" const val SETUP_DEPENDENCIES = "setupDependencies" const val TEST_IDE = "testIde" + const val VERIFY_PLUGIN_CONFIGURATION = "verifyPluginConfiguration" } object Sandbox { @@ -92,11 +98,8 @@ object IntelliJPluginConstants { const val RUN_PLUGIN_VERIFIER_TASK_NAME = "runPluginVerifier" const val SIGN_PLUGIN_TASK_NAME = "signPlugin" const val VERIFY_PLUGIN_TASK_NAME = "verifyPlugin" - const val VERIFY_PLUGIN_CONFIGURATION_TASK_NAME = "verifyPluginConfiguration" const val VERIFY_PLUGIN_SIGNATURE_TASK_NAME = "verifyPluginSignature" - const val COMPILE_KOTLIN_TASK_NAME = "compileKotlin" - val TASKS = listOf( Tasks.BUILD_PLUGIN, // BUILD_SEARCHABLE_OPTIONS_TASK_NAME, @@ -127,12 +130,10 @@ object IntelliJPluginConstants { // SIGN_PLUGIN_TASK_NAME, Tasks.TEST_IDE, // VERIFY_PLUGIN_TASK_NAME, -// VERIFY_PLUGIN_CONFIGURATION_TASK_NAME, + Tasks.VERIFY_PLUGIN_CONFIGURATION, // VERIFY_PLUGIN_SIGNATURE_TASK_NAME, ) - const val KOTLIN_GRADLE_PLUGIN_ID = "org.jetbrains.kotlin.jvm" - const val JAVA_TEST_FIXTURES_PLUGIN_ID = "java-test-fixtures" const val PLUGIN_XML_DIR_NAME = "patchedPluginXmlFiles" const val SEARCHABLE_OPTIONS_DIR_NAME = "searchableOptions" diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/dependencies.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/dependencies.kt deleted file mode 100644 index 80a4799ba3..0000000000 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/dependencies.kt +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -package org.jetbrains.intellij.platform.gradleplugin.dependencies - -import org.gradle.api.artifacts.Dependency -import org.gradle.api.artifacts.dsl.DependencyHandler -import org.gradle.api.file.DirectoryProperty -import org.gradle.api.invocation.Gradle -import org.gradle.api.model.ObjectFactory -import org.gradle.api.plugins.ExtensionAware -import org.gradle.kotlin.dsl.getByType -import org.gradle.kotlin.dsl.newInstance -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions -import org.jetbrains.kotlin.gradle.utils.projectCacheDir - -internal typealias DependencyAction = (Dependency.(settings: IntelliJPlatformDependencySettings) -> Unit) - -interface IntelliJPlatformDependencySettings { - - val ivyDirectory: DirectoryProperty -} - -internal fun DependencyHandler.applyIntelliJPlatformSettings(objects: ObjectFactory, gradle: Gradle) { - val settings = objects.newInstance(IntelliJPlatformDependencySettings::class) - - settings.ivyDirectory.dir(gradle.projectCacheDir.resolve("intellijPlatform/ivy").path) - - (this as ExtensionAware).extensions.add(Extensions.INTELLIJ_PLATFORM_DEPENDENCY_SETTINGS, settings) -} - -internal val DependencyHandler.intellijPlatformDependencySettings: IntelliJPlatformDependencySettings - get() = (this as ExtensionAware).extensions.getByType() diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt deleted file mode 100644 index a32c6b4a93..0000000000 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatform.kt +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -@file:Suppress("unused") - -package org.jetbrains.intellij.platform.gradleplugin.dependencies - -import org.gradle.api.artifacts.dsl.DependencyHandler -import org.gradle.api.provider.Provider -import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations - -fun DependencyHandler.intellijPlatform( - typeProvider: Provider, - versionProvider: Provider, - configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, -) = addProvider(configurationName, typeProvider.zip(versionProvider) { type, version -> - create(type, version) -}) - -fun DependencyHandler.intellijPlatform( - typeProvider: Provider, - version: String, - configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, -) = addProvider(configurationName, typeProvider.map { type -> create(type, version) }) - -fun DependencyHandler.intellijPlatform( - type: IntelliJPlatformType, - version: String, - configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, -) = add(configurationName, create(type, version)) - -fun DependencyHandler.intellijPlatform( - typeStringProvider: Provider, - versionProvider: Provider, -) = intellijPlatform(typeStringProvider.map { IntelliJPlatformType.fromCode(it) }, versionProvider) - -fun DependencyHandler.intellijPlatform( - typeStringProvider: Provider, - version: String, -) = intellijPlatform(typeStringProvider.map { IntelliJPlatformType.fromCode(it) }, version) - -fun DependencyHandler.intellijPlatform( - type: IntelliJPlatformType, - versionProvider: Provider, -) = intellijPlatform(versionProvider.map { type }, versionProvider) - -fun DependencyHandler.intellijPlatform( - typeString: String, - versionProvider: Provider, -) = intellijPlatform(versionProvider.map { IntelliJPlatformType.fromCode(typeString) }, versionProvider) - -fun DependencyHandler.intellijPlatform( - typeString: String, - version: String, -) = intellijPlatform(IntelliJPlatformType.fromCode(typeString), version) - -fun DependencyHandler.androidStudio(version: String) = intellijPlatform(AndroidStudio, version) -fun DependencyHandler.androidStudio(version: Provider) = intellijPlatform(AndroidStudio, version) - -fun DependencyHandler.clion(version: String) = intellijPlatform(CLion, version) -fun DependencyHandler.clion(version: Provider) = intellijPlatform(CLion, version) - -fun DependencyHandler.gateway(version: String) = intellijPlatform(Gateway, version) -fun DependencyHandler.gateway(version: Provider) = intellijPlatform(Gateway, version) - -fun DependencyHandler.goland(version: String) = intellijPlatform(GoLand, version) -fun DependencyHandler.goland(version: Provider) = intellijPlatform(GoLand, version) - -fun DependencyHandler.intellijIdeaCommunity(version: String) = intellijPlatform(IntellijIdeaCommunity, version) -fun DependencyHandler.intellijIdeaCommunity(version: Provider) = intellijPlatform(IntellijIdeaCommunity, version) - -fun DependencyHandler.intellijIdeaUltimate(version: String) = intellijPlatform(IntellijIdeaUltimate, version) -fun DependencyHandler.intellijIdeaUltimate(version: Provider) = intellijPlatform(IntellijIdeaUltimate, version) - -fun DependencyHandler.phpstorm(version: String) = intellijPlatform(PhpStorm, version) -fun DependencyHandler.phpstorm(version: Provider) = intellijPlatform(PhpStorm, version) - -fun DependencyHandler.pycharmProfessional(version: String) = intellijPlatform(PyCharmProfessional, version) -fun DependencyHandler.pycharmProfessional(version: Provider) = intellijPlatform(PyCharmProfessional, version) - -fun DependencyHandler.pycharmCommunity(version: String) = intellijPlatform(PyCharmCommunity, version) -fun DependencyHandler.pycharmCommunity(version: Provider) = intellijPlatform(PyCharmCommunity, version) - -fun DependencyHandler.rider(version: String) = intellijPlatform(Rider, version) -fun DependencyHandler.rider(version: Provider) = intellijPlatform(Rider, version) - -fun DependencyHandler.create( - type: IntelliJPlatformType, - version: String, - settings: IntelliJPlatformDependencySettings = intellijPlatformDependencySettings, - action: DependencyAction = {}, -) = create( - group = type.groupId, - name = type.artifactId, - version = version, -).apply { - action(this, settings) -} - -// TODO: review the below rules if nothing is missing anymore -// -// return when (type) { -// IntellijIdeaUltimate -> create( -// group = "com.jetbrains.intellij.idea", -// name = "ideaIU", -// version = version, -// ) -// -// CLion -> create( -// group = "com.jetbrains.intellij.clion", -// name = "clion", -// version = version, -// ) -// -// PyCharmProfessional -> create( -// group = "com.jetbrains.intellij.pycharm", -// name = "pycharmPY", -// version = version, -// ) -// -// PyCharmCommunity -> create( -// group = "com.jetbrains.intellij.pycharm", -// name = "pycharmPC", -// version = version, -// ) -// -// GoLand -> create( -// group = "com.jetbrains.intellij.goland", -// name = "goland", -// version = version, -// ) -// -// PhpStorm -> create( -// group = "com.jetbrains.intellij.phpstorm", -// name = "phpstorm", -// version = version, -// ) -// -// Rider -> create( -// group = "com.jetbrains.intellij.rider", -// name = "riderRD", -// version = version, -// ) -// -// Gateway -> create( -// group = "com.jetbrains.gateway", -// name = "JetBrainsGateway", -// version = version, -// ) -// -// AndroidStudio -> create( -// group = "com.google.android.studio", -// name = "android-studio", -// version = version, -// ext = when { -// OperatingSystem.current().isLinux -> "tar.gz" -// else -> "zip" -// }, -// ) -// { -// with(it) { -// Files.list(resolveAndroidStudioPath(this)) -// .forEach { entry -> Files.move(entry, resolve(entry.fileName), StandardCopyOption.REPLACE_EXISTING) } -// } -// } -// } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformBundledPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformBundledPlugin.kt deleted file mode 100644 index e56a5ae008..0000000000 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformBundledPlugin.kt +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -@file:Suppress("unused") - -package org.jetbrains.intellij.platform.gradleplugin.dependencies - -import org.gradle.kotlin.dsl.DependencyHandlerScope -import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations - -fun DependencyHandlerScope.intellijPlatformBundledPlugin( - id: String, - configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCIES, -) = create( - group = "", - name = id, - version = "version", -).let { dependency -> - add(configurationName, dependency) -} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt deleted file mode 100644 index be694b0579..0000000000 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformLocal.kt +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -@file:Suppress("unused") - -package org.jetbrains.intellij.platform.gradleplugin.dependencies - -import org.gradle.api.GradleException -import org.gradle.api.Project -import org.gradle.api.artifacts.Dependency -import org.gradle.api.artifacts.dsl.DependencyHandler -import org.gradle.internal.os.OperatingSystem -import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.platform.gradleplugin.BuildException -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.INTELLIJ_PLATFORM_LOCAL_INSTANCE -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Dependencies -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MINIMAL_SUPPORTED_INTELLIJ_PLATFORM_VERSION -import org.jetbrains.intellij.platform.gradleplugin.Version -import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.model.* -import java.nio.file.Path -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter -import kotlin.io.path.* - -val Project.intellijPlatformLocal: DependencyHandler.(String) -> Dependency? - get() = { localPath -> - val ideaDir = Path.of(localPath).let { - it.takeUnless { OperatingSystem.current().isMacOsX && it.extension == "app" } ?: it.resolve("Contents") - } - - if (!ideaDir.exists() || !ideaDir.isDirectory()) { - throw BuildException("Specified localPath '$localPath' doesn't exist or is not a directory") - } - - val productInfo = ideaDir.productInfo() - if (Version.parse(productInfo.buildNumber) < Version.parse(MINIMAL_SUPPORTED_INTELLIJ_PLATFORM_VERSION)) { - throw GradleException("The minimal supported IDE version is $MINIMAL_SUPPORTED_INTELLIJ_PLATFORM_VERSION+, the provided version is too low: ${productInfo.version} (${productInfo.buildNumber})") - } - - val ivyFileName = "${productInfo.productCode}-${productInfo.version}.xml" - val dependency = create(productInfo) { settings -> - settings.ivyDirectory.asPath - .resolve(ivyFileName) - .takeIf { it.notExists() } - ?.run { - val extractor = XmlExtractor() - val ivyModule = IvyModule( - info = IvyModuleInfo( - organisation = group, - module = name, - revision = version, - publication = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")), - ), - configurations = mutableListOf( - IvyModuleConfiguration( - name = "default", - visibility = "public", - ), - ), - publications = mutableListOf( - IvyModulePublication( - name = ideaDir.pathString, - type = "directory", - ext = null, - conf = "default", - ) - ), - ) - extractor.marshal(ivyModule, createFile()) - } - - this@intellijPlatformLocal.repositories.ivy { - val ivyDirectory = settings.ivyDirectory.asPath - - url = ivyDirectory.toUri() - ivyPattern("$ivyDirectory/[module]-[revision].[ext]") - artifactPattern(ideaDir.absolutePathString()) -// artifactPattern("$ivyDirectory/[artifact]") -// artifactPattern("/Users/hsz/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2023.2/5bcf969924aafaa0d1b4d4602ff824251b1004f6/[artifact](-[classifier])(.[ext])") -// artifactPattern("/[artifact]") - - -// artifactPattern("/Users/hsz/Projects/JetBrains/intellij-plugin-template/.gradle/intellijPlatform/sources/ideaIC-2023.2-[classifier].jar") -// artifactPattern(ideaDir.absolutePathString()) - } - } - - add(INTELLIJ_PLATFORM_LOCAL_INSTANCE, dependency) - } - -internal fun DependencyHandler.create( - productInfo: ProductInfo, - settings: IntelliJPlatformDependencySettings = intellijPlatformDependencySettings, - action: DependencyAction = {}, -) = create( - group = Dependencies.INTELLIJ_PLATFORM_LOCAL_GROUP, - name = productInfo.productCode, - version = productInfo.version, -).apply { - action(this, settings) -} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformPlugin.kt deleted file mode 100644 index 2db5018404..0000000000 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/intellijPlatformPlugin.kt +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -@file:Suppress("unused") - -package org.jetbrains.intellij.platform.gradleplugin.dependencies - -import org.gradle.kotlin.dsl.DependencyHandlerScope -import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations - -fun DependencyHandlerScope.intellijPlatformPlugin( - id: String, - version: String, - channel: String = "", - configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCIES, -) = create( - group = when { - channel.isBlank() -> "com.jetbrains.plugins" - else -> "$channel.com.jetbrains.plugins" - }, - name = id, - version = version, -).let { dependency -> - add(configurationName, dependency) -} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsRuntime.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsRuntime.kt deleted file mode 100644 index a2773c3338..0000000000 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependencies/jetbrainsRuntime.kt +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -package org.jetbrains.intellij.platform.gradleplugin.dependencies - -import org.gradle.api.Project -import org.gradle.api.artifacts.Dependency -import org.gradle.api.artifacts.dsl.DependencyHandler -import org.gradle.internal.os.OperatingSystem -import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Locations -import org.jetbrains.intellij.platform.gradleplugin.Version -import java.net.URI - -val Project.jetbrainsRuntime: DependencyHandler.(String, String, String) -> Dependency? - get() = { version, variant, architecture -> - jetbrainsRuntimeExplicit(from(version, variant, architecture)) - } - -val Project.jetbrainsRuntimeExplicit: DependencyHandler.(String) -> Dependency? - get() = { artifactName -> - val dependency = create( - group = "com.jetbrains", - name = "jbr", - version = artifactName, - ext = "tar.gz", - ) - - this@jetbrainsRuntimeExplicit.repositories.ivy { - url = URI(Locations.JETBRAINS_RUNTIME_REPOSITORY) - patternLayout { artifact("[revision].tar.gz") } - metadataSources { artifact() } - } - - add(Configurations.JETBRAINS_RUNTIME_DEPENDENCY, dependency) - } - -private fun from(jbrVersion: String, jbrVariant: String?, jbrArch: String?, operatingSystem: OperatingSystem = OperatingSystem.current()): String { - val version = "8".takeIf { jbrVersion.startsWith('u') }.orEmpty() + jbrVersion - var prefix = getPrefix(version, jbrVariant) - val lastIndexOfB = version.lastIndexOf('b') - val lastIndexOfDash = version.lastIndexOf('-') + 1 - val majorVersion = when (lastIndexOfB > -1) { - true -> version.substring(lastIndexOfDash, lastIndexOfB) - false -> version.substring(lastIndexOfDash) - } - val buildNumberString = when (lastIndexOfB > -1) { - (lastIndexOfDash == lastIndexOfB) -> version.substring(0, lastIndexOfDash - 1) - true -> version.substring(lastIndexOfB + 1) - else -> "" - } - val buildNumber = Version.parse(buildNumberString) - val isJava8 = majorVersion.startsWith("8") - val isJava17 = majorVersion.startsWith("17") - - val oldFormat = prefix == "jbrex" || isJava8 && buildNumber < Version.parse("1483.24") - if (oldFormat) { - return "jbrex${majorVersion}b${buildNumberString}_${platform(operatingSystem)}_${arch(false)}" - } - - val arch = jbrArch ?: arch(isJava8) - if (prefix.isEmpty()) { - prefix = when { - isJava17 -> "jbr_jcef-" - isJava8 -> "jbrx-" - operatingSystem.isMacOsX && arch == "aarch64" -> "jbr_jcef-" - buildNumber < Version.parse("1319.6") -> "jbr-" - else -> "jbr_jcef-" - } - } - - return "$prefix$majorVersion-${platform(operatingSystem)}-$arch-b$buildNumberString" -} - -private fun getPrefix(version: String, variant: String?) = when { - !variant.isNullOrEmpty() -> when (variant) { - "sdk" -> "jbrsdk-" - else -> "jbr_$variant-" - } - - version.startsWith("jbrsdk-") -> "jbrsdk-" - version.startsWith("jbr_jcef-") -> "jbr_jcef-" - version.startsWith("jbr_dcevm-") -> "jbr_dcevm-" - version.startsWith("jbr_fd-") -> "jbr_fd-" - version.startsWith("jbr_nomod-") -> "jbr_nomod-" - version.startsWith("jbr-") -> "jbr-" - version.startsWith("jbrx-") -> "jbrx-" - version.startsWith("jbrex8") -> "jbrex" - else -> "" -} - -internal fun platform(operatingSystem: OperatingSystem) = when { - operatingSystem.isWindows -> "windows" - operatingSystem.isMacOsX -> "osx" - else -> "linux" -} - -internal fun arch(newFormat: Boolean): String { - val arch = System.getProperty("os.arch") - if ("aarch64" == arch || "arm64" == arch) { - return "aarch64" - } - if ("x86_64" == arch || "amd64" == arch) { - return "x64" - } - val name = System.getProperty("os.name") - if (name.contains("Windows") && System.getenv("ProgramFiles(x86)") != null) { - return "x64" - } - return when (newFormat) { - true -> "i586" - false -> "x86" - } -} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformDependenciesExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformDependenciesExtension.kt new file mode 100644 index 0000000000..aff91f0a68 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformDependenciesExtension.kt @@ -0,0 +1,420 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.extensions + +import org.gradle.api.GradleException +import org.gradle.api.artifacts.Dependency +import org.gradle.api.artifacts.dsl.DependencyHandler +import org.gradle.api.artifacts.dsl.RepositoryHandler +import org.gradle.api.invocation.Gradle +import org.gradle.api.provider.Provider +import org.gradle.api.provider.ProviderFactory +import org.gradle.internal.os.OperatingSystem +import org.gradle.kotlin.dsl.create +import org.jetbrains.intellij.platform.gradleplugin.BuildException +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Dependencies +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Locations +import org.jetbrains.intellij.platform.gradleplugin.Version +import org.jetbrains.intellij.platform.gradleplugin.model.* +import org.jetbrains.kotlin.gradle.utils.projectCacheDir +import java.net.URI +import java.nio.file.Path +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import javax.inject.Inject +import kotlin.io.path.* + +internal typealias DependencyAction = (Dependency.() -> Unit) + +@Suppress("unused", "MemberVisibilityCanBePrivate") +@IntelliJPlatform +abstract class IntelliJPlatformDependenciesExtension @Inject constructor( + private val repositories: RepositoryHandler, + private val dependencies: DependencyHandler, + private val providers: ProviderFactory, + private val gradle: Gradle, +) { + + fun create( + type: Provider<*>, + version: Provider, + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, + action: DependencyAction = {}, + ) = addIntelliJPlatformDependency(type, version, configurationName, action) + + fun create( + type: Provider<*>, + version: String, + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, + action: DependencyAction = {}, + ) = addIntelliJPlatformDependency(type, providers.provider { version }, configurationName, action) + + fun create( + type: IntelliJPlatformType, + version: Provider, + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, + action: DependencyAction = {}, + ) = addIntelliJPlatformDependency(providers.provider { type }, version, configurationName, action) + + fun create( + type: String, + version: Provider, + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, + action: DependencyAction = {}, + ) = addIntelliJPlatformDependency(providers.provider { IntelliJPlatformType.fromCode(type) }, version, configurationName, action) + + fun create( + type: IntelliJPlatformType, + version: String, + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, + action: DependencyAction = {}, + ) = addIntelliJPlatformDependency(providers.provider { type }, providers.provider { version }, configurationName, action) + + fun create( + type: String, + version: String, + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, + action: DependencyAction = {}, + ) = addIntelliJPlatformDependency(providers.provider { IntelliJPlatformType.fromCode(type) }, providers.provider { version }, configurationName, action) + + fun androidStudio(version: String) = create(IntelliJPlatformType.AndroidStudio, version) + fun androidStudio(version: Provider) = create(IntelliJPlatformType.AndroidStudio, version) + + fun clion(version: String) = create(IntelliJPlatformType.CLion, version) + fun clion(version: Provider) = create(IntelliJPlatformType.CLion, version) + + fun gateway(version: String) = create(IntelliJPlatformType.Gateway, version) + fun gateway(version: Provider) = create(IntelliJPlatformType.Gateway, version) + + fun goland(version: String) = create(IntelliJPlatformType.GoLand, version) + fun goland(version: Provider) = create(IntelliJPlatformType.GoLand, version) + + fun intellijIdeaCommunity(version: String) = create(IntelliJPlatformType.IntellijIdeaCommunity, version) + fun intellijIdeaCommunity(version: Provider) = create(IntelliJPlatformType.IntellijIdeaCommunity, version) + + fun intellijIdeaUltimate(version: String) = create(IntelliJPlatformType.IntellijIdeaUltimate, version) + fun intellijIdeaUltimate(version: Provider) = create(IntelliJPlatformType.IntellijIdeaUltimate, version) + + fun phpstorm(version: String) = create(IntelliJPlatformType.PhpStorm, version) + fun phpstorm(version: Provider) = create(IntelliJPlatformType.PhpStorm, version) + + fun pycharmProfessional(version: String) = create(IntelliJPlatformType.PyCharmProfessional, version) + fun pycharmProfessional(version: Provider) = create(IntelliJPlatformType.PyCharmProfessional, version) + + fun pycharmCommunity(version: String) = create(IntelliJPlatformType.PyCharmCommunity, version) + fun pycharmCommunity(version: Provider) = create(IntelliJPlatformType.PyCharmCommunity, version) + + fun rider(version: String) = create(IntelliJPlatformType.Rider, version) + fun rider(version: Provider) = create(IntelliJPlatformType.Rider, version) + + fun local( + localPath: Provider, + configurationName: String = Configurations.INTELLIJ_PLATFORM_LOCAL_INSTANCE, + action: DependencyAction = {}, + ) = addIntelliJPlatformLocalDependency(localPath, configurationName, action) + + fun local( + localPath: String, + configurationName: String = Configurations.INTELLIJ_PLATFORM_LOCAL_INSTANCE, + action: DependencyAction = {}, + ) = local(providers.provider { localPath }, configurationName, action) + + fun jetbrainsRuntime( + explicitVersion: Provider, + configurationName: String = Configurations.JETBRAINS_RUNTIME_DEPENDENCY, + action: DependencyAction = {}, + ) = addJbrDependency(explicitVersion, configurationName, action) + + fun jetbrainsRuntime( + explicitVersion: String, + configurationName: String = Configurations.JETBRAINS_RUNTIME_DEPENDENCY, + action: DependencyAction = {}, + ) = addJbrDependency(providers.provider { explicitVersion }, configurationName, action) + + fun jetbrainsRuntime( + version: Provider, + variant: Provider, + architecture: Provider, + configurationName: String = Configurations.JETBRAINS_RUNTIME_DEPENDENCY, + action: DependencyAction = {}, + ) = jetbrainsRuntime(providers.provider { from(version.get(), variant.orNull, architecture.orNull) }, configurationName, action) + + fun jetbrainsRuntime( + version: String, + variant: String, + architecture: String, + configurationName: String = Configurations.JETBRAINS_RUNTIME_DEPENDENCY, + action: DependencyAction = {}, + ) = jetbrainsRuntime(providers.provider { from(version, variant, architecture) }, configurationName, action) + + fun jetbrainsRuntime( + version: String, + variant: String, + architecture: String, + ) = jetbrainsRuntime(from(version, variant, architecture)) + + fun plugin( + id: Provider, + version: Provider, + channel: Provider, + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCIES, + action: DependencyAction, + ) = addIntelliJPlatformPlugin(id, version, channel, configurationName, action) + + fun plugin( + id: String, + version: String, + channel: String = "", + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCIES, + action: DependencyAction, + ) = plugin(providers.provider { id }, providers.provider { version }, providers.provider { channel }, configurationName, action) + + fun bundledPlugin( + id: Provider, + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCIES, + action: DependencyAction, + ) = addIntelliJPlatformBundledPlugin(id, configurationName, action) + + fun bundledPlugin( + id: String, + configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCIES, + action: DependencyAction, + ) = bundledPlugin(providers.provider { id }, configurationName, action) + + private fun addIntelliJPlatformDependency( + typeProvider: Provider<*>, + versionProvider: Provider, + configurationName: String, + action: DependencyAction = {}, + ) = dependencies.addProvider( + configurationName, + typeProvider + .map { + when (it) { + is IntelliJPlatformType -> it + is String -> IntelliJPlatformType.fromCode(it) + else -> throw IllegalArgumentException("Invalid argument type: ${it.javaClass}. Supported types: String or IntelliJPlatformType") + } + } + .zip(versionProvider) { type, version -> + dependencies.create( + group = type.groupId, + name = type.artifactId, + version = version, + ) + }, + action, + ) + + private fun addIntelliJPlatformLocalDependency( + localPathProvider: Provider, + configurationName: String, + action: DependencyAction = {}, + ) = dependencies.addProvider( + configurationName, + localPathProvider.map { localPath -> + val ideaDir = Path.of(localPath).let { + it.takeUnless { OperatingSystem.current().isMacOsX && it.extension == "app" } ?: it.resolve("Contents") + } + + if (!ideaDir.exists() || !ideaDir.isDirectory()) { + throw BuildException("Specified localPath '$localPath' doesn't exist or is not a directory") + } + + val productInfo = ideaDir.productInfo() + if (Version.parse(productInfo.buildNumber) < Version.parse(IntelliJPluginConstants.MINIMAL_SUPPORTED_INTELLIJ_PLATFORM_VERSION)) { + throw GradleException("The minimal supported IDE version is ${IntelliJPluginConstants.MINIMAL_SUPPORTED_INTELLIJ_PLATFORM_VERSION}+, the provided version is too low: ${productInfo.version} (${productInfo.buildNumber})") + } + + val dependency = dependencies.create( + group = Dependencies.INTELLIJ_PLATFORM_LOCAL_GROUP, + name = productInfo.productCode, + version = productInfo.version, + ) + + val ivyFileName = "${productInfo.productCode}-${productInfo.version}.xml" + val ivyDirectory = gradle.projectCacheDir.resolve("intellijPlatform/ivy").toPath() + + ivyDirectory + .resolve(ivyFileName) + .takeUnless { it.exists() } + ?.run { + val extractor = XmlExtractor() + val ivyModule = IvyModule( + info = IvyModuleInfo( + organisation = dependency.group, + module = dependency.name, + revision = dependency.version, + publication = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")), + ), + configurations = mutableListOf( + IvyModuleConfiguration( + name = "default", + visibility = "public", + ), + ), + publications = mutableListOf( + IvyModulePublication( + name = ideaDir.pathString, + type = "directory", + ext = null, + conf = "default", + ) + ), + ) + extractor.marshal(ivyModule, createFile()) + } + + repositories.ivy { + url = ivyDirectory.toUri() + ivyPattern("$ivyDirectory/[module]-[revision].[ext]") + artifactPattern(ideaDir.absolutePathString()) + } + + dependency + }, + action, + ) + + private fun addJbrDependency( + explicitVersion: Provider, + configurationName: String, + action: DependencyAction = {}, + ) = dependencies.addProvider( + configurationName, + explicitVersion.map { version -> + val dependency = dependencies.create( + group = "com.jetbrains", + name = "jbr", + version = version, + ext = "tar.gz", + ) + + repositories.ivy { + url = URI(Locations.JETBRAINS_RUNTIME_REPOSITORY) + patternLayout { artifact("[revision].tar.gz") } + metadataSources { artifact() } + } + + dependency + }, + action, + ) + + private fun addIntelliJPlatformPlugin( + id: Provider, + version: Provider, + channel: Provider, + configurationName: String, + action: DependencyAction, + ) = dependencies.addProvider( + configurationName, + providers.provider { + val group = when (channel.orNull?.trim()) { + "default", "", null -> "com.jetbrains.plugins" + else -> "$channel.com.jetbrains.plugins" + } + + dependencies.create( + group = group, + name = id.get(), + version = version.get(), + ) + }, + action, + ) + + private fun addIntelliJPlatformBundledPlugin( + id: Provider, + configurationName: String, + action: DependencyAction, + ) = dependencies.addProvider( + configurationName, + id.map { + TODO("To be implemented") + }, + action, + ) +} + +// TODO: cleanup JBR helper functions: +private fun from(jbrVersion: String, jbrVariant: String?, jbrArch: String?, operatingSystem: OperatingSystem = OperatingSystem.current()): String { + val version = "8".takeIf { jbrVersion.startsWith('u') }.orEmpty() + jbrVersion + var prefix = getPrefix(version, jbrVariant) + val lastIndexOfB = version.lastIndexOf('b') + val lastIndexOfDash = version.lastIndexOf('-') + 1 + val majorVersion = when (lastIndexOfB > -1) { + true -> version.substring(lastIndexOfDash, lastIndexOfB) + false -> version.substring(lastIndexOfDash) + } + val buildNumberString = when (lastIndexOfB > -1) { + (lastIndexOfDash == lastIndexOfB) -> version.substring(0, lastIndexOfDash - 1) + true -> version.substring(lastIndexOfB + 1) + else -> "" + } + val buildNumber = Version.parse(buildNumberString) + val isJava8 = majorVersion.startsWith("8") + val isJava17 = majorVersion.startsWith("17") + + val oldFormat = prefix == "jbrex" || isJava8 && buildNumber < Version.parse("1483.24") + if (oldFormat) { + return "jbrex${majorVersion}b${buildNumberString}_${platform(operatingSystem)}_${arch(false)}" + } + + val arch = jbrArch ?: arch(isJava8) + if (prefix.isEmpty()) { + prefix = when { + isJava17 -> "jbr_jcef-" + isJava8 -> "jbrx-" + operatingSystem.isMacOsX && arch == "aarch64" -> "jbr_jcef-" + buildNumber < Version.parse("1319.6") -> "jbr-" + else -> "jbr_jcef-" + } + } + + return "$prefix$majorVersion-${platform(operatingSystem)}-$arch-b$buildNumberString" +} + +private fun getPrefix(version: String, variant: String?) = when { + !variant.isNullOrEmpty() -> when (variant) { + "sdk" -> "jbrsdk-" + else -> "jbr_$variant-" + } + + version.startsWith("jbrsdk-") -> "jbrsdk-" + version.startsWith("jbr_jcef-") -> "jbr_jcef-" + version.startsWith("jbr_dcevm-") -> "jbr_dcevm-" + version.startsWith("jbr_fd-") -> "jbr_fd-" + version.startsWith("jbr_nomod-") -> "jbr_nomod-" + version.startsWith("jbr-") -> "jbr-" + version.startsWith("jbrx-") -> "jbrx-" + version.startsWith("jbrex8") -> "jbrex" + else -> "" +} + +internal fun platform(operatingSystem: OperatingSystem) = when { + operatingSystem.isWindows -> "windows" + operatingSystem.isMacOsX -> "osx" + else -> "linux" +} + +internal fun arch(newFormat: Boolean): String { + val arch = System.getProperty("os.arch") + if ("aarch64" == arch || "arm64" == arch) { + return "aarch64" + } + if ("x86_64" == arch || "amd64" == arch) { + return "x64" + } + val name = System.getProperty("os.name") + if (name.contains("Windows") && System.getenv("ProgramFiles(x86)") != null) { + return "x64" + } + return when (newFormat) { + true -> "i586" + false -> "x86" + } +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt index 252b7b6277..8e0427a400 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt @@ -8,9 +8,6 @@ import org.gradle.api.provider.Property import org.gradle.kotlin.dsl.getByName import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions -@DslMarker -annotation class IntelliJPlatform - @IntelliJPlatform interface IntelliJPlatformExtension : ExtensionAware { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformRepositoriesExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformRepositoriesExtension.kt new file mode 100644 index 0000000000..d20bf456d2 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformRepositoriesExtension.kt @@ -0,0 +1,65 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.extensions + +import org.gradle.api.artifacts.dsl.RepositoryHandler +import org.gradle.api.artifacts.repositories.MavenArtifactRepository +import org.gradle.api.provider.ProviderFactory +import org.gradle.kotlin.dsl.maven +import org.jetbrains.intellij.platform.gradleplugin.BuildFeature +import javax.inject.Inject + +internal typealias RepositoryAction = (MavenArtifactRepository.() -> Unit) + +@Suppress("unused") +@IntelliJPlatform +abstract class IntelliJPlatformRepositoriesExtension @Inject constructor( + private val repositories: RepositoryHandler, + private val providers: ProviderFactory, +) { + + fun releases(action: RepositoryAction = {}) = createRepository( + name = "IntelliJ Repository", + url = "https://www.jetbrains.com/intellij-repository/releases", + urlWithCacheRedirector = "https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/releases", + action = action, + ) + + fun snapshots(action: RepositoryAction = {}) = createRepository( + name = "IntelliJ Repository (Snapshots)", + url = "https://www.jetbrains.com/intellij-repository/snapshots", + urlWithCacheRedirector = "https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/snapshots", + action = action, + ) + + fun nightly(action: RepositoryAction = {}) = createRepository( + name = "IntelliJ Repository (Nightly)", + url = "https://www.jetbrains.com/intellij-repository/nightly", + urlWithCacheRedirector = "https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/nightly", + action = action, + ) + + fun marketplace(action: RepositoryAction = {}) = createRepository( + name = "JetBrains Marketplace Repository", + url = "https://plugins.jetbrains.com/maven", + urlWithCacheRedirector = "https://cache-redirector.jetbrains.com/plugins.jetbrains.com/maven", + action = action, + ) + + private fun createRepository( + name: String, + url: String, + urlWithCacheRedirector: String = url, + action: RepositoryAction = {}, + ) = BuildFeature.USE_CACHE_REDIRECTOR.getValue(providers).get().let { useCacheRedirector -> + repositories.maven( + when (useCacheRedirector) { + true -> urlWithCacheRedirector + false -> url + } + ) { + this.name = name + action() + } + } +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/extensions.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/extensions.kt new file mode 100644 index 0000000000..d15c22243f --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/extensions.kt @@ -0,0 +1,6 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.extensions + +@DslMarker +annotation class IntelliJPlatform diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt index c80ca7ba17..e5078bd23e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt @@ -3,10 +3,10 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins import com.jetbrains.plugin.structure.intellij.version.IdeVersion +import org.gradle.api.GradleException import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.Task -import org.gradle.api.plugins.ExtensionAware import org.gradle.api.plugins.JavaPluginExtension import org.gradle.api.tasks.TaskContainer import org.gradle.jvm.toolchain.JavaToolchainService @@ -15,9 +15,8 @@ import org.gradle.kotlin.dsl.support.serviceOf import org.jetbrains.intellij.platform.gradleplugin.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks -import org.jetbrains.intellij.platform.gradleplugin.dependencies.create +import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformDependenciesExtension import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension import org.jetbrains.intellij.platform.gradleplugin.jbr.JetBrainsRuntimeResolver import org.jetbrains.intellij.platform.gradleplugin.model.productInfo @@ -72,9 +71,9 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu isCanBeConsumed = false isCanBeResolved = true - dependencies.addLater(project.provider { - project.dependencies.create(type.get(), version.get()) - }) + project.dependencies + .the() + .create(type, version, configurationName = name) } val intellijPlatformConfiguration = project.configurations.create("${Configurations.INTELLIJ_PLATFORM}_$suffix") { isVisible = false @@ -98,34 +97,42 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu extendsFrom(intellijPlatformConfiguration) } - val baseIntellijPlatformProductInfoProvider = project.provider { - project.configurations.getByName(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO).single().toPath().productInfo() - } - type.convention(baseIntellijPlatformProductInfoProvider.map { - IntelliJPlatformType.fromCode(it.productCode) + type.convention(project.provider { + val productInfo = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) + .singleOrNull() + .throwIfNull { GradleException("IntelliJ Platform is not specified.") } + .toPath() + .productInfo() + IntelliJPlatformType.fromCode(productInfo.productCode) }) - version.convention(baseIntellijPlatformProductInfoProvider.map { - IdeVersion.createIdeVersion(it.version).toString() + version.convention(project.provider { + val productInfo = project.configurations.getByName(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) + .singleOrNull() + .throwIfNull { GradleException("IntelliJ Platform is not specified.") } + .toPath() + .productInfo() + IdeVersion.createIdeVersion(productInfo.version).toString() }) intelliJPlatform.setFrom(project.provider { when { type.isSpecified() || version.isSpecified() -> intellijPlatformConfiguration - else -> project.configurations.getByName(Configurations.INTELLIJ_PLATFORM_DEPENDENCY) + else -> emptyList() } }) intelliJPlatformProductInfo.setFrom(project.provider { when { type.isSpecified() || version.isSpecified() -> intellijPlatformProductInfoConfiguration - else -> project.configurations.getByName(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) + else -> emptyList() } }) } if (this is SandboxAware) { val prepareSandboxTaskProvider = named(Tasks.PREPARE_SANDBOX) + val extension = project.the() - sandboxDirectory.convention(project.intelliJPlatformExtension.sandboxContainer.map { + sandboxDirectory.convention(extension.sandboxContainer.map { it.dir("$platformType-$platformVersion").also { directory -> directory.asFile.toPath().createDirectories() } @@ -163,15 +170,4 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu withType(configuration) } - - protected inline fun Any.configureExtension(name: String, noinline configuration: T.() -> Unit = {}) { - info(context, "Configuring extension: $name") - with((this as ExtensionAware).extensions) { - val extension = findByName(name) as? T ?: create(name) - extension.configuration() - } - } - - protected val Project.intelliJPlatformExtension - get() = extensions.getByName(Extensions.INTELLIJ_PLATFORM) } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt index cd6b81af33..ac6b302678 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt @@ -9,18 +9,18 @@ import org.gradle.api.plugins.JavaPlugin import org.gradle.api.plugins.JavaPlugin.* import org.gradle.kotlin.dsl.apply import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_TEST_FIXTURES_PLUGIN_ID import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_BASE_ID import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyCollectorTransformer import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyExtractorTransformer import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyProductInfoTransformer -import org.jetbrains.intellij.platform.gradleplugin.dependencies.applyIntelliJPlatformSettings +import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformDependenciesExtension import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension -import org.jetbrains.intellij.platform.gradleplugin.repositories.applyIntelliJPlatformSettings +import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformRepositoriesExtension abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugin(PLUGIN_BASE_ID) { @@ -30,10 +30,6 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi apply(JavaPlugin::class) } - with(repositories) { - applyIntelliJPlatformSettings(objects, providers) - } - with(configurations) { val intellijPlatformDependencyConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM_DEPENDENCY) .apply { @@ -63,6 +59,18 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi } extendsFrom(intellijPlatformDependencyConfiguration, intellijPlatformLocalConfiguration) + + incoming.beforeResolve { + if (dependencies.isEmpty()) { + throw GradleException("No IntelliJ Platform dependency found") + } + + val identifiers = IntelliJPlatformType.values().map { "${it.groupId}:${it.artifactId}" } + val matched = dependencies.filter { identifiers.contains("${it.group}:${it.name}") } + if (matched.size > 1) { + throw GradleException("Conflicting dependencies detected: \n${matched.joinToString("\n")}") + } + } } maybeCreate(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) @@ -136,20 +144,10 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi pluginManager.withPlugin(JAVA_TEST_FIXTURES_PLUGIN_ID) { getByName(Configurations.TEST_FIXTURES_COMPILE_ONLY).extend() } - - val identifiers = IntelliJPlatformType.values().map { "${it.groupId}:${it.artifactId}" } - all { - incoming.beforeResolve { - val matched = dependencies.filter { identifiers.contains("${it.group}:${it.name}") } - if (matched.size > 1) { - throw GradleException("Conflicting dependencies detected: \n${matched.joinToString("\n")}") - } - } - } } with(dependencies) { - applyIntelliJPlatformSettings(objects, gradle) +// applyIntelliJPlatformSettings(objects, gradle) attributesSchema { attribute(Attributes.collected) @@ -170,19 +168,21 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi applyProductInfoTransformer() } - with(IntelliJPluginConstants.Extensions) { - this@configure.configureExtension(INTELLIJ_PLATFORM) { - instrumentCode.convention(true) - sandboxContainer.convention(project.layout.buildDirectory.dir(Sandbox.CONTAINER)) - - configureExtension(PLUGIN_CONFIGURATION) { - name.convention(project.name) - - configureExtension(PRODUCT_DESCRIPTOR) - configureExtension(IDEA_VERSION) - configureExtension(VENDOR) - } + configureExtension(Extensions.INTELLIJ_PLATFORM) { + instrumentCode.convention(true) + sandboxContainer.convention(project.layout.buildDirectory.dir(Sandbox.CONTAINER)) + + configureExtension(Extensions.PLUGIN_CONFIGURATION) { + name.convention(project.name) + version.convention(this@configure.version.toString()) + + configureExtension(Extensions.PRODUCT_DESCRIPTOR) + configureExtension(Extensions.IDEA_VERSION) + configureExtension(Extensions.VENDOR) } } + + dependencies.configureExtension(Extensions.INTELLIJ_PLATFORM, repositories, dependencies, providers, gradle) + repositories.configureExtension(Extensions.INTELLIJ_PLATFORM, repositories, providers) } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt index acad0d1a9b..c12bfca42f 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt @@ -15,7 +15,8 @@ import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.DuplicatesStrategy import org.gradle.api.logging.LogLevel import org.gradle.api.plugins.JavaPlugin -import org.gradle.api.plugins.JavaPlugin.* +import org.gradle.api.plugins.JavaPlugin.JAR_TASK_NAME +import org.gradle.api.plugins.JavaPlugin.PROCESS_RESOURCES_TASK_NAME import org.gradle.api.plugins.JavaPluginExtension import org.gradle.api.provider.Provider import org.gradle.api.tasks.ClasspathNormalizer @@ -23,7 +24,6 @@ import org.gradle.api.tasks.PathSensitivity import org.gradle.api.tasks.SourceSetContainer import org.gradle.api.tasks.bundling.Jar import org.gradle.api.tasks.bundling.Zip -import org.gradle.api.tasks.compile.JavaCompile import org.gradle.api.tasks.testing.Test import org.gradle.jvm.toolchain.JavaToolchainService import org.gradle.kotlin.dsl.* @@ -36,7 +36,6 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANDROID_STUDIO_PRODUCTS_RELEASES_URL import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_SEARCHABLE_OPTIONS_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.CLASSPATH_INDEX_CLEANUP_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.COMPILE_KOTLIN_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_IDEA_VERSION import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME @@ -53,7 +52,6 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INST import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_COMPILER_ANT_TASKS_MAVEN_METADATA -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.KOTLIN_GRADLE_PLUGIN_ID import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.LIST_BUNDLED_PLUGINS_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MARKETPLACE_HOST @@ -72,7 +70,6 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SEAR import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SIGN_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_CONFIGURATION_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_SIGNATURE_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERSION_LATEST @@ -90,8 +87,6 @@ import org.jetbrains.intellij.platform.gradleplugin.utils.mavenRepository import org.jetbrains.intellij.pluginRepository.PluginRepositoryFactory import org.jetbrains.intellij.tasks.DownloadAndroidStudioProductReleasesXmlTask import org.jetbrains.intellij.tasks.DownloadIdeaProductReleasesXmlTask -import org.jetbrains.kotlin.gradle.dsl.kotlinExtension -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import java.io.File import java.net.URL import java.nio.file.Path @@ -180,18 +175,17 @@ abstract class IntelliJPlatformPlugin : Plugin { configureSignPluginTask(project) configurePublishPluginTask(project) configureProcessResources(project) - configureVerifyPluginConfigurationTask(project, ideaDependencyProvider) assert(!project.state.executed) { "afterEvaluate is a no-op for an executed project" } - project.pluginManager.withPlugin(KOTLIN_GRADLE_PLUGIN_ID) { - project.tasks.withType { - dependsOn(VERIFY_PLUGIN_CONFIGURATION_TASK_NAME) - } - } - - project.tasks.withType { - dependsOn(VERIFY_PLUGIN_CONFIGURATION_TASK_NAME) - } +// project.pluginManager.withPlugin(KOTLIN_GRADLE_PLUGIN_ID) { +//// project.tasks.withType { +//// dependsOn(Tasks.VERIFY_PLUGIN_CONFIGURATION) +//// } +// } +// +// project.tasks.withType { +// dependsOn(Tasks.VERIFY_PLUGIN_CONFIGURATION) +// } project.afterEvaluate { configureProjectAfterEvaluate(this, extension, ideaDependencyProvider) @@ -634,75 +628,6 @@ abstract class IntelliJPlatformPlugin : Plugin { } } - private fun configureVerifyPluginConfigurationTask(project: Project, ideaDependencyProvider: Provider) { - info(context, "Configuring plugin configuration verification task") - - val patchPluginXmlTaskProvider = project.tasks.named(Tasks.PATCH_PLUGIN_XML) - val runPluginVerifierTaskProvider = project.tasks.named(RUN_PLUGIN_VERIFIER_TASK_NAME) - val compileJavaTaskProvider = project.tasks.named(COMPILE_JAVA_TASK_NAME) - val stdlibDefaultDependencyProvider = project.providers.gradleProperty("kotlin.stdlib.default.dependency").map { - it.toBoolean() - } - val incrementalUseClasspathSnapshot = project.providers.gradleProperty("kotlin.incremental.useClasspathSnapshot").map { - it.toBoolean() - } - - val downloadDirProvider = runPluginVerifierTaskProvider.flatMap { runPluginVerifierTask -> - runPluginVerifierTask.downloadDir - } - - project.tasks.register(VERIFY_PLUGIN_CONFIGURATION_TASK_NAME) - project.tasks.withType { - platformBuild.convention(ideaDependencyProvider.map { - it.buildNumber - }) - platformVersion.convention(ideaDependencyProvider.map { - it.version - }) -// pluginXmlFiles.convention(patchPluginXmlTaskProvider.flatMap { patchPluginXmlTask -> -// patchPluginXmlTask.outputFiles -// }) - sourceCompatibility.convention(compileJavaTaskProvider.map { - it.sourceCompatibility - }) - targetCompatibility.convention(compileJavaTaskProvider.map { - it.targetCompatibility - }) - pluginVerifierDownloadDir.convention(downloadDirProvider) - kotlinxCoroutinesLibraryPresent.convention(project.provider { - listOf(IMPLEMENTATION_CONFIGURATION_NAME, COMPILE_ONLY_CONFIGURATION_NAME).any { configurationName -> - project.configurations.getByName(configurationName).dependencies.any { - it.group == "org.jetbrains.kotlinx" && it.name.startsWith("kotlinx-coroutines") - } - } - }) - - kotlinPluginAvailable.convention(project.provider { - project.pluginManager.hasPlugin(KOTLIN_GRADLE_PLUGIN_ID) - }) - project.pluginManager.withPlugin(KOTLIN_GRADLE_PLUGIN_ID) { - val compileKotlinTaskProvider = project.tasks.named(COMPILE_KOTLIN_TASK_NAME) - - kotlinJvmTarget.convention(project.provider { - compileKotlinTaskProvider.get().kotlinOptions.jvmTarget - }) - kotlinApiVersion.convention(project.provider { - compileKotlinTaskProvider.get().kotlinOptions.apiVersion - }) - kotlinLanguageVersion.convention(project.provider { - compileKotlinTaskProvider.get().kotlinOptions.languageVersion - }) - kotlinVersion.convention(project.provider { - project.kotlinExtension.coreLibrariesVersion - }) - kotlinStdlibDefaultDependency.convention(stdlibDefaultDependencyProvider) - kotlinIncrementalUseClasspathSnapshot.convention(incrementalUseClasspathSnapshot) - } - - dependsOn(Tasks.PATCH_PLUGIN_XML) - } - } - private fun configureRunIdeTask(project: Project) { info(context, "Configuring run IDE task") diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformSettingsPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformSettingsPlugin.kt index a2128e390f..cbb4b05ac4 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformSettingsPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformSettingsPlugin.kt @@ -4,18 +4,19 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins import org.gradle.api.Plugin import org.gradle.api.initialization.Settings -import org.gradle.api.model.ObjectFactory import org.gradle.api.provider.ProviderFactory -import org.jetbrains.intellij.platform.gradleplugin.repositories.applyIntelliJPlatformSettings +import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions +import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformRepositoriesExtension import javax.inject.Inject -@Suppress("UnstableApiUsage", "unused") +@Suppress("unused", "UnstableApiUsage") abstract class IntelliJPlatformSettingsPlugin @Inject constructor( - private val objects: ObjectFactory, private val providers: ProviderFactory, ) : Plugin { override fun apply(settings: Settings) { - settings.dependencyResolutionManagement.repositories.applyIntelliJPlatformSettings(objects, providers) + with(settings.dependencyResolutionManagement.repositories) { + configureExtension(Extensions.INTELLIJ_PLATFORM, this, providers) + } } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt index 7cd9919f6f..6c0cb43065 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt @@ -4,17 +4,16 @@ package org.jetbrains.intellij.platform.gradleplugin.plugins import org.gradle.api.Project import org.gradle.api.plugins.JavaPlugin +import org.gradle.api.provider.Property import org.gradle.api.tasks.ClasspathNormalizer import org.gradle.api.tasks.PathSensitivity import org.gradle.api.tasks.SourceSet.MAIN_SOURCE_SET_NAME import org.gradle.api.tasks.TaskContainer import org.gradle.api.tasks.bundling.Jar +import org.gradle.api.tasks.compile.JavaCompile import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem -import org.gradle.kotlin.dsl.apply -import org.gradle.kotlin.dsl.attributes -import org.gradle.kotlin.dsl.named -import org.gradle.kotlin.dsl.withNormalizer +import org.gradle.kotlin.dsl.* import org.gradle.process.JavaForkOptions import org.jetbrains.intellij.platform.gradleplugin.* import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.SELF_UPDATE_CHECK @@ -22,6 +21,7 @@ import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUG import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.IntelliJPlatformArgumentProvider import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.LaunchSystemArgumentProvider import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.PluginPathArgumentProvider @@ -40,9 +40,11 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug with(tasks) { configureSetupDependenciesTask() configurePrepareSandboxTasks() + configurePatchPluginXmlTask() + configureVerifyPluginConfigurationTask() + configureBuildPluginTask() configureInitializeIntelliJPlatformPluginTask() - configurePatchPluginXmlTask() configureJarTask() configureTestIdeTask() configureRunIdeTask() @@ -57,6 +59,206 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug private fun TaskContainer.configureSetupDependenciesTask() = configureTask(Tasks.SETUP_DEPENDENCIES) + private fun TaskContainer.configurePrepareSandboxTasks() = + configureTask(Tasks.PREPARE_SANDBOX, Tasks.PREPARE_TESTING_SANDBOX, Tasks.PREPARE_UI_TESTING_SANDBOX) { +// val downloadPluginTaskProvider = project.tasks.named(IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME) + val runtimeConfiguration = project.configurations.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME) + val jarTaskProvider = named(JavaPlugin.JAR_TASK_NAME) + val extension = project.the() + +// val ideaDependencyJarFiles = ideaDependencyProvider.map { +// project.files(it.jarFiles) +// } + val pluginJarProvider = extension.instrumentCode.flatMap { instrumentCode -> + when (instrumentCode) { + true -> named(Tasks.INSTRUMENTED_JAR) + false -> jarTaskProvider + } + }.flatMap { it.archiveFile } + + testSuffix.convention( + when (name) { + Tasks.PREPARE_TESTING_SANDBOX -> "-test" + Tasks.PREPARE_UI_TESTING_SANDBOX -> "-uiTest" + Tasks.PREPARE_SANDBOX -> "" + else -> "" + } + ) + +// project.tasks.register() { +// PREPARE_UI_TESTING_SANDBOX +// from(downloadPluginTaskProvider.flatMap { downloadPluginTask -> +// downloadPluginTask.outputDir +// }) +// +// dependsOn(IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME) +// } + + pluginName.convention(extension.pluginConfiguration.name) + pluginJar.convention(pluginJarProvider) + defaultDestinationDir.convention(sandboxDirectory.dir(Sandbox.PLUGINS)) +// librariesToIgnore.convention(ideaDependencyJarFiles) +// pluginDependencies.convention(project.provider { +// extension.getPluginDependenciesList(project) +// }) + runtimeClasspathFiles.convention(runtimeConfiguration) + + intoChild(pluginName.map { "$it/lib" }) + .from(runtimeClasspathFiles.map { files -> + val librariesToIgnore = librariesToIgnore.get().toSet() + Jvm.current().toolsJar + val pluginDirectories = pluginDependencies.get().map { it.artifact } + + listOf(pluginJar.asFile) + files.filter { file -> + !(librariesToIgnore.contains(file) || pluginDirectories.any { p -> + file.toPath() == p || file.canonicalPath.startsWith("$p${File.separator}") + }) + } + }) + .eachFile { + name = ensureName(file.toPath()) + } + + dependsOn(runtimeConfiguration) + dependsOn(jarTaskProvider) +// dependsOn(instrumentedJarTaskProvider) + +// project.afterEvaluate `{ +// extension.plugins.get().filterIsInstance().forEach { dependency -> +// if (dependency.state.executed) { +// configureProjectPluginTasksDependency(dependency, this@withType) +// } else { +// dependency.afterEvaluate { +// configureProjectPluginTasksDependency(dependency, this@withType) +// } +// } +// } +// }` + } + + private fun TaskContainer.configurePatchPluginXmlTask() = + configureTask(Tasks.PATCH_PLUGIN_XML) { + val extension = project.the() + + inputFile.convention(project.provider { + project.sourceSets.getByName(MAIN_SOURCE_SET_NAME).resources.srcDirs + .map { it.resolve("META-INF/plugin.xml") } + .firstOrNull { it.exists() } + }) + outputFile.convention(inputFile.map { + temporaryDir.resolve(it.name) + }) + + extension.pluginConfiguration.let { + pluginId.convention(it.id) + pluginName.convention(it.name) + pluginVersion.convention(it.version) + pluginDescription.convention(it.description) + changeNotes.convention(it.changeNotes) + + it.productDescriptor.let { productDescriptor -> + productDescriptorCode.convention(productDescriptor.code) + productDescriptorReleaseDate.convention(productDescriptor.releaseDate) + productDescriptorReleaseVersion.convention(productDescriptor.releaseVersion) + productDescriptorOptional.convention(productDescriptor.optional) + } + + it.ideaVersion.let { ideaVersion -> + sinceBuild.convention(ideaVersion.sinceBuild) + untilBuild.convention(ideaVersion.untilBuild) + } + + it.vendor.let { vendor -> + vendorName.convention(vendor.name) + vendorEmail.convention(vendor.email) + vendorUrl.convention(vendor.url) + } + } + } + + private fun TaskContainer.configureVerifyPluginConfigurationTask() = + configureTask(Tasks.VERIFY_PLUGIN_CONFIGURATION) { + info(context, "Configuring plugin configuration verification task") + + val patchPluginXmlTaskProvider = named(Tasks.PATCH_PLUGIN_XML) +// val runPluginVerifierTaskProvider = named(IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME) + val compileJavaTaskProvider = named(JavaPlugin.COMPILE_JAVA_TASK_NAME) +// val downloadDirProvider = runPluginVerifierTaskProvider.flatMap { runPluginVerifierTask -> +// runPluginVerifierTask.downloadDir +// } +// pluginXmlFiles.convention(patchPluginXmlTaskProvider.flatMap { patchPluginXmlTask -> +// patchPluginXmlTask.outputFiles +// }) + sourceCompatibility.convention(compileJavaTaskProvider.map { + it.sourceCompatibility + }) + targetCompatibility.convention(compileJavaTaskProvider.map { + it.targetCompatibility + }) +// pluginVerifierDownloadDir.convention(downloadDirProvider) + kotlinxCoroutinesLibraryPresent.convention(project.provider { + listOf(JavaPlugin.IMPLEMENTATION_CONFIGURATION_NAME, JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME).any { configurationName -> + project.configurations.getByName(configurationName).dependencies.any { + it.group == "org.jetbrains.kotlinx" && it.name.startsWith("kotlinx-coroutines") + } + } + }) + + kotlinPluginAvailable.convention(project.provider { + project.pluginManager.hasPlugin(IntelliJPluginConstants.KOTLIN_GRADLE_PLUGIN_ID) + }) + project.pluginManager.withPlugin(IntelliJPluginConstants.KOTLIN_GRADLE_PLUGIN_ID) { + val kotlinOptionsProvider = project.tasks.named(IntelliJPluginConstants.COMPILE_KOTLIN_TASK_NAME) + .apply { + configure { + dependsOn(this@configureTask) + } + } + .map { + it + .withGroovyBuilder { getProperty("kotlinOptions") } + .withGroovyBuilder { getProperty("options") } + } + + kotlinJvmTarget.convention(kotlinOptionsProvider.flatMap { + it + .withGroovyBuilder { getProperty("jvmTarget") as Property<*> } + .map { jvmTarget -> jvmTarget.withGroovyBuilder { getProperty("target") } } + .map { value -> value as String } + }) + kotlinApiVersion.convention(kotlinOptionsProvider.flatMap { + it + .withGroovyBuilder { getProperty("apiVersion") as Property<*> } + .map { value -> value as String } + }) + kotlinLanguageVersion.convention(kotlinOptionsProvider.flatMap { + it + .withGroovyBuilder { getProperty("languageVersion") as Property<*> } + .map { value -> value as String } + }) + kotlinVersion.convention(project.provider { + project.extensions + .getByName("kotlin") + .withGroovyBuilder { getProperty("coreLibrariesVersion") as String } + }) + kotlinStdlibDefaultDependency.convention( + project.providers + .gradleProperty(IntelliJPluginConstants.KOTLIN_STDLIB_DEFAULT_DEPENDENCY_PROPERTY_NAME) + .map { it.toBoolean() } + ) + kotlinIncrementalUseClasspathSnapshot.convention( + project.providers + .gradleProperty(IntelliJPluginConstants.KOTLIN_INCREMENTAL_USE_CLASSPATH_SNAPSHOT) + .map { it.toBoolean() } + ) + } + + project.tasks.withType { + dependsOn(this@configureTask) + } + + dependsOn(patchPluginXmlTaskProvider) + } + private fun TaskContainer.configureBuildPluginTask() = configureTask(Tasks.BUILD_PLUGIN) { val prepareSandboxTaskProvider = named(Tasks.PREPARE_SANDBOX) @@ -109,44 +311,6 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug } } - private fun TaskContainer.configurePatchPluginXmlTask() = - configureTask(Tasks.PATCH_PLUGIN_XML) { - inputFile.convention(project.provider { - project.sourceSets.getByName(MAIN_SOURCE_SET_NAME).resources.srcDirs - .map { it.resolve("META-INF/plugin.xml") } - .firstOrNull { it.exists() } - }) - outputFile.convention(inputFile.map { - temporaryDir.resolve(it.name) - }) - - project.intelliJPlatformExtension.pluginConfiguration.let { - pluginId.convention(it.id) - pluginName.convention(it.name) - pluginVersion.convention(it.version) - pluginDescription.convention(it.description) - changeNotes.convention(it.changeNotes) - - it.productDescriptor.let { productDescriptor -> - productDescriptorCode.convention(productDescriptor.code) - productDescriptorReleaseDate.convention(productDescriptor.releaseDate) - productDescriptorReleaseVersion.convention(productDescriptor.releaseVersion) - productDescriptorOptional.convention(productDescriptor.optional) - } - - it.ideaVersion.let { ideaVersion -> - sinceBuild.convention(ideaVersion.sinceBuild) - untilBuild.convention(ideaVersion.untilBuild) - } - - it.vendor.let { vendor -> - vendorName.convention(vendor.name) - vendorEmail.convention(vendor.email) - vendorUrl.convention(vendor.url) - } - } - } - private fun TaskContainer.configureJarTask() = configureTask(JavaPlugin.JAR_TASK_NAME, Tasks.INSTRUMENTED_JAR) { val gradleVersion = project.provider { @@ -182,81 +346,6 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug ) } - private fun TaskContainer.configurePrepareSandboxTasks() = - configureTask(Tasks.PREPARE_SANDBOX, Tasks.PREPARE_TESTING_SANDBOX, Tasks.PREPARE_UI_TESTING_SANDBOX) { -// val downloadPluginTaskProvider = project.tasks.named(IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME) - val runtimeConfiguration = project.configurations.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME) - val jarTaskProvider = named(JavaPlugin.JAR_TASK_NAME) - -// val ideaDependencyJarFiles = ideaDependencyProvider.map { -// project.files(it.jarFiles) -// } - val pluginJarProvider = project.intelliJPlatformExtension.instrumentCode.flatMap { instrumentCode -> - when (instrumentCode) { - true -> named(Tasks.INSTRUMENTED_JAR) - false -> jarTaskProvider - } - }.flatMap { it.archiveFile } - - testSuffix.convention( - when (name) { - Tasks.PREPARE_TESTING_SANDBOX -> "-test" - Tasks.PREPARE_UI_TESTING_SANDBOX -> "-uiTest" - Tasks.PREPARE_SANDBOX -> "" - else -> "" - } - ) - -// project.tasks.register() { -// PREPARE_UI_TESTING_SANDBOX -// from(downloadPluginTaskProvider.flatMap { downloadPluginTask -> -// downloadPluginTask.outputDir -// }) -// -// dependsOn(IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME) -// } - - pluginName.convention(project.intelliJPlatformExtension.pluginConfiguration.name) - pluginJar.convention(pluginJarProvider) - defaultDestinationDir.convention(sandboxDirectory.dir(Sandbox.PLUGINS)) -// librariesToIgnore.convention(ideaDependencyJarFiles) -// pluginDependencies.convention(project.provider { -// extension.getPluginDependenciesList(project) -// }) - runtimeClasspathFiles.convention(runtimeConfiguration) - - intoChild(pluginName.map { "$it/lib" }) - .from(runtimeClasspathFiles.map { files -> - val librariesToIgnore = librariesToIgnore.get().toSet() + Jvm.current().toolsJar - val pluginDirectories = pluginDependencies.get().map { it.artifact } - - listOf(pluginJar.asFile) + files.filter { file -> - !(librariesToIgnore.contains(file) || pluginDirectories.any { p -> - file.toPath() == p || file.canonicalPath.startsWith("$p${File.separator}") - }) - } - }) - .eachFile { - name = ensureName(file.toPath()) - } - - dependsOn(runtimeConfiguration) - dependsOn(jarTaskProvider) -// dependsOn(instrumentedJarTaskProvider) - -// project.afterEvaluate `{ -// extension.plugins.get().filterIsInstance().forEach { dependency -> -// if (dependency.state.executed) { -// configureProjectPluginTasksDependency(dependency, this@withType) -// } else { -// dependency.afterEvaluate { -// configureProjectPluginTasksDependency(dependency, this@withType) -// } -// } -// } -// }` - } - // TODO: define `inputs.property` for tasks to consider system properties in terms of the configuration cache // see: https://docs.gradle.org/current/kotlin-dsl/gradle/org.gradle.api.tasks/-task-inputs/property.html private fun TaskContainer.configureTestIdeTask() = diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/plugins.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/plugins.kt new file mode 100644 index 0000000000..5b5da5fb5b --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/plugins.kt @@ -0,0 +1,13 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradleplugin.plugins + +import org.gradle.api.plugins.ExtensionAware +import org.gradle.kotlin.dsl.create + +internal inline fun Any.configureExtension(name: String, vararg constructionArguments: Any, noinline configuration: T.() -> Unit = {}) { + with((this as ExtensionAware).extensions) { + val extension = findByName(name) as? T ?: create(name, *constructionArguments) + extension.configuration() + } +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellij.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellij.kt deleted file mode 100644 index ed2132d4dc..0000000000 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/intellij.kt +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -@file:Suppress("unused") - -package org.jetbrains.intellij.platform.gradleplugin.repositories - -import org.gradle.api.artifacts.dsl.RepositoryHandler - -fun RepositoryHandler.intellij(action: Action = {}) = customRepository( - name = "IntelliJ Repository", - url = "https://www.jetbrains.com/intellij-repository/releases", - urlWithCacheRedirector = "https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/releases", - action = action, -) - -fun RepositoryHandler.intellijSnapshots(action: Action = {}) = customRepository( - name = "IntelliJ Repository (Snapshots)", - url = "https://www.jetbrains.com/intellij-repository/snapshots", - urlWithCacheRedirector = "https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/snapshots", - action = action, -) - -fun RepositoryHandler.intellijNightly(action: Action = {}) = customRepository( - name = "IntelliJ Repository (Nightly)", - url = "https://www.jetbrains.com/intellij-repository/nightly", - urlWithCacheRedirector = "https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/nightly", - action = action, -) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/jetbrainsMarketplace.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/jetbrainsMarketplace.kt deleted file mode 100644 index 4016d8563b..0000000000 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/jetbrainsMarketplace.kt +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -@file:Suppress("unused") - -package org.jetbrains.intellij.platform.gradleplugin.repositories - -import org.gradle.api.artifacts.dsl.RepositoryHandler - -fun RepositoryHandler.jetbrainsMarketplace(action: Action = {}) = customRepository( - name = "JetBrains Marketplace Repository", - url = "https://plugins.jetbrains.com/maven", - urlWithCacheRedirector = "https://cache-redirector.jetbrains.com/plugins.jetbrains.com/maven", - action = action, -) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt deleted file mode 100644 index a7ed7f2f4d..0000000000 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/repositories/repositories.kt +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -package org.jetbrains.intellij.platform.gradleplugin.repositories - -import org.gradle.api.artifacts.dsl.RepositoryHandler -import org.gradle.api.artifacts.repositories.MavenArtifactRepository -import org.gradle.api.model.ObjectFactory -import org.gradle.api.plugins.ExtensionAware -import org.gradle.api.provider.Property -import org.gradle.api.provider.ProviderFactory -import org.gradle.kotlin.dsl.getByType -import org.gradle.kotlin.dsl.maven -import org.gradle.kotlin.dsl.newInstance -import org.jetbrains.intellij.platform.gradleplugin.BuildFeature -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions - -internal typealias Action = (MavenArtifactRepository.() -> Unit) - -interface IntelliJPlatformRepositorySettings { - - val useCacheRedirector: Property -} - -internal fun RepositoryHandler.applyIntelliJPlatformSettings(objects: ObjectFactory, providers: ProviderFactory) { - val settings = objects.newInstance(IntelliJPlatformRepositorySettings::class) - - settings.useCacheRedirector.convention(BuildFeature.USE_CACHE_REDIRECTOR.getValue(providers)) - - (this as ExtensionAware).extensions.add(Extensions.INTELLIJ_PLATFORM_REPOSITORY_SETTINGS, settings) -} - -internal val RepositoryHandler.intellijPlatformRepositorySettings: IntelliJPlatformRepositorySettings - get() = (this as ExtensionAware).extensions.getByType() - -internal fun RepositoryHandler.customRepository( - name: String, - url: String, - urlWithCacheRedirector: String, - settings: IntelliJPlatformRepositorySettings = intellijPlatformRepositorySettings, - action: Action = {}, -) = maven(settings.useCacheRedirector.map { cached -> - when (cached) { - true -> urlWithCacheRedirector - false -> url - } -}) { - this.name = name - action(this) -} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt index a5e6bac9ba..b41f7a25f2 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt @@ -149,10 +149,10 @@ abstract class PatchPluginXmlTask : DefaultTask(), PlatformVersionAware { val outputPath = outputFile.get().toPath() val sinceBuildValue = sinceBuild.orNull ?: with(platformVersion) { - "$baselineVersion.$build" + "$major.$minor" } val untilBuildValue = untilBuild.orNull ?: with(platformVersion) { - "$baselineVersion.*" + "$major.*" } inputPath.inputStream().use { inputStream -> diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt index 5ac91d07d2..15eb3ec6da 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt @@ -36,10 +36,11 @@ abstract class RunIdeTask : JavaExec(), CoroutinesJavaAgentAware, CustomPlatform */ @TaskAction override fun exec() { - workingDir = intelliJPlatform.singleFile - + assertPlatformVersion() configureClasspath() + workingDir = intelliJPlatform.singleFile + super.exec() } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/TestIdeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/TestIdeTask.kt index cc3113147e..0425228acd 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/TestIdeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/TestIdeTask.kt @@ -8,8 +8,6 @@ import org.gradle.api.tasks.UntrackedTask import org.gradle.api.tasks.testing.Test import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.IntelliJPlatformArgumentProvider -import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.LaunchSystemArgumentProvider import org.jetbrains.intellij.platform.gradleplugin.tasks.base.* import kotlin.io.path.absolutePathString @@ -31,12 +29,7 @@ abstract class TestIdeTask : Test(), CoroutinesJavaAgentAware, CustomPlatformVer @TaskAction override fun executeTests() { - jvmArgumentProviders.addAll( - listOf( - IntelliJPlatformArgumentProvider(intelliJPlatform, coroutinesJavaAgentFile, this), - LaunchSystemArgumentProvider(intelliJPlatform, sandboxDirectory, emptyList()), - ) - ) + assertPlatformVersion() super.executeTests() } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/UnbindSetupDependenciesTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/UnbindSetupDependenciesTask.kt deleted file mode 100644 index cacbc7e32b..0000000000 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/UnbindSetupDependenciesTask.kt +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. - -package org.jetbrains.intellij.platform.gradleplugin.tasks - -import org.gradle.api.DefaultTask -import org.gradle.api.provider.Property -import org.gradle.api.tasks.Internal -import org.gradle.api.tasks.TaskAction -import org.gradle.work.DisableCachingByDefault -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.dependency.IdeaDependency -import org.jetbrains.intellij.platform.gradleplugin.info -import org.jetbrains.intellij.platform.gradleplugin.logCategory - -/** - * Setups required dependencies for building and running project. - * - * This task is automatically added to the ["After Sync" Gradle trigger](https://www.jetbrains.com/help/idea/work-with-gradle-tasks.html#config_triggers_gradle) to make the IntelliJ SDK dependency available for IntelliJ IDEA right after the Gradle synchronization. - * - * > After removing the IntelliJ Platform Gradle Plugin from your project, the `Task 'setupDependencies' not found in root project` exception may occur. - * - * @see Frequently Asked Questions - */ -@DisableCachingByDefault(because = "No output state to track") -abstract class UnbindSetupDependenciesTask : DefaultTask() { - - /** - * Reference to the resolved `idea` dependency. - */ - @get:Internal - abstract val idea: Property - - private val context = logCategory() - - init { - group = PLUGIN_GROUP_NAME - description = "Sets up required dependencies for building and running project." - } - - @TaskAction - fun setupDependencies() { - info(context, "Setting up dependencies using: ${idea.get().classes}") - } -} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginConfigurationTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginConfigurationTask.kt index 5f3e3defe3..ff91f020ff 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginConfigurationTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginConfigurationTask.kt @@ -2,8 +2,6 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks -import com.jetbrains.plugin.structure.base.utils.exists -import com.jetbrains.plugin.structure.base.utils.listFiles import org.gradle.api.DefaultTask import org.gradle.api.JavaVersion import org.gradle.api.provider.ListProperty @@ -13,11 +11,10 @@ import org.gradle.api.tasks.* import org.gradle.api.tasks.compile.JavaCompile import org.jetbrains.intellij.platform.gradleplugin.* import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradleplugin.tasks.base.PlatformVersionAware import org.jetbrains.intellij.platform.gradleplugin.utils.PlatformJavaVersions import org.jetbrains.intellij.platform.gradleplugin.utils.PlatformKotlinVersions -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import java.io.File -import java.nio.file.Path import javax.inject.Inject /** @@ -44,7 +41,7 @@ import javax.inject.Inject @CacheableTask abstract class VerifyPluginConfigurationTask @Inject constructor( private val providers: ProviderFactory, -) : DefaultTask() { +) : DefaultTask(), PlatformVersionAware { /** * The location of the built plugin file which will be used for verification. @@ -55,18 +52,6 @@ abstract class VerifyPluginConfigurationTask @Inject constructor( @get:PathSensitive(PathSensitivity.RELATIVE) abstract val pluginXmlFiles: ListProperty - /** - * IntelliJ SDK platform version. - */ - @get:Internal - abstract val platformVersion: Property - - /** - * IntelliJ SDK platform build number. - */ - @get:Internal - abstract val platformBuild: Property - /** * [JavaCompile.sourceCompatibility] property defined in the build script. */ @@ -143,18 +128,20 @@ abstract class VerifyPluginConfigurationTask @Inject constructor( @TaskAction fun verifyPluginConfiguration() { - val platformVersion = platformVersion.get().let(Version::parse) - val platformBuildVersion = platformBuild.get().let(Version::parse) - val platformJavaVersion = platformBuildVersion.let(::getPlatformJavaVersion) + val platformJavaVersion = platformBuild.let(::getPlatformJavaVersion) val sourceCompatibilityJavaVersion = sourceCompatibility.get().let(JavaVersion::toVersion) val targetCompatibilityJavaVersion = targetCompatibility.get().let(JavaVersion::toVersion) val jvmTargetJavaVersion = kotlinJvmTarget.orNull?.let(JavaVersion::toVersion) val kotlinApiVersion = kotlinApiVersion.orNull?.let(Version::parse) + val kotlinIncrementalUseClasspathSnapshot = kotlinIncrementalUseClasspathSnapshot.orNull == null val kotlinLanguageVersion = kotlinLanguageVersion.orNull?.let(Version::parse) + val kotlinPluginAvailable = kotlinPluginAvailable.get() + val kotlinStdlibDefaultDependency = kotlinStdlibDefaultDependency.orNull == null val kotlinVersion = kotlinVersion.orNull?.let(Version::parse) - val platformKotlinLanguageVersion = platformBuildVersion.let(::getPlatformKotlinVersion)?.run { Version.parse("$major.$minor") } - val pluginVerifierDownloadPath = pluginVerifierDownloadDir.get().let(Path::of).toAbsolutePath() - val oldPluginVerifierDownloadPath = providers.systemProperty("user.home").map { "$it/.pluginVerifier/ides" }.get().let(Path::of).toAbsolutePath() + val kotlinxCoroutinesLibraryPresent = kotlinxCoroutinesLibraryPresent.get() + val platformKotlinLanguageVersion = platformBuild.let(::getPlatformKotlinVersion)?.run { Version.parse("$major.$minor") } +// val pluginVerifierDownloadPath = pluginVerifierDownloadDir.get().let(Path::of).toAbsolutePath() +// val oldPluginVerifierDownloadPath = providers.systemProperty("user.home").map { "$it/.pluginVerifier/ides" }.get().let(Path::of).toAbsolutePath() sequence { pluginXmlFiles.get() @@ -164,8 +151,8 @@ abstract class VerifyPluginConfigurationTask @Inject constructor( val sinceBuildJavaVersion = sinceBuild.let(::getPlatformJavaVersion) val sinceBuildKotlinApiVersion = sinceBuild.let(::getPlatformKotlinVersion)?.run { Version.parse("$major.$minor") } - if (sinceBuild.major < platformBuildVersion.major) { - yield("The 'since-build' property is lower than the target IntelliJ Platform major version: $sinceBuild < ${platformBuildVersion.major}.") + if (sinceBuild.major < platformBuild.major) { + yield("The 'since-build' property is lower than the target IntelliJ Platform major version: $sinceBuild < ${platformBuild.major}.") } if (sinceBuildJavaVersion < targetCompatibilityJavaVersion) { yield("The Java configuration specifies targetCompatibility=$targetCompatibilityJavaVersion but since-build='$sinceBuild' property requires targetCompatibility=$sinceBuildJavaVersion.") @@ -178,6 +165,9 @@ abstract class VerifyPluginConfigurationTask @Inject constructor( } } + if (platformBuild < Version(223)) { + yield("The minimal supported IntelliJ Platform version is 2022.3 (233.0), which is higher than provided: $platformVersion ($platformBuild)") + } if (platformJavaVersion > sourceCompatibilityJavaVersion) { yield("The Java configuration specifies sourceCompatibility=$sourceCompatibilityJavaVersion but IntelliJ Platform $platformVersion requires sourceCompatibility=$platformJavaVersion.") } @@ -190,13 +180,18 @@ abstract class VerifyPluginConfigurationTask @Inject constructor( if (platformJavaVersion < jvmTargetJavaVersion) { yield("The Kotlin configuration specifies jvmTarget=$jvmTargetJavaVersion but IntelliJ Platform $platformVersion requires jvmTarget=$platformJavaVersion.") } - if (kotlinPluginAvailable.get() && kotlinStdlibDefaultDependency.orNull == null) { + if (kotlinPluginAvailable && kotlinStdlibDefaultDependency) { yield("The dependency on the Kotlin Standard Library (stdlib) is automatically added when using the Gradle Kotlin plugin and may conflict with the version provided with the IntelliJ Platform, see: https://jb.gg/intellij-platform-kotlin-stdlib") } - if (kotlinPluginAvailable.get() && kotlinVersion >= Version(1, 8, 20) && kotlinVersion < Version(1, 9) && kotlinIncrementalUseClasspathSnapshot.orNull == null) { + if ( + kotlinPluginAvailable + && kotlinIncrementalUseClasspathSnapshot + && kotlinVersion >= Version(1, 8, 20) + && kotlinVersion < Version(1, 9) + ) { yield("The Kotlin plugin in version $kotlinVersion used with the IntelliJ Platform Gradle Plugin leads to the 'java.lang.OutOfMemoryError: Java heap space' exception, see: https://jb.gg/intellij-platform-kotlin-oom") } - if (kotlinxCoroutinesLibraryPresent.get()) { + if (kotlinxCoroutinesLibraryPresent) { yield("The Kotlin Coroutines library should not be added explicitly to the project as it is already provided with the IntelliJ Platform.") } }.joinToString("\n") { "- $it" }.takeIf(String::isNotEmpty)?.let { @@ -206,16 +201,16 @@ abstract class VerifyPluginConfigurationTask @Inject constructor( ) } - if ( - pluginVerifierDownloadPath != oldPluginVerifierDownloadPath - && oldPluginVerifierDownloadPath.exists() - && oldPluginVerifierDownloadPath.listFiles().isNotEmpty() - ) { - info( - context, - "The Plugin Verifier download directory is set to $pluginVerifierDownloadPath, but downloaded IDEs were also found in $oldPluginVerifierDownloadPath, see: https://jb.gg/intellij-platform-plugin-verifier-old-download-dir", - ) - } +// if ( +// pluginVerifierDownloadPath != oldPluginVerifierDownloadPath +// && oldPluginVerifierDownloadPath.exists() +// && oldPluginVerifierDownloadPath.listFiles().isNotEmpty() +// ) { +// info( +// context, +// "The Plugin Verifier download directory is set to $pluginVerifierDownloadPath, but downloaded IDEs were also found in $oldPluginVerifierDownloadPath, see: https://jb.gg/intellij-platform-plugin-verifier-old-download-dir", +// ) +// } } private fun getPlatformJavaVersion(buildNumber: Version) = PlatformJavaVersions.entries.firstOrNull { buildNumber >= it.key }?.value diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/PlatformVersionAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/PlatformVersionAware.kt index e83d3ab4d0..124128e211 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/PlatformVersionAware.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/PlatformVersionAware.kt @@ -2,13 +2,13 @@ package org.jetbrains.intellij.platform.gradleplugin.tasks.base -import com.jetbrains.plugin.structure.intellij.version.IdeVersion import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.tasks.InputFiles import org.gradle.api.tasks.Internal import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType +import org.jetbrains.intellij.platform.gradleplugin.Version import org.jetbrains.intellij.platform.gradleplugin.model.ProductInfo import org.jetbrains.intellij.platform.gradleplugin.model.productInfo @@ -27,14 +27,20 @@ interface PlatformVersionAware { get() = intelliJPlatformProductInfo.single().toPath().productInfo() @get:Internal - val platformBuild: IdeVersion - get() = IdeVersion.createIdeVersion(productInfo.buildNumber) + val platformBuild: Version + get() = Version.parse(productInfo.buildNumber) @get:Internal - val platformVersion: IdeVersion - get() = IdeVersion.createIdeVersion(productInfo.version) + val platformVersion: Version + get() = Version.parse(productInfo.version) @get:Internal val platformType: IntelliJPlatformType get() = IntelliJPlatformType.fromCode(productInfo.productCode) + + fun assertPlatformVersion() { + if (platformBuild < Version(223)) { + throw IllegalArgumentException("The minimal supported IntelliJ Platform version is 2022.3 (233.0), which is higher than provided: $platformVersion ($platformBuild)") + } + } } From b60edcc520a81f1c62fcd1fa798fa7cf04c088de Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 6 Nov 2023 15:35:21 +0100 Subject: [PATCH 036/347] `RepositoryHandler.intellijPlatform` helper function for `settings.gradle.kts` --- .../extensions/IntelliJPlatformRepositoriesExtension.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformRepositoriesExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformRepositoriesExtension.kt index d20bf456d2..d88f8d2611 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformRepositoriesExtension.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformRepositoriesExtension.kt @@ -2,10 +2,13 @@ package org.jetbrains.intellij.platform.gradleplugin.extensions +import org.gradle.api.Action import org.gradle.api.artifacts.dsl.RepositoryHandler import org.gradle.api.artifacts.repositories.MavenArtifactRepository +import org.gradle.api.plugins.ExtensionAware import org.gradle.api.provider.ProviderFactory import org.gradle.kotlin.dsl.maven +import org.gradle.kotlin.dsl.the import org.jetbrains.intellij.platform.gradleplugin.BuildFeature import javax.inject.Inject @@ -63,3 +66,6 @@ abstract class IntelliJPlatformRepositoriesExtension @Inject constructor( } } } + +fun RepositoryHandler.intellijPlatform(configure: Action) = + (this as ExtensionAware).the().apply(configure::execute) From ab9ef87425799e15a8c9436e82070d3dbc78fe1e Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 6 Nov 2023 15:36:16 +0100 Subject: [PATCH 037/347] IntelliJPlatformDependenciesExtension: add missing default values for `action` parameter --- .../IntelliJPlatformDependenciesExtension.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformDependenciesExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformDependenciesExtension.kt index aff91f0a68..31f6251f06 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformDependenciesExtension.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformDependenciesExtension.kt @@ -161,7 +161,7 @@ abstract class IntelliJPlatformDependenciesExtension @Inject constructor( version: Provider, channel: Provider, configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCIES, - action: DependencyAction, + action: DependencyAction = {}, ) = addIntelliJPlatformPlugin(id, version, channel, configurationName, action) fun plugin( @@ -169,19 +169,19 @@ abstract class IntelliJPlatformDependenciesExtension @Inject constructor( version: String, channel: String = "", configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCIES, - action: DependencyAction, + action: DependencyAction = {}, ) = plugin(providers.provider { id }, providers.provider { version }, providers.provider { channel }, configurationName, action) fun bundledPlugin( id: Provider, configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCIES, - action: DependencyAction, + action: DependencyAction = {}, ) = addIntelliJPlatformBundledPlugin(id, configurationName, action) fun bundledPlugin( id: String, configurationName: String = Configurations.INTELLIJ_PLATFORM_DEPENDENCIES, - action: DependencyAction, + action: DependencyAction = {}, ) = bundledPlugin(providers.provider { id }, configurationName, action) private fun addIntelliJPlatformDependency( @@ -309,7 +309,7 @@ abstract class IntelliJPlatformDependenciesExtension @Inject constructor( version: Provider, channel: Provider, configurationName: String, - action: DependencyAction, + action: DependencyAction = {}, ) = dependencies.addProvider( configurationName, providers.provider { @@ -330,7 +330,7 @@ abstract class IntelliJPlatformDependenciesExtension @Inject constructor( private fun addIntelliJPlatformBundledPlugin( id: Provider, configurationName: String, - action: DependencyAction, + action: DependencyAction = {}, ) = dependencies.addProvider( configurationName, id.map { From 97a2a881f3502e9a2ffe7da13651ae4e7b63a548 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 6 Nov 2023 20:26:08 +0100 Subject: [PATCH 038/347] Rename `org.jetbrains.intellij.platform.gradleplugin` package to `org.jetbrains.intellij.platform.gradle` --- CHANGELOG.md | 129 +++++++++++++++++- build.gradle.kts | 8 +- ...hingPluginBundledSourcesIntegrationTest.kt | 2 +- ...PluginSourcesFromIdeDistIntegrationTest.kt | 2 +- .../BuildFeaturesIntegrationTest.kt | 2 +- .../ClasspathInstrumentationTest.kt | 2 +- ...trumentationTaskDisabledIntegrationTest.kt | 2 +- .../InstrumentationTaskIntegrationTest.kt | 2 +- .../IntelliJPlatformIntegrationTestBase.kt | 2 +- .../JarManifestFileIntegrationTest.kt | 2 +- .../PluginXmlPatchingIntegrationTest.kt | 2 +- ...lasspathProjectResourcesIntegrationTest.kt | 2 +- .../ThrowingExceptionsIntegrationTest.kt | 2 +- ...erifyPluginConfigurationIntegrationTest.kt | 2 +- .../BuildException.kt | 2 +- .../{gradleplugin => gradle}/BuildFeature.kt | 4 +- .../IntelliJIvyDescriptorFileGenerator.kt | 6 +- .../IntelliJPlatformPluginLibrary.kt | 2 +- .../IntelliJPlatformType.kt | 2 +- .../IntelliJPluginConstants.kt | 2 +- .../IntelliJPluginExtension.kt | 14 +- .../{gradleplugin => gradle}/Version.kt | 2 +- .../transform/CollectorTransformer.kt | 8 +- .../transform/ExtractorTransformer.kt | 8 +- .../transform/ProductInfoTransformer.kt | 8 +- .../dependency/BuiltinPluginsRegistry.kt | 16 +-- .../dependency/CustomPluginsRepository.kt | 10 +- .../IdePluginSourceZipFilesProvider.kt | 2 +- .../dependency/IdeaDependency.kt | 8 +- .../dependency/IdeaDependencyManager.kt | 14 +- .../dependency/IdeaExtraDependency.kt | 4 +- .../dependency/IntellijIvyArtifact.kt | 2 +- .../dependency/JpsIdeaDependency.kt | 2 +- .../dependency/LocalIdeaDependency.kt | 2 +- .../dependency/MavenPluginsRepository.kt | 8 +- .../dependency/PluginDependency.kt | 2 +- .../dependency/PluginDependencyImpl.kt | 4 +- .../dependency/PluginDependencyManager.kt | 12 +- .../dependency/PluginDependencyNotation.kt | 4 +- .../dependency/PluginProjectDependency.kt | 4 +- .../dependency/PluginsRepository.kt | 2 +- .../PluginsRepositoryConfiguration.kt | 6 +- .../IntelliJPlatformDependenciesExtension.kt | 18 +-- .../extensions/IntelliJPlatformExtension.kt | 4 +- .../IntelliJPlatformRepositoriesExtension.kt | 4 +- .../extensions/extensions.kt | 2 +- .../jbr/JetBrainsRuntimeResolver.kt | 10 +- .../{gradleplugin => gradle}/memoize.kt | 2 +- .../model/AndroidStudioReleases.kt | 2 +- .../model/IvyModule.kt | 2 +- .../model/MavenMetadata.kt | 2 +- .../model/ObjectFactory.kt | 2 +- .../model/PerformanceTestResult.kt | 2 +- .../model/PerformanceTestScript.kt | 2 +- .../model/PerformanceTestStatistic.kt | 2 +- .../model/PluginsCache.kt | 2 +- .../model/ProductInfo.kt | 2 +- .../model/ProductsReleases.kt | 2 +- .../model/XmlExtractor.kt | 8 +- .../performanceTest/ProfilerName.kt | 2 +- .../TestExecutionFailException.kt | 2 +- .../performanceTest/parsers/IdeaLogParser.kt | 4 +- .../parsers/SimpleIJPerformanceParser.kt | 4 +- .../IntelliJPlatformAbstractProjectPlugin.kt | 26 ++-- .../plugins/IntelliJPlatformBasePlugin.kt | 28 ++-- .../plugins/IntelliJPlatformPlugin.kt | 112 +++++++-------- .../plugins/IntelliJPlatformSettingsPlugin.kt | 6 +- .../plugins/IntelliJPlatformTasksPlugin.kt | 24 ++-- .../plugins/plugins.kt | 2 +- .../IntelliJPlatformArgumentProvider.kt | 12 +- .../LaunchSystemArgumentProvider.kt | 10 +- .../PerformanceTestArgumentProvider.kt | 2 +- .../PluginPathArgumentProvider.kt | 6 +- .../tasks/BuildPluginTask.kt | 4 +- .../tasks/BuildSearchableOptionsTask.kt | 14 +- .../tasks/ClasspathIndexCleanupTask.kt | 10 +- ...loadAndroidStudioProductReleasesXmlTask.kt | 6 +- .../DownloadIdeaProductReleasesXmlTask.kt | 4 +- .../tasks/DownloadRobotServerPluginTask.kt | 18 +-- .../tasks/DownloadZipSignerTask.kt | 8 +- .../InitializeIntelliJPlatformPluginTask.kt | 14 +- .../tasks/InstrumentCodeTask.kt | 8 +- .../tasks/InstrumentedJarTask.kt | 4 +- .../tasks/JarSearchableOptionsTask.kt | 14 +- .../tasks/ListBundledPluginsTask.kt | 10 +- .../tasks/ListProductsReleasesTask.kt | 14 +- .../tasks/PatchPluginXmlTask.kt | 14 +- .../tasks/PrepareSandboxTask.kt | 12 +- .../tasks/PrintBundledPluginsTask.kt | 4 +- .../tasks/PrintProductsReleasesTask.kt | 4 +- .../tasks/PublishPluginTask.kt | 12 +- .../tasks/RunIdeForUiTestTask.kt | 6 +- .../tasks/RunIdePerformanceTestTask.kt | 24 ++-- .../tasks/RunIdeTask.kt | 12 +- .../tasks/RunPluginVerifierTask.kt | 26 ++-- .../tasks/SetupDependenciesTask.kt | 10 +- .../tasks/SignPluginTask.kt | 12 +- .../tasks/TestIdeTask.kt | 8 +- .../tasks/VerifyPluginConfigurationTask.kt | 12 +- .../tasks/VerifyPluginSignatureTask.kt | 12 +- .../tasks/VerifyPluginTask.kt | 12 +- .../tasks/base/CoroutinesJavaAgentAware.kt | 2 +- .../tasks/base/CustomPlatformVersionAware.kt | 4 +- .../tasks/base/JetBrainsRuntimeAware.kt | 2 +- .../tasks/base/PlatformVersionAware.kt | 10 +- .../tasks/base/RunIdeBase.kt | 6 +- .../tasks/base/SandboxAware.kt | 2 +- .../tasks/base/ZipSigningToolBase.kt | 12 +- .../{gradleplugin => gradle}/utils.kt | 8 +- .../utils/ArchiveUtils.kt | 4 +- .../utils/DependenciesDownloader.kt | 10 +- .../utils/LatestVersionResolver.kt | 8 +- .../utils/OpenedPackages.kt | 2 +- .../utils/PlatformJavaVersions.kt | 4 +- .../utils/PlatformKotlinVersions.kt | 4 +- ...oolboxEnterprisePluginRepositoryService.kt | 2 +- .../IntelliJPluginSpec.kt | 16 +-- .../IntelliJPluginSpecBase.kt | 4 +- .../SearchableOptionsSpecBase.kt | 6 +- .../{gradleplugin => gradle}/UtilsTest.kt | 4 +- .../{gradleplugin => gradle}/VersionTest.kt | 2 +- .../jbr/JbrResolverTest.kt | 4 +- .../parsers/IdeaLogParserTest.kt | 2 +- .../parsers/SimpleIJPerfParserTest.kt | 2 +- .../tasks/BuildPluginTaskSpec.kt | 8 +- .../tasks/BuildSearchableOptionsTaskSpec.kt | 6 +- .../tasks/DownloadIntelliJPluginsSpec.kt | 4 +- .../tasks/DownloadIntelliJSpec.kt | 4 +- .../DownloadRobotServerPluginTaskSpec.kt | 6 +- .../tasks/IntelliJInstrumentCodeTaskSpec.kt | 4 +- .../tasks/JarSearchableOptionsTaskSpec.kt | 6 +- .../tasks/ListBundledPluginsTaskSpec.kt | 4 +- .../tasks/ListProductsReleasesTaskSpec.kt | 10 +- .../tasks/PatchPluginXmlTaskSpec.kt | 8 +- .../tasks/PrepareSandboxTaskSpec.kt | 8 +- .../tasks/ProcessResourcesTaskSpec.kt | 4 +- .../tasks/PublishPluginTaskSpec.kt | 6 +- .../tasks/RunPluginVerifierTaskSpec.kt | 18 +-- .../tasks/SetupDependenciesTaskSpec.kt | 6 +- .../tasks/SignPluginTaskSpec.kt | 10 +- .../VerifyPluginConfigurationTaskSpec.kt | 6 +- .../tasks/VerifyPluginTaskSpec.kt | 6 +- .../test/localIdeTestUtils.kt | 4 +- .../IntelliJPlatformTestBase.kt | 2 +- 144 files changed, 656 insertions(+), 531 deletions(-) rename src/integrationTest/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/AttachingPluginBundledSourcesIntegrationTest.kt (93%) rename src/integrationTest/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/AttachingPluginSourcesFromIdeDistIntegrationTest.kt (93%) rename src/integrationTest/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/BuildFeaturesIntegrationTest.kt (98%) rename src/integrationTest/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/ClasspathInstrumentationTest.kt (98%) rename src/integrationTest/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/InstrumentationTaskDisabledIntegrationTest.kt (99%) rename src/integrationTest/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/InstrumentationTaskIntegrationTest.kt (98%) rename src/integrationTest/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/IntelliJPlatformIntegrationTestBase.kt (99%) rename src/integrationTest/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/JarManifestFileIntegrationTest.kt (93%) rename src/integrationTest/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/PluginXmlPatchingIntegrationTest.kt (92%) rename src/integrationTest/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/TestClasspathProjectResourcesIntegrationTest.kt (95%) rename src/integrationTest/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/ThrowingExceptionsIntegrationTest.kt (92%) rename src/integrationTest/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/VerifyPluginConfigurationIntegrationTest.kt (98%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/BuildException.kt (83%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/BuildFeature.kt (89%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/IntelliJIvyDescriptorFileGenerator.kt (95%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/IntelliJPlatformPluginLibrary.kt (84%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/IntelliJPlatformType.kt (97%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/IntelliJPluginConstants.kt (99%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/IntelliJPluginExtension.kt (94%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/Version.kt (97%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/artifacts/transform/CollectorTransformer.kt (89%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/artifacts/transform/ExtractorTransformer.kt (93%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/artifacts/transform/ProductInfoTransformer.kt (86%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/dependency/BuiltinPluginsRegistry.kt (90%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/dependency/CustomPluginsRepository.kt (85%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/dependency/IdePluginSourceZipFilesProvider.kt (94%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/dependency/IdeaDependency.kt (92%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/dependency/IdeaDependencyManager.kt (97%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/dependency/IdeaExtraDependency.kt (87%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/dependency/IntellijIvyArtifact.kt (97%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/dependency/JpsIdeaDependency.kt (90%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/dependency/LocalIdeaDependency.kt (91%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/dependency/MavenPluginsRepository.kt (90%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/dependency/PluginDependency.kt (93%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/dependency/PluginDependencyImpl.kt (96%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/dependency/PluginDependencyManager.kt (94%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/dependency/PluginDependencyNotation.kt (93%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/dependency/PluginProjectDependency.kt (95%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/dependency/PluginsRepository.kt (84%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/dependency/PluginsRepositoryConfiguration.kt (84%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/extensions/IntelliJPlatformDependenciesExtension.kt (96%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/extensions/IntelliJPlatformExtension.kt (98%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/extensions/IntelliJPlatformRepositoriesExtension.kt (95%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/extensions/extensions.kt (71%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/jbr/JetBrainsRuntimeResolver.kt (92%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/memoize.kt (96%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/model/AndroidStudioReleases.kt (95%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/model/IvyModule.kt (96%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/model/MavenMetadata.kt (93%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/model/ObjectFactory.kt (89%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/model/PerformanceTestResult.kt (82%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/model/PerformanceTestScript.kt (94%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/model/PerformanceTestStatistic.kt (92%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/model/PluginsCache.kt (93%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/model/ProductInfo.kt (98%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/model/ProductsReleases.kt (97%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/model/XmlExtractor.kt (84%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/performanceTest/ProfilerName.kt (71%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/performanceTest/TestExecutionFailException.kt (74%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/performanceTest/parsers/IdeaLogParser.kt (86%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/performanceTest/parsers/SimpleIJPerformanceParser.kt (91%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/plugins/IntelliJPlatformAbstractProjectPlugin.kt (86%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/plugins/IntelliJPlatformBasePlugin.kt (85%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/plugins/IntelliJPlatformPlugin.kt (92%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/plugins/IntelliJPlatformSettingsPlugin.kt (73%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/plugins/IntelliJPlatformTasksPlugin.kt (95%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/plugins/plugins.kt (89%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/propertyProviders/IntelliJPlatformArgumentProvider.kt (86%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/propertyProviders/LaunchSystemArgumentProvider.kt (83%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/propertyProviders/PerformanceTestArgumentProvider.kt (95%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/propertyProviders/PluginPathArgumentProvider.kt (80%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/BuildPluginTask.kt (78%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/BuildSearchableOptionsTask.kt (85%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/ClasspathIndexCleanupTask.kt (81%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt (78%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/DownloadIdeaProductReleasesXmlTask.kt (82%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/DownloadRobotServerPluginTask.kt (82%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/DownloadZipSignerTask.kt (89%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/InitializeIntelliJPlatformPluginTask.kt (84%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/InstrumentCodeTask.kt (97%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/InstrumentedJarTask.kt (75%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/JarSearchableOptionsTask.kt (86%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/ListBundledPluginsTask.kt (84%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/ListProductsReleasesTask.kt (94%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/PatchPluginXmlTask.kt (92%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/PrepareSandboxTask.kt (92%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/PrintBundledPluginsTask.kt (85%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/PrintProductsReleasesTask.kt (85%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/PublishPluginTask.kt (92%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/RunIdeForUiTestTask.kt (76%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/RunIdePerformanceTestTask.kt (81%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/RunIdeTask.kt (85%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/RunPluginVerifierTask.kt (95%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/SetupDependenciesTask.kt (82%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/SignPluginTask.kt (94%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/TestIdeTask.kt (80%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/VerifyPluginConfigurationTask.kt (96%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/VerifyPluginSignatureTask.kt (84%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/VerifyPluginTask.kt (89%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/base/CoroutinesJavaAgentAware.kt (85%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/base/CustomPlatformVersionAware.kt (81%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/base/JetBrainsRuntimeAware.kt (91%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/base/PlatformVersionAware.kt (80%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/base/RunIdeBase.kt (97%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/base/SandboxAware.kt (87%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/base/ZipSigningToolBase.kt (90%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/utils.kt (96%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/utils/ArchiveUtils.kt (94%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/utils/DependenciesDownloader.kt (93%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/utils/LatestVersionResolver.kt (82%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/utils/OpenedPackages.kt (98%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/utils/PlatformJavaVersions.kt (81%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/utils/PlatformKotlinVersions.kt (87%) rename src/main/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/utils/ToolboxEnterprisePluginRepositoryService.kt (94%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/IntelliJPluginSpec.kt (97%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/IntelliJPluginSpecBase.kt (98%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/SearchableOptionsSpecBase.kt (90%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/UtilsTest.kt (87%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/VersionTest.kt (97%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/jbr/JbrResolverTest.kt (94%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/performanceTest/parsers/IdeaLogParserTest.kt (91%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/performanceTest/parsers/SimpleIJPerfParserTest.kt (95%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/BuildPluginTaskSpec.kt (97%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/BuildSearchableOptionsTaskSpec.kt (87%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/DownloadIntelliJPluginsSpec.kt (98%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/DownloadIntelliJSpec.kt (97%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/DownloadRobotServerPluginTaskSpec.kt (94%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/IntelliJInstrumentCodeTaskSpec.kt (96%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/JarSearchableOptionsTaskSpec.kt (85%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/ListBundledPluginsTaskSpec.kt (95%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/ListProductsReleasesTaskSpec.kt (94%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/PatchPluginXmlTaskSpec.kt (97%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/PrepareSandboxTaskSpec.kt (98%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/ProcessResourcesTaskSpec.kt (94%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/PublishPluginTaskSpec.kt (82%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/RunPluginVerifierTaskSpec.kt (95%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/SetupDependenciesTaskSpec.kt (83%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/SignPluginTaskSpec.kt (95%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/VerifyPluginConfigurationTaskSpec.kt (97%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/tasks/VerifyPluginTaskSpec.kt (96%) rename src/test/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/test/localIdeTestUtils.kt (93%) rename src/testFixtures/kotlin/org/jetbrains/intellij/platform/{gradleplugin => gradle}/IntelliJPlatformTestBase.kt (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 273918335d..eeb27d806b 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ - New project name: IntelliJ Platform Gradle Plugin - New project ID: `org.jetbrains.intellij.platform` - New Maven coordinates: `org.jetbrains.intellij.platform:intellij-platform-gradle-plugin` -- Move classes under the new package: `org.jetbrains.intellij.platform.gradleplugin` +- Move classes under the new package: `org.jetbrains.intellij.platform.gradle` - Update minimal supported Gradle version to `8.0` ## [1.16.0] - 2023-10-06 @@ -40,6 +40,7 @@ - Deprecate `SetupDependenciesTask` ### Removed + - Removed `intellij`, `intellijPlugin`, `intellijPlugins`, `intellijExtra` helper methods from `DependenciesUtils` ## [1.15.0] - 2023-07-07 @@ -859,7 +860,7 @@ - added JPS-type for intellij dependency (fixes [#106](../../issues/106)) - patchXml action is reimplemented, now it's possible to freely customize input files, destination directory, since/until builds, plugin description and version - publishTask is reimplemented, now it's possible to set several channels to upload (fixes [#117](../../issues/117)) -- +- - it's possible to reuse reimplemented tasks in client's code - it's allowed to run tasks without plugin.xml - tasks are configured before project evaluation, `project.afterEvaluate` is not require anymore @@ -948,127 +949,251 @@ - Support for attaching IntelliJ sources in IDEA [next]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.16.0...HEAD + [1.16.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.15.0...v1.16.0 + [1.15.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.14.2...v1.15.0 + [1.14.2]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.14.1...v1.14.2 + [1.14.1]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.14.0...v1.14.1 + [1.14.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.13.3...v1.14.0 + [1.13.3]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.13.2...v1.13.3 + [1.13.2]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.13.1...v1.13.2 + [1.13.1]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.13.0...v1.13.1 + [1.13.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.12.0...v1.13.0 + [1.12.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.11.0...v1.12.0 + [1.11.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.10.2...v1.11.0 + [1.10.2]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.10.1...v1.10.2 + [1.10.1]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.10.0...v1.10.1 + [1.10.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.9.0...v1.10.0 + [1.9.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.8.1...v1.9.0 + [1.8.1]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.8.0...v1.8.1 + [1.8.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.7.0...v1.8.0 + [1.7.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.6.0...v1.7.0 + [1.6.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.5.3...v1.6.0 + [1.5.3]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.5.2...v1.5.3 + [1.5.2]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.5.1...v1.5.2 + [1.5.1]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.5.0...v1.5.1 + [1.5.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.4.0...v1.5.0 + [1.4.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.3.1...v1.4.0 + [1.3.1]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.3.0...v1.3.1 + [1.3.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.2.1...v1.3.0 + [1.2.1]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.2.0...v1.2.1 + [1.2.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.1.6...v1.2.0 + [1.1.6]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.1.5...v1.1.6 + [1.1.5]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.1.4...v1.1.5 + [1.1.4]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.1.3...v1.1.4 + [1.1.3]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.1.2...v1.1.3 + [1.1.2]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v1.0.0...v1.1.2 + [1.0.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.7.3...v1.0.0 + [0.7.3]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.7.2...v0.7.3 + [0.7.2]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.7.1...v0.7.2 + [0.7.1]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.7.0...v0.7.1 + [0.7.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.6.5...v0.7.0 + [0.6.5]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.6.4...v0.6.5 + [0.6.4]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.6.3...v0.6.4 + [0.6.3]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.6.2...v0.6.3 + [0.6.2]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.6.1...v0.6.2 + [0.6.1]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.6.0...v0.6.1 + [0.6.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.5.1...v0.6.0 + [0.5.1]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.5.0...v0.5.1 + [0.5.0]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.26...v0.5.0 + [0.4.26]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.25...v0.4.26 + [0.4.25]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.24...v0.4.25 + [0.4.24]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.23...v0.4.24 + [0.4.23]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.22...v0.4.23 + [0.4.22]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.21...v0.4.22 + [0.4.21]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.20...v0.4.21 + [0.4.20]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.19...v0.4.20 + [0.4.19]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.18...v0.4.19 + [0.4.18]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.17...v0.4.18 + [0.4.17]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.16...v0.4.17 + [0.4.16]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.15...v0.4.16 + [0.4.15]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.14...v0.4.15 + [0.4.14]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.13...v0.4.14 + [0.4.13]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.12...v0.4.13 + [0.4.12]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.11...v0.4.12 + [0.4.11]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.10...v0.4.11 + [0.4.10]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.9...v0.4.10 + [0.4.9]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.8...v0.4.9 + [0.4.8]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.7...v0.4.8 + [0.4.7]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.6...v0.4.7 + [0.4.6]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.5...v0.4.6 + [0.4.5]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.4...v0.4.5 + [0.4.4]: https://github.com/JetBrains/gradle-intellij-plugin/compare/v0.4.3...v0.4.4 + [0.4.3]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.4.2]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.4.1]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.4.0]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.3.12]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.3.11]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.3.10]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.3.7]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.3.6]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.3.5]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.3.4]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.3.3]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.3.2]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.3.1]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.3.0]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.20]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.19]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.18]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.17]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.16]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.15]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.14]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.13]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.12]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.11]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.10]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.9]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.8]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.7]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.6]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.5]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.4]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.3]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.2]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.1]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.2.0]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.1.10]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.1.9]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.1.6]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.1.4]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.1.0]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.0.41]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.0.39]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.0.37]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.0.35]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.0.34]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.0.33]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.0.32]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.0.30]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.0.29]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.0.28]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.0.27]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.0.25]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.0.21]: https://github.com/JetBrains/gradle-intellij-plugin/commits + [0.0.10]: https://github.com/JetBrains/gradle-intellij-plugin/commits diff --git a/build.gradle.kts b/build.gradle.kts index 996d961e17..49be54b991 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -217,7 +217,7 @@ gradlePlugin { plugins.create("intellijPlugin") { id = "org.jetbrains.intellij.platform" displayName = "IntelliJ Platform Gradle Plugin" - implementationClass = "org.jetbrains.intellij.platform.gradleplugin.plugins.IntelliJPlatformPlugin" + implementationClass = "org.jetbrains.intellij.platform.gradle.plugins.IntelliJPlatformPlugin" description = project.description tags.set(properties("tags").map { it.split(',') }) } @@ -225,7 +225,7 @@ gradlePlugin { plugins.create("intellijPluginBase") { id = "org.jetbrains.intellij.platform.base" displayName = "IntelliJ Platform Gradle Plugin (base)" - implementationClass = "org.jetbrains.intellij.platform.gradleplugin.plugins.IntelliJPlatformBasePlugin" + implementationClass = "org.jetbrains.intellij.platform.gradle.plugins.IntelliJPlatformBasePlugin" description = project.description tags.set(properties("tags").map { it.split(',') }) } @@ -233,7 +233,7 @@ gradlePlugin { plugins.create("intellijPluginSettings") { id = "org.jetbrains.intellij.platform.settings" displayName = "IntelliJ Platform Gradle Plugin (settings)" - implementationClass = "org.jetbrains.intellij.platform.gradleplugin.plugins.IntelliJPlatformSettingsPlugin" + implementationClass = "org.jetbrains.intellij.platform.gradle.plugins.IntelliJPlatformSettingsPlugin" description = project.description tags.set(properties("tags").map { it.split(',') }) } @@ -241,7 +241,7 @@ gradlePlugin { plugins.create("intellijPluginTasks") { id = "org.jetbrains.intellij.platform.tasks" displayName = "IntelliJ Platform Gradle Plugin (tasks)" - implementationClass = "org.jetbrains.intellij.platform.gradleplugin.plugins.IntelliJPlatformTasksPlugin" + implementationClass = "org.jetbrains.intellij.platform.gradle.plugins.IntelliJPlatformTasksPlugin" description = project.description tags.set(properties("tags").map { it.split(',') }) } diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/AttachingPluginBundledSourcesIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/AttachingPluginBundledSourcesIntegrationTest.kt similarity index 93% rename from src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/AttachingPluginBundledSourcesIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/AttachingPluginBundledSourcesIntegrationTest.kt index fed38b8e0d..b56b08d327 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/AttachingPluginBundledSourcesIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/AttachingPluginBundledSourcesIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/AttachingPluginSourcesFromIdeDistIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/AttachingPluginSourcesFromIdeDistIntegrationTest.kt similarity index 93% rename from src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/AttachingPluginSourcesFromIdeDistIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/AttachingPluginSourcesFromIdeDistIntegrationTest.kt index 276a255e21..1402bb0087 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/AttachingPluginSourcesFromIdeDistIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/AttachingPluginSourcesFromIdeDistIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeaturesIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/BuildFeaturesIntegrationTest.kt similarity index 98% rename from src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeaturesIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/BuildFeaturesIntegrationTest.kt index 3d9fb8ef54..15bea2cf46 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeaturesIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/BuildFeaturesIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import java.nio.file.Files import kotlin.test.Ignore diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/ClasspathInstrumentationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/ClasspathInstrumentationTest.kt similarity index 98% rename from src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/ClasspathInstrumentationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/ClasspathInstrumentationTest.kt index c2678f9469..70eb574908 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/ClasspathInstrumentationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/ClasspathInstrumentationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import java.nio.file.Files import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/InstrumentationTaskDisabledIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/InstrumentationTaskDisabledIntegrationTest.kt similarity index 99% rename from src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/InstrumentationTaskDisabledIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/InstrumentationTaskDisabledIntegrationTest.kt index a875f5704b..9bfc0dceda 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/InstrumentationTaskDisabledIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/InstrumentationTaskDisabledIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import java.nio.file.Files import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/InstrumentationTaskIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/InstrumentationTaskIntegrationTest.kt similarity index 98% rename from src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/InstrumentationTaskIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/InstrumentationTaskIntegrationTest.kt index 0b22567b62..739b651a65 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/InstrumentationTaskIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/InstrumentationTaskIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import java.nio.file.Files import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformIntegrationTestBase.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformIntegrationTestBase.kt similarity index 99% rename from src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformIntegrationTestBase.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformIntegrationTestBase.kt index 91b0f97792..1e5daa1b25 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformIntegrationTestBase.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformIntegrationTestBase.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import java.nio.file.FileSystems import java.nio.file.Files diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/JarManifestFileIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/JarManifestFileIntegrationTest.kt similarity index 93% rename from src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/JarManifestFileIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/JarManifestFileIntegrationTest.kt index 56cc38db8c..67f5bd6acc 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/JarManifestFileIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/JarManifestFileIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/PluginXmlPatchingIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/PluginXmlPatchingIntegrationTest.kt similarity index 92% rename from src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/PluginXmlPatchingIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/PluginXmlPatchingIntegrationTest.kt index b01f03dcd4..feffc13589 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/PluginXmlPatchingIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/PluginXmlPatchingIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/TestClasspathProjectResourcesIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/TestClasspathProjectResourcesIntegrationTest.kt similarity index 95% rename from src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/TestClasspathProjectResourcesIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/TestClasspathProjectResourcesIntegrationTest.kt index cdc5eb1842..b45fc37b1a 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/TestClasspathProjectResourcesIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/TestClasspathProjectResourcesIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import java.io.File import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/ThrowingExceptionsIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/ThrowingExceptionsIntegrationTest.kt similarity index 92% rename from src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/ThrowingExceptionsIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/ThrowingExceptionsIntegrationTest.kt index 016b6576c8..908dc84f1b 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/ThrowingExceptionsIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/ThrowingExceptionsIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import kotlin.test.Test diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/VerifyPluginConfigurationIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/VerifyPluginConfigurationIntegrationTest.kt similarity index 98% rename from src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/VerifyPluginConfigurationIntegrationTest.kt rename to src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/VerifyPluginConfigurationIntegrationTest.kt index c72d6bb641..80d4bd999a 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradleplugin/VerifyPluginConfigurationIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/VerifyPluginConfigurationIntegrationTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import java.nio.file.Files import kotlin.test.Ignore diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildException.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/BuildException.kt similarity index 83% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildException.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/BuildException.kt index 399d8a535a..55b26aa38c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildException.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/BuildException.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import org.gradle.tooling.BuildException diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeature.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/BuildFeature.kt similarity index 89% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeature.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/BuildFeature.kt index d2e481cf09..11165c421f 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/BuildFeature.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/BuildFeature.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import org.gradle.api.Project import org.gradle.api.provider.ProviderFactory -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_ID as prefix +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_ID as prefix enum class BuildFeature(private val defaultValue: Boolean) { NO_SEARCHABLE_OPTIONS_WARNING(true), diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJIvyDescriptorFileGenerator.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJIvyDescriptorFileGenerator.kt similarity index 95% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJIvyDescriptorFileGenerator.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJIvyDescriptorFileGenerator.kt index 8c4e20e456..e15035e87b 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJIvyDescriptorFileGenerator.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJIvyDescriptorFileGenerator.kt @@ -1,14 +1,14 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import org.gradle.api.publish.ivy.IvyArtifact import org.gradle.api.publish.ivy.IvyConfiguration import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration import org.gradle.internal.xml.SimpleXmlWriter import org.gradle.internal.xml.XmlTransformer -import org.jetbrains.intellij.platform.gradleplugin.dependency.IntellijIvyArtifact -import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginDependency +import org.jetbrains.intellij.platform.gradle.dependency.IntellijIvyArtifact +import org.jetbrains.intellij.platform.gradle.dependency.PluginDependency import java.io.File import java.io.IOException import java.io.UncheckedIOException diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformPluginLibrary.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformPluginLibrary.kt similarity index 84% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformPluginLibrary.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformPluginLibrary.kt index fdf4ce2167..44daa9c40c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformPluginLibrary.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformPluginLibrary.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import org.gradle.api.component.SoftwareComponent diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformType.kt similarity index 97% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformType.kt index e5ed78b7fb..f63628f274 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformType.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformType.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import org.gradle.api.GradleException diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginConstants.kt similarity index 99% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginConstants.kt index c53243d5fc..919763b83f 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginConstants.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import org.gradle.api.attributes.Attribute diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginExtension.kt similarity index 94% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginExtension.kt index e259d09715..b2ce10c007 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginExtension.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginExtension.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import org.gradle.api.Action import org.gradle.api.Project @@ -9,12 +9,12 @@ import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.api.provider.Provider import org.gradle.kotlin.dsl.newInstance -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.IntellijIdeaCommunity -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PLUGINS_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.dependency.IdeaDependency -import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginDependency -import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginsRepositoryConfiguration -import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader +import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType.IntellijIdeaCommunity +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.IDEA_PLUGINS_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradle.dependency.IdeaDependency +import org.jetbrains.intellij.platform.gradle.dependency.PluginDependency +import org.jetbrains.intellij.platform.gradle.dependency.PluginsRepositoryConfiguration +import org.jetbrains.intellij.platform.gradle.utils.DependenciesDownloader import javax.inject.Inject /** diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/Version.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/Version.kt similarity index 97% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/Version.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/Version.kt index d3db0bbc0f..695f8fa90a 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/Version.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/Version.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle class Version( val major: Int = 0, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/CollectorTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/artifacts/transform/CollectorTransformer.kt similarity index 89% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/CollectorTransformer.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/artifacts/transform/CollectorTransformer.kt index e09fdad241..62bdac8473 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/CollectorTransformer.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/artifacts/transform/CollectorTransformer.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.artifacts.transform +package org.jetbrains.intellij.platform.gradle.artifacts.transform import org.gradle.api.artifacts.Configuration import org.gradle.api.artifacts.dsl.DependencyHandler @@ -15,9 +15,9 @@ import org.gradle.api.provider.Provider import org.gradle.api.tasks.Classpath import org.gradle.kotlin.dsl.registerTransform import org.gradle.work.DisableCachingByDefault -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes -import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.collectIntelliJPlatformDependencyJars +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Configurations.Attributes +import org.jetbrains.intellij.platform.gradle.asPath +import org.jetbrains.intellij.platform.gradle.collectIntelliJPlatformDependencyJars import kotlin.io.path.forEachDirectoryEntry import kotlin.io.path.listDirectoryEntries import kotlin.io.path.name diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ExtractorTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/artifacts/transform/ExtractorTransformer.kt similarity index 93% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ExtractorTransformer.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/artifacts/transform/ExtractorTransformer.kt index c9d2afbf66..2302612526 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ExtractorTransformer.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/artifacts/transform/ExtractorTransformer.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.artifacts.transform +package org.jetbrains.intellij.platform.gradle.artifacts.transform import org.gradle.api.artifacts.Configuration import org.gradle.api.artifacts.dsl.DependencyHandler @@ -18,9 +18,9 @@ import org.gradle.api.tasks.Classpath import org.gradle.api.tasks.Internal import org.gradle.kotlin.dsl.registerTransform import org.gradle.work.DisableCachingByDefault -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes -import org.jetbrains.intellij.platform.gradleplugin.asPath +import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Configurations.Attributes +import org.jetbrains.intellij.platform.gradle.asPath import java.io.File.separator import javax.inject.Inject import kotlin.io.path.name diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ProductInfoTransformer.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/artifacts/transform/ProductInfoTransformer.kt similarity index 86% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ProductInfoTransformer.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/artifacts/transform/ProductInfoTransformer.kt index 824262f6bb..e75beb5e8e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/artifacts/transform/ProductInfoTransformer.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/artifacts/transform/ProductInfoTransformer.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.artifacts.transform +package org.jetbrains.intellij.platform.gradle.artifacts.transform import org.gradle.api.artifacts.dsl.DependencyHandler import org.gradle.api.artifacts.transform.InputArtifact @@ -14,9 +14,9 @@ import org.gradle.api.provider.Provider import org.gradle.api.tasks.Classpath import org.gradle.kotlin.dsl.registerTransform import org.gradle.work.DisableCachingByDefault -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes -import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.model.resolveProductInfoPath +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Configurations.Attributes +import org.jetbrains.intellij.platform.gradle.asPath +import org.jetbrains.intellij.platform.gradle.model.resolveProductInfoPath @DisableCachingByDefault(because = "Not worth caching") abstract class ProductInfoTransformer : TransformAction { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/BuiltinPluginsRegistry.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/BuiltinPluginsRegistry.kt similarity index 90% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/BuiltinPluginsRegistry.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/BuiltinPluginsRegistry.kt index be36f7aa17..35256fee21 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/BuiltinPluginsRegistry.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/BuiltinPluginsRegistry.kt @@ -1,17 +1,17 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.dependency +package org.jetbrains.intellij.platform.gradle.dependency import com.jetbrains.plugin.structure.base.utils.exists import com.jetbrains.plugin.structure.base.utils.listFiles import org.gradle.api.GradleException -import org.jetbrains.intellij.platform.gradleplugin.createPlugin -import org.jetbrains.intellij.platform.gradleplugin.debug -import org.jetbrains.intellij.platform.gradleplugin.model.PluginsCache -import org.jetbrains.intellij.platform.gradleplugin.model.PluginsCachePlugin -import org.jetbrains.intellij.platform.gradleplugin.model.XmlExtractor -import org.jetbrains.intellij.platform.gradleplugin.model.productInfo -import org.jetbrains.intellij.platform.gradleplugin.warn +import org.jetbrains.intellij.platform.gradle.createPlugin +import org.jetbrains.intellij.platform.gradle.debug +import org.jetbrains.intellij.platform.gradle.model.PluginsCache +import org.jetbrains.intellij.platform.gradle.model.PluginsCachePlugin +import org.jetbrains.intellij.platform.gradle.model.XmlExtractor +import org.jetbrains.intellij.platform.gradle.model.productInfo +import org.jetbrains.intellij.platform.gradle.warn import java.io.File import java.io.Serializable import java.nio.file.Path diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/CustomPluginsRepository.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/CustomPluginsRepository.kt similarity index 85% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/CustomPluginsRepository.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/CustomPluginsRepository.kt index 15682eec05..53c92176f5 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/CustomPluginsRepository.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/CustomPluginsRepository.kt @@ -1,15 +1,15 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.dependency +package org.jetbrains.intellij.platform.gradle.dependency import com.jetbrains.plugin.structure.intellij.repository.CustomPluginRepositoryListingParser import com.jetbrains.plugin.structure.intellij.repository.CustomPluginRepositoryListingType import org.gradle.api.Project import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.platform.gradleplugin.debug -import org.jetbrains.intellij.platform.gradleplugin.resolveRedirection -import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader -import org.jetbrains.intellij.platform.gradleplugin.utils.ivyRepository +import org.jetbrains.intellij.platform.gradle.debug +import org.jetbrains.intellij.platform.gradle.resolveRedirection +import org.jetbrains.intellij.platform.gradle.utils.DependenciesDownloader +import org.jetbrains.intellij.platform.gradle.utils.ivyRepository import java.io.File import java.net.URL diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdePluginSourceZipFilesProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/IdePluginSourceZipFilesProvider.kt similarity index 94% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdePluginSourceZipFilesProvider.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/IdePluginSourceZipFilesProvider.kt index cbb5bf9900..d417e9daac 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdePluginSourceZipFilesProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/IdePluginSourceZipFilesProvider.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.dependency +package org.jetbrains.intellij.platform.gradle.dependency import java.nio.file.Path import kotlin.io.path.name diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependency.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/IdeaDependency.kt similarity index 92% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependency.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/IdeaDependency.kt index bfbe8a9e75..e359812568 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependency.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/IdeaDependency.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.dependency +package org.jetbrains.intellij.platform.gradle.dependency -import org.jetbrains.intellij.platform.gradleplugin.collectJars -import org.jetbrains.intellij.platform.gradleplugin.collectZips -import org.jetbrains.intellij.platform.gradleplugin.isKotlinRuntime +import org.jetbrains.intellij.platform.gradle.collectJars +import org.jetbrains.intellij.platform.gradle.collectZips +import org.jetbrains.intellij.platform.gradle.isKotlinRuntime import java.io.File import java.io.Serializable import kotlin.io.path.isDirectory diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/IdeaDependencyManager.kt similarity index 97% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/IdeaDependencyManager.kt index 50b04c021c..ba34b0cc83 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaDependencyManager.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/IdeaDependencyManager.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.dependency +package org.jetbrains.intellij.platform.gradle.dependency import com.jetbrains.plugin.structure.base.utils.* import org.gradle.api.GradleException @@ -11,12 +11,12 @@ import org.gradle.api.plugins.JavaPlugin import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration import org.gradle.internal.os.OperatingSystem import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT -import org.jetbrains.intellij.platform.gradleplugin.model.productInfo -import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils -import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader +import org.jetbrains.intellij.platform.gradle.* +import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType.* +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT +import org.jetbrains.intellij.platform.gradle.model.productInfo +import org.jetbrains.intellij.platform.gradle.utils.ArchiveUtils +import org.jetbrains.intellij.platform.gradle.utils.DependenciesDownloader import java.io.File import java.nio.file.Files import java.nio.file.Path diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaExtraDependency.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/IdeaExtraDependency.kt similarity index 87% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaExtraDependency.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/IdeaExtraDependency.kt index 6486b400c8..ef6a1e999b 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IdeaExtraDependency.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/IdeaExtraDependency.kt @@ -1,8 +1,8 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.dependency +package org.jetbrains.intellij.platform.gradle.dependency -import org.jetbrains.intellij.platform.gradleplugin.collectJars +import org.jetbrains.intellij.platform.gradle.collectJars import java.io.File class IdeaExtraDependency(val name: String, val classes: File) { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IntellijIvyArtifact.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/IntellijIvyArtifact.kt similarity index 97% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IntellijIvyArtifact.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/IntellijIvyArtifact.kt index 531a211b51..3dc2c61fcd 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/IntellijIvyArtifact.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/IntellijIvyArtifact.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.dependency +package org.jetbrains.intellij.platform.gradle.dependency import org.gradle.api.internal.tasks.DefaultTaskDependency import org.gradle.api.publish.ivy.IvyArtifact diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/JpsIdeaDependency.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/JpsIdeaDependency.kt similarity index 90% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/JpsIdeaDependency.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/JpsIdeaDependency.kt index 8c25a7f207..6df0ab0037 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/JpsIdeaDependency.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/JpsIdeaDependency.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.dependency +package org.jetbrains.intellij.platform.gradle.dependency import java.io.File diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/LocalIdeaDependency.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/LocalIdeaDependency.kt similarity index 91% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/LocalIdeaDependency.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/LocalIdeaDependency.kt index 844202ae9c..db434bcff4 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/LocalIdeaDependency.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/LocalIdeaDependency.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.dependency +package org.jetbrains.intellij.platform.gradle.dependency import java.io.File diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/MavenPluginsRepository.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/MavenPluginsRepository.kt similarity index 90% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/MavenPluginsRepository.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/MavenPluginsRepository.kt index 11cb959855..0ab9e103fd 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/MavenPluginsRepository.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/MavenPluginsRepository.kt @@ -1,14 +1,14 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.dependency +package org.jetbrains.intellij.platform.gradle.dependency import org.gradle.api.Action import org.gradle.api.Project import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.repositories.MavenArtifactRepository -import org.jetbrains.intellij.platform.gradleplugin.debug -import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader -import org.jetbrains.intellij.platform.gradleplugin.utils.mavenRepository +import org.jetbrains.intellij.platform.gradle.debug +import org.jetbrains.intellij.platform.gradle.utils.DependenciesDownloader +import org.jetbrains.intellij.platform.gradle.utils.mavenRepository import java.io.File interface MavenRepository : PluginsRepository { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependency.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginDependency.kt similarity index 93% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependency.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginDependency.kt index 211da0771c..65226df544 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependency.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginDependency.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.dependency +package org.jetbrains.intellij.platform.gradle.dependency import com.jetbrains.plugin.structure.intellij.version.IdeVersion import java.io.File diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyImpl.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginDependencyImpl.kt similarity index 96% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyImpl.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginDependencyImpl.kt index 52291f9a92..40bb250701 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyImpl.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginDependencyImpl.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.dependency +package org.jetbrains.intellij.platform.gradle.dependency import com.jetbrains.plugin.structure.base.utils.isJar import com.jetbrains.plugin.structure.intellij.version.IdeVersion -import org.jetbrains.intellij.platform.gradleplugin.collectJars +import org.jetbrains.intellij.platform.gradle.collectJars import java.io.File class PluginDependencyImpl( diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyManager.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginDependencyManager.kt similarity index 94% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyManager.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginDependencyManager.kt index 19251ce160..e15eea551b 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyManager.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginDependencyManager.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.dependency +package org.jetbrains.intellij.platform.gradle.dependency import com.jetbrains.plugin.structure.base.utils.* import org.gradle.api.Project @@ -10,11 +10,11 @@ import org.gradle.api.provider.Provider import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration import org.gradle.kotlin.dsl.create import org.gradle.tooling.BuildException -import org.jetbrains.intellij.platform.gradleplugin.IntelliJIvyDescriptorFileGenerator -import org.jetbrains.intellij.platform.gradleplugin.createPlugin -import org.jetbrains.intellij.platform.gradleplugin.info -import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils -import org.jetbrains.intellij.platform.gradleplugin.warn +import org.jetbrains.intellij.platform.gradle.IntelliJIvyDescriptorFileGenerator +import org.jetbrains.intellij.platform.gradle.createPlugin +import org.jetbrains.intellij.platform.gradle.info +import org.jetbrains.intellij.platform.gradle.utils.ArchiveUtils +import org.jetbrains.intellij.platform.gradle.warn import java.io.File import java.nio.file.Path import java.nio.file.Paths diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyNotation.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginDependencyNotation.kt similarity index 93% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyNotation.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginDependencyNotation.kt index 48dce8cd89..8ab1b3f370 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginDependencyNotation.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginDependencyNotation.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.dependency +package org.jetbrains.intellij.platform.gradle.dependency import org.gradle.api.Project import org.gradle.api.artifacts.Dependency -import org.jetbrains.intellij.platform.gradleplugin.or +import org.jetbrains.intellij.platform.gradle.or import java.io.File import java.io.Serializable diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginProjectDependency.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginProjectDependency.kt similarity index 95% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginProjectDependency.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginProjectDependency.kt index 43dd44ff77..423901dde9 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginProjectDependency.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginProjectDependency.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.dependency +package org.jetbrains.intellij.platform.gradle.dependency import com.jetbrains.plugin.structure.base.plugin.PluginCreationSuccess import com.jetbrains.plugin.structure.intellij.plugin.IdePluginManager import com.jetbrains.plugin.structure.intellij.version.IdeVersion -import org.jetbrains.intellij.platform.gradleplugin.error +import org.jetbrains.intellij.platform.gradle.error import java.io.File class PluginProjectDependency(private val pluginDirectory: File, val context: String?) : PluginDependency { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginsRepository.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginsRepository.kt similarity index 84% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginsRepository.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginsRepository.kt index 7625846aeb..f989bae1c7 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginsRepository.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginsRepository.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.dependency +package org.jetbrains.intellij.platform.gradle.dependency import org.gradle.api.Project import java.io.File diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginsRepositoryConfiguration.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginsRepositoryConfiguration.kt similarity index 84% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginsRepositoryConfiguration.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginsRepositoryConfiguration.kt index f0fcb2acd4..28e5696669 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/dependency/PluginsRepositoryConfiguration.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/dependency/PluginsRepositoryConfiguration.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.dependency +package org.jetbrains.intellij.platform.gradle.dependency import org.gradle.api.Action import org.gradle.api.artifacts.repositories.MavenArtifactRepository -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_INTELLIJ_PLUGINS_REPOSITORY -import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DEFAULT_INTELLIJ_PLUGINS_REPOSITORY +import org.jetbrains.intellij.platform.gradle.utils.DependenciesDownloader import javax.inject.Inject abstract class PluginsRepositoryConfiguration @Inject constructor( diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformDependenciesExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformDependenciesExtension.kt similarity index 96% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformDependenciesExtension.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformDependenciesExtension.kt index 31f6251f06..cae700e682 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformDependenciesExtension.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformDependenciesExtension.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.extensions +package org.jetbrains.intellij.platform.gradle.extensions import org.gradle.api.GradleException import org.gradle.api.artifacts.Dependency @@ -11,14 +11,14 @@ import org.gradle.api.provider.Provider import org.gradle.api.provider.ProviderFactory import org.gradle.internal.os.OperatingSystem import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.platform.gradleplugin.BuildException -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Dependencies -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Locations -import org.jetbrains.intellij.platform.gradleplugin.Version -import org.jetbrains.intellij.platform.gradleplugin.model.* +import org.jetbrains.intellij.platform.gradle.BuildException +import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Configurations +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Dependencies +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Locations +import org.jetbrains.intellij.platform.gradle.Version +import org.jetbrains.intellij.platform.gradle.model.* import org.jetbrains.kotlin.gradle.utils.projectCacheDir import java.net.URI import java.nio.file.Path diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformExtension.kt similarity index 98% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformExtension.kt index 8e0427a400..d3c54c69df 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformExtension.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformExtension.kt @@ -1,12 +1,12 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.extensions +package org.jetbrains.intellij.platform.gradle.extensions import org.gradle.api.file.DirectoryProperty import org.gradle.api.plugins.ExtensionAware import org.gradle.api.provider.Property import org.gradle.kotlin.dsl.getByName -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Extensions @IntelliJPlatform interface IntelliJPlatformExtension : ExtensionAware { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformRepositoriesExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformRepositoriesExtension.kt similarity index 95% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformRepositoriesExtension.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformRepositoriesExtension.kt index d88f8d2611..045a3d9190 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/IntelliJPlatformRepositoriesExtension.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformRepositoriesExtension.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.extensions +package org.jetbrains.intellij.platform.gradle.extensions import org.gradle.api.Action import org.gradle.api.artifacts.dsl.RepositoryHandler @@ -9,7 +9,7 @@ import org.gradle.api.plugins.ExtensionAware import org.gradle.api.provider.ProviderFactory import org.gradle.kotlin.dsl.maven import org.gradle.kotlin.dsl.the -import org.jetbrains.intellij.platform.gradleplugin.BuildFeature +import org.jetbrains.intellij.platform.gradle.BuildFeature import javax.inject.Inject internal typealias RepositoryAction = (MavenArtifactRepository.() -> Unit) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/extensions.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/extensions.kt similarity index 71% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/extensions.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/extensions.kt index d15c22243f..45d6d0a375 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/extensions/extensions.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/extensions.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.extensions +package org.jetbrains.intellij.platform.gradle.extensions @DslMarker annotation class IntelliJPlatform diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JetBrainsRuntimeResolver.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/jbr/JetBrainsRuntimeResolver.kt similarity index 92% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JetBrainsRuntimeResolver.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/jbr/JetBrainsRuntimeResolver.kt index bec84c66fb..59cc4e5671 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JetBrainsRuntimeResolver.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/jbr/JetBrainsRuntimeResolver.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.jbr +package org.jetbrains.intellij.platform.gradle.jbr import com.jetbrains.plugin.structure.base.utils.exists import com.jetbrains.plugin.structure.base.utils.listFiles @@ -11,8 +11,8 @@ import org.gradle.internal.os.OperatingSystem import org.gradle.jvm.toolchain.JavaToolchainService import org.gradle.jvm.toolchain.JavaToolchainSpec import org.gradle.jvm.toolchain.internal.DefaultJvmVendorSpec -import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JETBRAINS_RUNTIME_VENDOR +import org.jetbrains.intellij.platform.gradle.* +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.JETBRAINS_RUNTIME_VENDOR import java.io.File import java.io.FileReader import java.io.IOException @@ -34,8 +34,8 @@ class JetBrainsRuntimeResolver( return listOf( /** * Use JetBrains Runtime provided via [IntelliJPluginConstants.Configurations.JETBRAINS_RUNTIME_DEPENDENCY] configuration. - * To add a custom JetBrains Runtime, use [org.jetbrains.intellij.platform.gradleplugin.dependencies.jetbrainsRuntime] - * or [org.jetbrains.intellij.platform.gradleplugin.dependencies.jetbrainsRuntimeExplicit]. + * To add a custom JetBrains Runtime, use [org.jetbrains.intellij.platform.gradle.dependencies.jetbrainsRuntime] + * or [org.jetbrains.intellij.platform.gradle.dependencies.jetbrainsRuntimeExplicit]. */ { jetbrainsRuntime.singleOrNull()?.let { file -> diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/memoize.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/memoize.kt similarity index 96% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/memoize.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/memoize.kt index 81a395e9c8..8ed7672015 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/memoize.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/memoize.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import org.gradle.api.internal.provider.AbstractMinimalProvider import org.gradle.api.internal.provider.DefaultValueSourceProviderFactory diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/AndroidStudioReleases.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/AndroidStudioReleases.kt similarity index 95% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/AndroidStudioReleases.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/AndroidStudioReleases.kt index 8d13549744..9819db2220 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/AndroidStudioReleases.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/AndroidStudioReleases.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.model +package org.jetbrains.intellij.platform.gradle.model import java.io.Serializable import javax.xml.bind.annotation.XmlAttribute diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/IvyModule.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/IvyModule.kt similarity index 96% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/IvyModule.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/IvyModule.kt index 230d83e670..57bd57694c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/IvyModule.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/IvyModule.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.model +package org.jetbrains.intellij.platform.gradle.model import javax.xml.bind.annotation.XmlAttribute import javax.xml.bind.annotation.XmlElement diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/MavenMetadata.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/MavenMetadata.kt similarity index 93% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/MavenMetadata.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/MavenMetadata.kt index 1752c2f85e..3cad6fde8e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/MavenMetadata.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/MavenMetadata.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.model +package org.jetbrains.intellij.platform.gradle.model import javax.xml.bind.annotation.XmlElement import javax.xml.bind.annotation.XmlElementWrapper diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ObjectFactory.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/ObjectFactory.kt similarity index 89% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ObjectFactory.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/ObjectFactory.kt index 2b4502b2f9..aad58ad930 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ObjectFactory.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/ObjectFactory.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.model +package org.jetbrains.intellij.platform.gradle.model import javax.xml.bind.annotation.XmlRegistry diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestResult.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/PerformanceTestResult.kt similarity index 82% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestResult.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/PerformanceTestResult.kt index dc7a8111c9..c05bd55cda 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestResult.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/PerformanceTestResult.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.model +package org.jetbrains.intellij.platform.gradle.model data class PerformanceTestResult( val testName: String, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestScript.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/PerformanceTestScript.kt similarity index 94% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestScript.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/PerformanceTestScript.kt index 3dae0924c3..71daff7705 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestScript.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/PerformanceTestScript.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.model +package org.jetbrains.intellij.platform.gradle.model class PerformanceTestScript private constructor( val projectName: String?, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestStatistic.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/PerformanceTestStatistic.kt similarity index 92% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestStatistic.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/PerformanceTestStatistic.kt index 26408b7451..262cf7ae8f 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PerformanceTestStatistic.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/PerformanceTestStatistic.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.model +package org.jetbrains.intellij.platform.gradle.model class PerformanceTestStatistic private constructor( val totalTime: Long?, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PluginsCache.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/PluginsCache.kt similarity index 93% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PluginsCache.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/PluginsCache.kt index 5e31144bea..79f05d42fd 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/PluginsCache.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/PluginsCache.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.model +package org.jetbrains.intellij.platform.gradle.model import java.io.Serializable import javax.xml.bind.annotation.XmlAttribute diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/ProductInfo.kt similarity index 98% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/ProductInfo.kt index d77c6c77d9..296f7bbe60 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductInfo.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/ProductInfo.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.model +package org.jetbrains.intellij.platform.gradle.model import com.jetbrains.plugin.structure.base.utils.readText import kotlinx.serialization.Serializable diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductsReleases.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/ProductsReleases.kt similarity index 97% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductsReleases.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/ProductsReleases.kt index 81d8159899..31dfaf260c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/ProductsReleases.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/ProductsReleases.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.model +package org.jetbrains.intellij.platform.gradle.model import java.io.Serializable import javax.xml.bind.annotation.XmlAttribute diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/XmlExtractor.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/XmlExtractor.kt similarity index 84% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/XmlExtractor.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/XmlExtractor.kt index 5bfb178d6b..b83c6efe90 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/model/XmlExtractor.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/model/XmlExtractor.kt @@ -1,12 +1,12 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.model +package org.jetbrains.intellij.platform.gradle.model import com.jetbrains.plugin.structure.base.utils.inputStream import com.jetbrains.plugin.structure.base.utils.outputStream import com.jetbrains.plugin.structure.intellij.utils.JDOMUtil -import org.jetbrains.intellij.platform.gradleplugin.transformXml -import org.jetbrains.intellij.platform.gradleplugin.warn +import org.jetbrains.intellij.platform.gradle.transformXml +import org.jetbrains.intellij.platform.gradle.warn import java.io.InputStream import java.nio.file.Path import javax.xml.bind.JAXBContext @@ -15,7 +15,7 @@ import javax.xml.bind.JAXBException class XmlExtractor(private val context: String? = null) { private val jaxbContext by lazy { - JAXBContext.newInstance("org.jetbrains.intellij.platform.gradleplugin.model", ObjectFactory::class.java.classLoader) + JAXBContext.newInstance("org.jetbrains.intellij.platform.gradle.model", ObjectFactory::class.java.classLoader) } @Throws(JAXBException::class) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/ProfilerName.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/ProfilerName.kt similarity index 71% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/ProfilerName.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/ProfilerName.kt index 0f740c9982..516ffc0551 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/ProfilerName.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/ProfilerName.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.performanceTest +package org.jetbrains.intellij.platform.gradle.performanceTest enum class ProfilerName { YOURKIT, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/TestExecutionFailException.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/TestExecutionFailException.kt similarity index 74% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/TestExecutionFailException.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/TestExecutionFailException.kt index fbaad6eb1d..b2b9849d4c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/TestExecutionFailException.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/TestExecutionFailException.kt @@ -1,5 +1,5 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.performanceTest +package org.jetbrains.intellij.platform.gradle.performanceTest class TestExecutionFailException(message: String) : RuntimeException(message) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/IdeaLogParser.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/parsers/IdeaLogParser.kt similarity index 86% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/IdeaLogParser.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/parsers/IdeaLogParser.kt index 9cfda3567e..2bf7ebe0f9 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/IdeaLogParser.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/parsers/IdeaLogParser.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.performanceTest.parsers +package org.jetbrains.intellij.platform.gradle.performanceTest.parsers import com.jetbrains.plugin.structure.base.utils.forEachLine -import org.jetbrains.intellij.platform.gradleplugin.model.PerformanceTestStatistic +import org.jetbrains.intellij.platform.gradle.model.PerformanceTestStatistic import java.nio.file.Path class IdeaLogParser(private val logPath: String) { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/SimpleIJPerformanceParser.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/parsers/SimpleIJPerformanceParser.kt similarity index 91% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/SimpleIJPerformanceParser.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/parsers/SimpleIJPerformanceParser.kt index 490360d4d7..5b85705c30 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/SimpleIJPerformanceParser.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/parsers/SimpleIJPerformanceParser.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.performanceTest.parsers +package org.jetbrains.intellij.platform.gradle.performanceTest.parsers import com.jetbrains.plugin.structure.base.utils.forEachLine -import org.jetbrains.intellij.platform.gradleplugin.model.PerformanceTestScript +import org.jetbrains.intellij.platform.gradle.model.PerformanceTestScript import java.nio.file.Path import java.time.Duration import java.util.concurrent.TimeUnit diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformAbstractProjectPlugin.kt similarity index 86% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformAbstractProjectPlugin.kt index e5078bd23e..49f82800d4 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformAbstractProjectPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformAbstractProjectPlugin.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.plugins +package org.jetbrains.intellij.platform.gradle.plugins import com.jetbrains.plugin.structure.intellij.version.IdeVersion import org.gradle.api.GradleException @@ -12,18 +12,18 @@ import org.gradle.api.tasks.TaskContainer import org.gradle.jvm.toolchain.JavaToolchainService import org.gradle.kotlin.dsl.* import org.gradle.kotlin.dsl.support.serviceOf -import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks -import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformDependenciesExtension -import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension -import org.jetbrains.intellij.platform.gradleplugin.jbr.JetBrainsRuntimeResolver -import org.jetbrains.intellij.platform.gradleplugin.model.productInfo -import org.jetbrains.intellij.platform.gradleplugin.tasks.InitializeIntelliJPlatformPluginTask -import org.jetbrains.intellij.platform.gradleplugin.tasks.PrepareSandboxTask -import org.jetbrains.intellij.platform.gradleplugin.tasks.TestIdeTask -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.* +import org.jetbrains.intellij.platform.gradle.* +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Configurations +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Configurations.Attributes +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformDependenciesExtension +import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformExtension +import org.jetbrains.intellij.platform.gradle.jbr.JetBrainsRuntimeResolver +import org.jetbrains.intellij.platform.gradle.model.productInfo +import org.jetbrains.intellij.platform.gradle.tasks.InitializeIntelliJPlatformPluginTask +import org.jetbrains.intellij.platform.gradle.tasks.PrepareSandboxTask +import org.jetbrains.intellij.platform.gradle.tasks.TestIdeTask +import org.jetbrains.intellij.platform.gradle.tasks.base.* import java.util.* import kotlin.io.path.createDirectories diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformBasePlugin.kt similarity index 85% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformBasePlugin.kt index ac6b302678..64f1c76f37 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformBasePlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformBasePlugin.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.plugins +package org.jetbrains.intellij.platform.gradle.plugins import org.gradle.api.GradleException import org.gradle.api.Project @@ -8,19 +8,19 @@ import org.gradle.api.artifacts.Configuration import org.gradle.api.plugins.JavaPlugin import org.gradle.api.plugins.JavaPlugin.* import org.gradle.kotlin.dsl.apply -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Configurations.Attributes -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_TEST_FIXTURES_PLUGIN_ID -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_BASE_ID -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox -import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyCollectorTransformer -import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyExtractorTransformer -import org.jetbrains.intellij.platform.gradleplugin.artifacts.transform.applyProductInfoTransformer -import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformDependenciesExtension -import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension -import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformRepositoriesExtension +import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Configurations +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Configurations.Attributes +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Extensions +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.JAVA_TEST_FIXTURES_PLUGIN_ID +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_BASE_ID +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Sandbox +import org.jetbrains.intellij.platform.gradle.artifacts.transform.applyCollectorTransformer +import org.jetbrains.intellij.platform.gradle.artifacts.transform.applyExtractorTransformer +import org.jetbrains.intellij.platform.gradle.artifacts.transform.applyProductInfoTransformer +import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformDependenciesExtension +import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformExtension +import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformRepositoriesExtension abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugin(PLUGIN_BASE_ID) { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformPlugin.kt similarity index 92% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformPlugin.kt index c12bfca42f..6ed4cca8e2 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformPlugin.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.plugins +package org.jetbrains.intellij.platform.gradle.plugins import com.jetbrains.plugin.structure.base.utils.extension import com.jetbrains.plugin.structure.base.utils.hasExtension @@ -29,61 +29,61 @@ import org.gradle.jvm.toolchain.JavaToolchainService import org.gradle.kotlin.dsl.* import org.gradle.kotlin.dsl.support.serviceOf import org.gradle.language.jvm.tasks.ProcessResources -import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.NO_SEARCHABLE_OPTIONS_WARNING -import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.PAID_PLUGIN_SEARCHABLE_OPTIONS_WARNING -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANDROID_STUDIO_PRODUCTS_RELEASES_URL -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_SEARCHABLE_OPTIONS_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.CLASSPATH_INDEX_CLEANUP_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_IDEA_VERSION -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ZIP_SIGNER_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions.INTELLIJ_PLATFORM -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PLUGINS_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.IDEA_PRODUCTS_RELEASES_URL -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENTED_JAR_PREFIX -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENT_CODE_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INSTRUMENT_TEST_CODE_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAVA_COMPILER_ANT_TASKS_MAVEN_METADATA -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.LIST_BUNDLED_PLUGINS_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MARKETPLACE_HOST -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PERFORMANCE_TEST_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PRINT_BUNDLED_PLUGINS_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PRINT_PRODUCTS_RELEASES_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PUBLISH_PLUGIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_EAP -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_EAP_CANDIDATE -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_FOR_UI_TESTS_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_IDE_PERFORMANCE_TEST_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SEARCHABLE_OPTIONS_DIR_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SIGN_PLUGIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_SIGNATURE_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERSION_LATEST -import org.jetbrains.intellij.platform.gradleplugin.dependency.* -import org.jetbrains.intellij.platform.gradleplugin.model.MavenMetadata -import org.jetbrains.intellij.platform.gradleplugin.model.XmlExtractor -import org.jetbrains.intellij.platform.gradleplugin.model.productInfo -import org.jetbrains.intellij.platform.gradleplugin.performanceTest.ProfilerName -import org.jetbrains.intellij.platform.gradleplugin.tasks.* -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.RunIdeBase -import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils -import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader -import org.jetbrains.intellij.platform.gradleplugin.utils.ivyRepository -import org.jetbrains.intellij.platform.gradleplugin.utils.mavenRepository +import org.jetbrains.intellij.platform.gradle.* +import org.jetbrains.intellij.platform.gradle.BuildFeature.NO_SEARCHABLE_OPTIONS_WARNING +import org.jetbrains.intellij.platform.gradle.BuildFeature.PAID_PLUGIN_SEARCHABLE_OPTIONS_WARNING +import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType.* +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.ANDROID_STUDIO_PRODUCTS_RELEASES_URL +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.BUILD_SEARCHABLE_OPTIONS_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.CLASSPATH_INDEX_CLEANUP_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DEFAULT_IDEA_VERSION +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DOWNLOAD_ZIP_SIGNER_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Extensions.INTELLIJ_PLATFORM +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.IDEA_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.IDEA_PLUGINS_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.IDEA_PRODUCTS_RELEASES_URL +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.INSTRUMENTED_JAR_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.INSTRUMENTED_JAR_PREFIX +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.INSTRUMENT_CODE_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.INSTRUMENT_TEST_CODE_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.JAVA_COMPILER_ANT_TASKS_MAVEN_METADATA +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.LIST_BUNDLED_PLUGINS_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.MARKETPLACE_HOST +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PERFORMANCE_TEST_CONFIGURATION_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PRINT_BUNDLED_PLUGINS_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PRINT_PRODUCTS_RELEASES_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PUBLISH_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.RELEASE_SUFFIX_EAP +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.RELEASE_SUFFIX_EAP_CANDIDATE +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.RUN_IDE_FOR_UI_TESTS_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.RUN_IDE_PERFORMANCE_TEST_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.SEARCHABLE_OPTIONS_DIR_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.SIGN_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Sandbox +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERIFY_PLUGIN_SIGNATURE_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERIFY_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERSION_LATEST +import org.jetbrains.intellij.platform.gradle.dependency.* +import org.jetbrains.intellij.platform.gradle.model.MavenMetadata +import org.jetbrains.intellij.platform.gradle.model.XmlExtractor +import org.jetbrains.intellij.platform.gradle.model.productInfo +import org.jetbrains.intellij.platform.gradle.performanceTest.ProfilerName +import org.jetbrains.intellij.platform.gradle.tasks.* +import org.jetbrains.intellij.platform.gradle.tasks.base.RunIdeBase +import org.jetbrains.intellij.platform.gradle.utils.ArchiveUtils +import org.jetbrains.intellij.platform.gradle.utils.DependenciesDownloader +import org.jetbrains.intellij.platform.gradle.utils.ivyRepository +import org.jetbrains.intellij.platform.gradle.utils.mavenRepository import org.jetbrains.intellij.pluginRepository.PluginRepositoryFactory import org.jetbrains.intellij.tasks.DownloadAndroidStudioProductReleasesXmlTask import org.jetbrains.intellij.tasks.DownloadIdeaProductReleasesXmlTask diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformSettingsPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformSettingsPlugin.kt similarity index 73% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformSettingsPlugin.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformSettingsPlugin.kt index cbb4b05ac4..932e53b1d5 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformSettingsPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformSettingsPlugin.kt @@ -1,12 +1,12 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.plugins +package org.jetbrains.intellij.platform.gradle.plugins import org.gradle.api.Plugin import org.gradle.api.initialization.Settings import org.gradle.api.provider.ProviderFactory -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Extensions -import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformRepositoriesExtension +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Extensions +import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformRepositoriesExtension import javax.inject.Inject @Suppress("unused", "UnstableApiUsage") diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformTasksPlugin.kt similarity index 95% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformTasksPlugin.kt index 6c0cb43065..befb7a48b7 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformTasksPlugin.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.plugins +package org.jetbrains.intellij.platform.gradle.plugins import org.gradle.api.Project import org.gradle.api.plugins.JavaPlugin @@ -15,17 +15,17 @@ import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem import org.gradle.kotlin.dsl.* import org.gradle.process.JavaForkOptions -import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.BuildFeature.SELF_UPDATE_CHECK -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_TASKS_ID -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks -import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension -import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.IntelliJPlatformArgumentProvider -import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.LaunchSystemArgumentProvider -import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.PluginPathArgumentProvider -import org.jetbrains.intellij.platform.gradleplugin.tasks.* +import org.jetbrains.intellij.platform.gradle.* +import org.jetbrains.intellij.platform.gradle.BuildFeature.SELF_UPDATE_CHECK +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_TASKS_ID +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Sandbox +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.TASKS +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformExtension +import org.jetbrains.intellij.platform.gradle.propertyProviders.IntelliJPlatformArgumentProvider +import org.jetbrains.intellij.platform.gradle.propertyProviders.LaunchSystemArgumentProvider +import org.jetbrains.intellij.platform.gradle.propertyProviders.PluginPathArgumentProvider +import org.jetbrains.intellij.platform.gradle.tasks.* import java.io.File import java.time.LocalDate import kotlin.io.path.exists diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/plugins.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/plugins.kt similarity index 89% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/plugins.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/plugins.kt index 5b5da5fb5b..cad313c2c2 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/plugins/plugins.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/plugins.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.plugins +package org.jetbrains.intellij.platform.gradle.plugins import org.gradle.api.plugins.ExtensionAware import org.gradle.kotlin.dsl.create diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/propertyProviders/IntelliJPlatformArgumentProvider.kt similarity index 86% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/propertyProviders/IntelliJPlatformArgumentProvider.kt index d8bd52be2e..40203f8ce7 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/IntelliJPlatformArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/propertyProviders/IntelliJPlatformArgumentProvider.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.propertyProviders +package org.jetbrains.intellij.platform.gradle.propertyProviders import com.jetbrains.plugin.structure.base.utils.exists import com.jetbrains.plugin.structure.base.utils.readLines @@ -12,11 +12,11 @@ import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.gradle.process.CommandLineArgumentProvider import org.gradle.process.JavaForkOptions -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType -import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.model.productInfo -import org.jetbrains.intellij.platform.gradleplugin.resolveIdeHomeVariable -import org.jetbrains.intellij.platform.gradleplugin.utils.OpenedPackages +import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType +import org.jetbrains.intellij.platform.gradle.asPath +import org.jetbrains.intellij.platform.gradle.model.productInfo +import org.jetbrains.intellij.platform.gradle.resolveIdeHomeVariable +import org.jetbrains.intellij.platform.gradle.utils.OpenedPackages class IntelliJPlatformArgumentProvider( @InputFiles @PathSensitive(RELATIVE) val intellijPlatform: ConfigurableFileCollection, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/propertyProviders/LaunchSystemArgumentProvider.kt similarity index 83% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/propertyProviders/LaunchSystemArgumentProvider.kt index 3ff6871bdf..3c4bd17ebb 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/LaunchSystemArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/propertyProviders/LaunchSystemArgumentProvider.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.propertyProviders +package org.jetbrains.intellij.platform.gradle.propertyProviders import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.DirectoryProperty @@ -9,10 +9,10 @@ import org.gradle.api.tasks.InputFiles import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.gradle.process.CommandLineArgumentProvider -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox -import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.model.productInfo -import org.jetbrains.intellij.platform.gradleplugin.resolveIdeHomeVariable +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Sandbox +import org.jetbrains.intellij.platform.gradle.asPath +import org.jetbrains.intellij.platform.gradle.model.productInfo +import org.jetbrains.intellij.platform.gradle.resolveIdeHomeVariable import kotlin.io.path.pathString class LaunchSystemArgumentProvider( diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/PerformanceTestArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/propertyProviders/PerformanceTestArgumentProvider.kt similarity index 95% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/PerformanceTestArgumentProvider.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/propertyProviders/PerformanceTestArgumentProvider.kt index ad7d005d33..6dcb69d98e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/PerformanceTestArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/propertyProviders/PerformanceTestArgumentProvider.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.propertyProviders +package org.jetbrains.intellij.platform.gradle.propertyProviders import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.PathSensitive diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/PluginPathArgumentProvider.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/propertyProviders/PluginPathArgumentProvider.kt similarity index 80% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/PluginPathArgumentProvider.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/propertyProviders/PluginPathArgumentProvider.kt index bd611b6ee5..eeccdbf741 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/propertyProviders/PluginPathArgumentProvider.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/propertyProviders/PluginPathArgumentProvider.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.propertyProviders +package org.jetbrains.intellij.platform.gradle.propertyProviders import com.jetbrains.plugin.structure.base.utils.listFiles import org.gradle.api.file.DirectoryProperty @@ -8,8 +8,8 @@ import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.gradle.process.CommandLineArgumentProvider -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox -import org.jetbrains.intellij.platform.gradleplugin.asPath +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Sandbox +import org.jetbrains.intellij.platform.gradle.asPath import java.io.File class PluginPathArgumentProvider( diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildPluginTask.kt similarity index 78% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildPluginTask.kt index b1930add5f..d429eb77f9 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildPluginTask.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.tasks.bundling.Zip import org.gradle.work.DisableCachingByDefault -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME /** * Assembles a plugin and prepares ZIP archive for deployment. diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTask.kt similarity index 85% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTask.kt index bf16af1c7e..126fe46171 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTask.kt @@ -1,18 +1,18 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.file.DirectoryProperty import org.gradle.api.provider.Property import org.gradle.api.tasks.CacheableTask import org.gradle.api.tasks.Internal import org.gradle.api.tasks.OutputDirectory -import org.jetbrains.intellij.platform.gradleplugin.BuildFeature -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.logCategory -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.RunIdeBase -import org.jetbrains.intellij.platform.gradleplugin.warn +import org.jetbrains.intellij.platform.gradle.BuildFeature +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.asPath +import org.jetbrains.intellij.platform.gradle.logCategory +import org.jetbrains.intellij.platform.gradle.tasks.base.RunIdeBase +import org.jetbrains.intellij.platform.gradle.warn import kotlin.io.path.pathString /** diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ClasspathIndexCleanupTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ClasspathIndexCleanupTask.kt similarity index 81% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ClasspathIndexCleanupTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ClasspathIndexCleanupTask.kt index eae64b2c32..9957a51a60 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ClasspathIndexCleanupTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ClasspathIndexCleanupTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import com.jetbrains.plugin.structure.base.utils.deleteQuietly import org.gradle.api.DefaultTask @@ -10,10 +10,10 @@ import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity import org.gradle.api.tasks.TaskAction import org.gradle.work.DisableCachingByDefault -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginExtension -import org.jetbrains.intellij.platform.gradleplugin.info -import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginExtension +import org.jetbrains.intellij.platform.gradle.info +import org.jetbrains.intellij.platform.gradle.logCategory /** * Remove `classpath.index` files that are created by the `PathClassLoader`. diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt similarity index 78% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt index 226c9c6f54..465a74882c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt @@ -7,9 +7,9 @@ import org.gradle.api.tasks.CacheableTask import org.gradle.api.tasks.Input import org.gradle.api.tasks.Optional import org.gradle.api.tasks.Sync -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.logCategory @CacheableTask abstract class DownloadAndroidStudioProductReleasesXmlTask : Sync() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIdeaProductReleasesXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIdeaProductReleasesXmlTask.kt similarity index 82% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIdeaProductReleasesXmlTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIdeaProductReleasesXmlTask.kt index 83a9dfdc25..d168748dcf 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIdeaProductReleasesXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIdeaProductReleasesXmlTask.kt @@ -4,8 +4,8 @@ package org.jetbrains.intellij.tasks import org.gradle.api.provider.Property import org.gradle.api.tasks.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME import java.io.File @CacheableTask diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadRobotServerPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadRobotServerPluginTask.kt similarity index 82% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadRobotServerPluginTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadRobotServerPluginTask.kt index 1cf4dd14ec..b925af67f8 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadRobotServerPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadRobotServerPluginTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.DefaultTask import org.gradle.api.file.DirectoryProperty @@ -11,14 +11,14 @@ import org.gradle.api.tasks.OutputDirectory import org.gradle.api.tasks.TaskAction import org.gradle.kotlin.dsl.newInstance import org.gradle.work.DisableCachingByDefault -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERSION_LATEST -import org.jetbrains.intellij.platform.gradleplugin.Version -import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.logCategory -import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils -import org.jetbrains.intellij.platform.gradleplugin.utils.LatestVersionResolver +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERSION_LATEST +import org.jetbrains.intellij.platform.gradle.Version +import org.jetbrains.intellij.platform.gradle.asPath +import org.jetbrains.intellij.platform.gradle.logCategory +import org.jetbrains.intellij.platform.gradle.utils.ArchiveUtils +import org.jetbrains.intellij.platform.gradle.utils.LatestVersionResolver import java.io.File import javax.inject.Inject diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadZipSignerTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadZipSignerTask.kt similarity index 89% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadZipSignerTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadZipSignerTask.kt index 087be1f982..b1e46c7ecd 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadZipSignerTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadZipSignerTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.DefaultTask import org.gradle.api.file.RegularFileProperty @@ -10,9 +10,9 @@ import org.gradle.api.tasks.Optional import org.gradle.api.tasks.OutputFile import org.gradle.api.tasks.TaskAction import org.gradle.work.DisableCachingByDefault -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERSION_LATEST -import org.jetbrains.intellij.platform.gradleplugin.utils.LatestVersionResolver +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERSION_LATEST +import org.jetbrains.intellij.platform.gradle.utils.LatestVersionResolver import java.nio.file.Path import kotlin.io.path.copyTo diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPlatformPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InitializeIntelliJPlatformPluginTask.kt similarity index 84% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPlatformPluginTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InitializeIntelliJPlatformPluginTask.kt index 643676e4a2..69d6ace440 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InitializeIntelliJPlatformPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InitializeIntelliJPlatformPluginTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import com.jetbrains.plugin.structure.base.utils.create import com.jetbrains.plugin.structure.base.utils.exists @@ -11,12 +11,12 @@ import org.gradle.api.provider.Property import org.gradle.api.tasks.Internal import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.UntrackedTask -import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.GITHUB_REPOSITORY -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_ID -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_NAME -import org.jetbrains.intellij.platform.gradleplugin.utils.LatestVersionResolver +import org.jetbrains.intellij.platform.gradle.* +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.GITHUB_REPOSITORY +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_ID +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_NAME +import org.jetbrains.intellij.platform.gradle.utils.LatestVersionResolver import java.util.jar.JarOutputStream import java.util.jar.Manifest diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentCodeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InstrumentCodeTask.kt similarity index 97% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentCodeTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InstrumentCodeTask.kt index c03a71e71a..7a5de9c79c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentCodeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InstrumentCodeTask.kt @@ -2,7 +2,7 @@ @file:Suppress("SameReturnValue") -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import com.jetbrains.plugin.structure.base.utils.* import groovy.lang.Closure @@ -16,9 +16,9 @@ import org.gradle.api.tasks.* import org.gradle.work.ChangeType import org.gradle.work.Incremental import org.gradle.work.InputChanges -import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.dependency.IdeaDependency +import org.jetbrains.intellij.platform.gradle.* +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.dependency.IdeaDependency import java.io.File import java.nio.file.Files import java.nio.file.Path diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentedJarTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InstrumentedJarTask.kt similarity index 75% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentedJarTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InstrumentedJarTask.kt index 688d3868ea..c20faaf334 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/InstrumentedJarTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InstrumentedJarTask.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.tasks.CacheableTask import org.gradle.api.tasks.bundling.Jar -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME /** * Creates a JAR file with instrumented classes. diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/JarSearchableOptionsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTask.kt similarity index 86% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/JarSearchableOptionsTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTask.kt index 886b648ea8..d5edb7fe42 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/JarSearchableOptionsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import com.jetbrains.plugin.structure.base.utils.listFiles import com.jetbrains.plugin.structure.base.utils.simpleName @@ -8,11 +8,11 @@ import org.gradle.api.file.DirectoryProperty import org.gradle.api.provider.Property import org.gradle.api.tasks.* import org.gradle.jvm.tasks.Jar -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SEARCHABLE_OPTIONS_SUFFIX -import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.logCategory -import org.jetbrains.intellij.platform.gradleplugin.warn +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.SEARCHABLE_OPTIONS_SUFFIX +import org.jetbrains.intellij.platform.gradle.asPath +import org.jetbrains.intellij.platform.gradle.logCategory +import org.jetbrains.intellij.platform.gradle.warn import java.nio.file.Path /** @@ -34,7 +34,7 @@ abstract class JarSearchableOptionsTask : Jar() { /** * The name of the plugin. * - * Default value: [org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginExtension.pluginName] + * Default value: [org.jetbrains.intellij.platform.gradle.IntelliJPluginExtension.pluginName] */ @get:Input @get:Optional diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListBundledPluginsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListBundledPluginsTask.kt similarity index 84% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListBundledPluginsTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListBundledPluginsTask.kt index 4806bdb369..be9c15decd 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListBundledPluginsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListBundledPluginsTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import com.jetbrains.plugin.structure.base.utils.outputStream import org.gradle.api.DefaultTask @@ -11,10 +11,10 @@ import org.gradle.api.tasks.CacheableTask import org.gradle.api.tasks.Input import org.gradle.api.tasks.OutputFile import org.gradle.api.tasks.TaskAction -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.dependency.BuiltinPluginsRegistry -import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.asPath +import org.jetbrains.intellij.platform.gradle.dependency.BuiltinPluginsRegistry +import org.jetbrains.intellij.platform.gradle.logCategory import java.io.File /** diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTask.kt similarity index 94% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTask.kt index ea93a885a7..f22b5a4dcc 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import com.jetbrains.plugin.structure.base.utils.outputStream import org.gradle.api.DefaultTask @@ -10,12 +10,12 @@ import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.api.provider.SetProperty import org.gradle.api.tasks.* -import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.AndroidStudio -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.model.AndroidStudioReleases -import org.jetbrains.intellij.platform.gradleplugin.model.ProductsReleases -import org.jetbrains.intellij.platform.gradleplugin.model.XmlExtractor +import org.jetbrains.intellij.platform.gradle.* +import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType.AndroidStudio +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.model.AndroidStudioReleases +import org.jetbrains.intellij.platform.gradle.model.ProductsReleases +import org.jetbrains.intellij.platform.gradle.model.XmlExtractor /** * List all available IntelliJ-based IDE releases with their updates. diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTask.kt similarity index 92% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTask.kt index b41f7a25f2..01334382f1 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import com.jetbrains.plugin.structure.intellij.utils.JDOMUtil import org.gradle.api.DefaultTask @@ -10,12 +10,12 @@ import org.gradle.api.provider.Provider import org.gradle.api.tasks.* import org.jdom2.Document import org.jdom2.Element -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.extensions.IntelliJPlatformExtension -import org.jetbrains.intellij.platform.gradleplugin.logCategory -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.PlatformVersionAware -import org.jetbrains.intellij.platform.gradleplugin.transformXml -import org.jetbrains.intellij.platform.gradleplugin.warn +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformExtension +import org.jetbrains.intellij.platform.gradle.logCategory +import org.jetbrains.intellij.platform.gradle.tasks.base.PlatformVersionAware +import org.jetbrains.intellij.platform.gradle.transformXml +import org.jetbrains.intellij.platform.gradle.warn import java.io.File import kotlin.io.path.inputStream diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareSandboxTask.kt similarity index 92% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareSandboxTask.kt index ebaf330add..80d26be09e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareSandboxTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import com.jetbrains.plugin.structure.base.utils.* import com.jetbrains.plugin.structure.intellij.utils.JDOMUtil @@ -13,11 +13,11 @@ import org.gradle.api.provider.Property import org.gradle.api.tasks.* import org.gradle.work.DisableCachingByDefault import org.jdom2.Element -import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Sandbox -import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginDependency -import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginProjectDependency +import org.jetbrains.intellij.platform.gradle.* +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Sandbox +import org.jetbrains.intellij.platform.gradle.dependency.PluginDependency +import org.jetbrains.intellij.platform.gradle.dependency.PluginProjectDependency import java.io.File import java.nio.file.Path import kotlin.io.path.createDirectories diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrintBundledPluginsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintBundledPluginsTask.kt similarity index 85% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrintBundledPluginsTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintBundledPluginsTask.kt index 5c970783cd..7481078922 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrintBundledPluginsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintBundledPluginsTask.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.DefaultTask import org.gradle.api.file.RegularFileProperty import org.gradle.api.tasks.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME /** * Prints the output produced by the [ListBundledPluginsTask] task. diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrintProductsReleasesTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintProductsReleasesTask.kt similarity index 85% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrintProductsReleasesTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintProductsReleasesTask.kt index 44f69c7ee6..41a8ad6c55 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrintProductsReleasesTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintProductsReleasesTask.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.DefaultTask import org.gradle.api.file.RegularFileProperty import org.gradle.api.tasks.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME /** * Prints the output produced by the [ListProductsReleasesTask] task. diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PublishPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PublishPluginTask.kt similarity index 92% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PublishPluginTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PublishPluginTask.kt index c77504521a..ceeb7fb7a0 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PublishPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PublishPluginTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import com.jetbrains.plugin.structure.base.plugin.PluginCreationFail import com.jetbrains.plugin.structure.base.plugin.PluginCreationSuccess @@ -12,11 +12,11 @@ import org.gradle.api.file.RegularFileProperty import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.api.tasks.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.info -import org.jetbrains.intellij.platform.gradleplugin.logCategory -import org.jetbrains.intellij.platform.gradleplugin.utils.ToolboxEnterprisePluginRepositoryService +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.asPath +import org.jetbrains.intellij.platform.gradle.info +import org.jetbrains.intellij.platform.gradle.logCategory +import org.jetbrains.intellij.platform.gradle.utils.ToolboxEnterprisePluginRepositoryService import org.jetbrains.intellij.pluginRepository.PluginRepositoryFactory import org.jetbrains.intellij.pluginRepository.model.StringPluginId diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeForUiTestTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdeForUiTestTask.kt similarity index 76% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeForUiTestTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdeForUiTestTask.kt index 643ec3395a..3eb682e4d0 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeForUiTestTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdeForUiTestTask.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.tasks.JavaExec import org.gradle.api.tasks.UntrackedTask -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.RunIdeBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.tasks.base.RunIdeBase /** * Runs the IDE instance with the developed plugin and robot-server installed and ready for UI testing. diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdePerformanceTestTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdePerformanceTestTask.kt similarity index 81% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdePerformanceTestTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdePerformanceTestTask.kt index fab104fcc6..ba68fa8fbb 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdePerformanceTestTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdePerformanceTestTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import com.jetbrains.plugin.structure.base.utils.createDir import com.jetbrains.plugin.structure.base.utils.extension @@ -11,17 +11,17 @@ import org.gradle.api.tasks.Input import org.gradle.api.tasks.JavaExec import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.UntrackedTask -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.error -import org.jetbrains.intellij.platform.gradleplugin.info -import org.jetbrains.intellij.platform.gradleplugin.logCategory -import org.jetbrains.intellij.platform.gradleplugin.model.PerformanceTestResult -import org.jetbrains.intellij.platform.gradleplugin.performanceTest.ProfilerName -import org.jetbrains.intellij.platform.gradleplugin.performanceTest.TestExecutionFailException -import org.jetbrains.intellij.platform.gradleplugin.performanceTest.parsers.IdeaLogParser -import org.jetbrains.intellij.platform.gradleplugin.performanceTest.parsers.SimpleIJPerformanceParser -import org.jetbrains.intellij.platform.gradleplugin.propertyProviders.PerformanceTestArgumentProvider -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.RunIdeBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.error +import org.jetbrains.intellij.platform.gradle.info +import org.jetbrains.intellij.platform.gradle.logCategory +import org.jetbrains.intellij.platform.gradle.model.PerformanceTestResult +import org.jetbrains.intellij.platform.gradle.performanceTest.ProfilerName +import org.jetbrains.intellij.platform.gradle.performanceTest.TestExecutionFailException +import org.jetbrains.intellij.platform.gradle.performanceTest.parsers.IdeaLogParser +import org.jetbrains.intellij.platform.gradle.performanceTest.parsers.SimpleIJPerformanceParser +import org.jetbrains.intellij.platform.gradle.propertyProviders.PerformanceTestArgumentProvider +import org.jetbrains.intellij.platform.gradle.tasks.base.RunIdeBase import java.nio.file.Files import java.nio.file.Path import java.nio.file.Paths diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdeTask.kt similarity index 85% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdeTask.kt index 15eb3ec6da..d611127bfb 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunIdeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdeTask.kt @@ -1,17 +1,17 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.tasks.JavaExec import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.UntrackedTask import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.model.getBootClasspath -import org.jetbrains.intellij.platform.gradleplugin.or -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.* +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.asPath +import org.jetbrains.intellij.platform.gradle.model.getBootClasspath +import org.jetbrains.intellij.platform.gradle.or +import org.jetbrains.intellij.platform.gradle.tasks.base.* import java.io.File import kotlin.io.path.absolutePathString diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunPluginVerifierTask.kt similarity index 95% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunPluginVerifierTask.kt index 96e1cd8116..dcb89286c4 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunPluginVerifierTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import com.jetbrains.plugin.structure.base.utils.* import org.apache.tools.ant.util.TeeOutputStream @@ -18,18 +18,18 @@ import org.gradle.kotlin.dsl.create import org.gradle.kotlin.dsl.newInstance import org.gradle.process.ExecOperations import org.gradle.process.internal.ExecException -import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.AndroidStudio -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType.IntellijIdeaCommunity -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERSION_LATEST -import org.jetbrains.intellij.platform.gradleplugin.Version -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.JetBrainsRuntimeAware -import org.jetbrains.intellij.platform.gradleplugin.utils.ArchiveUtils -import org.jetbrains.intellij.platform.gradleplugin.utils.DependenciesDownloader -import org.jetbrains.intellij.platform.gradleplugin.utils.LatestVersionResolver -import org.jetbrains.intellij.platform.gradleplugin.utils.ivyRepository +import org.jetbrains.intellij.platform.gradle.* +import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType.AndroidStudio +import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType.IntellijIdeaCommunity +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERSION_LATEST +import org.jetbrains.intellij.platform.gradle.Version +import org.jetbrains.intellij.platform.gradle.tasks.base.JetBrainsRuntimeAware +import org.jetbrains.intellij.platform.gradle.utils.ArchiveUtils +import org.jetbrains.intellij.platform.gradle.utils.DependenciesDownloader +import org.jetbrains.intellij.platform.gradle.utils.LatestVersionResolver +import org.jetbrains.intellij.platform.gradle.utils.ivyRepository import java.io.ByteArrayOutputStream import java.io.File import java.io.IOException diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SetupDependenciesTask.kt similarity index 82% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SetupDependenciesTask.kt index 8deb5a5022..2f3b37f1ad 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SetupDependenciesTask.kt @@ -1,16 +1,16 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.DefaultTask import org.gradle.api.provider.Property import org.gradle.api.tasks.Internal import org.gradle.api.tasks.TaskAction import org.gradle.work.DisableCachingByDefault -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.dependency.IdeaDependency -import org.jetbrains.intellij.platform.gradleplugin.error -import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.dependency.IdeaDependency +import org.jetbrains.intellij.platform.gradle.error +import org.jetbrains.intellij.platform.gradle.logCategory /** * A deprecated method for setting up IntelliJ Platform dependencies. diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SignPluginTask.kt similarity index 94% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SignPluginTask.kt index 9488092319..9acf7597f1 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SignPluginTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.InvalidUserDataException import org.gradle.api.file.RegularFileProperty @@ -9,11 +9,11 @@ import org.gradle.api.provider.Property import org.gradle.api.tasks.* import org.gradle.api.tasks.Optional import org.gradle.process.ExecOperations -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.debug -import org.jetbrains.intellij.platform.gradleplugin.logCategory -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.ZipSigningToolBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.asPath +import org.jetbrains.intellij.platform.gradle.debug +import org.jetbrains.intellij.platform.gradle.logCategory +import org.jetbrains.intellij.platform.gradle.tasks.base.ZipSigningToolBase import java.util.* import javax.inject.Inject import kotlin.io.path.pathString diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/TestIdeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/TestIdeTask.kt similarity index 80% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/TestIdeTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/TestIdeTask.kt index 0425228acd..9cb2bad369 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/TestIdeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/TestIdeTask.kt @@ -1,14 +1,14 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.tasks.JavaExec import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.UntrackedTask import org.gradle.api.tasks.testing.Test -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.* +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.asPath +import org.jetbrains.intellij.platform.gradle.tasks.base.* import kotlin.io.path.absolutePathString /** diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginConfigurationTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTask.kt similarity index 96% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginConfigurationTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTask.kt index ff91f020ff..79413d02ec 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginConfigurationTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.DefaultTask import org.gradle.api.JavaVersion @@ -9,11 +9,11 @@ import org.gradle.api.provider.Property import org.gradle.api.provider.ProviderFactory import org.gradle.api.tasks.* import org.gradle.api.tasks.compile.JavaCompile -import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.PlatformVersionAware -import org.jetbrains.intellij.platform.gradleplugin.utils.PlatformJavaVersions -import org.jetbrains.intellij.platform.gradleplugin.utils.PlatformKotlinVersions +import org.jetbrains.intellij.platform.gradle.* +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.tasks.base.PlatformVersionAware +import org.jetbrains.intellij.platform.gradle.utils.PlatformJavaVersions +import org.jetbrains.intellij.platform.gradle.utils.PlatformKotlinVersions import java.io.File import javax.inject.Inject diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginSignatureTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginSignatureTask.kt similarity index 84% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginSignatureTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginSignatureTask.kt index 4ca70f8d2c..f985b4d1a4 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginSignatureTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginSignatureTask.kt @@ -1,17 +1,17 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.InvalidUserDataException import org.gradle.api.file.RegularFileProperty import org.gradle.api.model.ObjectFactory import org.gradle.api.tasks.* import org.gradle.process.ExecOperations -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.debug -import org.jetbrains.intellij.platform.gradleplugin.logCategory -import org.jetbrains.intellij.platform.gradleplugin.tasks.base.ZipSigningToolBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.asPath +import org.jetbrains.intellij.platform.gradle.debug +import org.jetbrains.intellij.platform.gradle.logCategory +import org.jetbrains.intellij.platform.gradle.tasks.base.ZipSigningToolBase import javax.inject.Inject /** diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginTask.kt similarity index 89% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginTask.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginTask.kt index c068841c8f..b01ddcd871 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginTask.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import com.jetbrains.plugin.structure.base.plugin.PluginCreationFail import com.jetbrains.plugin.structure.base.plugin.PluginCreationSuccess @@ -11,11 +11,11 @@ import org.gradle.api.GradleException import org.gradle.api.file.DirectoryProperty import org.gradle.api.provider.Property import org.gradle.api.tasks.* -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.error -import org.jetbrains.intellij.platform.gradleplugin.logCategory -import org.jetbrains.intellij.platform.gradleplugin.warn +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.asPath +import org.jetbrains.intellij.platform.gradle.error +import org.jetbrains.intellij.platform.gradle.logCategory +import org.jetbrains.intellij.platform.gradle.warn /** * Validates completeness and contents of `plugin.xml` descriptors as well as plugin archive structure. diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CoroutinesJavaAgentAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/CoroutinesJavaAgentAware.kt similarity index 85% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CoroutinesJavaAgentAware.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/CoroutinesJavaAgentAware.kt index 693da5eec4..fdf90ba90c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CoroutinesJavaAgentAware.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/CoroutinesJavaAgentAware.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks.base +package org.jetbrains.intellij.platform.gradle.tasks.base import org.gradle.api.file.RegularFileProperty import org.gradle.api.tasks.Internal diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformVersionAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/CustomPlatformVersionAware.kt similarity index 81% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformVersionAware.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/CustomPlatformVersionAware.kt index fdd6a81bba..29579740f6 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/CustomPlatformVersionAware.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/CustomPlatformVersionAware.kt @@ -1,13 +1,13 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks.base +package org.jetbrains.intellij.platform.gradle.tasks.base import org.gradle.api.file.DirectoryProperty import org.gradle.api.provider.Property import org.gradle.api.tasks.Input import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.Optional -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType +import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType interface CustomPlatformVersionAware : PlatformVersionAware { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/JetBrainsRuntimeAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/JetBrainsRuntimeAware.kt similarity index 91% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/JetBrainsRuntimeAware.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/JetBrainsRuntimeAware.kt index 29629dfd62..d4f83976cf 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/JetBrainsRuntimeAware.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/JetBrainsRuntimeAware.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks.base +package org.jetbrains.intellij.platform.gradle.tasks.base import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.DirectoryProperty diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/PlatformVersionAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/PlatformVersionAware.kt similarity index 80% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/PlatformVersionAware.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/PlatformVersionAware.kt index 124128e211..a574af5c01 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/PlatformVersionAware.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/PlatformVersionAware.kt @@ -1,16 +1,16 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks.base +package org.jetbrains.intellij.platform.gradle.tasks.base import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.tasks.InputFiles import org.gradle.api.tasks.Internal import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPlatformType -import org.jetbrains.intellij.platform.gradleplugin.Version -import org.jetbrains.intellij.platform.gradleplugin.model.ProductInfo -import org.jetbrains.intellij.platform.gradleplugin.model.productInfo +import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType +import org.jetbrains.intellij.platform.gradle.Version +import org.jetbrains.intellij.platform.gradle.model.ProductInfo +import org.jetbrains.intellij.platform.gradle.model.productInfo interface PlatformVersionAware { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/RunIdeBase.kt similarity index 97% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/RunIdeBase.kt index b9a3d6fe5f..741d11f2b4 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/RunIdeBase.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/RunIdeBase.kt @@ -1,14 +1,14 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks.base +package org.jetbrains.intellij.platform.gradle.tasks.base import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.api.tasks.* import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem -import org.jetbrains.intellij.platform.gradleplugin.* -import org.jetbrains.intellij.platform.gradleplugin.model.productInfo +import org.jetbrains.intellij.platform.gradle.* +import org.jetbrains.intellij.platform.gradle.model.productInfo import java.io.File import java.nio.file.Path diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/SandboxAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/SandboxAware.kt similarity index 87% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/SandboxAware.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/SandboxAware.kt index c1afe0a8b3..5e5349c943 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/SandboxAware.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/SandboxAware.kt @@ -1,6 +1,6 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks.base +package org.jetbrains.intellij.platform.gradle.tasks.base import org.gradle.api.file.DirectoryProperty import org.gradle.api.tasks.InputDirectory diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/ZipSigningToolBase.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/ZipSigningToolBase.kt similarity index 90% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/ZipSigningToolBase.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/ZipSigningToolBase.kt index cf4533b83d..c3660066de 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/base/ZipSigningToolBase.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/ZipSigningToolBase.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks.base +package org.jetbrains.intellij.platform.gradle.tasks.base import com.jetbrains.plugin.structure.base.utils.exists import org.apache.tools.ant.util.TeeOutputStream @@ -12,11 +12,11 @@ import org.gradle.api.provider.Property import org.gradle.api.tasks.* import org.gradle.process.ExecOperations import org.gradle.process.internal.ExecException -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.asPath -import org.jetbrains.intellij.platform.gradleplugin.debug -import org.jetbrains.intellij.platform.gradleplugin.error -import org.jetbrains.intellij.platform.gradleplugin.logCategory +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.asPath +import org.jetbrains.intellij.platform.gradle.debug +import org.jetbrains.intellij.platform.gradle.error +import org.jetbrains.intellij.platform.gradle.logCategory import java.io.ByteArrayOutputStream import java.nio.file.Path import kotlin.io.path.absolutePathString diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils.kt similarity index 96% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils.kt index b1eb6cf451..b21900ba75 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils.kt @@ -3,7 +3,7 @@ @file:JvmName("Utils") @file:Suppress("BooleanMethodIsAlwaysInverted") -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import com.jetbrains.plugin.structure.base.plugin.PluginCreationFail import com.jetbrains.plugin.structure.base.plugin.PluginCreationSuccess @@ -30,9 +30,9 @@ import org.gradle.util.GradleVersion import org.jdom2.Document import org.jdom2.output.Format import org.jdom2.output.XMLOutputter -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MINIMAL_SUPPORTED_GRADLE_VERSION -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_NAME -import org.jetbrains.intellij.platform.gradleplugin.plugins.IntelliJPlatformPlugin +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.MINIMAL_SUPPORTED_GRADLE_VERSION +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_NAME +import org.jetbrains.intellij.platform.gradle.plugins.IntelliJPlatformPlugin import java.io.File import java.io.StringWriter import java.net.HttpURLConnection diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/ArchiveUtils.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/ArchiveUtils.kt similarity index 94% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/ArchiveUtils.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/ArchiveUtils.kt index fc4846420b..64a59d3467 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/ArchiveUtils.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/ArchiveUtils.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.utils +package org.jetbrains.intellij.platform.gradle.utils import com.jetbrains.plugin.structure.base.utils.* import org.gradle.api.file.ArchiveOperations import org.gradle.api.file.FileSystemOperations -import org.jetbrains.intellij.platform.gradleplugin.debug +import org.jetbrains.intellij.platform.gradle.debug import java.nio.file.Path import java.util.function.BiConsumer import java.util.function.Predicate diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/DependenciesDownloader.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/DependenciesDownloader.kt similarity index 93% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/DependenciesDownloader.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/DependenciesDownloader.kt index a8eed21640..28337e49f0 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/DependenciesDownloader.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/DependenciesDownloader.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.utils +package org.jetbrains.intellij.platform.gradle.utils import org.gradle.api.artifacts.ArtifactRepositoryContainer import org.gradle.api.artifacts.ConfigurationContainer @@ -12,10 +12,10 @@ import org.gradle.api.artifacts.repositories.IvyArtifactRepository import org.gradle.api.artifacts.repositories.MavenArtifactRepository import org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.ANDROID_STUDIO_PRODUCTS_RELEASES_URL -import org.jetbrains.intellij.platform.gradleplugin.error -import org.jetbrains.intellij.platform.gradleplugin.info -import org.jetbrains.intellij.platform.gradleplugin.repositoryVersion +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.ANDROID_STUDIO_PRODUCTS_RELEASES_URL +import org.jetbrains.intellij.platform.gradle.error +import org.jetbrains.intellij.platform.gradle.info +import org.jetbrains.intellij.platform.gradle.repositoryVersion import java.io.File import java.net.URI import java.net.URL diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/LatestVersionResolver.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/LatestVersionResolver.kt similarity index 82% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/LatestVersionResolver.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/LatestVersionResolver.kt index afd9cdacd8..03e866cd75 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/LatestVersionResolver.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/LatestVersionResolver.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.utils +package org.jetbrains.intellij.platform.gradle.utils import org.gradle.api.GradleException -import org.jetbrains.intellij.platform.gradleplugin.debug -import org.jetbrains.intellij.platform.gradleplugin.model.MavenMetadata -import org.jetbrains.intellij.platform.gradleplugin.model.XmlExtractor +import org.jetbrains.intellij.platform.gradle.debug +import org.jetbrains.intellij.platform.gradle.model.MavenMetadata +import org.jetbrains.intellij.platform.gradle.model.XmlExtractor import java.net.HttpURLConnection import java.net.URL diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/OpenedPackages.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/OpenedPackages.kt similarity index 98% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/OpenedPackages.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/OpenedPackages.kt index 234780761d..ef83f1bb4d 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/OpenedPackages.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/OpenedPackages.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.utils +package org.jetbrains.intellij.platform.gradle.utils import org.gradle.internal.os.OperatingSystem diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/PlatformJavaVersions.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/PlatformJavaVersions.kt similarity index 81% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/PlatformJavaVersions.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/PlatformJavaVersions.kt index 99b56cb851..f65256b37f 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/PlatformJavaVersions.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/PlatformJavaVersions.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.utils +package org.jetbrains.intellij.platform.gradle.utils import org.gradle.api.JavaVersion -import org.jetbrains.intellij.platform.gradleplugin.Version +import org.jetbrains.intellij.platform.gradle.Version // Java versions list used in IntelliJ Platform synchronized with: // https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html#intellij-platform-based-products-of-recent-ide-versions diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/PlatformKotlinVersions.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/PlatformKotlinVersions.kt similarity index 87% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/PlatformKotlinVersions.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/PlatformKotlinVersions.kt index be2c9c8241..c6fd273f1b 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/PlatformKotlinVersions.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/PlatformKotlinVersions.kt @@ -1,8 +1,8 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.utils +package org.jetbrains.intellij.platform.gradle.utils -import org.jetbrains.intellij.platform.gradleplugin.Version +import org.jetbrains.intellij.platform.gradle.Version // Bundled Kotlin versions list synchronized with: // https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/ToolboxEnterprisePluginRepositoryService.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/ToolboxEnterprisePluginRepositoryService.kt similarity index 94% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/ToolboxEnterprisePluginRepositoryService.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/ToolboxEnterprisePluginRepositoryService.kt index 3dbee01641..742ac2886d 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradleplugin/utils/ToolboxEnterprisePluginRepositoryService.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/ToolboxEnterprisePluginRepositoryService.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.utils +package org.jetbrains.intellij.platform.gradle.utils import okhttp3.MultipartBody import okhttp3.RequestBody diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpec.kt similarity index 97% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpec.kt index a1737cce9d..38ba30b8e6 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpec.kt @@ -1,16 +1,16 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import com.jetbrains.plugin.structure.base.utils.forceDeleteIfExists import org.gradle.api.plugins.JavaPlugin.TEST_TASK_NAME import org.gradle.testkit.runner.BuildResult -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MARKETPLACE_HOST -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.MINIMAL_SUPPORTED_GRADLE_VERSION -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.TASKS -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks -import org.jetbrains.intellij.platform.gradleplugin.test.createLocalIdeIfNotExists +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.MARKETPLACE_HOST +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.MINIMAL_SUPPORTED_GRADLE_VERSION +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.TASKS +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.test.createLocalIdeIfNotExists import org.jetbrains.intellij.pluginRepository.PluginRepositoryFactory import org.junit.AfterClass import org.junit.Assume.assumeFalse @@ -663,7 +663,7 @@ class IntelliJPluginSpec : IntelliJPluginSpecBase() { this.groovy( """ import org.gradle.api.artifacts.result.UnresolvedArtifactResult - import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks + import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks task printPluginSourceArtifacts { dependsOn(Tasks.SETUP_DEPENDENCIES) diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpecBase.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpecBase.kt similarity index 98% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpecBase.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpecBase.kt index 53a03cdb98..a806c9c8cc 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPluginSpecBase.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpecBase.kt @@ -1,12 +1,12 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import org.apache.commons.io.FileUtils import org.gradle.api.GradleException import org.gradle.api.internal.project.ProjectInternal import org.intellij.lang.annotations.Language -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_INTELLIJ_PLUGINS_REPOSITORY +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DEFAULT_INTELLIJ_PLUGINS_REPOSITORY import java.io.BufferedReader import java.io.File import java.io.FileOutputStream diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/SearchableOptionsSpecBase.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/SearchableOptionsSpecBase.kt similarity index 90% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/SearchableOptionsSpecBase.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/SearchableOptionsSpecBase.kt index 8ea28a752f..3d343ee30f 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/SearchableOptionsSpecBase.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/SearchableOptionsSpecBase.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import org.intellij.lang.annotations.Language -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SEARCHABLE_OPTIONS_DIR_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SEARCHABLE_OPTIONS_SUFFIX +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.SEARCHABLE_OPTIONS_DIR_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.SEARCHABLE_OPTIONS_SUFFIX import java.io.File abstract class SearchableOptionsSpecBase : IntelliJPluginSpecBase() { diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/UtilsTest.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/UtilsTest.kt similarity index 87% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/UtilsTest.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/UtilsTest.kt index f6614bf81f..a3d78ad142 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/UtilsTest.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/UtilsTest.kt @@ -1,8 +1,8 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle -import org.jetbrains.intellij.platform.gradleplugin.dependency.PluginDependencyNotation +import org.jetbrains.intellij.platform.gradle.dependency.PluginDependencyNotation import kotlin.test.Test import kotlin.test.assertEquals diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/VersionTest.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/VersionTest.kt similarity index 97% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/VersionTest.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/VersionTest.kt index fae5053432..b4270f3331 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/VersionTest.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/VersionTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import kotlin.test.Test import kotlin.test.assertEquals diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolverTest.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/jbr/JbrResolverTest.kt similarity index 94% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolverTest.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/jbr/JbrResolverTest.kt index aaaa582c1e..e809460ca2 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/jbr/JbrResolverTest.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/jbr/JbrResolverTest.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.jbr +package org.jetbrains.intellij.platform.gradle.jbr import org.gradle.internal.os.OperatingSystem -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import kotlin.test.Test const val TASK_NAME = "testJbrResolver" diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/IdeaLogParserTest.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/parsers/IdeaLogParserTest.kt similarity index 91% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/IdeaLogParserTest.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/parsers/IdeaLogParserTest.kt index b22b8d24b8..9db65f9c31 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/IdeaLogParserTest.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/parsers/IdeaLogParserTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.performanceTest.parsers +package org.jetbrains.intellij.platform.gradle.performanceTest.parsers import kotlin.test.Test import kotlin.test.assertEquals diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/SimpleIJPerfParserTest.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/parsers/SimpleIJPerfParserTest.kt similarity index 95% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/SimpleIJPerfParserTest.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/parsers/SimpleIJPerfParserTest.kt index d3489b3b32..3e5cfbc7e6 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/performanceTest/parsers/SimpleIJPerfParserTest.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/performanceTest/parsers/SimpleIJPerfParserTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.performanceTest.parsers +package org.jetbrains.intellij.platform.gradle.performanceTest.parsers import java.nio.file.Path import kotlin.test.Test diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildPluginTaskSpec.kt similarity index 97% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildPluginTaskSpec.kt index d9aa372a9b..244e18bdef 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildPluginTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildPluginTaskSpec.kt @@ -1,12 +1,12 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import java.io.File import java.util.jar.Manifest import java.util.zip.ZipFile diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTaskSpec.kt similarity index 87% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTaskSpec.kt index c90677f507..92ed5c3081 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/BuildSearchableOptionsTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTaskSpec.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.BUILD_SEARCHABLE_OPTIONS_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.SearchableOptionsSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.BUILD_SEARCHABLE_OPTIONS_TASK_NAME +import org.jetbrains.intellij.platform.gradle.SearchableOptionsSpecBase import kotlin.test.Ignore import kotlin.test.Test diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIntelliJPluginsSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIntelliJPluginsSpec.kt similarity index 98% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIntelliJPluginsSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIntelliJPluginsSpec.kt index 26ab7e3c58..e8482ae447 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIntelliJPluginsSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIntelliJPluginsSpec.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.plugins.BasePlugin.ASSEMBLE_TASK_NAME import org.gradle.internal.os.OperatingSystem -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import org.junit.Assume.assumeFalse import java.io.File import kotlin.test.BeforeTest diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIntelliJSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIntelliJSpec.kt similarity index 97% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIntelliJSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIntelliJSpec.kt index 993926502b..d81ea91cec 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadIntelliJSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIntelliJSpec.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.plugins.BasePlugin.ASSEMBLE_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import java.io.File import kotlin.test.* diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadRobotServerPluginTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadRobotServerPluginTaskSpec.kt similarity index 94% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadRobotServerPluginTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadRobotServerPluginTaskSpec.kt index d59beb3600..2317f65ffd 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/DownloadRobotServerPluginTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadRobotServerPluginTaskSpec.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import java.io.File import kotlin.test.Test import kotlin.test.assertTrue diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/IntelliJInstrumentCodeTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/IntelliJInstrumentCodeTaskSpec.kt similarity index 96% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/IntelliJInstrumentCodeTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/IntelliJInstrumentCodeTaskSpec.kt index b4c0da80df..6a2e4c3ba8 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/IntelliJInstrumentCodeTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/IntelliJInstrumentCodeTaskSpec.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.plugins.JavaPlugin import org.gradle.testkit.runner.TaskOutcome -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import kotlin.test.Test import kotlin.test.assertEquals diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/JarSearchableOptionsTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTaskSpec.kt similarity index 85% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/JarSearchableOptionsTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTaskSpec.kt index 9fa96df10a..3bef14351d 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/JarSearchableOptionsTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTaskSpec.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.SearchableOptionsSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME +import org.jetbrains.intellij.platform.gradle.SearchableOptionsSpecBase import java.io.File import kotlin.test.Test import kotlin.test.assertEquals diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListBundledPluginsTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListBundledPluginsTaskSpec.kt similarity index 95% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListBundledPluginsTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListBundledPluginsTaskSpec.kt index b4a3879975..b821593a44 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListBundledPluginsTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListBundledPluginsTaskSpec.kt @@ -1,8 +1,8 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase class ListBundledPluginsTaskSpec : IntelliJPluginSpecBase() { diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTaskSpec.kt similarity index 94% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTaskSpec.kt index 06097f0dc3..7881d0e91b 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ListProductsReleasesTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTaskSpec.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import kotlin.test.BeforeTest import kotlin.test.Test import kotlin.test.assertEquals @@ -162,7 +162,7 @@ class ListProductsReleasesTaskSpec : IntelliJPluginSpecBase() { fun `get IDEs list without EAP releases`() { buildFile.groovy( """ - import org.jetbrains.intellij.platform.gradleplugin.tasks.ListProductsReleasesTask.Channel + import org.jetbrains.intellij.platform.gradle.tasks.ListProductsReleasesTask.Channel listProductsReleases { sinceVersion = "2021.1" @@ -265,7 +265,7 @@ class ListProductsReleasesTaskSpec : IntelliJPluginSpecBase() { fun `get Android Studio releases for Release channel`() { buildFile.groovy( """ - import org.jetbrains.intellij.platform.gradleplugin.tasks.ListProductsReleasesTask.Channel + import org.jetbrains.intellij.platform.gradle.tasks.ListProductsReleasesTask.Channel listProductsReleases { sinceVersion = "2021.1" diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTaskSpec.kt similarity index 97% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTaskSpec.kt index 99e46a4168..ce8a1cf1a1 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PatchPluginXmlTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTaskSpec.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.testkit.runner.TaskOutcome -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_XML_DIR_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_XML_DIR_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import java.io.File import kotlin.test.Test import kotlin.test.assertEquals diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareSandboxTaskSpec.kt similarity index 98% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareSandboxTaskSpec.kt index 4540b5d650..697fafb480 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PrepareSandboxTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareSandboxTaskSpec.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_SANDBOX_CONTAINER -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DEFAULT_SANDBOX_CONTAINER +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import java.io.File import java.nio.file.Files.createTempDirectory import java.util.zip.ZipFile diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ProcessResourcesTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ProcessResourcesTaskSpec.kt similarity index 94% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ProcessResourcesTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ProcessResourcesTaskSpec.kt index 47e4bf2b75..4f066f1d7c 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/ProcessResourcesTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ProcessResourcesTaskSpec.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.plugins.JavaPlugin import org.gradle.testkit.runner.TaskOutcome -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import java.io.File import kotlin.test.Test import kotlin.test.assertEquals diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PublishPluginTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PublishPluginTaskSpec.kt similarity index 82% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PublishPluginTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PublishPluginTaskSpec.kt index 29ec8587a7..c808da6093 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/PublishPluginTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PublishPluginTaskSpec.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PUBLISH_PLUGIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PUBLISH_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import kotlin.test.BeforeTest import kotlin.test.Test diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunPluginVerifierTaskSpec.kt similarity index 95% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunPluginVerifierTaskSpec.kt index 8f86190b17..85e20cde13 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/RunPluginVerifierTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunPluginVerifierTaskSpec.kt @@ -1,13 +1,13 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.apache.commons.io.FileUtils import org.gradle.kotlin.dsl.support.listFilesOrdered -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import org.junit.Assert import java.net.URL import java.util.* @@ -267,7 +267,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { val resource = resolveResourcePath("products-releases/idea-releases.xml") buildFile.groovy( """ - import org.jetbrains.intellij.platform.gradleplugin.tasks.ListProductsReleasesTask.Channel + import org.jetbrains.intellij.platform.gradle.tasks.ListProductsReleasesTask.Channel version = "1.0.0" @@ -329,7 +329,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { writePluginXmlFile() buildFile.groovy( """ - import org.jetbrains.intellij.platform.gradleplugin.tasks.RunPluginVerifierTask.FailureLevel + import org.jetbrains.intellij.platform.gradle.tasks.RunPluginVerifierTask.FailureLevel version = "1.0.0" @@ -391,7 +391,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { writePluginXmlFile() buildFile.groovy( """ - import org.jetbrains.intellij.platform.gradleplugin.tasks.RunPluginVerifierTask.FailureLevel + import org.jetbrains.intellij.platform.gradle.tasks.RunPluginVerifierTask.FailureLevel version = "1.0.0" @@ -414,7 +414,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { writePluginXmlFile() buildFile.groovy( """ - import org.jetbrains.intellij.platform.gradleplugin.tasks.RunPluginVerifierTask.FailureLevel + import org.jetbrains.intellij.platform.gradle.tasks.RunPluginVerifierTask.FailureLevel version = "1.0.0" diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SetupDependenciesTaskSpec.kt similarity index 83% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SetupDependenciesTaskSpec.kt index 7cf368100d..8de2329ce2 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SetupDependenciesTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SetupDependenciesTaskSpec.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.Tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import kotlin.test.Test @Suppress("ComplexRedundantLet") diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SignPluginTaskSpec.kt similarity index 95% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SignPluginTaskSpec.kt index b9de31d740..b7a455b0d0 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/SignPluginTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SignPluginTaskSpec.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DOWNLOAD_ZIP_SIGNER_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.SIGN_PLUGIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_SIGNATURE_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DOWNLOAD_ZIP_SIGNER_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.SIGN_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERIFY_PLUGIN_SIGNATURE_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import java.io.File import kotlin.test.Test import kotlin.test.assertTrue diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginConfigurationTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTaskSpec.kt similarity index 97% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginConfigurationTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTaskSpec.kt index 38cbcf4f27..4cb34c33f7 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginConfigurationTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTaskSpec.kt @@ -1,10 +1,10 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.internal.impldep.org.testng.annotations.BeforeTest -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_CONFIGURATION_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERIFY_PLUGIN_CONFIGURATION_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import java.io.File import kotlin.test.Test diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginTaskSpec.kt similarity index 96% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginTaskSpec.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginTaskSpec.kt index 95432de09a..923d628551 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/tasks/VerifyPluginTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginTaskSpec.kt @@ -1,9 +1,9 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.tasks +package org.jetbrains.intellij.platform.gradle.tasks -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.VERIFY_PLUGIN_TASK_NAME -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERIFY_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import kotlin.test.Test @Suppress("PluginXmlCapitalization", "PluginXmlValidity", "ComplexRedundantLet") diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/test/localIdeTestUtils.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/test/localIdeTestUtils.kt similarity index 93% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/test/localIdeTestUtils.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/test/localIdeTestUtils.kt index b50cd88305..29d5d19831 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradleplugin/test/localIdeTestUtils.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/test/localIdeTestUtils.kt @@ -1,11 +1,11 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin.test +package org.jetbrains.intellij.platform.gradle.test import com.jetbrains.plugin.structure.base.utils.createDir import com.jetbrains.plugin.structure.base.utils.exists import com.jetbrains.plugin.structure.base.utils.forceDeleteIfExists -import org.jetbrains.intellij.platform.gradleplugin.IntelliJPluginConstants.DEFAULT_INTELLIJ_REPOSITORY +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DEFAULT_INTELLIJ_REPOSITORY import java.io.File import java.net.URL import java.nio.file.Files diff --git a/src/testFixtures/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformTestBase.kt b/src/testFixtures/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformTestBase.kt similarity index 99% rename from src/testFixtures/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformTestBase.kt rename to src/testFixtures/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformTestBase.kt index d6139f1477..413676c3b0 100644 --- a/src/testFixtures/kotlin/org/jetbrains/intellij/platform/gradleplugin/IntelliJPlatformTestBase.kt +++ b/src/testFixtures/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformTestBase.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradleplugin +package org.jetbrains.intellij.platform.gradle import org.gradle.testkit.runner.BuildResult import org.gradle.testkit.runner.GradleRunner From 67b5648a3423dc197591b783533d470db1f2ef75 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Wed, 8 Nov 2023 13:39:46 +0100 Subject: [PATCH 039/347] Tasks and Tests cleanup. Finalizing: - InitializeIntelliJPlatformPluginTask - SetupDependenciesTask - ListBundledPluginsTask - PrintBundledPluginsTask --- gradle.properties | 2 +- .../gradle/BuildFeaturesIntegrationTest.kt | 2 +- .../InstrumentationTaskIntegrationTest.kt | 1 + .../IntelliJPlatformIntegrationTestBase.kt | 8 +- .../gradle/IntelliJPluginConstants.kt | 43 +- .../executableResolver/ExecutableResolver.kt | 12 + .../IntelliJPluginVerifierResolver.kt | 47 + .../JetBrainsRuntimeResolver.kt | 33 +- .../IntelliJPlatformDependenciesExtension.kt | 144 +- .../extensions/IntelliJPlatformExtension.kt | 19 + .../IntelliJPlatformRepositoriesExtension.kt | 11 +- .../IntelliJPlatformAbstractProjectPlugin.kt | 25 +- .../plugins/IntelliJPlatformBasePlugin.kt | 154 +- .../gradle/plugins/IntelliJPlatformPlugin.kt | 132 +- .../plugins/IntelliJPlatformTasksPlugin.kt | 230 ++- .../platform/gradle/plugins/plugins.kt | 12 + .../platform/gradle/tasks/BuildPluginTask.kt | 1 + .../tasks/BuildSearchableOptionsTask.kt | 5 +- .../gradle/tasks/ClasspathIndexCleanupTask.kt | 1 + ...loadAndroidStudioProductReleasesXmlTask.kt | 1 + .../DownloadIdeaProductReleasesXmlTask.kt | 1 + .../tasks/DownloadRobotServerPluginTask.kt | 1 + .../gradle/tasks/DownloadZipSignerTask.kt | 1 + .../InitializeIntelliJPlatformPluginTask.kt | 58 +- .../gradle/tasks/InstrumentCodeTask.kt | 1 + .../gradle/tasks/InstrumentedJarTask.kt | 1 + .../gradle/tasks/JarSearchableOptionsTask.kt | 1 + .../gradle/tasks/ListBundledPluginsTask.kt | 45 +- .../gradle/tasks/ListProductsReleasesTask.kt | 1 + .../gradle/tasks/PatchPluginXmlTask.kt | 1 + .../gradle/tasks/PrepareSandboxTask.kt | 1 + .../gradle/tasks/PrintBundledPluginsTask.kt | 16 + .../gradle/tasks/PrintProductsReleasesTask.kt | 1 + .../gradle/tasks/PublishPluginTask.kt | 1 + .../gradle/tasks/RunIdeForUiTestTask.kt | 1 + .../gradle/tasks/RunIdePerformanceTestTask.kt | 1 + .../platform/gradle/tasks/RunIdeTask.kt | 1 + .../gradle/tasks/RunPluginVerifierTask.kt | 97 +- .../gradle/tasks/SetupDependenciesTask.kt | 28 +- .../platform/gradle/tasks/SignPluginTask.kt | 1 + .../platform/gradle/tasks/TestIdeTask.kt | 1 + .../tasks/VerifyPluginConfigurationTask.kt | 72 +- .../gradle/tasks/VerifyPluginSignatureTask.kt | 1 + .../platform/gradle/tasks/VerifyPluginTask.kt | 1 + .../tasks/base/JetBrainsRuntimeAware.kt | 10 +- .../gradle/tasks/base/PluginVerifierAware.kt | 21 + .../platform/gradle/tasks/base/RunIdeBase.kt | 1 + .../gradle/tasks/base/ZipSigningToolBase.kt | 1 + .../intellij/platform/gradle/tasks/tasks.kt | 171 ++ .../intellij/platform/gradle/utils.kt | 18 - .../platform/gradle/IntelliJPluginSpec.kt | 13 +- .../platform/gradle/IntelliJPluginSpecBase.kt | 66 +- .../gradle/SearchableOptionsSpecBase.kt | 5 +- .../JbrResolverTest.kt | 2 +- .../gradle/tasks/BuildPluginTaskSpec.kt | 35 +- .../tasks/BuildSearchableOptionsTaskSpec.kt | 2 +- .../DownloadRobotServerPluginTaskSpec.kt | 7 +- ...nitializeIntelliJPlatformPluginTaskSpec.kt | 90 + .../tasks/JarSearchableOptionsTaskSpec.kt | 4 +- .../tasks/ListBundledPluginsTaskSpec.kt | 151 +- .../tasks/ListProductsReleasesTaskSpec.kt | 1 + .../gradle/tasks/PatchPluginXmlTaskSpec.kt | 4 +- .../gradle/tasks/PrepareSandboxTaskSpec.kt | 1784 ++++++++--------- .../tasks/PrintBundledPluginsTaskSpec.kt | 90 + .../gradle/tasks/ProcessResourcesTaskSpec.kt | 4 +- .../gradle/tasks/RunPluginVerifierTaskSpec.kt | 47 +- .../gradle/tasks/SetupDependenciesTaskSpec.kt | 28 +- .../gradle/tasks/SignPluginTaskSpec.kt | 13 +- .../VerifyPluginConfigurationTaskSpec.kt | 28 +- .../gradle/tasks/VerifyPluginTaskSpec.kt | 20 +- .../gradle/IntelliJPlatformTestBase.kt | 21 +- 71 files changed, 2144 insertions(+), 1710 deletions(-) create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradle/executableResolver/ExecutableResolver.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradle/executableResolver/IntelliJPluginVerifierResolver.kt rename src/main/kotlin/org/jetbrains/intellij/platform/gradle/{jbr => executableResolver}/JetBrainsRuntimeResolver.kt (85%) create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/PluginVerifierAware.kt create mode 100644 src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/tasks.kt rename src/test/kotlin/org/jetbrains/intellij/platform/gradle/{jbr => executableResolver}/JbrResolverTest.kt (97%) create mode 100644 src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InitializeIntelliJPlatformPluginTaskSpec.kt create mode 100644 src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintBundledPluginsTaskSpec.kt diff --git a/gradle.properties b/gradle.properties index 5ea8f9a9f2..49ddb925fb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ gradleVersion=8.4 kotlinVersion=1.9.10 testGradleVersion= testGradleArguments= -testIntelliJVersion=2022.1.4 +testIntelliJVersion=2022.3.3 testMarkdownPluginVersion=221.5787.39 #org.gradle.caching=true #org.gradle.parallel=true diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/BuildFeaturesIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/BuildFeaturesIntegrationTest.kt index 15bea2cf46..1cd4e2445f 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/BuildFeaturesIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/BuildFeaturesIntegrationTest.kt @@ -82,7 +82,7 @@ class BuildFeaturesIntegrationTest : IntelliJPlatformIntegrationTestBase( fun `paidPluginSearchableOptionsWarning is enabled`() { val flag = BuildFeature.PAID_PLUGIN_SEARCHABLE_OPTIONS_WARNING.toString() - dir.toPath().resolve("src/main/resources/META-INF/plugin.xml").also { + dir.resolve("src/main/resources/META-INF/plugin.xml").also { Files.createDirectories(it.parent) Files.deleteIfExists(it) Files.createFile(it) diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/InstrumentationTaskIntegrationTest.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/InstrumentationTaskIntegrationTest.kt index 739b651a65..a77fdc6da3 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/InstrumentationTaskIntegrationTest.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/InstrumentationTaskIntegrationTest.kt @@ -3,6 +3,7 @@ package org.jetbrains.intellij.platform.gradle import java.nio.file.Files +import kotlin.io.path.appendText import kotlin.test.Test class InstrumentationTaskIntegrationTest : IntelliJPlatformIntegrationTestBase( diff --git a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformIntegrationTestBase.kt b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformIntegrationTestBase.kt index 1e5daa1b25..3e83849de5 100644 --- a/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformIntegrationTestBase.kt +++ b/src/integrationTest/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformIntegrationTestBase.kt @@ -6,7 +6,9 @@ import java.nio.file.FileSystems import java.nio.file.Files import java.nio.file.Path import java.util.zip.ZipFile +import kotlin.io.path.ExperimentalPathApi import kotlin.io.path.copyTo +import kotlin.io.path.deleteRecursively import kotlin.io.path.notExists import kotlin.test.AfterTest import kotlin.test.BeforeTest @@ -25,13 +27,13 @@ open class IntelliJPlatformIntegrationTestBase( } @AfterTest + @OptIn(ExperimentalPathApi::class) fun cleanup() { dir.deleteRecursively() } protected fun use(resourceName: String) { val resourcePath = Path.of("src", "integrationTest", "resources", resourceName) - val destinationPath = dir.toPath() if (resourcePath.notExists()) { throw IllegalArgumentException("Integration tests resource '$resourceName' not found in: $resourcePath") @@ -39,7 +41,7 @@ open class IntelliJPlatformIntegrationTestBase( Files.walk(resourcePath) .forEach { - val destinationFile = destinationPath.resolve(resourcePath.relativize(it)) + val destinationFile = dir.resolve(resourcePath.relativize(it)) it.copyTo(destinationFile, true) } } @@ -81,7 +83,7 @@ open class IntelliJPlatformIntegrationTestBase( * e.g., `/Users/hsz/Projects/JetBrains/gradle-intellij-plugin/integration-tests/plugin-xml-patching/build/`. */ val buildDirectory - get() = dir.resolve("build").toPath() + get() = dir.resolve("build") .also { assert(Files.exists(it)) { "Build directory does not exist: $it" } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginConstants.kt index 919763b83f..497d4b998a 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginConstants.kt @@ -17,16 +17,15 @@ object IntelliJPluginConstants { const val KOTLIN_STDLIB_DEFAULT_DEPENDENCY_PROPERTY_NAME = "kotlin.stdlib.default.dependency" const val KOTLIN_INCREMENTAL_USE_CLASSPATH_SNAPSHOT = "kotlin.incremental.useClasspathSnapshot" const val COMPILE_KOTLIN_TASK_NAME = "compileKotlin" + const val VERSION_LATEST = "latest" object Extensions { const val IDEA_VERSION = "ideaVersion" const val INTELLIJ_PLATFORM = "intellijPlatform" const val PLUGIN_CONFIGURATION = "pluginConfiguration" + const val PLUGIN_VERIFIER = "pluginVerifier" const val PRODUCT_DESCRIPTOR = "productDescriptor" const val VENDOR = "vendor" - - const val INTELLIJ_PLATFORM_REPOSITORY_SETTINGS = "intellijPlatformRepositorySettings" - const val INTELLIJ_PLATFORM_DEPENDENCY_SETTINGS = "intellijPlatformDependencySettings" } object Configurations { @@ -35,6 +34,7 @@ object IntelliJPluginConstants { const val INTELLIJ_PLATFORM = "intellijPlatform" const val INTELLIJ_PLATFORM_PRODUCT_INFO = "intellijPlatformProductInfo" const val INTELLIJ_PLATFORM_DEPENDENCIES = "intellijPlatformDependencies" + const val INTELLIJ_PLUGIN_VERIFIER = "intellijPluginVerifier" const val JETBRAINS_RUNTIME = "jetbrainsRuntime" const val JETBRAINS_RUNTIME_DEPENDENCY = "jetbrainsRuntimeDependency" const val JETBRAINS_RUNTIME_LOCAL_INSTANCE = "jetbrainsRuntimeLocalInstance" @@ -52,17 +52,21 @@ object IntelliJPluginConstants { } object Tasks { - const val BUILD_PLUGIN = "buildPlugin" + const val BUILD_PLUGIN = "buildPlugin" // TODO: check const val INITIALIZE_INTELLIJ_PLATFORM_PLUGIN = "initializeIntellijPlatformPlugin" - const val INSTRUMENTED_JAR = "instrumentedJar" - const val PATCH_PLUGIN_XML = "patchPluginXml" - const val PREPARE_SANDBOX = "prepareSandbox" - const val PREPARE_TESTING_SANDBOX = "prepareTestingSandbox" - const val PREPARE_UI_TESTING_SANDBOX = "prepareUiTestingSandbox" - const val RUN_IDE = "runIde" + const val INSTRUMENTED_JAR = "instrumentedJar" // TODO: check + const val LIST_BUNDLED_PLUGINS = "listBundledPlugins" + const val PATCH_PLUGIN_XML = "patchPluginXml" // TODO: check + const val PREPARE_SANDBOX = "prepareSandbox" // TODO: check + const val PREPARE_TESTING_SANDBOX = "prepareTestingSandbox" // TODO: check + const val PREPARE_UI_TESTING_SANDBOX = "prepareUiTestingSandbox" // TODO: check + const val PRINT_BUNDLED_PLUGINS = "printBundledPlugins" + const val RUN_IDE = "runIde" // TODO: check + const val RUN_PLUGIN_VERIFIER = "runPluginVerifier" // TODO: check const val SETUP_DEPENDENCIES = "setupDependencies" - const val TEST_IDE = "testIde" - const val VERIFY_PLUGIN_CONFIGURATION = "verifyPluginConfiguration" + const val TEST_IDE = "testIde" // TODO: check + const val VERIFY_PLUGIN = "verifyPlugin" // TODO: check + const val VERIFY_PLUGIN_CONFIGURATION = "verifyPluginConfiguration" // TODO: check } object Sandbox { @@ -75,7 +79,9 @@ object IntelliJPluginConstants { object Locations { const val CACHE_REDIRECTOR = "https://cache-redirector.jetbrains.com" + const val GITHUB_REPOSITORY = "https://github.com/jetbrains/gradle-intellij-plugin" const val JETBRAINS_RUNTIME_REPOSITORY = "$CACHE_REDIRECTOR/intellij-jbr" + const val PLUGIN_VERIFIER_REPOSITORY = "$CACHE_REDIRECTOR/packages.jetbrains.team/maven/p/intellij-plugin-verifier/intellij-plugin-verifier" } const val BUILD_SEARCHABLE_OPTIONS_TASK_NAME = "buildSearchableOptions" @@ -87,17 +93,13 @@ object IntelliJPluginConstants { const val INSTRUMENT_CODE_TASK_NAME = "instrumentCode" const val INSTRUMENT_TEST_CODE_TASK_NAME = "instrumentTestCode" const val JAR_SEARCHABLE_OPTIONS_TASK_NAME = "jarSearchableOptions" - const val LIST_BUNDLED_PLUGINS_TASK_NAME = "listBundledPlugins" const val LIST_PRODUCTS_RELEASES_TASK_NAME = "listProductsReleases" - const val PRINT_BUNDLED_PLUGINS_TASK_NAME = "printBundledPlugins" const val PRINT_PRODUCTS_RELEASES_TASK_NAME = "printProductsReleases" const val PUBLISH_PLUGIN_TASK_NAME = "publishPlugin" const val RUN_IDE_FOR_UI_TESTS_TASK_NAME = "runIdeForUiTests" const val RUN_IDE_PERFORMANCE_TEST_TASK_NAME = "runIdePerformanceTest" - const val RUN_PLUGIN_VERIFIER_TASK_NAME = "runPluginVerifier" const val SIGN_PLUGIN_TASK_NAME = "signPlugin" - const val VERIFY_PLUGIN_TASK_NAME = "verifyPlugin" const val VERIFY_PLUGIN_SIGNATURE_TASK_NAME = "verifyPluginSignature" val TASKS = listOf( @@ -113,7 +115,7 @@ object IntelliJPluginConstants { Tasks.INSTRUMENTED_JAR, // INSTRUMENT_TEST_CODE_TASK_NAME, // JAR_SEARCHABLE_OPTIONS_TASK_NAME, -// LIST_BUNDLED_PLUGINS_TASK_NAME, + Tasks.LIST_BUNDLED_PLUGINS, // LIST_PRODUCTS_RELEASES_TASK_NAME, Tasks.PATCH_PLUGIN_XML, Tasks.PREPARE_SANDBOX, @@ -125,11 +127,11 @@ object IntelliJPluginConstants { Tasks.RUN_IDE, // RUN_IDE_FOR_UI_TESTS_TASK_NAME, // RUN_IDE_PERFORMANCE_TEST_TASK_NAME, -// RUN_PLUGIN_VERIFIER_TASK_NAME, + Tasks.RUN_PLUGIN_VERIFIER, Tasks.SETUP_DEPENDENCIES, // SIGN_PLUGIN_TASK_NAME, Tasks.TEST_IDE, -// VERIFY_PLUGIN_TASK_NAME, + Tasks.VERIFY_PLUGIN, Tasks.VERIFY_PLUGIN_CONFIGURATION, // VERIFY_PLUGIN_SIGNATURE_TASK_NAME, ) @@ -170,11 +172,8 @@ object IntelliJPluginConstants { const val INTELLIJ_DEPENDENCIES = "${Locations.CACHE_REDIRECTOR}/intellij-dependencies" const val DEFAULT_INTELLIJ_REPOSITORY = "${Locations.CACHE_REDIRECTOR}/www.jetbrains.com/intellij-repository" const val DEFAULT_INTELLIJ_PLUGINS_REPOSITORY = "${Locations.CACHE_REDIRECTOR}/plugins.jetbrains.com/maven" - const val PLUGIN_VERIFIER_REPOSITORY = "${Locations.CACHE_REDIRECTOR}/packages.jetbrains.team/maven/p/intellij-plugin-verifier/intellij-plugin-verifier" const val JAVA_COMPILER_ANT_TASKS_MAVEN_METADATA = "$DEFAULT_INTELLIJ_REPOSITORY/releases/com/jetbrains/intellij/java/java-compiler-ant-tasks/maven-metadata.xml" - const val GITHUB_REPOSITORY = "https://github.com/jetbrains/gradle-intellij-plugin" - const val VERSION_LATEST = "latest" const val PERFORMANCE_PLUGIN_ID = "com.jetbrains.performancePlugin" } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/executableResolver/ExecutableResolver.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/executableResolver/ExecutableResolver.kt new file mode 100644 index 0000000000..f244f2c10f --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/executableResolver/ExecutableResolver.kt @@ -0,0 +1,12 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradle.executableResolver + +import java.nio.file.Path + +interface ExecutableResolver { + + fun resolveExecutable(): Path? + + fun resolveDirectory(): Path? +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/executableResolver/IntelliJPluginVerifierResolver.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/executableResolver/IntelliJPluginVerifierResolver.kt new file mode 100644 index 0000000000..f01a6bdd99 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/executableResolver/IntelliJPluginVerifierResolver.kt @@ -0,0 +1,47 @@ +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradle.executableResolver + +import org.gradle.api.file.FileCollection +import org.gradle.api.file.RegularFileProperty +import org.jetbrains.intellij.platform.gradle.asPath +import org.jetbrains.intellij.platform.gradle.debug +import org.jetbrains.intellij.platform.gradle.ifNull +import org.jetbrains.intellij.platform.gradle.info +import java.nio.file.Path +import kotlin.io.path.exists + +class IntelliJPluginVerifierResolver( + val intellijPluginVerifier: FileCollection, + val localPath: RegularFileProperty, + val context: String? = null, +) : ExecutableResolver { + + override fun resolveExecutable(): Path? { + debug(context, "Resolving runtime directory.") + + return listOf( + { + localPath.orNull?.let { file -> + file.asPath + .takeIf { it.exists() } + .also { debug(context, "Plugin Verifier specified with a local path: $file") } + .ifNull { debug(context, "Cannot resolve Plugin Verifier: $file") } + } + }, + { + intellijPluginVerifier.singleOrNull()?.let { file -> + file.toPath().getJbrRoot() + .also { debug(context, "Plugin Verifier specified with dependencies resolved as: $it") } + .ifNull { debug(context, "Cannot resolve Plugin Verifier: $file") } + } + }, + ) + .asSequence() + .mapNotNull { it() } + .firstOrNull() + ?.also { info(context, "Resolved IntelliJ Plugin Verifier: $it") } + } + + override fun resolveDirectory() = resolveExecutable()?.parent +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/jbr/JetBrainsRuntimeResolver.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/executableResolver/JetBrainsRuntimeResolver.kt similarity index 85% rename from src/main/kotlin/org/jetbrains/intellij/platform/gradle/jbr/JetBrainsRuntimeResolver.kt rename to src/main/kotlin/org/jetbrains/intellij/platform/gradle/executableResolver/JetBrainsRuntimeResolver.kt index 59cc4e5671..e43d353fb7 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/jbr/JetBrainsRuntimeResolver.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/executableResolver/JetBrainsRuntimeResolver.kt @@ -1,11 +1,11 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradle.jbr +package org.jetbrains.intellij.platform.gradle.executableResolver import com.jetbrains.plugin.structure.base.utils.exists import com.jetbrains.plugin.structure.base.utils.listFiles import com.jetbrains.plugin.structure.base.utils.simpleName -import org.gradle.api.file.ConfigurableFileCollection +import org.gradle.api.file.FileCollection import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem import org.gradle.jvm.toolchain.JavaToolchainService @@ -20,15 +20,23 @@ import java.nio.file.Path import java.util.* class JetBrainsRuntimeResolver( - val jetbrainsRuntime: ConfigurableFileCollection, - val intellijPlatform: ConfigurableFileCollection, + val jetbrainsRuntime: FileCollection, + val intellijPlatform: FileCollection, val javaToolchainSpec: JavaToolchainSpec, val javaToolchainService: JavaToolchainService, val context: String? = null, -) { - fun resolveExecutable(validate: (executable: Path) -> Boolean = { true }) = resolveDirectory(validate)?.findJavaExecutable() +) : ExecutableResolver { - fun resolveDirectory(validate: (executable: Path) -> Boolean = { true }): Path? { + override fun resolveExecutable() = resolveDirectory()?.getJbrRoot()?.let { root -> + root + .resolve("jre") + .takeIf { it.exists() } + .or(root) + .resolve("bin/java" + ".exe".takeIf { OperatingSystem.current().isWindows }.orEmpty()) + .takeIf { it.exists() } + } + + override fun resolveDirectory(): Path? { debug(context, "Resolving runtime directory.") return listOf( @@ -72,7 +80,7 @@ class JetBrainsRuntimeResolver( }, ) .asSequence() - .mapNotNull { it()?.takeIf(validate) } + .mapNotNull { it() } .firstOrNull() ?.also { info(context, "Resolved JetBrains Runtime directory: $it") } } @@ -94,15 +102,6 @@ class JetBrainsRuntimeResolver( } } -internal fun Path.findJavaExecutable() = getJbrRoot().let { root -> - root - .resolve("jre") - .takeIf { it.exists() } - .or(root) - .resolve("bin/java" + ".exe".takeIf { OperatingSystem.current().isWindows }.orEmpty()) - .takeIf { it.exists() } -} - internal fun Path.getJbrRoot(): Path { val jbr = listFiles().firstOrNull { it.simpleName.startsWith("jbr") }?.takeIf { it.exists() } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformDependenciesExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformDependenciesExtension.kt index cae700e682..8df849133a 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformDependenciesExtension.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformDependenciesExtension.kt @@ -17,8 +17,10 @@ import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Configurations import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Dependencies import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Locations +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERSION_LATEST import org.jetbrains.intellij.platform.gradle.Version import org.jetbrains.intellij.platform.gradle.model.* +import org.jetbrains.intellij.platform.gradle.utils.LatestVersionResolver import org.jetbrains.kotlin.gradle.utils.projectCacheDir import java.net.URI import java.nio.file.Path @@ -184,6 +186,18 @@ abstract class IntelliJPlatformDependenciesExtension @Inject constructor( action: DependencyAction = {}, ) = bundledPlugin(providers.provider { id }, configurationName, action) + fun pluginVerifier( + version: Provider, + configurationName: String = Configurations.INTELLIJ_PLUGIN_VERIFIER, + action: DependencyAction = {}, + ) = addPluginVerifier(version, configurationName, action) + + fun pluginVerifier( + version: String = VERSION_LATEST, + configurationName: String = Configurations.INTELLIJ_PLUGIN_VERIFIER, + action: DependencyAction = {}, + ) = pluginVerifier(providers.provider { version }, configurationName, action) + private fun addIntelliJPlatformDependency( typeProvider: Provider<*>, versionProvider: Provider, @@ -191,21 +205,19 @@ abstract class IntelliJPlatformDependenciesExtension @Inject constructor( action: DependencyAction = {}, ) = dependencies.addProvider( configurationName, - typeProvider - .map { - when (it) { - is IntelliJPlatformType -> it - is String -> IntelliJPlatformType.fromCode(it) - else -> throw IllegalArgumentException("Invalid argument type: ${it.javaClass}. Supported types: String or IntelliJPlatformType") - } + typeProvider.map { + when (it) { + is IntelliJPlatformType -> it + is String -> IntelliJPlatformType.fromCode(it) + else -> throw IllegalArgumentException("Invalid argument type: ${it.javaClass}. Supported types: String or IntelliJPlatformType") } - .zip(versionProvider) { type, version -> - dependencies.create( - group = type.groupId, - name = type.artifactId, - version = version, - ) - }, + }.zip(versionProvider) { type, version -> + dependencies.create( + group = type.groupId, + name = type.artifactId, + version = version, + ) + }, action, ) @@ -238,35 +250,32 @@ abstract class IntelliJPlatformDependenciesExtension @Inject constructor( val ivyFileName = "${productInfo.productCode}-${productInfo.version}.xml" val ivyDirectory = gradle.projectCacheDir.resolve("intellijPlatform/ivy").toPath() - ivyDirectory - .resolve(ivyFileName) - .takeUnless { it.exists() } - ?.run { - val extractor = XmlExtractor() - val ivyModule = IvyModule( - info = IvyModuleInfo( - organisation = dependency.group, - module = dependency.name, - revision = dependency.version, - publication = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")), + ivyDirectory.resolve(ivyFileName).takeUnless { it.exists() }?.run { + val extractor = XmlExtractor() + val ivyModule = IvyModule( + info = IvyModuleInfo( + organisation = dependency.group, + module = dependency.name, + revision = dependency.version, + publication = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")), + ), + configurations = mutableListOf( + IvyModuleConfiguration( + name = "default", + visibility = "public", ), - configurations = mutableListOf( - IvyModuleConfiguration( - name = "default", - visibility = "public", - ), - ), - publications = mutableListOf( - IvyModulePublication( - name = ideaDir.pathString, - type = "directory", - ext = null, - conf = "default", - ) - ), - ) - extractor.marshal(ivyModule, createFile()) - } + ), + publications = mutableListOf( + IvyModulePublication( + name = ideaDir.pathString, + type = "directory", + ext = null, + conf = "default", + ) + ), + ) + extractor.marshal(ivyModule, createFile()) + } repositories.ivy { url = ivyDirectory.toUri() @@ -280,16 +289,16 @@ abstract class IntelliJPlatformDependenciesExtension @Inject constructor( ) private fun addJbrDependency( - explicitVersion: Provider, + explicitVersionProvider: Provider, configurationName: String, action: DependencyAction = {}, ) = dependencies.addProvider( configurationName, - explicitVersion.map { version -> + explicitVersionProvider.map { explicitVersion -> val dependency = dependencies.create( group = "com.jetbrains", name = "jbr", - version = version, + version = explicitVersion, ext = "tar.gz", ) @@ -305,39 +314,68 @@ abstract class IntelliJPlatformDependenciesExtension @Inject constructor( ) private fun addIntelliJPlatformPlugin( - id: Provider, - version: Provider, - channel: Provider, + idProvider: Provider, + versionProvider: Provider, + channelProvider: Provider, configurationName: String, action: DependencyAction = {}, ) = dependencies.addProvider( configurationName, providers.provider { - val group = when (channel.orNull?.trim()) { + val channel = channelProvider.orNull?.trim() + val id = idProvider.get() + val version = versionProvider.get() + + val group = when (channel) { "default", "", null -> "com.jetbrains.plugins" else -> "$channel.com.jetbrains.plugins" } dependencies.create( group = group, - name = id.get(), - version = version.get(), + name = id, + version = version, ) }, action, ) private fun addIntelliJPlatformBundledPlugin( - id: Provider, + idProvider: Provider, configurationName: String, action: DependencyAction = {}, ) = dependencies.addProvider( configurationName, - id.map { + idProvider.map { id -> TODO("To be implemented") }, action, ) + + private fun addPluginVerifier( + versionProvider: Provider, + configurationName: String, + action: DependencyAction = {}, + ) = dependencies.addProvider( + configurationName, + versionProvider.map { version -> + dependencies.create( + group = "org.jetbrains.intellij.plugins", + name = "verifier-cli", + version = when (version) { + VERSION_LATEST -> LatestVersionResolver.fromMaven( + "IntelliJ Plugin Verifier", + "${Locations.PLUGIN_VERIFIER_REPOSITORY}/org/jetbrains/intellij/plugins/verifier-cli/maven-metadata.xml", + ) + + else -> version + }, + classifier = "all", + ext = "jar", + ) + }, + action, + ) } // TODO: cleanup JBR helper functions: diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformExtension.kt index d3c54c69df..68425a795b 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformExtension.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformExtension.kt @@ -3,6 +3,7 @@ package org.jetbrains.intellij.platform.gradle.extensions import org.gradle.api.file.DirectoryProperty +import org.gradle.api.file.RegularFileProperty import org.gradle.api.plugins.ExtensionAware import org.gradle.api.provider.Property import org.gradle.kotlin.dsl.getByName @@ -23,6 +24,9 @@ interface IntelliJPlatformExtension : ExtensionAware { val pluginConfiguration get() = extensions.getByName(Extensions.PLUGIN_CONFIGURATION) + val pluginVerifier + get() = extensions.getByName(Extensions.PLUGIN_VERIFIER) + @IntelliJPlatform interface PluginConfiguration : ExtensionAware { @@ -182,4 +186,19 @@ interface IntelliJPlatformExtension : ExtensionAware { val url: Property } } + + @IntelliJPlatform + interface PluginVerifier { + + /** + * Represents the version of the IntelliJ Plugin Verifier. + */ + val version: Property + + /** + * A path to the local IntelliJ Plugin Verifier CLI tool to be used. + * Takes precedence over the [version]. + */ + val path: RegularFileProperty + } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformRepositoriesExtension.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformRepositoriesExtension.kt index 045a3d9190..2fb10a8784 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformRepositoriesExtension.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/extensions/IntelliJPlatformRepositoriesExtension.kt @@ -8,8 +8,8 @@ import org.gradle.api.artifacts.repositories.MavenArtifactRepository import org.gradle.api.plugins.ExtensionAware import org.gradle.api.provider.ProviderFactory import org.gradle.kotlin.dsl.maven -import org.gradle.kotlin.dsl.the import org.jetbrains.intellij.platform.gradle.BuildFeature +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Extensions import javax.inject.Inject internal typealias RepositoryAction = (MavenArtifactRepository.() -> Unit) @@ -49,6 +49,13 @@ abstract class IntelliJPlatformRepositoriesExtension @Inject constructor( action = action, ) + fun pluginVerifier(action: RepositoryAction = {}) = createRepository( + name = "IntelliJ Plugin Verifier Repository", + url = "https://packages.jetbrains.team/maven/p/intellij-plugin-verifier/intellij-plugin-verifier", + urlWithCacheRedirector = "https://cache-redirector.jetbrains.com/packages.jetbrains.team/maven/p/intellij-plugin-verifier/intellij-plugin-verifier", + action = action, + ) + private fun createRepository( name: String, url: String, @@ -68,4 +75,4 @@ abstract class IntelliJPlatformRepositoriesExtension @Inject constructor( } fun RepositoryHandler.intellijPlatform(configure: Action) = - (this as ExtensionAware).the().apply(configure::execute) + (this as ExtensionAware).extensions.configure(Extensions.INTELLIJ_PLATFORM, configure) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformAbstractProjectPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformAbstractProjectPlugin.kt index 49f82800d4..802ab30031 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformAbstractProjectPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformAbstractProjectPlugin.kt @@ -16,9 +16,10 @@ import org.jetbrains.intellij.platform.gradle.* import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Configurations import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Configurations.Attributes import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.executableResolver.IntelliJPluginVerifierResolver +import org.jetbrains.intellij.platform.gradle.executableResolver.JetBrainsRuntimeResolver import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformDependenciesExtension import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformExtension -import org.jetbrains.intellij.platform.gradle.jbr.JetBrainsRuntimeResolver import org.jetbrains.intellij.platform.gradle.model.productInfo import org.jetbrains.intellij.platform.gradle.tasks.InitializeIntelliJPlatformPluginTask import org.jetbrains.intellij.platform.gradle.tasks.PrepareSandboxTask @@ -42,6 +43,7 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu protected abstract fun Project.configure() + @Deprecated("use Project.configureTask") protected inline fun TaskContainer.configureTask(vararg names: String, noinline configuration: T.() -> Unit = {}) { names.forEach { name -> info(context, "Configuring task: $name") @@ -146,12 +148,10 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu } if (this is JetBrainsRuntimeAware) { - jetbrainsRuntime = project.configurations.getByName(Configurations.JETBRAINS_RUNTIME) - val jbrResolver = JetBrainsRuntimeResolver( - jetbrainsRuntime = jetbrainsRuntime, + jetbrainsRuntime = project.configurations.getByName(Configurations.JETBRAINS_RUNTIME), intellijPlatform = intelliJPlatform, - javaToolchainSpec = project.extensions.getByType().toolchain, + javaToolchainSpec = project.the().toolchain, javaToolchainService = project.serviceOf(), ) @@ -166,6 +166,21 @@ abstract class IntelliJPlatformAbstractProjectPlugin(val pluginId: String) : Plu if (this is TestIdeTask) { executable(jetbrainsRuntimeExecutable) } + + if (this is PluginVerifierAware) { + val extension = project.the() + val pluginVerifierResolver = IntelliJPluginVerifierResolver( + intellijPluginVerifier = project.configurations.getByName(Configurations.INTELLIJ_PLUGIN_VERIFIER), + localPath = extension.pluginVerifier.path, + ) + + pluginVerifierDirectory.convention(project.layout.dir(project.provider { + pluginVerifierResolver.resolveDirectory()?.toFile() + })) + pluginVerifierExecutable.convention(project.layout.file(project.provider { + pluginVerifierResolver.resolveExecutable()?.toFile() + })) + } } withType(configuration) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformBasePlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformBasePlugin.kt index 64f1c76f37..de9876d9cc 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformBasePlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformBasePlugin.kt @@ -15,6 +15,7 @@ import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Extensions import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.JAVA_TEST_FIXTURES_PLUGIN_ID import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_BASE_ID import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Sandbox +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERSION_LATEST import org.jetbrains.intellij.platform.gradle.artifacts.transform.applyCollectorTransformer import org.jetbrains.intellij.platform.gradle.artifacts.transform.applyExtractorTransformer import org.jetbrains.intellij.platform.gradle.artifacts.transform.applyProductInfoTransformer @@ -31,108 +32,89 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi } with(configurations) { - val intellijPlatformDependencyConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM_DEPENDENCY) - .apply { - isVisible = false - isCanBeConsumed = false - isCanBeResolved = true - description = "IntelliJ Platform dependency archive" - } + val intellijPlatformDependencyConfiguration = create( + name = Configurations.INTELLIJ_PLATFORM_DEPENDENCY, + description = "IntelliJ Platform dependency archive", + ) + + val intellijPlatformLocalConfiguration = create( + name = Configurations.INTELLIJ_PLATFORM_LOCAL_INSTANCE, + description = "IntelliJ Platform local instance", + ) - val intellijPlatformLocalConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM_LOCAL_INSTANCE) - .apply { - isVisible = false - isCanBeConsumed = false - isCanBeResolved = true - description = "IntelliJ Platform local instance" + val intellijPlatformConfiguration = create( + name = Configurations.INTELLIJ_PLATFORM, + description = "IntelliJ Platform", + ) { + attributes { + attribute(Attributes.extracted, true) } - val intellijPlatformConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM) - .apply { - isVisible = false - isCanBeConsumed = false - isCanBeResolved = true - description = "IntelliJ Platform" + extendsFrom(intellijPlatformDependencyConfiguration, intellijPlatformLocalConfiguration) - attributes { - attribute(Attributes.extracted, true) + incoming.beforeResolve { + if (dependencies.isEmpty()) { + throw GradleException("No IntelliJ Platform dependency found") } - extendsFrom(intellijPlatformDependencyConfiguration, intellijPlatformLocalConfiguration) - - incoming.beforeResolve { - if (dependencies.isEmpty()) { - throw GradleException("No IntelliJ Platform dependency found") - } - - val identifiers = IntelliJPlatformType.values().map { "${it.groupId}:${it.artifactId}" } - val matched = dependencies.filter { identifiers.contains("${it.group}:${it.name}") } - if (matched.size > 1) { - throw GradleException("Conflicting dependencies detected: \n${matched.joinToString("\n")}") - } + val identifiers = IntelliJPlatformType.values().map { "${it.groupId}:${it.artifactId}" } + val matched = dependencies.filter { identifiers.contains("${it.group}:${it.name}") } + if (matched.size > 1) { + throw GradleException("Conflicting dependencies detected: \n${matched.joinToString("\n")}") } } + } - maybeCreate(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) - .apply { - isVisible = false - isCanBeConsumed = false - isCanBeResolved = true - description = "IntelliJ Platform product info" - - attributes { - attribute(Attributes.productInfo, true) - } - - extendsFrom(intellijPlatformConfiguration) + create( + name = Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO, + description = "IntelliJ Platform product info", + ) { + attributes { + attribute(Attributes.productInfo, true) } - val jetbrainsRuntimeDependencyConfiguration = maybeCreate(Configurations.JETBRAINS_RUNTIME_DEPENDENCY) - .apply { - isVisible = false - isCanBeConsumed = false - isCanBeResolved = true - description = "JetBrains Runtime dependency archive" + extendsFrom(intellijPlatformConfiguration) + } - attributes { - attribute(Attributes.extracted, false) - } + val jetbrainsRuntimeDependencyConfiguration = create( + name = Configurations.JETBRAINS_RUNTIME_DEPENDENCY, + description = "JetBrains Runtime dependency archive", + ) { + attributes { + attribute(Attributes.extracted, false) } + } - val jetbrainsRuntimeLocalConfiguration = maybeCreate(Configurations.JETBRAINS_RUNTIME_LOCAL_INSTANCE) - .apply { - isVisible = false - isCanBeConsumed = false - isCanBeResolved = true - description = "JetBrains Runtime local instance" - - attributes { - attribute(Attributes.extracted, true) - } + val jetbrainsRuntimeLocalConfiguration = create( + name = Configurations.JETBRAINS_RUNTIME_LOCAL_INSTANCE, + description = "JetBrains Runtime local instance" + ) { + attributes { + attribute(Attributes.extracted, true) } + } - maybeCreate(Configurations.JETBRAINS_RUNTIME) - .apply { - isVisible = false - isCanBeConsumed = false - isCanBeResolved = true - description = "JetBrains Runtime" + create( + name = Configurations.JETBRAINS_RUNTIME, + description = "JetBrains Runtime", + ) { + attributes { + attribute(Attributes.extracted, true) + } - attributes { - attribute(Attributes.extracted, true) - } + extendsFrom(jetbrainsRuntimeDependencyConfiguration) + extendsFrom(jetbrainsRuntimeLocalConfiguration) + } - extendsFrom(jetbrainsRuntimeDependencyConfiguration) - extendsFrom(jetbrainsRuntimeLocalConfiguration) - } + create( + name = Configurations.INTELLIJ_PLUGIN_VERIFIER, + description = "IntelliJ Plugin Verifier", + ) - val intellijPlatformDependenciesConfiguration = maybeCreate(Configurations.INTELLIJ_PLATFORM_DEPENDENCIES) - .apply { - isVisible = false - isCanBeConsumed = false - isCanBeResolved = true - description = "IntelliJ Platform extra dependencies" - } + val intellijPlatformDependenciesConfiguration = create( + name = Configurations.INTELLIJ_PLATFORM_DEPENDENCIES, + description = "IntelliJ Platform extra dependencies", + ) fun Configuration.extend() = extendsFrom( intellijPlatformConfiguration, @@ -147,8 +129,6 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi } with(dependencies) { -// applyIntelliJPlatformSettings(objects, gradle) - attributesSchema { attribute(Attributes.collected) attribute(Attributes.extracted) @@ -180,6 +160,10 @@ abstract class IntelliJPlatformBasePlugin : IntelliJPlatformAbstractProjectPlugi configureExtension(Extensions.IDEA_VERSION) configureExtension(Extensions.VENDOR) } + + configureExtension(Extensions.PLUGIN_VERIFIER) { + version.convention(VERSION_LATEST) + } } dependencies.configureExtension(Extensions.INTELLIJ_PLATFORM, repositories, dependencies, providers, gradle) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformPlugin.kt index 6ed4cca8e2..3540a18551 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformPlugin.kt @@ -52,12 +52,9 @@ import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.INSTRUMENT import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.JAVA_COMPILER_ANT_TASKS_MAVEN_METADATA -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.LIST_BUNDLED_PLUGINS_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.MARKETPLACE_HOST import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PERFORMANCE_TEST_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PRINT_BUNDLED_PLUGINS_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PRINT_PRODUCTS_RELEASES_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PUBLISH_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.RELEASE_SUFFIX_EAP @@ -65,13 +62,11 @@ import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.RELEASE_SU import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.RELEASE_SUFFIX_SNAPSHOT import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.RUN_IDE_FOR_UI_TESTS_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.RUN_IDE_PERFORMANCE_TEST_TASK_NAME -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.SEARCHABLE_OPTIONS_DIR_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.SIGN_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Sandbox import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERIFY_PLUGIN_SIGNATURE_TASK_NAME -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERIFY_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERSION_LATEST import org.jetbrains.intellij.platform.gradle.dependency.* import org.jetbrains.intellij.platform.gradle.model.MavenMetadata @@ -89,7 +84,6 @@ import org.jetbrains.intellij.tasks.DownloadAndroidStudioProductReleasesXmlTask import org.jetbrains.intellij.tasks.DownloadIdeaProductReleasesXmlTask import java.io.File import java.net.URL -import java.nio.file.Path import java.time.LocalDateTime import java.time.format.DateTimeFormatter import java.util.* @@ -164,8 +158,6 @@ abstract class IntelliJPlatformPlugin : Plugin { configureInstrumentation(project, extension, ideaDependencyProvider) configureDownloadRobotServerPluginTask(project) configureListProductsReleasesTask(project, extension) - configureListBundledPluginsTask(project, ideaDependencyProvider) - configurePluginVerificationTask(project) configureRunIdeTask(project) configureRunIdePerformanceTestTask(project, extension) configureRunIdeForUiTestsTask(project) @@ -529,105 +521,6 @@ abstract class IntelliJPlatformPlugin : Plugin { } } - private fun configureRunPluginVerifierTask(project: Project, extension: IntelliJPluginExtension) { - info(context, "Configuring run plugin verifier task") - - val listProductsReleasesTaskProvider = project.tasks.named(LIST_PRODUCTS_RELEASES_TASK_NAME) - val runIdeTaskProvider = project.tasks.named(Tasks.RUN_IDE) - val userHomeProvider = project.providers.systemProperty("user.home") - - project.tasks.register(RUN_PLUGIN_VERIFIER_TASK_NAME) - project.tasks.withType { - val taskContext = logCategory() - - failureLevel.convention(EnumSet.of(RunPluginVerifierTask.FailureLevel.COMPATIBILITY_PROBLEMS)) - verifierVersion.convention(VERSION_LATEST) - distributionFile.convention(project.resolveBuildTaskOutput()) - verificationReportsDir.convention( - project.layout.buildDirectory.dir("reports/pluginVerifier").map { it.asFile.canonicalPath } - ) - verificationReportsFormats.convention( - EnumSet.of( - RunPluginVerifierTask.VerificationReportsFormats.PLAIN, - RunPluginVerifierTask.VerificationReportsFormats.HTML, - ) - ) - downloadDir.convention(ideDownloadDir().map { - it.toFile().invariantSeparatorsPath - }) - downloadPath.convention(userHomeProvider.map { - val userHomePath = Path.of(it) - with(downloadDir.get()) { - when { - startsWith("~/") -> userHomePath.resolve(removePrefix("~/")) - equals("~") -> userHomePath - else -> Path.of(this) - } - } - }) - teamCityOutputFormat.convention(false) - subsystemsToCheck.convention("all") -// ideDir.convention(runIdeTaskProvider.flatMap { runIdeTask -> -// runIdeTask.ideDir -// }) - productsReleasesFile.convention(listProductsReleasesTaskProvider.flatMap { listProductsReleasesTask -> - listProductsReleasesTask.outputFile.asFile - }) - verifierPath.convention(project.provider { - debug(context, "Using Verifier in '$currentVersion' version") - - dependenciesDownloader.downloadFromRepository(taskContext, { - create( - group = "org.jetbrains.intellij.plugins", - name = "verifier-cli", - version = currentVersion, - classifier = "all", - ext = "jar", - ) - }, { - mavenRepository(PLUGIN_VERIFIER_REPOSITORY) - }).first().canonicalPath - }) - offline.convention(project.gradle.startParameter.isOffline) - - dependsOn(Tasks.BUILD_PLUGIN) - dependsOn(VERIFY_PLUGIN_TASK_NAME) - dependsOn(LIST_PRODUCTS_RELEASES_TASK_NAME) - - val isIdeVersionsEmpty = localPaths.flatMap { localPaths -> - ideVersions.map { ideVersions -> - localPaths.isEmpty() && ideVersions.isEmpty() - } - } - listProductsReleasesTaskProvider.get().onlyIf { isIdeVersionsEmpty.get() } - } - } - - private fun configurePluginVerificationTask(project: Project) { - info(context, "Configuring plugin verification task") - - val prepareSandboxTaskProvider = project.tasks.named(Tasks.PREPARE_SANDBOX) - - project.tasks.register(VERIFY_PLUGIN_TASK_NAME) - project.tasks.withType { - ignoreFailures.convention(false) - ignoreUnacceptableWarnings.convention(false) - ignoreWarnings.convention(true) - - pluginDir.convention( - project.layout.dir( - prepareSandboxTaskProvider.flatMap { prepareSandboxTask -> - prepareSandboxTask.pluginName.map { pluginName -> - prepareSandboxTask.destinationDir.resolve(pluginName) - } - } - ) - ) - - dependsOn(Tasks.PREPARE_SANDBOX) - } - } - private fun configureRunIdeTask(project: Project) { info(context, "Configuring run IDE task") @@ -1183,7 +1076,7 @@ abstract class IntelliJPlatformPlugin : Plugin { ) dependsOn(Tasks.BUILD_PLUGIN) - dependsOn(VERIFY_PLUGIN_TASK_NAME) + dependsOn(Tasks.VERIFY_PLUGIN) dependsOn(SIGN_PLUGIN_TASK_NAME) onlyIf { !isOffline } } @@ -1260,29 +1153,6 @@ abstract class IntelliJPlatformPlugin : Plugin { } } - private fun configureListBundledPluginsTask(project: Project, ideaDependencyProvider: Provider) { - info(context, "Configuring list bundled plugins task") - - val listBundledPluginsTaskProvider = project.tasks.register(LIST_BUNDLED_PLUGINS_TASK_NAME) - project.tasks.withType { - ideDir.convention(ideaDependencyProvider.map { - project.file(it.classes.path) - }) - outputFile.convention( - project.layout.buildDirectory.file("$LIST_BUNDLED_PLUGINS_TASK_NAME.txt") - ) - } - - project.tasks.register(PRINT_BUNDLED_PLUGINS_TASK_NAME) - project.tasks.withType { - inputFile.convention(listBundledPluginsTaskProvider.flatMap { listBundledPluginsTask -> - listBundledPluginsTask.outputFile - }) - - dependsOn(LIST_BUNDLED_PLUGINS_TASK_NAME) - } - } - private fun configureProcessResources(project: Project) { info(context, "Configuring resources task") val patchPluginXmlTaskProvider = project.tasks.named(Tasks.PATCH_PLUGIN_XML) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformTasksPlugin.kt index befb7a48b7..06e0f714f5 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformTasksPlugin.kt @@ -15,20 +15,21 @@ import org.gradle.internal.jvm.Jvm import org.gradle.internal.os.OperatingSystem import org.gradle.kotlin.dsl.* import org.gradle.process.JavaForkOptions -import org.jetbrains.intellij.platform.gradle.* -import org.jetbrains.intellij.platform.gradle.BuildFeature.SELF_UPDATE_CHECK +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_TASKS_ID import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Sandbox import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.TASKS import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformExtension +import org.jetbrains.intellij.platform.gradle.info import org.jetbrains.intellij.platform.gradle.propertyProviders.IntelliJPlatformArgumentProvider import org.jetbrains.intellij.platform.gradle.propertyProviders.LaunchSystemArgumentProvider import org.jetbrains.intellij.platform.gradle.propertyProviders.PluginPathArgumentProvider +import org.jetbrains.intellij.platform.gradle.sourceSets import org.jetbrains.intellij.platform.gradle.tasks.* import java.io.File -import java.time.LocalDate -import kotlin.io.path.exists +import java.nio.file.Path +import java.util.* abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlugin(PLUGIN_TASKS_ID) { @@ -38,13 +39,18 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug } with(tasks) { - configureSetupDependenciesTask() + InitializeIntelliJPlatformPluginTask.register(project) + SetupDependenciesTask.register(project) + ListBundledPluginsTask.register(project) + PrintBundledPluginsTask.register(project) + configurePrepareSandboxTasks() + configureBuildPluginTask() configurePatchPluginXmlTask() + configureRunPluginVerifierTask() + configureVerifyPluginTask() configureVerifyPluginConfigurationTask() - configureBuildPluginTask() - configureInitializeIntelliJPlatformPluginTask() configureJarTask() configureTestIdeTask() configureRunIdeTask() @@ -56,9 +62,6 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug } } - private fun TaskContainer.configureSetupDependenciesTask() = - configureTask(Tasks.SETUP_DEPENDENCIES) - private fun TaskContainer.configurePrepareSandboxTasks() = configureTask(Tasks.PREPARE_SANDBOX, Tasks.PREPARE_TESTING_SANDBOX, Tasks.PREPARE_UI_TESTING_SANDBOX) { // val downloadPluginTaskProvider = project.tasks.named(IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME) @@ -103,20 +106,18 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug // }) runtimeClasspathFiles.convention(runtimeConfiguration) - intoChild(pluginName.map { "$it/lib" }) - .from(runtimeClasspathFiles.map { files -> - val librariesToIgnore = librariesToIgnore.get().toSet() + Jvm.current().toolsJar - val pluginDirectories = pluginDependencies.get().map { it.artifact } + intoChild(pluginName.map { "$it/lib" }).from(runtimeClasspathFiles.map { files -> + val librariesToIgnore = librariesToIgnore.get().toSet() + Jvm.current().toolsJar + val pluginDirectories = pluginDependencies.get().map { it.artifact } - listOf(pluginJar.asFile) + files.filter { file -> - !(librariesToIgnore.contains(file) || pluginDirectories.any { p -> - file.toPath() == p || file.canonicalPath.startsWith("$p${File.separator}") - }) - } - }) - .eachFile { - name = ensureName(file.toPath()) + listOf(pluginJar.asFile) + files.filter { file -> + !(librariesToIgnore.contains(file) || pluginDirectories.any { p -> + file.toPath() == p || file.canonicalPath.startsWith("$p${File.separator}") + }) } + }).eachFile { + name = ensureName(file.toPath()) + } dependsOn(runtimeConfiguration) dependsOn(jarTaskProvider) @@ -140,9 +141,7 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug val extension = project.the() inputFile.convention(project.provider { - project.sourceSets.getByName(MAIN_SOURCE_SET_NAME).resources.srcDirs - .map { it.resolve("META-INF/plugin.xml") } - .firstOrNull { it.exists() } + project.sourceSets.getByName(MAIN_SOURCE_SET_NAME).resources.srcDirs.map { it.resolve("META-INF/plugin.xml") }.firstOrNull { it.exists() } }) outputFile.convention(inputFile.map { temporaryDir.resolve(it.name) @@ -175,16 +174,35 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug } } + private fun TaskContainer.configureVerifyPluginTask() = + configureTask(Tasks.VERIFY_PLUGIN) { + ignoreFailures.convention(false) + ignoreUnacceptableWarnings.convention(false) + ignoreWarnings.convention(true) + +// pluginDir.convention( +// project.layout.dir( +// prepareSandboxTaskProvider.flatMap { prepareSandboxTask -> +// prepareSandboxTask.pluginName.map { pluginName -> +// prepareSandboxTask.destinationDir.resolve(pluginName) +// } +// } +// ) +// ) + +// dependsOn(Tasks.PREPARE_SANDBOX) + } + private fun TaskContainer.configureVerifyPluginConfigurationTask() = configureTask(Tasks.VERIFY_PLUGIN_CONFIGURATION) { info(context, "Configuring plugin configuration verification task") val patchPluginXmlTaskProvider = named(Tasks.PATCH_PLUGIN_XML) -// val runPluginVerifierTaskProvider = named(IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME) + val runPluginVerifierTaskProvider = named(Tasks.RUN_PLUGIN_VERIFIER) val compileJavaTaskProvider = named(JavaPlugin.COMPILE_JAVA_TASK_NAME) -// val downloadDirProvider = runPluginVerifierTaskProvider.flatMap { runPluginVerifierTask -> -// runPluginVerifierTask.downloadDir -// } + val downloadDirProvider = runPluginVerifierTaskProvider.flatMap { runPluginVerifierTask -> + runPluginVerifierTask.downloadDir + } // pluginXmlFiles.convention(patchPluginXmlTaskProvider.flatMap { patchPluginXmlTask -> // patchPluginXmlTask.outputFiles // }) @@ -194,7 +212,7 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug targetCompatibility.convention(compileJavaTaskProvider.map { it.targetCompatibility }) -// pluginVerifierDownloadDir.convention(downloadDirProvider) + pluginVerifierDownloadDir.convention(downloadDirProvider) kotlinxCoroutinesLibraryPresent.convention(project.provider { listOf(JavaPlugin.IMPLEMENTATION_CONFIGURATION_NAME, JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME).any { configurationName -> project.configurations.getByName(configurationName).dependencies.any { @@ -207,49 +225,31 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug project.pluginManager.hasPlugin(IntelliJPluginConstants.KOTLIN_GRADLE_PLUGIN_ID) }) project.pluginManager.withPlugin(IntelliJPluginConstants.KOTLIN_GRADLE_PLUGIN_ID) { - val kotlinOptionsProvider = project.tasks.named(IntelliJPluginConstants.COMPILE_KOTLIN_TASK_NAME) - .apply { - configure { - dependsOn(this@configureTask) - } - } - .map { - it - .withGroovyBuilder { getProperty("kotlinOptions") } - .withGroovyBuilder { getProperty("options") } + val kotlinOptionsProvider = project.tasks.named(IntelliJPluginConstants.COMPILE_KOTLIN_TASK_NAME).apply { + configure { + dependsOn(this@configureTask) } + }.map { + it.withGroovyBuilder { getProperty("kotlinOptions") }.withGroovyBuilder { getProperty("options") } + } kotlinJvmTarget.convention(kotlinOptionsProvider.flatMap { - it - .withGroovyBuilder { getProperty("jvmTarget") as Property<*> } - .map { jvmTarget -> jvmTarget.withGroovyBuilder { getProperty("target") } } + it.withGroovyBuilder { getProperty("jvmTarget") as Property<*> }.map { jvmTarget -> jvmTarget.withGroovyBuilder { getProperty("target") } } .map { value -> value as String } }) kotlinApiVersion.convention(kotlinOptionsProvider.flatMap { - it - .withGroovyBuilder { getProperty("apiVersion") as Property<*> } - .map { value -> value as String } + it.withGroovyBuilder { getProperty("apiVersion") as Property<*> }.map { value -> value as String } }) kotlinLanguageVersion.convention(kotlinOptionsProvider.flatMap { - it - .withGroovyBuilder { getProperty("languageVersion") as Property<*> } - .map { value -> value as String } + it.withGroovyBuilder { getProperty("languageVersion") as Property<*> }.map { value -> value as String } }) kotlinVersion.convention(project.provider { - project.extensions - .getByName("kotlin") - .withGroovyBuilder { getProperty("coreLibrariesVersion") as String } + project.extensions.getByName("kotlin").withGroovyBuilder { getProperty("coreLibrariesVersion") as String } }) - kotlinStdlibDefaultDependency.convention( - project.providers - .gradleProperty(IntelliJPluginConstants.KOTLIN_STDLIB_DEFAULT_DEPENDENCY_PROPERTY_NAME) - .map { it.toBoolean() } - ) - kotlinIncrementalUseClasspathSnapshot.convention( - project.providers - .gradleProperty(IntelliJPluginConstants.KOTLIN_INCREMENTAL_USE_CLASSPATH_SNAPSHOT) - .map { it.toBoolean() } - ) + kotlinStdlibDefaultDependency.convention(project.providers.gradleProperty(IntelliJPluginConstants.KOTLIN_STDLIB_DEFAULT_DEPENDENCY_PROPERTY_NAME) + .map { it.toBoolean() }) + kotlinIncrementalUseClasspathSnapshot.convention(project.providers.gradleProperty(IntelliJPluginConstants.KOTLIN_INCREMENTAL_USE_CLASSPATH_SNAPSHOT) + .map { it.toBoolean() }) } project.tasks.withType { @@ -291,28 +291,10 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug // } } - private fun TaskContainer.configureInitializeIntelliJPlatformPluginTask() = - configureTask(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) { - offline.convention(project.gradle.startParameter.isOffline) - selfUpdateCheck.convention(project.isBuildFeatureEnabled(SELF_UPDATE_CHECK)) - selfUpdateLock.convention( - project.layout.file(project.provider { - temporaryDir.resolve(LocalDate.now().toString()) - }) - ) - coroutinesJavaAgent.convention( - project.layout.file(project.provider { - temporaryDir.resolve("coroutines-javaagent.jar") - }) - ) - - onlyIf { - !selfUpdateLock.asPath.exists() || !coroutinesJavaAgent.asPath.exists() - } - } - private fun TaskContainer.configureJarTask() = configureTask(JavaPlugin.JAR_TASK_NAME, Tasks.INSTRUMENTED_JAR) { + val initializeIntelliJPlatformPluginTaskProvider = + project.tasks.named(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) val gradleVersion = project.provider { project.gradle.gradleVersion } @@ -335,15 +317,20 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug exclude("**/classpath.index") - manifest.attributes( - "Created-By" to gradleVersion.map { version -> "Gradle $version" }, - "Build-JVM" to Jvm.current(), - "Version" to projectVersion, - "Build-Plugin" to IntelliJPluginConstants.PLUGIN_NAME, - "Build-Plugin-Version" to getCurrentPluginVersion().or("0.0.0"), - "Build-OS" to OperatingSystem.current(), - "Build-SDK" to buildSdk.get(), - ) +// TODO: make it lazy +// manifest.attributes( +// "Created-By" to gradleVersion.map { version -> "Gradle $version" }, +// "Build-JVM" to Jvm.current(), +// "Version" to projectVersion, +// "Build-Plugin" to IntelliJPluginConstants.PLUGIN_NAME, +// "Build-Plugin-Version" to initializeIntelliJPlatformPluginTaskProvider.flatMap { +// it.pluginVersion +// }.get(), // FIXME +// "Build-OS" to OperatingSystem.current(), +// "Build-SDK" to buildSdk.get(), +// ) + + dependsOn(initializeIntelliJPlatformPluginTaskProvider) } // TODO: define `inputs.property` for tasks to consider system properties in terms of the configuration cache @@ -362,17 +349,9 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug ) ) - outputs - .dir(sandboxDirectoryProvider.dir(Sandbox.SYSTEM)) - .withPropertyName("System directory") - inputs - .dir(sandboxDirectoryProvider.dir(Sandbox.CONFIG)) - .withPropertyName("Config Directory") - .withPathSensitivity(PathSensitivity.RELATIVE) - inputs - .files(sandboxDirectoryProvider.dir(Sandbox.PLUGINS)) - .withPropertyName("Plugins directory") - .withPathSensitivity(PathSensitivity.RELATIVE) + outputs.dir(sandboxDirectoryProvider.dir(Sandbox.SYSTEM)).withPropertyName("System directory") + inputs.dir(sandboxDirectoryProvider.dir(Sandbox.CONFIG)).withPropertyName("Config Directory").withPathSensitivity(PathSensitivity.RELATIVE) + inputs.files(sandboxDirectoryProvider.dir(Sandbox.PLUGINS)).withPropertyName("Plugins directory").withPathSensitivity(PathSensitivity.RELATIVE) .withNormalizer(ClasspathNormalizer::class) // systemProperty("idea.use.core.classloader.for.plugin.path", "true") @@ -441,6 +420,53 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug } } + private fun TaskContainer.configureRunPluginVerifierTask() = + configureTask(Tasks.RUN_PLUGIN_VERIFIER) { +// val listProductsReleasesTaskProvider = named(IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME) + val buildPluginTaskProvider = named(Tasks.BUILD_PLUGIN) + val userHomeProvider = project.providers.systemProperty("user.home") + + failureLevel.convention(EnumSet.of(RunPluginVerifierTask.FailureLevel.COMPATIBILITY_PROBLEMS)) + distributionFile.convention(buildPluginTaskProvider.flatMap { it.archiveFile }) + verificationReportsDir.convention(project.layout.buildDirectory.dir("reports/pluginVerifier").map { it.asFile.canonicalPath }) + verificationReportsFormats.convention( + EnumSet.of( + RunPluginVerifierTask.VerificationReportsFormats.PLAIN, + RunPluginVerifierTask.VerificationReportsFormats.HTML, + ) + ) + downloadDir.convention(ideDownloadDir().map { + it.toFile().invariantSeparatorsPath + }) + downloadPath.convention(userHomeProvider.map { + val userHomePath = Path.of(it) + with(downloadDir.get()) { + when { + startsWith("~/") -> userHomePath.resolve(removePrefix("~/")) + equals("~") -> userHomePath + else -> Path.of(this) + } + } + }) + teamCityOutputFormat.convention(false) + subsystemsToCheck.convention("all") +// productsReleasesFile.convention(listProductsReleasesTaskProvider.flatMap { listProductsReleasesTask -> +// listProductsReleasesTask.outputFile.asFile +// }) + offline.convention(project.gradle.startParameter.isOffline) + + dependsOn(Tasks.BUILD_PLUGIN) + dependsOn(Tasks.VERIFY_PLUGIN) + dependsOn(IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME) + + val isIdeVersionsEmpty = localPaths.flatMap { localPaths -> + ideVersions.map { ideVersions -> + localPaths.isEmpty() && ideVersions.isEmpty() + } + } +// listProductsReleasesTaskProvider.get().onlyIf { isIdeVersionsEmpty.get() } + } + private fun JavaForkOptions.systemPropertyDefault(name: String, defaultValue: Any) { if (!systemProperties.containsKey(name)) { systemProperty(name, defaultValue) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/plugins.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/plugins.kt index cad313c2c2..9992574f1c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/plugins.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/plugins.kt @@ -2,6 +2,8 @@ package org.jetbrains.intellij.platform.gradle.plugins +import org.gradle.api.artifacts.Configuration +import org.gradle.api.artifacts.ConfigurationContainer import org.gradle.api.plugins.ExtensionAware import org.gradle.kotlin.dsl.create @@ -11,3 +13,13 @@ internal inline fun Any.configureExtension(name: String, varar extension.configuration() } } + +internal inline fun ConfigurationContainer.create(name: String, description: String, noinline configuration: Configuration.() -> Unit = {}) = + maybeCreate(name).apply { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + + this.description = description + configuration() + } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildPluginTask.kt index d429eb77f9..cac7f7de39 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildPluginTask.kt @@ -11,6 +11,7 @@ import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GRO * * @see [Zip] */ +@Deprecated(message = "CHECK") @DisableCachingByDefault(because = "Zip based tasks do not benefit from caching") abstract class BuildPluginTask : Zip() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTask.kt index 126fe46171..3bdd5008ff 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTask.kt @@ -9,11 +9,9 @@ import org.gradle.api.tasks.Internal import org.gradle.api.tasks.OutputDirectory import org.jetbrains.intellij.platform.gradle.BuildFeature import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradle.asPath import org.jetbrains.intellij.platform.gradle.logCategory import org.jetbrains.intellij.platform.gradle.tasks.base.RunIdeBase import org.jetbrains.intellij.platform.gradle.warn -import kotlin.io.path.pathString /** * Builds an index of UI components (searchable options) for the plugin. @@ -25,6 +23,7 @@ import kotlin.io.path.pathString * @see [RunIdeBase] * @see [BuildFeature.NO_SEARCHABLE_OPTIONS_WARNING] */ +@Deprecated(message = "CHECK") @CacheableTask abstract class BuildSearchableOptionsTask : RunIdeBase() { @@ -61,7 +60,7 @@ abstract class BuildSearchableOptionsTask : RunIdeBase() { ) } - args = args + listOf(outputDir.asPath.pathString, "true") +// args = args + listOf(outputDir.asPath.pathString, "true") super.exec() } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ClasspathIndexCleanupTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ClasspathIndexCleanupTask.kt index 9957a51a60..85de2b47b6 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ClasspathIndexCleanupTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ClasspathIndexCleanupTask.kt @@ -22,6 +22,7 @@ import org.jetbrains.intellij.platform.gradle.logCategory * * Task is enabled if [IntelliJPluginExtension.version] is set to `2022.1` or higher. */ +@Deprecated(message = "CHECK") @DisableCachingByDefault(because = "Deletion cannot be cached") abstract class ClasspathIndexCleanupTask : DefaultTask() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt index 465a74882c..361e87e8a5 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt @@ -11,6 +11,7 @@ import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME import org.jetbrains.intellij.platform.gradle.logCategory +@Deprecated(message = "CHECK") @CacheableTask abstract class DownloadAndroidStudioProductReleasesXmlTask : Sync() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIdeaProductReleasesXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIdeaProductReleasesXmlTask.kt index d168748dcf..83141c08ae 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIdeaProductReleasesXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIdeaProductReleasesXmlTask.kt @@ -8,6 +8,7 @@ import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME import java.io.File +@Deprecated(message = "CHECK") @CacheableTask abstract class DownloadIdeaProductReleasesXmlTask : Sync() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadRobotServerPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadRobotServerPluginTask.kt index b925af67f8..b856cabfa6 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadRobotServerPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadRobotServerPluginTask.kt @@ -29,6 +29,7 @@ import javax.inject.Inject * * @see IntelliJ UI Test Robot */ +@Deprecated(message = "CHECK") @DisableCachingByDefault(because = "Resolves value from remote source") abstract class DownloadRobotServerPluginTask @Inject constructor( objectFactory: ObjectFactory, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadZipSignerTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadZipSignerTask.kt index b1e46c7ecd..d3fcdad743 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadZipSignerTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadZipSignerTask.kt @@ -19,6 +19,7 @@ import kotlin.io.path.copyTo /** * Resolves and downloads Marketplace ZIP Signer CLI tool used by the [SignPluginTask] task. */ +@Deprecated(message = "CHECK") @DisableCachingByDefault(because = "Resolves value from remote source") abstract class DownloadZipSignerTask : DefaultTask() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InitializeIntelliJPlatformPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InitializeIntelliJPlatformPluginTask.kt index 69d6ace440..2c7c364184 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InitializeIntelliJPlatformPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InitializeIntelliJPlatformPluginTask.kt @@ -6,22 +6,26 @@ import com.jetbrains.plugin.structure.base.utils.create import com.jetbrains.plugin.structure.base.utils.exists import com.jetbrains.plugin.structure.base.utils.outputStream import org.gradle.api.DefaultTask +import org.gradle.api.Project import org.gradle.api.file.RegularFileProperty import org.gradle.api.provider.Property import org.gradle.api.tasks.Internal import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.UntrackedTask import org.jetbrains.intellij.platform.gradle.* -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.GITHUB_REPOSITORY +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Locations import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_ID import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradle.utils.LatestVersionResolver +import java.net.URL +import java.time.LocalDate import java.util.jar.JarOutputStream import java.util.jar.Manifest /** - * Initializes the IntelliJ Platform Gradle Plugin and performs various checks, like if the plugin is up to date. + * Initializes the IntelliJ Platform Gradle Plugin and performs various checks, like if the plugin is up-to-date. */ @UntrackedTask(because = "Should always be run to initialize the plugin") abstract class InitializeIntelliJPlatformPluginTask : DefaultTask() { @@ -38,6 +42,9 @@ abstract class InitializeIntelliJPlatformPluginTask : DefaultTask() { @get:Internal abstract val coroutinesJavaAgent: RegularFileProperty + @get:Internal + abstract val pluginVersion: Property + init { group = PLUGIN_GROUP_NAME description = "Initializes the IntelliJ Platform Gradle Plugin" @@ -60,10 +67,8 @@ abstract class InitializeIntelliJPlatformPluginTask : DefaultTask() { } try { - val version = getCurrentPluginVersion() - ?.let(Version::parse) - .or { Version() } - val latestVersion = LatestVersionResolver.fromGitHub(PLUGIN_NAME, GITHUB_REPOSITORY) + val version = Version.parse(pluginVersion.get()) + val latestVersion = LatestVersionResolver.fromGitHub(PLUGIN_NAME, Locations.GITHUB_REPOSITORY) if (version < Version.parse(latestVersion)) { warn(context, "$PLUGIN_NAME is outdated: $version. Update `$PLUGIN_ID` to: $latestVersion") } @@ -98,4 +103,45 @@ abstract class InitializeIntelliJPlatformPluginTask : DefaultTask() { JarOutputStream(coroutinesJavaAgent.asPath.outputStream(), manifest).close() } + + companion object { + fun register(project: Project) = + project.configureTask(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) { + offline.convention(project.gradle.startParameter.isOffline) + selfUpdateCheck.convention(project.isBuildFeatureEnabled(BuildFeature.SELF_UPDATE_CHECK)) + selfUpdateLock.convention( + project.layout.file(project.provider { + temporaryDir.resolve(LocalDate.now().toString()) + }) + ) + coroutinesJavaAgent.convention( + project.layout.file(project.provider { + temporaryDir.resolve("coroutines-javaagent.jar") + }) + ) + pluginVersion.convention(project.provider { + InitializeIntelliJPlatformPluginTask::class.java + .run { getResource("$simpleName.class") } + .runCatching { + val manifestPath = with(this?.path) { + when { + this == null -> return@runCatching null + startsWith("jar:") -> this + startsWith("file:") -> "jar:$this" + else -> return@runCatching null + } + }.run { substring(0, lastIndexOf("!") + 1) } + "/META-INF/MANIFEST.MF" + + info(null, "Resolving $PLUGIN_NAME version with: $manifestPath") + URL(manifestPath).openStream().use { + Manifest(it).mainAttributes.getValue("Version") + } + }.getOrNull() ?: "0.0.0" + }) + + onlyIf { + !selfUpdateLock.asPath.exists() || !coroutinesJavaAgent.asPath.exists() + } + } + } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InstrumentCodeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InstrumentCodeTask.kt index 7a5de9c79c..7fb684fe85 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InstrumentCodeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InstrumentCodeTask.kt @@ -30,6 +30,7 @@ typealias IntelliJInstrumentCodeTask = InstrumentCodeTask /** * The following attributes help you to tune instrumenting behaviour in `instrumentCode { ... }` block. */ +@Deprecated(message = "CHECK") @CacheableTask abstract class InstrumentCodeTask : DefaultTask() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InstrumentedJarTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InstrumentedJarTask.kt index c20faaf334..2e58719998 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InstrumentedJarTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InstrumentedJarTask.kt @@ -11,6 +11,7 @@ import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GRO * * @see [InstrumentCodeTask] */ +@Deprecated(message = "CHECK") @CacheableTask abstract class InstrumentedJarTask : Jar() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTask.kt index d5edb7fe42..6aa4fbed39 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTask.kt @@ -18,6 +18,7 @@ import java.nio.file.Path /** * Creates a JAR file with searchable options to be distributed with the plugin. */ +@Deprecated(message = "CHECK") @CacheableTask abstract class JarSearchableOptionsTask : Jar() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListBundledPluginsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListBundledPluginsTask.kt index be9c15decd..aecad310d8 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListBundledPluginsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListBundledPluginsTask.kt @@ -2,20 +2,17 @@ package org.jetbrains.intellij.platform.gradle.tasks -import com.jetbrains.plugin.structure.base.utils.outputStream +import com.jetbrains.plugin.structure.base.utils.writeText import org.gradle.api.DefaultTask -import org.gradle.api.Incubating +import org.gradle.api.Project import org.gradle.api.file.RegularFileProperty -import org.gradle.api.provider.Property import org.gradle.api.tasks.CacheableTask -import org.gradle.api.tasks.Input import org.gradle.api.tasks.OutputFile import org.gradle.api.tasks.TaskAction import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradle.asPath -import org.jetbrains.intellij.platform.gradle.dependency.BuiltinPluginsRegistry -import org.jetbrains.intellij.platform.gradle.logCategory -import java.io.File +import org.jetbrains.intellij.platform.gradle.tasks.base.PlatformVersionAware /** * Lists all IDs of plugins bundled within the currently targeted IDE. @@ -24,18 +21,8 @@ import java.io.File * * @see [PrintBundledPluginsTask] */ -@Incubating @CacheableTask -abstract class ListBundledPluginsTask : DefaultTask() { - - /** - * The IDEA dependency sources path. - * Configured automatically with the [SetupDependenciesTask.idea] dependency. - * - * Default value: `setupDependenciesTask.idea.get().classes.path` - */ - @get:Input - abstract val ideDir: Property +abstract class ListBundledPluginsTask : DefaultTask(), PlatformVersionAware { /** * Path to the file, where the output list will be stored. @@ -45,8 +32,6 @@ abstract class ListBundledPluginsTask : DefaultTask() { @get:OutputFile abstract val outputFile: RegularFileProperty - private val context = logCategory() - init { group = PLUGIN_GROUP_NAME description = "List bundled plugins within the currently targeted IntelliJ-based IDE release." @@ -54,13 +39,17 @@ abstract class ListBundledPluginsTask : DefaultTask() { @TaskAction fun listBundledPlugins() { - outputFile.asPath.outputStream().use { os -> - BuiltinPluginsRegistry - .resolveBundledPlugins(ideDir.get().toPath(), context) - .joinToString("\n") - .apply { - os.write(toByteArray()) - } - } + outputFile.asPath.writeText( + productInfo.bundledPlugins.joinToString(separator = "\n") + ) + } + + companion object { + fun register(project: Project) = + project.configureTask(Tasks.LIST_BUNDLED_PLUGINS) { + outputFile.convention( + project.layout.buildDirectory.file("${Tasks.LIST_BUNDLED_PLUGINS}.txt") + ) + } } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTask.kt index f22b5a4dcc..d482c93d0b 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTask.kt @@ -31,6 +31,7 @@ import org.jetbrains.intellij.platform.gradle.model.XmlExtractor * * @see [PrintProductsReleasesTask] */ +@Deprecated(message = "CHECK") @CacheableTask abstract class ListProductsReleasesTask : DefaultTask() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTask.kt index 01334382f1..ba19e0e9d3 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTask.kt @@ -26,6 +26,7 @@ import kotlin.io.path.inputStream * * @see Plugin Configuration File */ +@Deprecated(message = "CHECK") @CacheableTask abstract class PatchPluginXmlTask : DefaultTask(), PlatformVersionAware { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareSandboxTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareSandboxTask.kt index 80d26be09e..9e193b5338 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareSandboxTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareSandboxTask.kt @@ -27,6 +27,7 @@ import kotlin.io.path.notExists /** * Prepares sandbox directory with installed plugin and its dependencies. */ +@Deprecated(message = "CHECK") @DisableCachingByDefault(because = "Setting up configuration on local machine") abstract class PrepareSandboxTask : Sync() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintBundledPluginsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintBundledPluginsTask.kt index 7481078922..ab2c334a3d 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintBundledPluginsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintBundledPluginsTask.kt @@ -3,9 +3,12 @@ package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.DefaultTask +import org.gradle.api.Project import org.gradle.api.file.RegularFileProperty import org.gradle.api.tasks.* +import org.gradle.kotlin.dsl.named import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks /** * Prints the output produced by the [ListBundledPluginsTask] task. @@ -29,4 +32,17 @@ abstract class PrintBundledPluginsTask : DefaultTask() { @TaskAction fun printBundledPlugins() = println(inputFile.asFile.get().readText()) + + companion object { + fun register(project: Project) = + project.configureTask(Tasks.PRINT_BUNDLED_PLUGINS) { + val listBundledPluginsTaskProvider = project.tasks.named(Tasks.LIST_BUNDLED_PLUGINS) + + inputFile.convention(listBundledPluginsTaskProvider.flatMap { listBundledPluginsTask -> + listBundledPluginsTask.outputFile + }) + + dependsOn(listBundledPluginsTaskProvider) + } + } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintProductsReleasesTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintProductsReleasesTask.kt index 41a8ad6c55..52b4bc1b05 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintProductsReleasesTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintProductsReleasesTask.kt @@ -12,6 +12,7 @@ import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GRO * * @see [ListProductsReleasesTask] */ +@Deprecated(message = "CHECK") @UntrackedTask(because = "Prints the output produced by the listProductsReleases task") abstract class PrintProductsReleasesTask : DefaultTask() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PublishPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PublishPluginTask.kt index ceeb7fb7a0..3202fc5422 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PublishPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PublishPluginTask.kt @@ -30,6 +30,7 @@ import org.jetbrains.intellij.pluginRepository.model.StringPluginId * * See [Publishing Plugin With Gradle](https://plugins.jetbrains.com/docs/intellij/publishing-plugin.html#publishing-plugin-with-gradle) tutorial for step-by-step instructions. */ +@Deprecated(message = "CHECK") @UntrackedTask(because = "Output is stored remotely") abstract class PublishPluginTask : DefaultTask() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdeForUiTestTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdeForUiTestTask.kt index 3eb682e4d0..b58a95d3eb 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdeForUiTestTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdeForUiTestTask.kt @@ -15,6 +15,7 @@ import org.jetbrains.intellij.platform.gradle.tasks.base.RunIdeBase * @see [RunIdeBase] * @see [JavaExec] */ +@Deprecated(message = "CHECK") @UntrackedTask(because = "Should always run IDE for UI tests") abstract class RunIdeForUiTestTask : RunIdeBase() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdePerformanceTestTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdePerformanceTestTask.kt index ba68fa8fbb..2314250cd7 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdePerformanceTestTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdePerformanceTestTask.kt @@ -38,6 +38,7 @@ import java.nio.file.Paths * @see [RunIdeBase] * @see [JavaExec] */ +@Deprecated(message = "CHECK") @Incubating @UntrackedTask(because = "Should always run IDE for performance tests") abstract class RunIdePerformanceTestTask : RunIdeBase() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdeTask.kt index d611127bfb..0580f21f4c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdeTask.kt @@ -23,6 +23,7 @@ import kotlin.io.path.absolutePathString * @see [RunIdeBase] * @see [JavaExec] */ +@Deprecated(message = "CHECK") @UntrackedTask(because = "Should always run guest IDE") abstract class RunIdeTask : JavaExec(), CoroutinesJavaAgentAware, CustomPlatformVersionAware, JetBrainsRuntimeAware, SandboxAware { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunPluginVerifierTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunPluginVerifierTask.kt index dcb89286c4..e79f2b06ec 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunPluginVerifierTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunPluginVerifierTask.kt @@ -6,7 +6,6 @@ import com.jetbrains.plugin.structure.base.utils.* import org.apache.tools.ant.util.TeeOutputStream import org.gradle.api.DefaultTask import org.gradle.api.GradleException -import org.gradle.api.InvalidUserDataException import org.gradle.api.file.RegularFileProperty import org.gradle.api.model.ObjectFactory import org.gradle.api.provider.ListProperty @@ -21,11 +20,10 @@ import org.gradle.process.internal.ExecException import org.jetbrains.intellij.platform.gradle.* import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType.AndroidStudio import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType.IntellijIdeaCommunity +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Locations import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERSION_LATEST -import org.jetbrains.intellij.platform.gradle.Version import org.jetbrains.intellij.platform.gradle.tasks.base.JetBrainsRuntimeAware +import org.jetbrains.intellij.platform.gradle.tasks.base.PluginVerifierAware import org.jetbrains.intellij.platform.gradle.utils.ArchiveUtils import org.jetbrains.intellij.platform.gradle.utils.DependenciesDownloader import org.jetbrains.intellij.platform.gradle.utils.LatestVersionResolver @@ -53,12 +51,13 @@ import kotlin.io.path.pathString * @see Verifying Plugin Compatibility * @see IntelliJ Plugin Verifier */ +@Deprecated(message = "CHECK") @UntrackedTask(because = "Should always run Plugin Verifier") abstract class RunPluginVerifierTask @Inject constructor( private val objectFactory: ObjectFactory, private val execOperations: ExecOperations, private val providers: ProviderFactory, -) : DefaultTask(), JetBrainsRuntimeAware { +) : DefaultTask(), JetBrainsRuntimeAware, PluginVerifierAware { /** * Defines the verification level at which the task should fail if any reported issue matches. @@ -93,24 +92,24 @@ abstract class RunPluginVerifierTask @Inject constructor( @get:Input abstract val localPaths: ListProperty - /** - * Returns the version of the IntelliJ Plugin Verifier that will be used. - * - * Default value: `latest` - */ - @get:Input - @get:Optional - abstract val verifierVersion: Property - - /** - * Local path to the IntelliJ Plugin Verifier that will be used. - * If provided, [verifierVersion] is ignored. - * - * Default value: path to the JAR file resolved using the [verifierVersion] property - */ - @get:Input - @get:Optional - abstract val verifierPath: Property +// /** +// * Returns the version of the IntelliJ Plugin Verifier that will be used. +// * +// * Default value: `latest` +// */ +// @get:Input +// @get:Optional +// abstract val verifierVersion: Property + +// /** +// * Local path to the IntelliJ Plugin Verifier that will be used. +// * If provided, [verifierVersion] is ignored. +// * +// * Default value: path to the JAR file resolved using the [verifierVersion] property +// */ +// @get:Input +// @get:Optional +// abstract val verifierPath: Property /** * Free arguments passed to the IntelliJ Plugin Verifier exactly as specified. @@ -206,9 +205,6 @@ abstract class RunPluginVerifierTask @Inject constructor( @get:Optional abstract val ignoredProblems: Property - @get:Internal - abstract val ideDir: Property - @get:Internal abstract val offline: Property @@ -234,16 +230,15 @@ abstract class RunPluginVerifierTask @Inject constructor( throw GradleException("'ideVersions' and 'localPaths' properties should not be empty") } - val verifierPath = resolveVerifierPath() val verifierArgs = listOf("check-plugin") + getOptions() + file.toString() + paths debug(context, "Distribution file: $file") - debug(context, "Verifier path: $verifierPath") + debug(context, "Verifier path: $pluginVerifierExecutable") ByteArrayOutputStream().use { os -> try { execOperations.javaexec { - classpath = objectFactory.fileCollection().from(verifierPath) + classpath = objectFactory.fileCollection().from(pluginVerifierExecutable) mainClass.set("com.jetbrains.pluginverifier.PluginVerifierMain") args = verifierArgs standardOutput = TeeOutputStream(System.out, os) @@ -331,27 +326,6 @@ abstract class RunPluginVerifierTask @Inject constructor( } } - /** - * Resolves the path to the IntelliJ Plugin Verifier file. - * At first, checks if it was provided with [verifierPath]. - * Fetches IntelliJ Plugin Verifier artifact from the [PLUGIN_VERIFIER_REPOSITORY] repository and resolves the path to `verifier-cli` jar file. - * - * @return path to `verifier-cli` jar - */ - private fun resolveVerifierPath() = - verifierPath.orNull - ?.let(Path::of) - ?.takeIf(Path::exists) - ?: throw InvalidUserDataException("Provided Plugin Verifier path doesn't exist: '$path'. Downloading Plugin Verifier: $verifierVersion") - - /** - * Check that the Plugin Verifier supports the Verification reports output formats. - * This is available only in version 1.304 and later. - * - * The previous versions do not support the corresponding versions properly, leading to CLI argument parsing errors. - */ - private fun supportsVerificationReportOutputFormats() = currentVersion.let(Version::parse) >= Version(1, 304) - /** * Collects all the options for the Plugin Verifier CLI provided with the task configuration. * @@ -377,10 +351,10 @@ abstract class RunPluginVerifierTask @Inject constructor( if (offline.get()) { args.add("-offline") } - if (supportsVerificationReportOutputFormats()) { - args.add("-verification-reports-formats") - args.add(verificationReportsFormats.get().joinToString(",")) - } + + args.add("-verification-reports-formats") + args.add(verificationReportsFormats.get().joinToString(",")) + if (ignoredProblems.orNull != null) { args.add("-ignored-problems") args.add(ignoredProblems.get().absolutePath) @@ -405,17 +379,6 @@ abstract class RunPluginVerifierTask @Inject constructor( .orElse(providers.systemProperty("user.home").map { Path.of(it).resolve(".cache/pluginVerifier") }) .orElse(temporaryDir.toPath().resolve("pluginVerifier")) - /** - * Resolves the Plugin Verifier version. - * If set to [VERSION_LATEST], there's request to [METADATA_URL] performed for the latest available version. - * - * @return Plugin Verifier version - */ - @get:Internal - internal val currentVersion by lazy { - verifierVersion.orNull?.takeIf { it != VERSION_LATEST } ?: resolveLatestVersion() - } - /** * Resolves the IDE type and version. If only `version` is provided, `type` is set to "IC". * @@ -496,7 +459,7 @@ abstract class RunPluginVerifierTask @Inject constructor( val redirectUrl = URL(getHeaderField("Location")) disconnect() debug(context, "Resolved IDE download URL: $url") - return "${IntelliJPluginConstants.Locations.CACHE_REDIRECTOR}/${redirectUrl.host}${redirectUrl.file}" + return "${Locations.CACHE_REDIRECTOR}/${redirectUrl.host}${redirectUrl.file}" } else { debug(context, "IDE download URL has no redirection provided. Skipping") } @@ -537,7 +500,7 @@ abstract class RunPluginVerifierTask @Inject constructor( internal fun ideDownloadDir() = verifierHomeDir().map { it.resolve("ides").createDir() } companion object { - private const val METADATA_URL = "$PLUGIN_VERIFIER_REPOSITORY/org/jetbrains/intellij/plugins/verifier-cli/maven-metadata.xml" + private const val METADATA_URL = "${Locations.PLUGIN_VERIFIER_REPOSITORY}/org/jetbrains/intellij/plugins/verifier-cli/maven-metadata.xml" private const val IDEA_DOWNLOAD_URL = "https://data.services.jetbrains.com/products/download" private const val ANDROID_STUDIO_DOWNLOAD_URL = "https://redirector.gvt1.com/edgedl/android/studio/ide-zips" diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SetupDependenciesTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SetupDependenciesTask.kt index 2f3b37f1ad..28d2ce985f 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SetupDependenciesTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SetupDependenciesTask.kt @@ -3,15 +3,19 @@ package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.DefaultTask -import org.gradle.api.provider.Property -import org.gradle.api.tasks.Internal +import org.gradle.api.Project import org.gradle.api.tasks.TaskAction import org.gradle.work.DisableCachingByDefault import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradle.dependency.IdeaDependency +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradle.error import org.jetbrains.intellij.platform.gradle.logCategory +/** + * TODO: Provide valid URL + */ +private const val message = "Task is scheduled for removal, see: [SDK Docs link]" + /** * A deprecated method for setting up IntelliJ Platform dependencies. * @@ -23,25 +27,23 @@ import org.jetbrains.intellij.platform.gradle.logCategory * TODO: Link to SDK Docs */ @DisableCachingByDefault(because = "No output state to track") +@Deprecated(message = message) abstract class SetupDependenciesTask : DefaultTask() { - /** - * Reference to the resolved `idea` dependency. - * TODO: suggest alternative method for accessing IDEA dependency - */ - @Deprecated(message = "setupDependencies.idea is no longer available") - @get:Internal - abstract val idea: Property - private val context = logCategory() init { group = PLUGIN_GROUP_NAME - description = "Deprecated task" + description = message } @TaskAction fun setupDependencies() { - error(context, "Task is deprecated now, see: [SDK Docs link]") + error(context, message) + } + + companion object { + fun register(project: Project) = + project.configureTask(Tasks.SETUP_DEPENDENCIES) } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SignPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SignPluginTask.kt index 9acf7597f1..46e289d029 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SignPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SignPluginTask.kt @@ -31,6 +31,7 @@ import kotlin.io.path.pathString * @see Plugin Signing * @see Marketplace ZIP Signer */ +@Deprecated(message = "CHECK") @CacheableTask abstract class SignPluginTask @Inject constructor( objectFactory: ObjectFactory, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/TestIdeTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/TestIdeTask.kt index 9cb2bad369..229bda7e35 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/TestIdeTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/TestIdeTask.kt @@ -19,6 +19,7 @@ import kotlin.io.path.absolutePathString * @see [RunIdeBase] * @see [JavaExec] */ +@Deprecated(message = "CHECK") @UntrackedTask(because = "Should always run guest IDE") abstract class TestIdeTask : Test(), CoroutinesJavaAgentAware, CustomPlatformVersionAware, JetBrainsRuntimeAware, SandboxAware { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTask.kt index 79413d02ec..c62da91c97 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTask.kt @@ -15,7 +15,10 @@ import org.jetbrains.intellij.platform.gradle.tasks.base.PlatformVersionAware import org.jetbrains.intellij.platform.gradle.utils.PlatformJavaVersions import org.jetbrains.intellij.platform.gradle.utils.PlatformKotlinVersions import java.io.File +import java.nio.file.Files +import java.nio.file.Path import javax.inject.Inject +import kotlin.io.path.* /** * Validates the plugin project configuration: @@ -38,6 +41,7 @@ import javax.inject.Inject * @see Build Number Ranges * @see Kotlin Standard Library */ +@Deprecated(message = "CHECK") @CacheableTask abstract class VerifyPluginConfigurationTask @Inject constructor( private val providers: ProviderFactory, @@ -140,30 +144,28 @@ abstract class VerifyPluginConfigurationTask @Inject constructor( val kotlinVersion = kotlinVersion.orNull?.let(Version::parse) val kotlinxCoroutinesLibraryPresent = kotlinxCoroutinesLibraryPresent.get() val platformKotlinLanguageVersion = platformBuild.let(::getPlatformKotlinVersion)?.run { Version.parse("$major.$minor") } -// val pluginVerifierDownloadPath = pluginVerifierDownloadDir.get().let(Path::of).toAbsolutePath() -// val oldPluginVerifierDownloadPath = providers.systemProperty("user.home").map { "$it/.pluginVerifier/ides" }.get().let(Path::of).toAbsolutePath() + val pluginVerifierDownloadPath = pluginVerifierDownloadDir.get().let(Path::of).toAbsolutePath() + val oldPluginVerifierDownloadPath = providers.systemProperty("user.home").map { "$it/.pluginVerifier/ides" }.get().let(Path::of).toAbsolutePath() sequence { - pluginXmlFiles.get() - .mapNotNull { parsePluginXml(it.toPath(), context) } - .forEach { plugin -> - val sinceBuild = plugin.ideaVersion.sinceBuild.let(Version::parse) - val sinceBuildJavaVersion = sinceBuild.let(::getPlatformJavaVersion) - val sinceBuildKotlinApiVersion = sinceBuild.let(::getPlatformKotlinVersion)?.run { Version.parse("$major.$minor") } - - if (sinceBuild.major < platformBuild.major) { - yield("The 'since-build' property is lower than the target IntelliJ Platform major version: $sinceBuild < ${platformBuild.major}.") - } - if (sinceBuildJavaVersion < targetCompatibilityJavaVersion) { - yield("The Java configuration specifies targetCompatibility=$targetCompatibilityJavaVersion but since-build='$sinceBuild' property requires targetCompatibility=$sinceBuildJavaVersion.") - } - if (sinceBuildJavaVersion < jvmTargetJavaVersion) { - yield("The Kotlin configuration specifies jvmTarget=$jvmTargetJavaVersion but since-build='$sinceBuild' property requires jvmTarget=$sinceBuildJavaVersion.") - } - if (sinceBuildKotlinApiVersion < kotlinApiVersion) { - yield("The Kotlin configuration specifies apiVersion=$kotlinApiVersion but since-build='$sinceBuild' property requires apiVersion=$sinceBuildKotlinApiVersion.") - } + pluginXmlFiles.get().mapNotNull { parsePluginXml(it.toPath(), context) }.forEach { plugin -> + val sinceBuild = plugin.ideaVersion.sinceBuild.let(Version::parse) + val sinceBuildJavaVersion = sinceBuild.let(::getPlatformJavaVersion) + val sinceBuildKotlinApiVersion = sinceBuild.let(::getPlatformKotlinVersion)?.run { Version.parse("$major.$minor") } + + if (sinceBuild.major < platformBuild.major) { + yield("The 'since-build' property is lower than the target IntelliJ Platform major version: $sinceBuild < ${platformBuild.major}.") + } + if (sinceBuildJavaVersion < targetCompatibilityJavaVersion) { + yield("The Java configuration specifies targetCompatibility=$targetCompatibilityJavaVersion but since-build='$sinceBuild' property requires targetCompatibility=$sinceBuildJavaVersion.") + } + if (sinceBuildJavaVersion < jvmTargetJavaVersion) { + yield("The Kotlin configuration specifies jvmTarget=$jvmTargetJavaVersion but since-build='$sinceBuild' property requires jvmTarget=$sinceBuildJavaVersion.") + } + if (sinceBuildKotlinApiVersion < kotlinApiVersion) { + yield("The Kotlin configuration specifies apiVersion=$kotlinApiVersion but since-build='$sinceBuild' property requires apiVersion=$sinceBuildKotlinApiVersion.") } + } if (platformBuild < Version(223)) { yield("The minimal supported IntelliJ Platform version is 2022.3 (233.0), which is higher than provided: $platformVersion ($platformBuild)") @@ -183,12 +185,7 @@ abstract class VerifyPluginConfigurationTask @Inject constructor( if (kotlinPluginAvailable && kotlinStdlibDefaultDependency) { yield("The dependency on the Kotlin Standard Library (stdlib) is automatically added when using the Gradle Kotlin plugin and may conflict with the version provided with the IntelliJ Platform, see: https://jb.gg/intellij-platform-kotlin-stdlib") } - if ( - kotlinPluginAvailable - && kotlinIncrementalUseClasspathSnapshot - && kotlinVersion >= Version(1, 8, 20) - && kotlinVersion < Version(1, 9) - ) { + if (kotlinPluginAvailable && kotlinIncrementalUseClasspathSnapshot && kotlinVersion >= Version(1, 8, 20) && kotlinVersion < Version(1, 9)) { yield("The Kotlin plugin in version $kotlinVersion used with the IntelliJ Platform Gradle Plugin leads to the 'java.lang.OutOfMemoryError: Java heap space' exception, see: https://jb.gg/intellij-platform-kotlin-oom") } if (kotlinxCoroutinesLibraryPresent) { @@ -196,21 +193,18 @@ abstract class VerifyPluginConfigurationTask @Inject constructor( } }.joinToString("\n") { "- $it" }.takeIf(String::isNotEmpty)?.let { warn( - context, - listOf("The following plugin configuration issues were found:", it, "See: https://jb.gg/intellij-platform-versions").joinToString("\n") + context, listOf("The following plugin configuration issues were found:", it, "See: https://jb.gg/intellij-platform-versions").joinToString("\n") ) } -// if ( -// pluginVerifierDownloadPath != oldPluginVerifierDownloadPath -// && oldPluginVerifierDownloadPath.exists() -// && oldPluginVerifierDownloadPath.listFiles().isNotEmpty() -// ) { -// info( -// context, -// "The Plugin Verifier download directory is set to $pluginVerifierDownloadPath, but downloaded IDEs were also found in $oldPluginVerifierDownloadPath, see: https://jb.gg/intellij-platform-plugin-verifier-old-download-dir", -// ) -// } + with(oldPluginVerifierDownloadPath) { + if (this != pluginVerifierDownloadPath && exists() && Files.list(this).findAny().isPresent) { + info( + context, + "The Plugin Verifier download directory is set to $pluginVerifierDownloadPath, but downloaded IDEs were also found in $oldPluginVerifierDownloadPath, see: https://jb.gg/intellij-platform-plugin-verifier-old-download-dir", + ) + } + } } private fun getPlatformJavaVersion(buildNumber: Version) = PlatformJavaVersions.entries.firstOrNull { buildNumber >= it.key }?.value diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginSignatureTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginSignatureTask.kt index f985b4d1a4..d58bc4fcab 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginSignatureTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginSignatureTask.kt @@ -22,6 +22,7 @@ import javax.inject.Inject * @see Plugin Signing * @see Marketplace ZIP Signer */ +@Deprecated(message = "CHECK") @CacheableTask abstract class VerifyPluginSignatureTask @Inject constructor( objectFactory: ObjectFactory, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginTask.kt index b01ddcd871..a696f5fb6a 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginTask.kt @@ -22,6 +22,7 @@ import org.jetbrains.intellij.platform.gradle.warn * * @see Plugin Configuration File */ +@Deprecated(message = "CHECK") @CacheableTask abstract class VerifyPluginTask : DefaultTask() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/JetBrainsRuntimeAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/JetBrainsRuntimeAware.kt index d4f83976cf..05096c70ef 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/JetBrainsRuntimeAware.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/JetBrainsRuntimeAware.kt @@ -2,17 +2,15 @@ package org.jetbrains.intellij.platform.gradle.tasks.base -import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.DirectoryProperty import org.gradle.api.file.RegularFileProperty -import org.gradle.api.tasks.* +import org.gradle.api.tasks.InputDirectory +import org.gradle.api.tasks.InputFile +import org.gradle.api.tasks.PathSensitive +import org.gradle.api.tasks.PathSensitivity interface JetBrainsRuntimeAware : PlatformVersionAware { - @get:InputFiles - @get:PathSensitive(PathSensitivity.RELATIVE) - val jetbrainsRuntime: ConfigurableFileCollection - @get:InputDirectory @get:PathSensitive(PathSensitivity.RELATIVE) val jetbrainsRuntimeDirectory: DirectoryProperty diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/PluginVerifierAware.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/PluginVerifierAware.kt new file mode 100644 index 0000000000..f581d0ca80 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/PluginVerifierAware.kt @@ -0,0 +1,21 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradle.tasks.base + +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.file.RegularFileProperty +import org.gradle.api.tasks.InputDirectory +import org.gradle.api.tasks.InputFile +import org.gradle.api.tasks.PathSensitive +import org.gradle.api.tasks.PathSensitivity + +interface PluginVerifierAware { + + @get:InputDirectory + @get:PathSensitive(PathSensitivity.RELATIVE) + val pluginVerifierDirectory: DirectoryProperty + + @get:InputFile + @get:PathSensitive(PathSensitivity.RELATIVE) + val pluginVerifierExecutable: RegularFileProperty +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/RunIdeBase.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/RunIdeBase.kt index 741d11f2b4..cda5230f3c 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/RunIdeBase.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/RunIdeBase.kt @@ -15,6 +15,7 @@ import java.nio.file.Path /** * Base task for running an IDE with the current plugin in various modes. */ +@Deprecated(message = "CHECK") @UntrackedTask(because = "Runs an IDE which should happen every time this task is run.") abstract class RunIdeBase : JavaExec() { diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/ZipSigningToolBase.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/ZipSigningToolBase.kt index c3660066de..d09bf0ca95 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/ZipSigningToolBase.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/base/ZipSigningToolBase.kt @@ -24,6 +24,7 @@ import kotlin.io.path.absolutePathString /** * Base class for tasks that use Marketplace ZIP Signer CLI. */ +@Deprecated(message = "CHECK") @CacheableTask abstract class ZipSigningToolBase( private val objectFactory: ObjectFactory, diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/tasks.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/tasks.kt new file mode 100644 index 0000000000..c7bc69b9a9 --- /dev/null +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/tasks.kt @@ -0,0 +1,171 @@ +// Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradle.tasks + +import com.jetbrains.plugin.structure.intellij.version.IdeVersion +import org.gradle.api.GradleException +import org.gradle.api.Project +import org.gradle.api.Task +import org.gradle.api.plugins.JavaPluginExtension +import org.gradle.jvm.toolchain.JavaToolchainService +import org.gradle.kotlin.dsl.* +import org.gradle.kotlin.dsl.support.serviceOf +import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Configurations +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Configurations.Attributes +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.executableResolver.IntelliJPluginVerifierResolver +import org.jetbrains.intellij.platform.gradle.executableResolver.JetBrainsRuntimeResolver +import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformDependenciesExtension +import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformExtension +import org.jetbrains.intellij.platform.gradle.info +import org.jetbrains.intellij.platform.gradle.isSpecified +import org.jetbrains.intellij.platform.gradle.model.productInfo +import org.jetbrains.intellij.platform.gradle.tasks.base.* +import org.jetbrains.intellij.platform.gradle.throwIfNull +import java.util.* +import kotlin.io.path.createDirectories + +internal inline fun Project.configureTask(vararg names: String, noinline configuration: T.() -> Unit = {}) { + names.forEach { name -> + info(null, "Configuring task: $name") + tasks.maybeCreate(name) + } + + tasks.withType { + if (this is PlatformVersionAware) { + intelliJPlatform = configurations.getByName(Configurations.INTELLIJ_PLATFORM) + intelliJPlatformProductInfo = configurations.getByName(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) + } + + if (this is CoroutinesJavaAgentAware) { + val initializeIntelliJPlatformPluginTaskProvider = tasks.named(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) + + coroutinesJavaAgentFile.convention(initializeIntelliJPlatformPluginTaskProvider.flatMap { + it.coroutinesJavaAgent + }) + + dependsOn(initializeIntelliJPlatformPluginTaskProvider) + } + + if (this is CustomPlatformVersionAware) { + val suffix = UUID.randomUUID().toString().substring(0, 8) + val intellijPlatformDependencyConfiguration = + configurations.create("${Configurations.INTELLIJ_PLATFORM_DEPENDENCY}_$suffix") { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + + this@configureTask.dependencies + .the() + .create(type, version, configurationName = name) + } + val intellijPlatformConfiguration = configurations.create("${Configurations.INTELLIJ_PLATFORM}_$suffix") { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + + attributes { + attribute(Attributes.extracted, true) + } + + extendsFrom(intellijPlatformDependencyConfiguration) + } + val intellijPlatformProductInfoConfiguration = + configurations.create("${Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO}_$suffix") { + isVisible = false + isCanBeConsumed = false + isCanBeResolved = true + + attributes { + attribute(Attributes.productInfo, true) + } + + extendsFrom(intellijPlatformConfiguration) + } + + type.convention(provider { + val productInfo = configurations.getByName(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) + .singleOrNull() + .throwIfNull { GradleException("IntelliJ Platform is not specified.") } + .toPath() + .productInfo() + IntelliJPlatformType.fromCode(productInfo.productCode) + }) + version.convention(provider { + val productInfo = configurations.getByName(Configurations.INTELLIJ_PLATFORM_PRODUCT_INFO) + .singleOrNull() + .throwIfNull { GradleException("IntelliJ Platform is not specified.") } + .toPath() + .productInfo() + IdeVersion.createIdeVersion(productInfo.version).toString() + }) + intelliJPlatform.setFrom(provider { + when { + type.isSpecified() || version.isSpecified() -> intellijPlatformConfiguration + else -> emptyList() + } + }) + intelliJPlatformProductInfo.setFrom(provider { + when { + type.isSpecified() || version.isSpecified() -> intellijPlatformProductInfoConfiguration + else -> emptyList() + } + }) + } + + if (this is SandboxAware) { + val prepareSandboxTaskProvider = tasks.named(Tasks.PREPARE_SANDBOX) + val extension = the() + + sandboxDirectory.convention(extension.sandboxContainer.map { + it.dir("$platformType-$platformVersion").also { directory -> + directory.asFile.toPath().createDirectories() + } + }) + + prepareSandboxTaskProvider.configure { + sandboxDirectory.convention(this@withType.sandboxDirectory) + } + + dependsOn(prepareSandboxTaskProvider) + } + + if (this is JetBrainsRuntimeAware) { + val jbrResolver = JetBrainsRuntimeResolver( + jetbrainsRuntime = configurations.getByName(Configurations.JETBRAINS_RUNTIME), + intellijPlatform = intelliJPlatform, + javaToolchainSpec = project.the().toolchain, + javaToolchainService = serviceOf(), + ) + + jetbrainsRuntimeDirectory.convention(layout.dir(provider { + jbrResolver.resolveDirectory()?.toFile() + })) + jetbrainsRuntimeExecutable.convention(layout.file(provider { + jbrResolver.resolveExecutable()?.toFile() + })) + } + + if (this is TestIdeTask) { + executable(jetbrainsRuntimeExecutable) + } + + if (this is PluginVerifierAware) { + val extension = the() + val pluginVerifierResolver = IntelliJPluginVerifierResolver( + intellijPluginVerifier = configurations.getByName(Configurations.INTELLIJ_PLUGIN_VERIFIER), + localPath = extension.pluginVerifier.path, + ) + + pluginVerifierDirectory.convention(layout.dir(provider { + pluginVerifierResolver.resolveDirectory()?.toFile() + })) + pluginVerifierExecutable.convention(layout.file(provider { + pluginVerifierResolver.resolveExecutable()?.toFile() + })) + } + } + + tasks.withType(configuration) +} diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils.kt index b21900ba75..49ce3bac18 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils.kt @@ -44,7 +44,6 @@ import java.time.format.DateTimeFormatter import java.time.format.DateTimeFormatterBuilder import java.time.temporal.ChronoField import java.util.function.Predicate -import java.util.jar.Manifest import kotlin.io.path.absolute import kotlin.io.path.exists import kotlin.io.path.name @@ -206,23 +205,6 @@ internal fun checkGradleVersion() { } } -internal fun getCurrentPluginVersion() = IntelliJPlatformPlugin::class.java - .run { getResource("$simpleName.class") } - .runCatching { - val manifestPath = with(this?.path) { - when { - this == null -> return@runCatching null - startsWith("jar:") -> this - startsWith("file:") -> "jar:$this" - else -> return@runCatching null - } - }.run { substring(0, lastIndexOf("!") + 1) } + "/META-INF/MANIFEST.MF" - info(null, "Resolving IntelliJ Platform Gradle Plugin version with: $manifestPath") - URL(manifestPath).openStream().use { - Manifest(it).mainAttributes.getValue("Version") - } - }.getOrNull() - fun Property.isSpecified() = isPresent && when (val value = orNull) { null -> false is String -> value.isNotEmpty() diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpec.kt index 38ba30b8e6..40c12646af 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpec.kt @@ -16,9 +16,10 @@ import org.junit.AfterClass import org.junit.Assume.assumeFalse import java.io.File import java.nio.file.Path +import kotlin.io.path.pathString import kotlin.test.* -@Suppress("GroovyAssignabilityCheck", "ComplexRedundantLet") +@Suppress("GroovyAssignabilityCheck") class IntelliJPluginSpec : IntelliJPluginSpecBase() { companion object { @@ -64,7 +65,7 @@ class IntelliJPluginSpec : IntelliJPluginSpecBase() { writeTestFile() build(TEST_TASK_NAME, "--info").let { - val sandboxPath = adjustWindowsPath("${buildDirectory.canonicalPath}/idea-sandbox") + val sandboxPath = adjustWindowsPath("${buildDirectory.pathString}/idea-sandbox") val testCommand = parseCommand(it.output) assertPathParameters(testCommand, sandboxPath) @@ -112,7 +113,7 @@ class IntelliJPluginSpec : IntelliJPluginSpecBase() { @Test fun `add local plugin to compile only classpath`() { val repositoryInstance = PluginRepositoryFactory.create(MARKETPLACE_HOST, null) - val plugin = repositoryInstance.downloader.download("org.jetbrains.postfixCompletion", "0.8-beta", dir, null) + val plugin = repositoryInstance.downloader.download("org.jetbrains.postfixCompletion", "0.8-beta", dir.toFile(), null) buildFile.groovy( """ @@ -523,7 +524,7 @@ class IntelliJPluginSpec : IntelliJPluginSpecBase() { fun `custom sandbox directory`() { writeTestFile() - val sandboxPath = adjustWindowsPath("${dir.canonicalPath}/customSandbox") + val sandboxPath = adjustWindowsPath("${dir.pathString}/customSandbox") buildFile.xml( """ intellij { @@ -531,8 +532,8 @@ class IntelliJPluginSpec : IntelliJPluginSpecBase() { } """.trimIndent() ) - build(TEST_TASK_NAME, "--info").let { - assertPathParameters(parseCommand(it.output), sandboxPath) + build(TEST_TASK_NAME, "--info") { + assertPathParameters(parseCommand(output), sandboxPath) } } diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpecBase.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpecBase.kt index a806c9c8cc..b9fab3e2eb 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpecBase.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpecBase.kt @@ -10,9 +10,12 @@ import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DEFAULT_IN import java.io.BufferedReader import java.io.File import java.io.FileOutputStream +import java.nio.file.Path import java.nio.file.Paths import java.util.zip.ZipFile import java.util.zip.ZipOutputStream +import kotlin.io.path.createDirectories +import kotlin.io.path.pathString import kotlin.test.BeforeTest import kotlin.test.assertEquals import kotlin.test.assertTrue @@ -27,7 +30,7 @@ abstract class IntelliJPluginSpecBase : IntelliJPlatformTestBase() { ?: throw GradleException("'test.markdownPlugin.version' isn't provided") val gradleProperties get() = file("gradle.properties") - val buildFile get() = file("build.gradle") + val buildFile get() = file("build.gradle.kts") val settingsFile get() = file("settings.gradle") val pluginXml get() = file("src/main/resources/META-INF/plugin.xml") val buildDirectory get() = dir.resolve("build") @@ -61,31 +64,46 @@ abstract class IntelliJPluginSpecBase : IntelliJPlatformTestBase() { buildFile.groovy( """ plugins { - id 'java' - id 'org.jetbrains.intellij.platform' - id 'org.jetbrains.kotlin.jvm' version '$kotlinPluginVersion' + id("java") + id("org.jetbrains.intellij.platform") + id("org.jetbrains.kotlin.jvm") version "$kotlinPluginVersion" } - sourceCompatibility = 11 - targetCompatibility = 11 + + kotlin { + jvmToolchain { + languageVersion = JavaLanguageVersion.of(17) + vendor = JvmVendorSpec.JETBRAINS + } + } + repositories { mavenCentral() - } - intellij { - version = '$intellijVersion' - downloadSources = false - pluginsRepositories { - maven('$pluginsRepository') + + intellijPlatform { + releases() } - instrumentCode = false } - buildSearchableOptions { - enabled = false + + dependencies { + intellijPlatform { + intellijIdeaCommunity("$intellijVersion") + } } +// intellij { +// pluginsRepositories { +// maven('$pluginsRepository') +// } +// instrumentCode = false +// } +// buildSearchableOptions { +// enabled = false +// } + // Define tasks with a minimal set of tasks required to build a source set - sourceSets.all { - task(it.getTaskName('build', 'SourceSet'), dependsOn: it.output) - } +// sourceSets.all { +// task(it.getTaskName('build', 'SourceSet'), dependsOn: it.output) +// } """.trimIndent() ) @@ -124,7 +142,7 @@ abstract class IntelliJPluginSpecBase : IntelliJPlatformTestBase() { .filterNot { it.isEmpty() } } - protected fun directory(path: String) = File(dir, path).apply { mkdirs() } + protected fun directory(path: String) = dir.resolve(path).createDirectories() protected fun emptyZipFile(path: String): File { val split = path.split('/') @@ -132,16 +150,16 @@ abstract class IntelliJPluginSpecBase : IntelliJPlatformTestBase() { split.size > 1 -> directory(split.dropLast(1).joinToString("/")) else -> dir } - val file = File(directory, split.last()) - val outputStream = FileOutputStream(file) + val file = directory.resolve(split.last()) + val outputStream = FileOutputStream(file.toFile()) val zipOutputStream = ZipOutputStream(outputStream) zipOutputStream.close() outputStream.close() - return file + return file.toFile() } protected fun file(path: String) = path - .run { takeIf { startsWith('/') } ?: "${dir.path}/$this" } + .run { takeIf { startsWith('/') } ?: dir.resolve(this).pathString } .split('/') .run { File(dropLast(1).joinToString("/")) to last() } .apply { if (!first.exists()) first.mkdirs() } @@ -222,6 +240,8 @@ abstract class IntelliJPluginSpecBase : IntelliJPlatformTestBase() { protected fun collectPaths(zipFile: ZipFile) = zipFile.entries().toList().mapNotNull { it.name }.toSet() + protected fun collectPaths(directory: Path) = collectPaths(directory.toFile()) + protected fun collectPaths(directory: File): Set { assert(directory.exists()) return directory.walkTopDown().filterNot { it.isDirectory }.map { diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/SearchableOptionsSpecBase.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/SearchableOptionsSpecBase.kt index 3d343ee30f..90d366dfa0 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/SearchableOptionsSpecBase.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/SearchableOptionsSpecBase.kt @@ -5,7 +5,6 @@ package org.jetbrains.intellij.platform.gradle import org.intellij.lang.annotations.Language import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.SEARCHABLE_OPTIONS_DIR_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.SEARCHABLE_OPTIONS_SUFFIX -import java.io.File abstract class SearchableOptionsSpecBase : IntelliJPluginSpecBase() { @@ -64,7 +63,7 @@ abstract class SearchableOptionsSpecBase : IntelliJPluginSpecBase() { } """.trimIndent() - fun getSearchableOptionsXml(jar: String) = File(getSearchableOptions(), "/$jar.jar/search/$jar.jar$SEARCHABLE_OPTIONS_SUFFIX") + fun getSearchableOptionsXml(jar: String) = getSearchableOptions().resolve("/$jar.jar/search/$jar.jar$SEARCHABLE_OPTIONS_SUFFIX") - private fun getSearchableOptions() = File(buildDirectory, SEARCHABLE_OPTIONS_DIR_NAME) + private fun getSearchableOptions() = buildDirectory.resolve(SEARCHABLE_OPTIONS_DIR_NAME) } diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/jbr/JbrResolverTest.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/executableResolver/JbrResolverTest.kt similarity index 97% rename from src/test/kotlin/org/jetbrains/intellij/platform/gradle/jbr/JbrResolverTest.kt rename to src/test/kotlin/org/jetbrains/intellij/platform/gradle/executableResolver/JbrResolverTest.kt index e809460ca2..0c0f5982dc 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/jbr/JbrResolverTest.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/executableResolver/JbrResolverTest.kt @@ -1,6 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.platform.gradle.jbr +package org.jetbrains.intellij.platform.gradle.executableResolver import org.gradle.internal.os.OperatingSystem import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildPluginTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildPluginTaskSpec.kt index 244e18bdef..c97ad78e34 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildPluginTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildPluginTaskSpec.kt @@ -7,9 +7,10 @@ import org.gradle.internal.os.OperatingSystem import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase -import java.io.File import java.util.jar.Manifest import java.util.zip.ZipFile +import kotlin.io.path.exists +import kotlin.io.path.pathString import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotNull @@ -63,10 +64,10 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { build(Tasks.BUILD_PLUGIN) - val distribution = File(buildDirectory, "distributions/myPluginName-0.42.123.zip") + val distribution = buildDirectory.resolve("distributions/myPluginName-0.42.123.zip") assertTrue(distribution.exists()) - val zipFile = ZipFile(distribution) + val zipFile = ZipFile(distribution.toFile()) assertEquals( setOf( "myPluginName/", @@ -143,7 +144,7 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { val distribution = buildDirectory.resolve("distributions/myPluginName-0.42.123.zip") assertTrue(distribution.exists()) - val zipFile = ZipFile(distribution) + val zipFile = ZipFile(distribution.toFile()) assertEquals( setOf( "myPluginName/", @@ -195,7 +196,7 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - val sandboxPath = adjustWindowsPath("${dir.canonicalPath}/customSandbox") + val sandboxPath = adjustWindowsPath("${dir.pathString}/customSandbox") buildFile.groovy( """ version = '0.42.123' @@ -218,7 +219,7 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { build(Tasks.BUILD_PLUGIN) - val distribution = File(buildDirectory, "distributions/myPluginName-0.42.123.zip") + val distribution = buildDirectory.resolve("distributions/myPluginName-0.42.123.zip") assertTrue(distribution.exists()) assertEquals( @@ -229,7 +230,7 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { "myPluginName/lib/projectName-0.42.123.jar", "myPluginName/lib/searchableOptions-0.42.123.jar", ), - collectPaths(ZipFile(distribution)) + collectPaths(ZipFile(distribution.toFile())) ) } @@ -256,7 +257,7 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { setOf( "projectName-0.42.123.zip", ), - File(buildDirectory, "distributions").list()?.toSet(), + buildDirectory.resolve("distributions").toFile().list()?.toSet(), ) } @@ -298,10 +299,10 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { build(Tasks.BUILD_PLUGIN) - val distribution = File(buildDirectory, "distributions/myPluginName-0.42.123.zip") + val distribution = buildDirectory.resolve("distributions/myPluginName-0.42.123.zip") assertTrue(distribution.exists()) - val jar = extractFile(ZipFile(distribution), "myPluginName/lib/projectName-0.42.123.jar") + val jar = extractFile(ZipFile(distribution.toFile()), "myPluginName/lib/projectName-0.42.123.jar") assertTrue(collectPaths(ZipFile(jar)).contains("App.class")) } @@ -343,10 +344,10 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { build(Tasks.BUILD_PLUGIN) - val distribution = File(buildDirectory, "distributions/myPluginName-0.42.123.zip") + val distribution = buildDirectory.resolve("distributions/myPluginName-0.42.123.zip") assertTrue(distribution.exists()) - val jar = extractFile(ZipFile(distribution), "myPluginName/lib/projectName-0.42.123.jar") + val jar = extractFile(ZipFile(distribution.toFile()), "myPluginName/lib/projectName-0.42.123.jar") assertTrue(collectPaths(ZipFile(jar)).contains("App.class")) } @@ -376,10 +377,10 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { build(Tasks.BUILD_PLUGIN) - val distribution = File(buildDirectory, "distributions/myPluginName-0.42.123.zip") + val distribution = buildDirectory.resolve("distributions/myPluginName-0.42.123.zip") assertTrue(distribution.exists()) - val zip = ZipFile(distribution) + val zip = ZipFile(distribution.toFile()) assertEquals( setOf( "myPluginName/", @@ -439,10 +440,10 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { build(Tasks.BUILD_PLUGIN) - val distribution = File(buildDirectory, "distributions/myPluginName-0.42.123.zip") + val distribution = buildDirectory.resolve("distributions/myPluginName-0.42.123.zip") assertTrue(distribution.exists()) - val zip = ZipFile(distribution) + val zip = ZipFile(distribution.toFile()) assertEquals( setOf( "myPluginName/", @@ -484,7 +485,7 @@ class BuildPluginTaskSpec : IntelliJPluginSpecBase() { build(Tasks.BUILD_PLUGIN) val archive = buildDirectory.resolve("distributions").resolve("projectName-0.42.123.zip") - val artifact = extractFile(ZipFile(archive), "projectName/lib/projectName-0.42.123.jar") + val artifact = extractFile(ZipFile(archive.toFile()), "projectName/lib/projectName-0.42.123.jar") fileText(ZipFile(artifact), "META-INF/MANIFEST.MF").byteInputStream().use { Manifest(it).mainAttributes }.let { assertNotNull(it) diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTaskSpec.kt index 92ed5c3081..608d9c4b08 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTaskSpec.kt @@ -4,10 +4,10 @@ package org.jetbrains.intellij.platform.gradle.tasks import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.BUILD_SEARCHABLE_OPTIONS_TASK_NAME import org.jetbrains.intellij.platform.gradle.SearchableOptionsSpecBase +import kotlin.io.path.readText import kotlin.test.Ignore import kotlin.test.Test -@Suppress("ComplexRedundantLet") class BuildSearchableOptionsTaskSpec : SearchableOptionsSpecBase() { @Test diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadRobotServerPluginTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadRobotServerPluginTaskSpec.kt index 2317f65ffd..4ec5174ce2 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadRobotServerPluginTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadRobotServerPluginTaskSpec.kt @@ -4,7 +4,6 @@ package org.jetbrains.intellij.platform.gradle.tasks import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase -import java.io.File import kotlin.test.Test import kotlin.test.assertTrue @@ -52,7 +51,7 @@ class DownloadRobotServerPluginTaskSpec : IntelliJPluginSpecBase() { build(DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME) assertTrue( - collectPaths(File(buildDirectory, "robotServerPlugin")) + collectPaths(buildDirectory.resolve("robotServerPlugin")) .containsAll(setOf("/robot-server-plugin/lib/robot-server-plugin-0.10.0.jar")) ) } @@ -98,7 +97,7 @@ class DownloadRobotServerPluginTaskSpec : IntelliJPluginSpecBase() { build(DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME) assertTrue( - collectPaths(File(buildDirectory, "robotServerPlugin")) + collectPaths(buildDirectory.resolve("robotServerPlugin")) .containsAll(setOf("/robot-server-plugin/lib/robot-server-plugin-0.11.1.jar")) ) } @@ -144,7 +143,7 @@ class DownloadRobotServerPluginTaskSpec : IntelliJPluginSpecBase() { val resolvedVersion = DownloadRobotServerPluginTask.resolveLatestVersion() assertTrue( - collectPaths(File(buildDirectory, "robotServerPlugin")) + collectPaths(buildDirectory.resolve("robotServerPlugin")) .containsAll(setOf("/robot-server-plugin/lib/instrumented-robot-server-plugin-$resolvedVersion.jar")) ) } diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InitializeIntelliJPlatformPluginTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InitializeIntelliJPlatformPluginTaskSpec.kt new file mode 100644 index 0000000000..225478a0bf --- /dev/null +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InitializeIntelliJPlatformPluginTaskSpec.kt @@ -0,0 +1,90 @@ +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradle.tasks + +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Locations +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_ID +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase +import org.jetbrains.intellij.platform.gradle.utils.LatestVersionResolver +import kotlin.io.path.createFile +import kotlin.io.path.exists +import kotlin.io.path.name +import kotlin.test.Test +import kotlin.test.assertFalse +import kotlin.test.assertTrue + +class InitializeIntelliJPlatformPluginTaskSpec : IntelliJPluginSpecBase() { + + @Test + fun `report outdated plugin`() { + build(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) { + val latestVersion = LatestVersionResolver.fromGitHub(PLUGIN_NAME, Locations.GITHUB_REPOSITORY) + + assertContains("$PLUGIN_NAME is outdated: 0.0.0. Update `$PLUGIN_ID` to: $latestVersion", output) + } + } + + @Test + fun `skip version check when offline`() { + build(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN, "--offline") { + assertNotContains("$PLUGIN_NAME is outdated: 0.0.0.", output) + } + } + + @Test + fun `skip version check is disabled with BuildFeature`() { + gradleProperties.properties( + """ + org.jetbrains.intellij.platform.buildFeature.selfUpdateCheck=false + """.trimIndent() + ) + + build(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) { + assertNotContains("$PLUGIN_NAME is outdated: 0.0.0.", output) + } + } + + @Test + fun `skip version check is disabled with existing lock file`() { + val file = dir.resolve("lockFile").createFile() + + buildFile.groovy( + """ + tasks { + ${Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN} { + selfUpdateLock.set(file("${file.name}")) + } + } + """.trimIndent() + ) + + assertTrue(file.exists()) + + build(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) { + assertNotContains("$PLUGIN_NAME is outdated: 0.0.0.", output) + } + } + + @Test + fun `creates coroutines-javaagent file`() { + val file = dir.resolve("coroutines-javaagent.jar") + + buildFile.groovy( + """ + tasks { + ${Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN} { + coroutinesJavaAgent.set(file("${file.name}")) + } + } + """.trimIndent() + ) + + assertFalse(file.exists()) + + build(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) + + assertTrue(file.exists()) + } +} diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTaskSpec.kt index 3bef14351d..71178640f4 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTaskSpec.kt @@ -4,7 +4,7 @@ package org.jetbrains.intellij.platform.gradle.tasks import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME import org.jetbrains.intellij.platform.gradle.SearchableOptionsSpecBase -import java.io.File +import kotlin.io.path.exists import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertTrue @@ -44,7 +44,7 @@ class JarSearchableOptionsTaskSpec : SearchableOptionsSpecBase() { build(JAR_SEARCHABLE_OPTIONS_TASK_NAME) - File(buildDirectory, "libsSearchableOptions").let { + buildDirectory.resolve("libsSearchableOptions").let { assertTrue(it.exists()) assertEquals(setOf("/lib/searchableOptions.jar"), collectPaths(it)) } diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListBundledPluginsTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListBundledPluginsTaskSpec.kt index b821593a44..468bcff125 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListBundledPluginsTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListBundledPluginsTaskSpec.kt @@ -2,76 +2,91 @@ package org.jetbrains.intellij.platform.gradle.tasks +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase +import kotlin.io.path.readText +import kotlin.test.Test +import kotlin.test.assertEquals class ListBundledPluginsTaskSpec : IntelliJPluginSpecBase() { -// @Test -// fun `list plugins for 2020_1`() { -// buildFile.groovy( -// """ -// intellij { -// version = "2020.1" -// } -// """.trimIndent() -// ) -// -// build(LIST_BUNDLED_PLUGINS_TASK_NAME) -// -// val content = buildDirectory.resolve("$LIST_BUNDLED_PLUGINS_TASK_NAME.txt").readText() -// assertEquals( -// """ -// org.jetbrains.idea.reposearch -// AntSupport -// ByteCodeViewer -// org.jetbrains.java.decompiler -// org.intellij.intelliLang -// org.jetbrains.debugger.streams -// Git4Idea -// com.intellij.tasks -// com.intellij.stats.completion -// com.intellij.laf.macos -// org.jetbrains.idea.eclipse -// org.jetbrains.plugins.javaFX -// XPathView -// org.jetbrains.plugins.gradle.maven -// JUnit -// org.intellij.plugins.markdown -// com.intellij.java-i18n -// org.jetbrains.idea.maven -// TestNG-J -// org.jetbrains.settingsRepository -// com.jetbrains.changeReminder -// com.intellij.properties.bundle.editor -// org.jetbrains.plugins.textmate -// com.jetbrains.filePrediction -// org.jetbrains.plugins.terminal -// com.intellij.java -// org.jetbrains.kotlin -// com.intellij.platform.images -// hg4idea -// com.intellij.gradle -// com.jetbrains.sh -// org.editorconfig.editorconfigjetbrains -// org.jetbrains.plugins.github -// com.intellij.properties -// org.jetbrains.plugins.gradle -// org.jetbrains.android -// com.intellij.laf.win10 -// org.jetbrains.plugins.yaml -// tanvd.grazi -// Subversion -// DevKit -// com.intellij.copyright -// org.intellij.groovy -// com.intellij.uiDesigner -// XSLT-Debugger -// com.intellij.java.ide -// com.android.tools.idea.smali -// Coverage -// com.intellij.configurationScript -// """.trimIndent(), -// content, -// ) -// } + @Test + fun `list bundled plugins`() { + build(Tasks.LIST_BUNDLED_PLUGINS) + + val content = buildDirectory.resolve("${Tasks.LIST_BUNDLED_PLUGINS}.txt").readText() + assertEquals( + """ + AntSupport + ByteCodeViewer + Coverage + DevKit + Git4Idea + JUnit + Lombook Plugin + PerforceDirectPlugin + Subversion + TestNG-J + XPathView + XSLT-Debugger + com.android.tools.design + com.android.tools.idea.smali + com.intellij + com.intellij.completion.ml.ranking + com.intellij.configurationScript + com.intellij.copyright + com.intellij.dev + com.intellij.gradle + com.intellij.java + com.intellij.java-i18n + com.intellij.java.ide + com.intellij.marketplace + com.intellij.platform.images + com.intellij.plugins.eclipsekeymap + com.intellij.plugins.netbeanskeymap + com.intellij.plugins.visualstudiokeymap + com.intellij.properties + com.intellij.searcheverywhere.ml + com.intellij.settingsSync + com.intellij.tasks + com.intellij.tracing.ide + com.intellij.uiDesigner + com.jetbrains.codeWithMe + com.jetbrains.packagesearch.intellij-plugin + com.jetbrains.projector.libs + com.jetbrains.sh + com.jetbrains.space + hg4idea + intellij.indexing.shared.core + intellij.webp + org.editorconfig.editorconfigjetbrains + org.intellij.groovy + org.intellij.intelliLang + org.intellij.plugins.markdown + org.intellij.qodana + org.jetbrains.android + org.jetbrains.debugger.streams + org.jetbrains.idea.eclipse + org.jetbrains.idea.gradle.dsl + org.jetbrains.idea.maven + org.jetbrains.idea.maven.model + org.jetbrains.idea.maven.server.api + org.jetbrains.idea.reposearch + org.jetbrains.java.decompiler + org.jetbrains.kotlin + org.jetbrains.plugins.github + org.jetbrains.plugins.gradle + org.jetbrains.plugins.gradle.dependency.updater + org.jetbrains.plugins.gradle.maven + org.jetbrains.plugins.javaFX + org.jetbrains.plugins.terminal + org.jetbrains.plugins.textmate + org.jetbrains.plugins.yaml + org.toml.lang + tanvd.grazi + training + """.trimIndent(), + content, + ) + } } diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTaskSpec.kt index 7881d0e91b..85cc95a2b0 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTaskSpec.kt @@ -4,6 +4,7 @@ package org.jetbrains.intellij.platform.gradle.tasks import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase +import kotlin.io.path.readText import kotlin.test.BeforeTest import kotlin.test.Test import kotlin.test.assertEquals diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTaskSpec.kt index ce8a1cf1a1..899b255687 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTaskSpec.kt @@ -2,11 +2,11 @@ package org.jetbrains.intellij.platform.gradle.tasks +import com.jetbrains.plugin.structure.base.utils.listFiles import org.gradle.testkit.runner.TaskOutcome import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_XML_DIR_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase -import java.io.File import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotEquals @@ -14,7 +14,7 @@ import kotlin.test.assertNotEquals @Suppress("PluginXmlValidity") class PatchPluginXmlTaskSpec : IntelliJPluginSpecBase() { - private val patchedPluginXml = lazy { File(buildDirectory, PLUGIN_XML_DIR_NAME).listFiles()?.first() } + private val patchedPluginXml = lazy { buildDirectory.resolve(PLUGIN_XML_DIR_NAME).listFiles().first() } @Test fun `patch version and since until builds`() { diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareSandboxTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareSandboxTaskSpec.kt index 697fafb480..7c8132746b 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareSandboxTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareSandboxTaskSpec.kt @@ -2,905 +2,897 @@ package org.jetbrains.intellij.platform.gradle.tasks -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DEFAULT_SANDBOX_CONTAINER -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase -import java.io.File -import java.nio.file.Files.createTempDirectory -import java.util.zip.ZipFile -import kotlin.test.Test -import kotlin.test.assertEquals -import kotlin.test.assertTrue @Suppress("GroovyUnusedAssignment", "PluginXmlValidity") class PrepareSandboxTaskSpec : IntelliJPluginSpecBase() { - private val sandbox get() = File(buildDirectory, DEFAULT_SANDBOX_CONTAINER) - - @Test - fun `prepare sandbox for two plugins`() { - writeJavaFile() - - pluginXml.xml( - """ - - org.intellij.test.plugin - Test - 1.0 - JetBrains - Lorem ipsum dolor sit amet, consectetur adipisicing elit. - - - """.trimIndent() - ) - - buildFile.groovy( - """ - version = '0.42.123' - - intellij { - pluginName = 'myPluginName' - plugins = [project('nestedProject')] - } - """.trimIndent() - ) - - file("settings.gradle").groovy( - """ - include 'nestedProject' - """.trimIndent() - ) - - file("nestedProject/build.gradle").groovy( - """ - repositories { mavenCentral() } - apply plugin: 'org.jetbrains.intellij.platform' - version = '0.42.123' - - compileJava { - sourceCompatibility = '1.8' - targetCompatibility = '1.8' - } - - intellij { - version = '$intellijVersion' - downloadSources = false - pluginName = 'myNestedPluginName' - instrumentCode = false - } - """.trimIndent() - ) - - file("nestedProject/src/main/java/NestedAppFile.java").groovy( - """ - class NestedAppFile {} - """.trimIndent() - ) - - file("nestedProject/src/main/resources/META-INF/plugin.xml").xml(pluginXml.readText()) - - build(Tasks.PREPARE_SANDBOX) - - assertEquals( - setOf( - "/config/options/updates.xml", - "/plugins/myNestedPluginName/lib/nestedProject-0.42.123.jar", - "/plugins/myPluginName/lib/projectName-0.42.123.jar", - ), - collectPaths(sandbox), - ) - - val jar = File(sandbox, "/plugins/myPluginName/lib/projectName-0.42.123.jar") - assertEquals( - setOf( - "META-INF/", - "META-INF/MANIFEST.MF", - "App.class", - "META-INF/plugin.xml", - ), - collectPaths(ZipFile(jar)), - ) - - val nestedProjectJar = File(sandbox, "/plugins/myNestedPluginName/lib/nestedProject-0.42.123.jar") - assertEquals( - setOf( - "META-INF/", - "META-INF/MANIFEST.MF", - "NestedAppFile.class", - "META-INF/plugin.xml", - ), - collectPaths(ZipFile(nestedProjectJar)), - ) - } - - @Test - fun `prepare sandbox for two plugins with evaluated project`() { - writeJavaFile() - - pluginXml.xml( - """ - - org.intellij.test.plugin - Test - 1.0 - JetBrains - Lorem ipsum dolor sit amet, consectetur adipisicing elit. - - - """.trimIndent() - ) - - buildFile.groovy( - """ - allprojects { - repositories { mavenCentral() } - version = '0.42.123' - apply plugin: 'org.jetbrains.intellij.platform' - intellij { - downloadSources = false - version = "$intellijVersion" - } - } - project(':') { - intellij { - pluginName = 'myPluginName' - plugins = [project(':nestedProject')] - } - } - project(':nestedProject') { - compileJava { - sourceCompatibility = '1.8' - targetCompatibility = '1.8' - } - intellij { - pluginName = 'myNestedPluginName' - instrumentCode = false - } - } - """.trimIndent() - ) - - file("settings.gradle").groovy( - """ - include 'nestedProject' - """.trimIndent() - ) - - file("nestedProject/src/main/java/NestedAppFile.java").java( - """ - class NestedAppFile {} - """.trimIndent() - ) - - file("nestedProject/src/main/resources/META-INF/plugin.xml").xml(pluginXml.readText()) - - build(Tasks.PREPARE_SANDBOX) - - assertEquals( - setOf( - "/plugins/myPluginName/lib/projectName-0.42.123.jar", - "/plugins/myNestedPluginName/lib/nestedProject-0.42.123.jar", - "/config/options/updates.xml", - ), - collectPaths(sandbox), - ) - - val jar = File(sandbox, "/plugins/myPluginName/lib/projectName-0.42.123.jar") - assertEquals( - setOf( - "META-INF/", - "META-INF/MANIFEST.MF", - "App.class", - "META-INF/plugin.xml", - ), - collectPaths(ZipFile(jar)), - ) - - val nestedProjectJar = File(sandbox, "/plugins/myNestedPluginName/lib/nestedProject-0.42.123.jar") - assertEquals( - setOf( - "META-INF/", - "META-INF/MANIFEST.MF", - "NestedAppFile.class", - "META-INF/plugin.xml", - ), - collectPaths(ZipFile(nestedProjectJar)), - ) - } - - @Test - fun `prepare sandbox task without plugin_xml`() { - writeJavaFile() - - buildFile.groovy( - """ - version = '0.42.123' - intellij { - pluginName = 'myPluginName' - plugins = ['copyright'] - } - dependencies { - implementation 'joda-time:joda-time:2.8.1' - } - """.trimIndent() - ) - - build(Tasks.PREPARE_SANDBOX) - - assertEquals( - setOf( - "/plugins/myPluginName/lib/projectName-0.42.123.jar", - "/plugins/myPluginName/lib/joda-time-2.8.1.jar", - "/config/options/updates.xml", - ), - collectPaths(sandbox), - ) - } - - @Test - fun `prepare sandbox task`() { - writeJavaFile() - - file("src/main/resources/META-INF/other.xml").xml( - """ - - """.trimIndent() - ) - - file("src/main/resources/META-INF/nonIncluded.xml").xml( - """ - - """.trimIndent() - ) - - pluginXml.xml( - """ - - - - """.trimIndent() - ) - - buildFile.groovy( - """ - version = '0.42.123' - intellij { - pluginName = 'myPluginName' - plugins = ['copyright'] - } - dependencies { - implementation 'joda-time:joda-time:2.8.1' - } - """.trimIndent() - ) - - build(Tasks.PREPARE_SANDBOX) - - assertEquals( - setOf( - "/plugins/myPluginName/lib/projectName-0.42.123.jar", - "/plugins/myPluginName/lib/joda-time-2.8.1.jar", - "/config/options/updates.xml", - ), - collectPaths(sandbox), - ) - - val jar = ZipFile(File(sandbox, "/plugins/myPluginName/lib/projectName-0.42.123.jar")) - assertEquals( - setOf( - "META-INF/", - "META-INF/MANIFEST.MF", - "App.class", - "META-INF/nonIncluded.xml", - "META-INF/other.xml", - "META-INF/plugin.xml", - ), - collectPaths(jar), - ) - - assertZipContent( - jar, - "META-INF/plugin.xml", - """ - - 0.42.123 - - - - """.trimIndent() - ) - } - - @Test - fun `prepare ui tests sandbox task`() { - writeJavaFile() - - file("src/main/resources/META-INF/other.xml").xml( - """ - - """.trimIndent() - ) - - file("src/main/resources/META-INF/nonIncluded.xml").xml( - """ - - """.trimIndent() - ) - - pluginXml.xml( - """ - - - - """.trimIndent() - ) - - buildFile.groovy( - """ - version = '0.42.123' - intellij { - pluginName = 'myPluginName' - plugins = ['copyright'] - } - downloadRobotServerPlugin.version = '0.11.1' - dependencies { - implementation 'joda-time:joda-time:2.8.1' - } - """.trimIndent() - ) - - build(Tasks.PREPARE_UI_TESTING_SANDBOX) - - assertTrue( - collectPaths(sandbox).containsAll( - setOf( - "/plugins-uiTest/myPluginName/lib/projectName-0.42.123.jar", - "/plugins-uiTest/myPluginName/lib/joda-time-2.8.1.jar", - "/config-uiTest/options/updates.xml", - "/plugins-uiTest/robot-server-plugin/lib/robot-server-plugin-0.11.1.jar", - ) - ) - ) - } - - @Test - fun `prepare sandbox with external jar-type plugin`() { - writeJavaFile() - - pluginXml.xml( - """ - - """.trimIndent() - ) - - buildFile.groovy( - """ - intellij { - plugins = ['org.jetbrains.postfixCompletion:0.8-beta'] - pluginName = 'myPluginName' - } - """.trimIndent() - ) - - build(Tasks.PREPARE_SANDBOX) - - assertEquals( - setOf( - "/plugins/org.jetbrains.postfixCompletion-0.8-beta.jar", - "/plugins/myPluginName/lib/projectName.jar", - "/config/options/updates.xml", - ), - collectPaths(sandbox), - ) - } - - @Test - fun `prepare sandbox with external zip-type plugin`() { - writeJavaFile() - - pluginXml.xml( - """ - - """.trimIndent() - ) - - buildFile.groovy( - """ - intellij { - plugins = ['org.intellij.plugins.markdown:$testMarkdownPluginVersion'] - pluginName = 'myPluginName' - } - """.trimIndent() - ) - - build(Tasks.PREPARE_SANDBOX) - - assertEquals( - setOf( - "/config/options/updates.xml", - "/plugins/markdown/lib/markdown.jar", - "/plugins/myPluginName/lib/projectName.jar", - ), - collectPaths(sandbox), - ) - } - - @Test - fun `prepare sandbox with plugin dependency with classes directory`() { - val plugin = createPlugin() - - writeJavaFile() - - pluginXml.xml( - """ - - """.trimIndent() - ) - - buildFile.groovy( - """ - intellij { - plugins = ['${adjustWindowsPath(plugin.canonicalPath)}'] - pluginName = 'myPluginName' - } - """.trimIndent() - ) - - build(Tasks.PREPARE_SANDBOX) - - assertEquals( - setOf( - "/plugins/myPluginName/lib/projectName.jar", - "/config/options/updates.xml", - "/plugins/${plugin.name}/classes/A.class", - "/plugins/${plugin.name}/classes/someResources.properties", - "/plugins/${plugin.name}/META-INF/plugin.xml", - ), - collectPaths(sandbox), - ) - } - - private fun createPlugin() = createTempDirectory("tmp").toFile().also { - File(it, "classes/").mkdir() - File(it, "META-INF/").mkdir() - File(it, "classes/A.class").createNewFile() - File(it, "classes/someResources.properties").createNewFile() - File(it, "META-INF/plugin.xml").xml( - """ - - ${it.name} - Test - 1.0 - - JetBrains - Lorem ipsum dolor sit amet, consectetur adipisicing elit. - - - """.trimIndent() - ) - } - - @Test - fun `prepare custom sandbox task`() { - writeJavaFile() - - file("src/main/resources/META-INF/other.xml").xml( - """ - - """.trimIndent() - ) - - file("src/main/resources/META-INF/nonIncluded.xml").xml( - """ - - """.trimIndent() - ) - - pluginXml.xml( - """ - - - - """.trimIndent() - ) - - val sandboxPath = adjustWindowsPath("${dir.canonicalPath}/customSandbox") - buildFile.groovy( - """ - version = '0.42.123' - intellij { - pluginName = 'myPluginName' - plugins = ['copyright'] - sandboxDir = '$sandboxPath' - } - dependencies { - implementation 'joda-time:joda-time:2.8.1' - } - """.trimIndent() - ) - - build(Tasks.PREPARE_SANDBOX) - - val sandbox = File(sandboxPath) - assertEquals( - setOf( - "/plugins/myPluginName/lib/projectName-0.42.123.jar", - "/plugins/myPluginName/lib/joda-time-2.8.1.jar", - "/config/options/updates.xml", - ), - collectPaths(sandbox), - ) - } - - @Test - fun `use gradle project name if plugin name is not defined`() { - pluginXml.xml( - """ - - """.trimIndent() - ) - - build(Tasks.PREPARE_SANDBOX) - - assertEquals( - setOf( - "/plugins/projectName/lib/projectName.jar", - "/config/options/updates.xml", - ), - collectPaths(sandbox), - ) - } - - @Test - fun `disable ide update without updates_xml`() { - pluginXml.xml( - """ - - """.trimIndent() - ) - - build(Tasks.PREPARE_SANDBOX) - - assertFileContent( - File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), - """ - - - - - """.trimIndent(), - ) - } - - @Test - fun `disable ide update without updates component`() { - pluginXml.xml( - """ - - """.trimIndent() - ) - - val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") - updatesFile.xml( - """ - - - - - """.trimIndent() - ) - - build(Tasks.PREPARE_SANDBOX) - - assertFileContent( - File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), - """ - - - - - - - """.trimIndent(), - ) - } - - @Test - fun `disable ide update without check_needed option`() { - pluginXml.xml( - """ - - """.trimIndent() - ) - - val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") - updatesFile.xml( - """ - - - - - """.trimIndent() - ) - - build(Tasks.PREPARE_SANDBOX) - - assertFileContent( - File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), - """ - - - - - """.trimIndent(), - ) - } - - @Test - fun `disable ide update without value attribute`() { - pluginXml.xml( - """ - - """.trimIndent() - ) - - val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") - - updatesFile.xml( - """ - - - - - """.trimIndent() - ) - - build(Tasks.PREPARE_SANDBOX) - - assertFileContent( - File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), - """ - - - - - """.trimIndent(), - ) - } - - @Test - fun `disable ide update`() { - pluginXml.xml( - """ - - """.trimIndent() - ) - - val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") - - updatesFile.xml( - """ - - - - - """.trimIndent() - ) - - build(Tasks.PREPARE_SANDBOX) - - assertFileContent( - File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), - """ - - - - - """.trimIndent(), - ) - } - - @Test - fun `disable ide update with updates_xml empty`() { - pluginXml.xml( - """ - - """.trimIndent() - ) - - val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") - - updatesFile.xml("") - - build(Tasks.PREPARE_SANDBOX) - - assertFileContent( - File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), - """ - - - - - """.trimIndent(), - ) - } - - @Test - fun `disable ide update with complex updates_xml`() { - pluginXml.xml( - """ - - """.trimIndent() - ) - - val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") - - updatesFile.xml( - """ - - - - - - - - - - - - """.trimIndent() - ) - - build(Tasks.PREPARE_SANDBOX) - - assertFileContent( - File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), - """ - - - - - - - - - - - - """.trimIndent(), - ) - } - - @Test - fun `replace jar on version changing`() { - pluginXml.xml( - """ - - """.trimIndent() - ) - - buildFile.groovy( - """ - version = '0.42.123' - """.trimIndent() - ) - - build(Tasks.PREPARE_SANDBOX) - - buildFile.groovy( - """ - version = '0.42.124' - """.trimIndent() - ) - - build(Tasks.PREPARE_SANDBOX) - - assertEquals( - setOf( - "/plugins/projectName/lib/projectName-0.42.124.jar", - "/config/options/updates.xml", - ), - collectPaths(sandbox), - ) - } - - @Test - fun `rename jars with same names`() { - emptyZipFile("one/core.jar") - emptyZipFile("two/core.jar") - emptyZipFile("three/core.jar") - writeJavaFile() - - buildFile.groovy( - """ - version = '0.42.123' - - intellij { - pluginName = 'myPluginName' - } - - dependencies { - implementation 'joda-time:joda-time:2.8.1' - implementation fileTree('one') - implementation fileTree('two') - implementation fileTree('three') - } - """.trimIndent() - ) - - build(Tasks.PREPARE_SANDBOX) - - assertEquals( - setOf( - "/plugins/myPluginName/lib/projectName-0.42.123.jar", - "/plugins/myPluginName/lib/joda-time-2.8.1.jar", - "/plugins/myPluginName/lib/core.jar", - "/plugins/myPluginName/lib/core_1.jar", - "/plugins/myPluginName/lib/core_2.jar", - "/config/options/updates.xml", - ), - collectPaths(sandbox), - ) - } - - @Test - fun `prepareTestingSandbox runs before test`() { - writeJavaFile() - file("additional/some-file") - - pluginXml.xml( - """ - - """.trimIndent() - ) - - buildFile.groovy( - """ - intellij { - pluginName = 'myPluginName' - } - - ${Tasks.PREPARE_TESTING_SANDBOX} { - from("additional") - } - """.trimIndent() - ) - - build("test") - - assertEquals( - setOf( - "/plugins-test/myPluginName/lib/projectName.jar", - "/plugins-test/some-file", - "/config-test/options/updates.xml", - ), - collectPaths(sandbox), - ) - } +// private val sandbox get() = File(buildDirectory, DEFAULT_SANDBOX_CONTAINER) +// +// @Test +// fun `prepare sandbox for two plugins`() { +// writeJavaFile() +// +// pluginXml.xml( +// """ +// +// org.intellij.test.plugin +// Test +// 1.0 +// JetBrains +// Lorem ipsum dolor sit amet, consectetur adipisicing elit. +// +// +// """.trimIndent() +// ) +// +// buildFile.groovy( +// """ +// version = '0.42.123' +// +// intellij { +// pluginName = 'myPluginName' +// plugins = [project('nestedProject')] +// } +// """.trimIndent() +// ) +// +// file("settings.gradle").groovy( +// """ +// include 'nestedProject' +// """.trimIndent() +// ) +// +// file("nestedProject/build.gradle").groovy( +// """ +// repositories { mavenCentral() } +// apply plugin: 'org.jetbrains.intellij.platform' +// version = '0.42.123' +// +// compileJava { +// sourceCompatibility = '1.8' +// targetCompatibility = '1.8' +// } +// +// intellij { +// version = '$intellijVersion' +// downloadSources = false +// pluginName = 'myNestedPluginName' +// instrumentCode = false +// } +// """.trimIndent() +// ) +// +// file("nestedProject/src/main/java/NestedAppFile.java").groovy( +// """ +// class NestedAppFile {} +// """.trimIndent() +// ) +// +// file("nestedProject/src/main/resources/META-INF/plugin.xml").xml(pluginXml.readText()) +// +// build(Tasks.PREPARE_SANDBOX) +// +// assertEquals( +// setOf( +// "/config/options/updates.xml", +// "/plugins/myNestedPluginName/lib/nestedProject-0.42.123.jar", +// "/plugins/myPluginName/lib/projectName-0.42.123.jar", +// ), +// collectPaths(sandbox), +// ) +// +// val jar = File(sandbox, "/plugins/myPluginName/lib/projectName-0.42.123.jar") +// assertEquals( +// setOf( +// "META-INF/", +// "META-INF/MANIFEST.MF", +// "App.class", +// "META-INF/plugin.xml", +// ), +// collectPaths(ZipFile(jar)), +// ) +// +// val nestedProjectJar = File(sandbox, "/plugins/myNestedPluginName/lib/nestedProject-0.42.123.jar") +// assertEquals( +// setOf( +// "META-INF/", +// "META-INF/MANIFEST.MF", +// "NestedAppFile.class", +// "META-INF/plugin.xml", +// ), +// collectPaths(ZipFile(nestedProjectJar)), +// ) +// } +// +// @Test +// fun `prepare sandbox for two plugins with evaluated project`() { +// writeJavaFile() +// +// pluginXml.xml( +// """ +// +// org.intellij.test.plugin +// Test +// 1.0 +// JetBrains +// Lorem ipsum dolor sit amet, consectetur adipisicing elit. +// +// +// """.trimIndent() +// ) +// +// buildFile.groovy( +// """ +// allprojects { +// repositories { mavenCentral() } +// version = '0.42.123' +// apply plugin: 'org.jetbrains.intellij.platform' +// intellij { +// downloadSources = false +// version = "$intellijVersion" +// } +// } +// project(':') { +// intellij { +// pluginName = 'myPluginName' +// plugins = [project(':nestedProject')] +// } +// } +// project(':nestedProject') { +// compileJava { +// sourceCompatibility = '1.8' +// targetCompatibility = '1.8' +// } +// intellij { +// pluginName = 'myNestedPluginName' +// instrumentCode = false +// } +// } +// """.trimIndent() +// ) +// +// file("settings.gradle").groovy( +// """ +// include 'nestedProject' +// """.trimIndent() +// ) +// +// file("nestedProject/src/main/java/NestedAppFile.java").java( +// """ +// class NestedAppFile {} +// """.trimIndent() +// ) +// +// file("nestedProject/src/main/resources/META-INF/plugin.xml").xml(pluginXml.readText()) +// +// build(Tasks.PREPARE_SANDBOX) +// +// assertEquals( +// setOf( +// "/plugins/myPluginName/lib/projectName-0.42.123.jar", +// "/plugins/myNestedPluginName/lib/nestedProject-0.42.123.jar", +// "/config/options/updates.xml", +// ), +// collectPaths(sandbox), +// ) +// +// val jar = File(sandbox, "/plugins/myPluginName/lib/projectName-0.42.123.jar") +// assertEquals( +// setOf( +// "META-INF/", +// "META-INF/MANIFEST.MF", +// "App.class", +// "META-INF/plugin.xml", +// ), +// collectPaths(ZipFile(jar)), +// ) +// +// val nestedProjectJar = File(sandbox, "/plugins/myNestedPluginName/lib/nestedProject-0.42.123.jar") +// assertEquals( +// setOf( +// "META-INF/", +// "META-INF/MANIFEST.MF", +// "NestedAppFile.class", +// "META-INF/plugin.xml", +// ), +// collectPaths(ZipFile(nestedProjectJar)), +// ) +// } +// +// @Test +// fun `prepare sandbox task without plugin_xml`() { +// writeJavaFile() +// +// buildFile.groovy( +// """ +// version = '0.42.123' +// intellij { +// pluginName = 'myPluginName' +// plugins = ['copyright'] +// } +// dependencies { +// implementation 'joda-time:joda-time:2.8.1' +// } +// """.trimIndent() +// ) +// +// build(Tasks.PREPARE_SANDBOX) +// +// assertEquals( +// setOf( +// "/plugins/myPluginName/lib/projectName-0.42.123.jar", +// "/plugins/myPluginName/lib/joda-time-2.8.1.jar", +// "/config/options/updates.xml", +// ), +// collectPaths(sandbox), +// ) +// } +// +// @Test +// fun `prepare sandbox task`() { +// writeJavaFile() +// +// file("src/main/resources/META-INF/other.xml").xml( +// """ +// +// """.trimIndent() +// ) +// +// file("src/main/resources/META-INF/nonIncluded.xml").xml( +// """ +// +// """.trimIndent() +// ) +// +// pluginXml.xml( +// """ +// +// +// +// """.trimIndent() +// ) +// +// buildFile.groovy( +// """ +// version = '0.42.123' +// intellij { +// pluginName = 'myPluginName' +// plugins = ['copyright'] +// } +// dependencies { +// implementation 'joda-time:joda-time:2.8.1' +// } +// """.trimIndent() +// ) +// +// build(Tasks.PREPARE_SANDBOX) +// +// assertEquals( +// setOf( +// "/plugins/myPluginName/lib/projectName-0.42.123.jar", +// "/plugins/myPluginName/lib/joda-time-2.8.1.jar", +// "/config/options/updates.xml", +// ), +// collectPaths(sandbox), +// ) +// +// val jar = ZipFile(File(sandbox, "/plugins/myPluginName/lib/projectName-0.42.123.jar")) +// assertEquals( +// setOf( +// "META-INF/", +// "META-INF/MANIFEST.MF", +// "App.class", +// "META-INF/nonIncluded.xml", +// "META-INF/other.xml", +// "META-INF/plugin.xml", +// ), +// collectPaths(jar), +// ) +// +// assertZipContent( +// jar, +// "META-INF/plugin.xml", +// """ +// +// 0.42.123 +// +// +// +// """.trimIndent() +// ) +// } +// +// @Test +// fun `prepare ui tests sandbox task`() { +// writeJavaFile() +// +// file("src/main/resources/META-INF/other.xml").xml( +// """ +// +// """.trimIndent() +// ) +// +// file("src/main/resources/META-INF/nonIncluded.xml").xml( +// """ +// +// """.trimIndent() +// ) +// +// pluginXml.xml( +// """ +// +// +// +// """.trimIndent() +// ) +// +// buildFile.groovy( +// """ +// version = '0.42.123' +// intellij { +// pluginName = 'myPluginName' +// plugins = ['copyright'] +// } +// downloadRobotServerPlugin.version = '0.11.1' +// dependencies { +// implementation 'joda-time:joda-time:2.8.1' +// } +// """.trimIndent() +// ) +// +// build(Tasks.PREPARE_UI_TESTING_SANDBOX) +// +// assertTrue( +// collectPaths(sandbox).containsAll( +// setOf( +// "/plugins-uiTest/myPluginName/lib/projectName-0.42.123.jar", +// "/plugins-uiTest/myPluginName/lib/joda-time-2.8.1.jar", +// "/config-uiTest/options/updates.xml", +// "/plugins-uiTest/robot-server-plugin/lib/robot-server-plugin-0.11.1.jar", +// ) +// ) +// ) +// } +// +// @Test +// fun `prepare sandbox with external jar-type plugin`() { +// writeJavaFile() +// +// pluginXml.xml( +// """ +// +// """.trimIndent() +// ) +// +// buildFile.groovy( +// """ +// intellij { +// plugins = ['org.jetbrains.postfixCompletion:0.8-beta'] +// pluginName = 'myPluginName' +// } +// """.trimIndent() +// ) +// +// build(Tasks.PREPARE_SANDBOX) +// +// assertEquals( +// setOf( +// "/plugins/org.jetbrains.postfixCompletion-0.8-beta.jar", +// "/plugins/myPluginName/lib/projectName.jar", +// "/config/options/updates.xml", +// ), +// collectPaths(sandbox), +// ) +// } +// +// @Test +// fun `prepare sandbox with external zip-type plugin`() { +// writeJavaFile() +// +// pluginXml.xml( +// """ +// +// """.trimIndent() +// ) +// +// buildFile.groovy( +// """ +// intellij { +// plugins = ['org.intellij.plugins.markdown:$testMarkdownPluginVersion'] +// pluginName = 'myPluginName' +// } +// """.trimIndent() +// ) +// +// build(Tasks.PREPARE_SANDBOX) +// +// assertEquals( +// setOf( +// "/config/options/updates.xml", +// "/plugins/markdown/lib/markdown.jar", +// "/plugins/myPluginName/lib/projectName.jar", +// ), +// collectPaths(sandbox), +// ) +// } +// +// @Test +// fun `prepare sandbox with plugin dependency with classes directory`() { +// val plugin = createPlugin() +// +// writeJavaFile() +// +// pluginXml.xml( +// """ +// +// """.trimIndent() +// ) +// +// buildFile.groovy( +// """ +// intellij { +// plugins = ['${adjustWindowsPath(plugin.canonicalPath)}'] +// pluginName = 'myPluginName' +// } +// """.trimIndent() +// ) +// +// build(Tasks.PREPARE_SANDBOX) +// +// assertEquals( +// setOf( +// "/plugins/myPluginName/lib/projectName.jar", +// "/config/options/updates.xml", +// "/plugins/${plugin.name}/classes/A.class", +// "/plugins/${plugin.name}/classes/someResources.properties", +// "/plugins/${plugin.name}/META-INF/plugin.xml", +// ), +// collectPaths(sandbox), +// ) +// } +// +// private fun createPlugin() = createTempDirectory("tmp").toFile().also { +// File(it, "classes/").mkdir() +// File(it, "META-INF/").mkdir() +// File(it, "classes/A.class").createNewFile() +// File(it, "classes/someResources.properties").createNewFile() +// File(it, "META-INF/plugin.xml").xml( +// """ +// +// ${it.name} +// Test +// 1.0 +// +// JetBrains +// Lorem ipsum dolor sit amet, consectetur adipisicing elit. +// +// +// """.trimIndent() +// ) +// } +// +// @Test +// fun `prepare custom sandbox task`() { +// writeJavaFile() +// +// file("src/main/resources/META-INF/other.xml").xml( +// """ +// +// """.trimIndent() +// ) +// +// file("src/main/resources/META-INF/nonIncluded.xml").xml( +// """ +// +// """.trimIndent() +// ) +// +// pluginXml.xml( +// """ +// +// +// +// """.trimIndent() +// ) +// +// val sandboxPath = adjustWindowsPath("${dir.canonicalPath}/customSandbox") +// buildFile.groovy( +// """ +// version = '0.42.123' +// intellij { +// pluginName = 'myPluginName' +// plugins = ['copyright'] +// sandboxDir = '$sandboxPath' +// } +// dependencies { +// implementation 'joda-time:joda-time:2.8.1' +// } +// """.trimIndent() +// ) +// +// build(Tasks.PREPARE_SANDBOX) +// +// val sandbox = File(sandboxPath) +// assertEquals( +// setOf( +// "/plugins/myPluginName/lib/projectName-0.42.123.jar", +// "/plugins/myPluginName/lib/joda-time-2.8.1.jar", +// "/config/options/updates.xml", +// ), +// collectPaths(sandbox), +// ) +// } +// +// @Test +// fun `use gradle project name if plugin name is not defined`() { +// pluginXml.xml( +// """ +// +// """.trimIndent() +// ) +// +// build(Tasks.PREPARE_SANDBOX) +// +// assertEquals( +// setOf( +// "/plugins/projectName/lib/projectName.jar", +// "/config/options/updates.xml", +// ), +// collectPaths(sandbox), +// ) +// } +// +// @Test +// fun `disable ide update without updates_xml`() { +// pluginXml.xml( +// """ +// +// """.trimIndent() +// ) +// +// build(Tasks.PREPARE_SANDBOX) +// +// assertFileContent( +// File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), +// """ +// +// +// +// +// """.trimIndent(), +// ) +// } +// +// @Test +// fun `disable ide update without updates component`() { +// pluginXml.xml( +// """ +// +// """.trimIndent() +// ) +// +// val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") +// updatesFile.xml( +// """ +// +// +// +// +// """.trimIndent() +// ) +// +// build(Tasks.PREPARE_SANDBOX) +// +// assertFileContent( +// File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), +// """ +// +// +// +// +// +// +// """.trimIndent(), +// ) +// } +// +// @Test +// fun `disable ide update without check_needed option`() { +// pluginXml.xml( +// """ +// +// """.trimIndent() +// ) +// +// val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") +// updatesFile.xml( +// """ +// +// +// +// +// """.trimIndent() +// ) +// +// build(Tasks.PREPARE_SANDBOX) +// +// assertFileContent( +// File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), +// """ +// +// +// +// +// """.trimIndent(), +// ) +// } +// +// @Test +// fun `disable ide update without value attribute`() { +// pluginXml.xml( +// """ +// +// """.trimIndent() +// ) +// +// val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") +// +// updatesFile.xml( +// """ +// +// +// +// +// """.trimIndent() +// ) +// +// build(Tasks.PREPARE_SANDBOX) +// +// assertFileContent( +// File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), +// """ +// +// +// +// +// """.trimIndent(), +// ) +// } +// +// @Test +// fun `disable ide update`() { +// pluginXml.xml( +// """ +// +// """.trimIndent() +// ) +// +// val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") +// +// updatesFile.xml( +// """ +// +// +// +// +// """.trimIndent() +// ) +// +// build(Tasks.PREPARE_SANDBOX) +// +// assertFileContent( +// File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), +// """ +// +// +// +// +// """.trimIndent(), +// ) +// } +// +// @Test +// fun `disable ide update with updates_xml empty`() { +// pluginXml.xml( +// """ +// +// """.trimIndent() +// ) +// +// val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") +// +// updatesFile.xml("") +// +// build(Tasks.PREPARE_SANDBOX) +// +// assertFileContent( +// File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), +// """ +// +// +// +// +// """.trimIndent(), +// ) +// } +// +// @Test +// fun `disable ide update with complex updates_xml`() { +// pluginXml.xml( +// """ +// +// """.trimIndent() +// ) +// +// val updatesFile = File(directory("build/$DEFAULT_SANDBOX_CONTAINER/config/options"), "updates.xml") +// +// updatesFile.xml( +// """ +// +// +// +// +// +// +// +// +// +// +// +// """.trimIndent() +// ) +// +// build(Tasks.PREPARE_SANDBOX) +// +// assertFileContent( +// File(buildDirectory, "$DEFAULT_SANDBOX_CONTAINER/config/options/updates.xml"), +// """ +// +// +// +// +// +// +// +// +// +// +// +// """.trimIndent(), +// ) +// } +// +// @Test +// fun `replace jar on version changing`() { +// pluginXml.xml( +// """ +// +// """.trimIndent() +// ) +// +// buildFile.groovy( +// """ +// version = '0.42.123' +// """.trimIndent() +// ) +// +// build(Tasks.PREPARE_SANDBOX) +// +// buildFile.groovy( +// """ +// version = '0.42.124' +// """.trimIndent() +// ) +// +// build(Tasks.PREPARE_SANDBOX) +// +// assertEquals( +// setOf( +// "/plugins/projectName/lib/projectName-0.42.124.jar", +// "/config/options/updates.xml", +// ), +// collectPaths(sandbox), +// ) +// } +// +// @Test +// fun `rename jars with same names`() { +// emptyZipFile("one/core.jar") +// emptyZipFile("two/core.jar") +// emptyZipFile("three/core.jar") +// writeJavaFile() +// +// buildFile.groovy( +// """ +// version = '0.42.123' +// +// intellij { +// pluginName = 'myPluginName' +// } +// +// dependencies { +// implementation 'joda-time:joda-time:2.8.1' +// implementation fileTree('one') +// implementation fileTree('two') +// implementation fileTree('three') +// } +// """.trimIndent() +// ) +// +// build(Tasks.PREPARE_SANDBOX) +// +// assertEquals( +// setOf( +// "/plugins/myPluginName/lib/projectName-0.42.123.jar", +// "/plugins/myPluginName/lib/joda-time-2.8.1.jar", +// "/plugins/myPluginName/lib/core.jar", +// "/plugins/myPluginName/lib/core_1.jar", +// "/plugins/myPluginName/lib/core_2.jar", +// "/config/options/updates.xml", +// ), +// collectPaths(sandbox), +// ) +// } +// +// @Test +// fun `prepareTestingSandbox runs before test`() { +// writeJavaFile() +// file("additional/some-file") +// +// pluginXml.xml( +// """ +// +// """.trimIndent() +// ) +// +// buildFile.groovy( +// """ +// intellij { +// pluginName = 'myPluginName' +// } +// +// ${Tasks.PREPARE_TESTING_SANDBOX} { +// from("additional") +// } +// """.trimIndent() +// ) +// +// build("test") +// +// assertEquals( +// setOf( +// "/plugins-test/myPluginName/lib/projectName.jar", +// "/plugins-test/some-file", +// "/config-test/options/updates.xml", +// ), +// collectPaths(sandbox), +// ) +// } } diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintBundledPluginsTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintBundledPluginsTaskSpec.kt new file mode 100644 index 0000000000..7d7b67e51b --- /dev/null +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintBundledPluginsTaskSpec.kt @@ -0,0 +1,90 @@ +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradle.tasks + +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase +import kotlin.test.Test + +class PrintBundledPluginsTaskSpec : IntelliJPluginSpecBase() { + + @Test + fun `print bundled plugins`() { + build(Tasks.PRINT_BUNDLED_PLUGINS) { + assertContains( + """ + > Task :${Tasks.PRINT_BUNDLED_PLUGINS} + AntSupport + ByteCodeViewer + Coverage + DevKit + Git4Idea + JUnit + Lombook Plugin + PerforceDirectPlugin + Subversion + TestNG-J + XPathView + XSLT-Debugger + com.android.tools.design + com.android.tools.idea.smali + com.intellij + com.intellij.completion.ml.ranking + com.intellij.configurationScript + com.intellij.copyright + com.intellij.dev + com.intellij.gradle + com.intellij.java + com.intellij.java-i18n + com.intellij.java.ide + com.intellij.marketplace + com.intellij.platform.images + com.intellij.plugins.eclipsekeymap + com.intellij.plugins.netbeanskeymap + com.intellij.plugins.visualstudiokeymap + com.intellij.properties + com.intellij.searcheverywhere.ml + com.intellij.settingsSync + com.intellij.tasks + com.intellij.tracing.ide + com.intellij.uiDesigner + com.jetbrains.codeWithMe + com.jetbrains.packagesearch.intellij-plugin + com.jetbrains.projector.libs + com.jetbrains.sh + com.jetbrains.space + hg4idea + intellij.indexing.shared.core + intellij.webp + org.editorconfig.editorconfigjetbrains + org.intellij.groovy + org.intellij.intelliLang + org.intellij.plugins.markdown + org.intellij.qodana + org.jetbrains.android + org.jetbrains.debugger.streams + org.jetbrains.idea.eclipse + org.jetbrains.idea.gradle.dsl + org.jetbrains.idea.maven + org.jetbrains.idea.maven.model + org.jetbrains.idea.maven.server.api + org.jetbrains.idea.reposearch + org.jetbrains.java.decompiler + org.jetbrains.kotlin + org.jetbrains.plugins.github + org.jetbrains.plugins.gradle + org.jetbrains.plugins.gradle.dependency.updater + org.jetbrains.plugins.gradle.maven + org.jetbrains.plugins.javaFX + org.jetbrains.plugins.terminal + org.jetbrains.plugins.textmate + org.jetbrains.plugins.yaml + org.toml.lang + tanvd.grazi + training + """.trimIndent(), + output, + ) + } + } +} diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ProcessResourcesTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ProcessResourcesTaskSpec.kt index 4f066f1d7c..d34fb207b2 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ProcessResourcesTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ProcessResourcesTaskSpec.kt @@ -2,10 +2,10 @@ package org.jetbrains.intellij.platform.gradle.tasks +import com.jetbrains.plugin.structure.base.utils.listFiles import org.gradle.api.plugins.JavaPlugin import org.gradle.testkit.runner.TaskOutcome import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase -import java.io.File import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotEquals @@ -13,7 +13,7 @@ import kotlin.test.assertNotEquals @Suppress("GroovyUnusedAssignment", "PluginXmlValidity", "ComplexRedundantLet") class ProcessResourcesTaskSpec : IntelliJPluginSpecBase() { - private val outputPluginXml = lazy { File(buildDirectory, "resources/main/META-INF/").listFiles()?.first() } + private val outputPluginXml = lazy { buildDirectory.resolve("resources/main/META-INF/").listFiles().first() } @Test fun `use patched plugin xml files`() { diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunPluginVerifierTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunPluginVerifierTaskSpec.kt index 85e20cde13..1fabf61c7f 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunPluginVerifierTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunPluginVerifierTaskSpec.kt @@ -4,8 +4,7 @@ package org.jetbrains.intellij.platform.gradle.tasks import org.apache.commons.io.FileUtils import org.gradle.kotlin.dsl.support.listFilesOrdered -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_VERIFIER_REPOSITORY -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.RUN_PLUGIN_VERIFIER_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Locations import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import org.junit.Assert @@ -34,7 +33,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(RUN_PLUGIN_VERIFIER_TASK_NAME).let { + build(Tasks.RUN_PLUGIN_VERIFIER).let { assertContains("Starting the IntelliJ Plugin Verifier 1.255", it.output) } } @@ -57,7 +56,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { gradleVersion = gradleVersion, fail = true, assertValidConfigurationCache = false, - RUN_PLUGIN_VERIFIER_TASK_NAME, + Tasks.RUN_PLUGIN_VERIFIER, ).let { assertContains("Could not find org.jetbrains.intellij.plugins:verifier-cli:1.254", it.output) } @@ -76,7 +75,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(RUN_PLUGIN_VERIFIER_TASK_NAME).let { + build(Tasks.RUN_PLUGIN_VERIFIER).let { val version = RunPluginVerifierTask.resolveLatestVersion() assertContains("Starting the IntelliJ Plugin Verifier $version", it.output) } @@ -96,7 +95,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(RUN_PLUGIN_VERIFIER_TASK_NAME).let { + build(Tasks.RUN_PLUGIN_VERIFIER).let { assertContains("Plugin MyName:1.0.0 against IC-202.7660.26: Compatible", it.output) assertContains("Plugin MyName:1.0.0 against PS-201.8538.41: Compatible", it.output) } @@ -116,7 +115,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(RUN_PLUGIN_VERIFIER_TASK_NAME).let { + build(Tasks.RUN_PLUGIN_VERIFIER).let { assertContains("Plugin MyName:1.0.0 against AI-211.7628.21.2111.7824002: Compatible", it.output) } } @@ -136,7 +135,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(RUN_PLUGIN_VERIFIER_TASK_NAME).let { + build(Tasks.RUN_PLUGIN_VERIFIER).let { val directory = file("build/foo").canonicalPath assertContains("Verification reports directory: $directory", it.output) } @@ -160,7 +159,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(RUN_PLUGIN_VERIFIER_TASK_NAME).let { buildResult -> + build(Tasks.RUN_PLUGIN_VERIFIER).let { buildResult -> val reportsDirectory = file("build/foo") val directory = reportsDirectory.canonicalPath assertContains("Verification reports directory: $directory", buildResult.output) @@ -190,7 +189,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(RUN_PLUGIN_VERIFIER_TASK_NAME).let { buildResult -> + build(Tasks.RUN_PLUGIN_VERIFIER).let { buildResult -> val reportsDirectory = file("build/foo") val directory = reportsDirectory.canonicalPath assertContains("Verification reports directory: $directory", buildResult.output) @@ -219,7 +218,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(RUN_PLUGIN_VERIFIER_TASK_NAME).let { buildResult -> + build(Tasks.RUN_PLUGIN_VERIFIER).let { buildResult -> val reportsDirectory = file("build/foo") val directory = reportsDirectory.canonicalPath assertContains("Verification reports directory: $directory", buildResult.output) @@ -253,7 +252,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(RUN_PLUGIN_VERIFIER_TASK_NAME).let { + build(Tasks.RUN_PLUGIN_VERIFIER).let { assertContains("Compatible. 1 usage of scheduled for removal API and 1 usage of deprecated API. 1 usage of internal API", it.output) assertNotContains("Reference to a missing property", it.output) } @@ -280,7 +279,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(RUN_PLUGIN_VERIFIER_TASK_NAME).let { + build(Tasks.RUN_PLUGIN_VERIFIER).let { assertContains("> Task :listProductsReleases", it.output) assertContains("Starting the IntelliJ Plugin Verifier", it.output) } @@ -302,7 +301,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - buildAndFail(RUN_PLUGIN_VERIFIER_TASK_NAME).let { + buildAndFail(Tasks.RUN_PLUGIN_VERIFIER).let { assertContains("> Task :listProductsReleases SKIPPED", it.output) } } @@ -317,7 +316,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - buildAndFail(RUN_PLUGIN_VERIFIER_TASK_NAME).let { + buildAndFail(Tasks.RUN_PLUGIN_VERIFIER).let { assertContains("Plugin descriptor 'plugin.xml' is not found", it.output) assertContains("Task :verifyPlugin FAILED", it.output) } @@ -340,7 +339,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - buildAndFail(RUN_PLUGIN_VERIFIER_TASK_NAME).let { + buildAndFail(Tasks.RUN_PLUGIN_VERIFIER).let { assertContains("Deprecated API usages", it.output) assertContains("org.gradle.api.GradleException: DEPRECATED_API_USAGES", it.output) } @@ -360,7 +359,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(RUN_PLUGIN_VERIFIER_TASK_NAME).let { + build(Tasks.RUN_PLUGIN_VERIFIER).let { assertContains("Deprecated API usages", it.output) assertNotContains("org.gradle.api.GradleException: DEPRECATED_API_USAGES", it.output) } @@ -380,7 +379,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - buildAndFail(RUN_PLUGIN_VERIFIER_TASK_NAME).let { + buildAndFail(Tasks.RUN_PLUGIN_VERIFIER).let { assertContains("IDE 'foo' cannot be downloaded.", it.output) } } @@ -402,7 +401,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - buildAndFail(RUN_PLUGIN_VERIFIER_TASK_NAME).let { + buildAndFail(Tasks.RUN_PLUGIN_VERIFIER).let { assertContains("Deprecated API usages", it.output) assertContains("org.gradle.api.GradleException: DEPRECATED_API_USAGES", it.output) } @@ -425,7 +424,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(RUN_PLUGIN_VERIFIER_TASK_NAME).let { + build(Tasks.RUN_PLUGIN_VERIFIER).let { assertContains("Deprecated API usages", it.output) assertNotContains("org.gradle.api.GradleException: DEPRECATED_API_USAGES", it.output) } @@ -447,12 +446,12 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { ) val version = RunPluginVerifierTask.resolveLatestVersion() - URL("$PLUGIN_VERIFIER_REPOSITORY/org/jetbrains/intellij/plugins/verifier-cli/$version/verifier-cli-$version-all.jar") + URL("${Locations.PLUGIN_VERIFIER_REPOSITORY}/org/jetbrains/intellij/plugins/verifier-cli/$version/verifier-cli-$version-all.jar") .openStream().use { FileUtils.copyInputStreamToFile(it, file("build/pluginVerifier.jar")) } - buildAndFail(RUN_PLUGIN_VERIFIER_TASK_NAME, "--offline").let { + buildAndFail(Tasks.RUN_PLUGIN_VERIFIER, "--offline").let { assertContains("Cannot download", it.output) } } @@ -474,7 +473,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(RUN_PLUGIN_VERIFIER_TASK_NAME).let { buildResult -> + build(Tasks.RUN_PLUGIN_VERIFIER).let { buildResult -> val reportsDirectory = file("build/foo") val directory = reportsDirectory.canonicalPath assertContains("Verification reports directory: $directory", buildResult.output) @@ -503,7 +502,7 @@ class RunPluginVerifierTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(RUN_PLUGIN_VERIFIER_TASK_NAME).let { buildResult -> + build(Tasks.RUN_PLUGIN_VERIFIER).let { buildResult -> assertNotContains("Internal API usages (2):", buildResult.output) } } diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SetupDependenciesTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SetupDependenciesTaskSpec.kt index 8de2329ce2..dfc70b3762 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SetupDependenciesTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SetupDependenciesTaskSpec.kt @@ -6,35 +6,13 @@ import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import kotlin.test.Test -@Suppress("ComplexRedundantLet") class SetupDependenciesTaskSpec : IntelliJPluginSpecBase() { @Test - fun `idea dependency is available`() { - val testTaskName = "${Tasks.SETUP_DEPENDENCIES}Test" + fun `throw error when called`() { + build(Tasks.SETUP_DEPENDENCIES) { - buildFile.groovy( - """ - def classes = providers.provider { - tasks.named('${Tasks.SETUP_DEPENDENCIES}').get().idea.get().classes - } - tasks.register('$testTaskName') { - doLast { - println classes.get() - } - - dependsOn('${Tasks.SETUP_DEPENDENCIES}') - } - - """.trimIndent() - ) - - build(testTaskName).let { - assertContains("> Task :$testTaskName", it.output) - assertContains("ideaIC-2022.1.4", it.output) - } - build(testTaskName).let { - assertContains("Reusing configuration cache.", it.output) + assertContains("Task is scheduled for removal, see: [SDK Docs link]", output) } } } diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SignPluginTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SignPluginTaskSpec.kt index b7a455b0d0..4bc9bf2ec3 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SignPluginTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SignPluginTaskSpec.kt @@ -2,15 +2,16 @@ package org.jetbrains.intellij.platform.gradle.tasks +import com.jetbrains.plugin.structure.base.utils.listFiles import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DOWNLOAD_ZIP_SIGNER_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.SIGN_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERIFY_PLUGIN_SIGNATURE_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase -import java.io.File +import kotlin.io.path.name import kotlin.test.Test import kotlin.test.assertTrue -@Suppress("GroovyUnusedAssignment", "ComplexRedundantLet") +@Suppress("GroovyUnusedAssignment") class SignPluginTaskSpec : IntelliJPluginSpecBase() { @Test @@ -193,10 +194,10 @@ class SignPluginTaskSpec : IntelliJPluginSpecBase() { ) build(SIGN_PLUGIN_TASK_NAME) - val distributionFolder = File(buildDirectory, "distributions") - assertTrue(distributionFolder.listFiles()?.asList()?.any { - it.name.equals("projectName-1.0.0-signed.zip") - } ?: false) + val distributionFolder = buildDirectory.resolve("distributions") + assertTrue(distributionFolder.listFiles().any { + it.name == "projectName-1.0.0-signed.zip" + }) } @Test diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTaskSpec.kt index 4cb34c33f7..bdb602f902 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTaskSpec.kt @@ -3,7 +3,7 @@ package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.internal.impldep.org.testng.annotations.BeforeTest -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERIFY_PLUGIN_CONFIGURATION_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import java.io.File import kotlin.test.Test @@ -41,7 +41,7 @@ class VerifyPluginConfigurationTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(VERIFY_PLUGIN_CONFIGURATION_TASK_NAME).let { + build(Tasks.VERIFY_PLUGIN_CONFIGURATION).let { assertNotContains(HEADER, it.output) } } @@ -67,7 +67,7 @@ class VerifyPluginConfigurationTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(VERIFY_PLUGIN_CONFIGURATION_TASK_NAME).let { + build(Tasks.VERIFY_PLUGIN_CONFIGURATION).let { assertContains(HEADER, it.output) assertContains("- The 'since-build' property is lower than the target IntelliJ Platform major version: 211 < 221.", it.output) } @@ -81,7 +81,7 @@ class VerifyPluginConfigurationTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(VERIFY_PLUGIN_CONFIGURATION_TASK_NAME).let { + build(Tasks.VERIFY_PLUGIN_CONFIGURATION).let { assertContains(HEADER, it.output) assertContains( "- The Java configuration specifies sourceCompatibility=1.8 but IntelliJ Platform 2022.1.4 requires sourceCompatibility=11.", @@ -98,7 +98,7 @@ class VerifyPluginConfigurationTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(VERIFY_PLUGIN_CONFIGURATION_TASK_NAME).let { + build(Tasks.VERIFY_PLUGIN_CONFIGURATION).let { assertContains(HEADER, it.output) assertContains( "- The Java configuration specifies targetCompatibility=17 but IntelliJ Platform 2022.1.4 requires targetCompatibility=11.", @@ -119,7 +119,7 @@ class VerifyPluginConfigurationTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(VERIFY_PLUGIN_CONFIGURATION_TASK_NAME).let { + build(Tasks.VERIFY_PLUGIN_CONFIGURATION).let { assertContains(HEADER, it.output) assertContains("- The Kotlin configuration specifies jvmTarget=17 but IntelliJ Platform 2022.1.4 requires jvmTarget=11.", it.output) } @@ -154,7 +154,7 @@ class VerifyPluginConfigurationTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(VERIFY_PLUGIN_CONFIGURATION_TASK_NAME).let { + build(Tasks.VERIFY_PLUGIN_CONFIGURATION).let { assertNotContains(HEADER, it.output) } } @@ -182,7 +182,7 @@ class VerifyPluginConfigurationTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(VERIFY_PLUGIN_CONFIGURATION_TASK_NAME).let { + build(Tasks.VERIFY_PLUGIN_CONFIGURATION).let { assertContains(HEADER, it.output) assertContains("- The Kotlin configuration specifies apiVersion=1.9 but since-build='221.6008' property requires apiVersion=1.6.", it.output) } @@ -206,7 +206,7 @@ class VerifyPluginConfigurationTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(VERIFY_PLUGIN_CONFIGURATION_TASK_NAME).let { + build(Tasks.VERIFY_PLUGIN_CONFIGURATION).let { assertNotContains(HEADER, it.output) } } @@ -223,7 +223,7 @@ class VerifyPluginConfigurationTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(VERIFY_PLUGIN_CONFIGURATION_TASK_NAME).let { + build(Tasks.VERIFY_PLUGIN_CONFIGURATION).let { assertContains(HEADER, it.output) assertContains( "- The Kotlin configuration specifies languageVersion=1.3 but IntelliJ Platform 2022.1.4 requires languageVersion=1.6.", @@ -237,7 +237,7 @@ class VerifyPluginConfigurationTaskSpec : IntelliJPluginSpecBase() { // kotlin.stdlib.default.dependency gets unset gradleProperties.writeText("") - build(VERIFY_PLUGIN_CONFIGURATION_TASK_NAME).let { + build(Tasks.VERIFY_PLUGIN_CONFIGURATION).let { assertContains(HEADER, it.output) assertContains( "- The dependency on the Kotlin Standard Library (stdlib) is automatically added when using the Gradle Kotlin plugin and may conflict with the version provided with the IntelliJ Platform, see: https://jb.gg/intellij-platform-kotlin-stdlib", @@ -252,7 +252,7 @@ class VerifyPluginConfigurationTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build("clean", VERIFY_PLUGIN_CONFIGURATION_TASK_NAME).let { + build("clean", Tasks.VERIFY_PLUGIN_CONFIGURATION).let { assertNotContains(HEADER, it.output) } @@ -262,7 +262,7 @@ class VerifyPluginConfigurationTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build("clean", VERIFY_PLUGIN_CONFIGURATION_TASK_NAME).let { + build("clean", Tasks.VERIFY_PLUGIN_CONFIGURATION).let { assertNotContains(HEADER, it.output) } } @@ -277,7 +277,7 @@ class VerifyPluginConfigurationTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(VERIFY_PLUGIN_CONFIGURATION_TASK_NAME).let { + build(Tasks.VERIFY_PLUGIN_CONFIGURATION).let { assertContains(HEADER, it.output) assertContains( "- The Kotlin Coroutines library should not be added explicitly to the project as it is already provided with the IntelliJ Platform.", diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginTaskSpec.kt index 923d628551..b663e9a751 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginTaskSpec.kt @@ -2,7 +2,7 @@ package org.jetbrains.intellij.platform.gradle.tasks -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.VERIFY_PLUGIN_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import kotlin.test.Test @@ -27,7 +27,7 @@ class VerifyPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(VERIFY_PLUGIN_TASK_NAME).let { + build(Tasks.VERIFY_PLUGIN).let { assertContains("Plugin name specified in plugin.xml should not contain the word 'plugin'", it.output) } } @@ -54,7 +54,7 @@ class VerifyPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - buildAndFail(VERIFY_PLUGIN_TASK_NAME).let { + buildAndFail(Tasks.VERIFY_PLUGIN).let { assertContains("Plugin name specified in plugin.xml should not contain the word 'IntelliJ'", it.output) } } @@ -77,7 +77,7 @@ class VerifyPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - buildAndFail(VERIFY_PLUGIN_TASK_NAME).let { + buildAndFail(Tasks.VERIFY_PLUGIN).let { assertContains("Invalid plugin descriptor 'description': Please provide a long-enough English description.", it.output) } } @@ -104,7 +104,7 @@ class VerifyPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(VERIFY_PLUGIN_TASK_NAME).let { + build(Tasks.VERIFY_PLUGIN).let { assertContains("Invalid plugin descriptor 'description': Please provide a long-enough English description.", it.output) } } @@ -112,7 +112,7 @@ class VerifyPluginTaskSpec : IntelliJPluginSpecBase() { @Test fun `fail on errors by default`() { pluginXml.delete() - buildAndFail(VERIFY_PLUGIN_TASK_NAME).let { + buildAndFail(Tasks.VERIFY_PLUGIN).let { assertContains("Plugin descriptor 'plugin.xml' is not found", it.output) } } @@ -128,7 +128,7 @@ class VerifyPluginTaskSpec : IntelliJPluginSpecBase() { ) pluginXml.delete() - build(VERIFY_PLUGIN_TASK_NAME).let { + build(Tasks.VERIFY_PLUGIN).let { assertContains("Plugin descriptor 'plugin.xml' is not found", it.output) } } @@ -155,7 +155,7 @@ class VerifyPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - buildAndFail(VERIFY_PLUGIN_TASK_NAME).let { + buildAndFail(Tasks.VERIFY_PLUGIN).let { assertContains(" must not be equal to default value:", it.output) } } @@ -182,7 +182,7 @@ class VerifyPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(VERIFY_PLUGIN_TASK_NAME).let { + build(Tasks.VERIFY_PLUGIN).let { assertContains("Invalid plugin descriptor 'description': Please provide a long-enough English description.", it.output) } } @@ -210,7 +210,7 @@ class VerifyPluginTaskSpec : IntelliJPluginSpecBase() { """.trimIndent() ) - build(VERIFY_PLUGIN_TASK_NAME).let { + build(Tasks.VERIFY_PLUGIN).let { assertNotContains("Plugin verification", it.output) } } diff --git a/src/testFixtures/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformTestBase.kt b/src/testFixtures/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformTestBase.kt index 413676c3b0..01d32430b5 100644 --- a/src/testFixtures/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformTestBase.kt +++ b/src/testFixtures/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPlatformTestBase.kt @@ -8,7 +8,9 @@ import org.gradle.testkit.runner.internal.DefaultGradleRunner import org.intellij.lang.annotations.Language import java.io.File import java.nio.file.Files.createTempDirectory +import java.nio.file.Path import java.nio.file.Paths +import kotlin.io.path.readText import kotlin.test.BeforeTest import kotlin.test.assertEquals import kotlin.test.assertFalse @@ -24,11 +26,11 @@ abstract class IntelliJPlatformTestBase { val isCI get() = System.getProperty("test.ci").toBoolean() val gradleHome: String = System.getProperty("test.gradle.home") - var dir = createTempDirectory("tmp").toFile() + var dir = createTempDirectory("tmp") @BeforeTest open fun setup() { - dir = createTempDirectory("tmp").toFile() + dir = createTempDirectory("tmp") } protected fun build( @@ -36,11 +38,13 @@ abstract class IntelliJPlatformTestBase { projectProperties: Map = emptyMap(), systemProperties: Map = emptyMap(), args: List = emptyList(), + block: BuildResult.() -> Unit = {}, ) = build( tasks = tasksList, projectProperties = projectProperties, systemProperties = systemProperties, args = args, + block = block, ) protected fun buildAndFail( @@ -48,12 +52,14 @@ abstract class IntelliJPlatformTestBase { projectProperties: Map = emptyMap(), systemProperties: Map = emptyMap(), args: List = emptyList(), + block: BuildResult.() -> Unit = {}, ) = build( fail = true, tasks = tasksList, projectProperties = projectProperties, systemProperties = systemProperties, args = args, + block = block, ) protected fun build( @@ -64,6 +70,7 @@ abstract class IntelliJPlatformTestBase { projectProperties: Map = emptyMap(), systemProperties: Map = emptyMap(), args: List = emptyList(), + block: BuildResult.() -> Unit = {}, ): BuildResult = builder( gradleVersion = gradleVersion, tasks = tasks, @@ -82,6 +89,7 @@ abstract class IntelliJPlatformTestBase { assertNotContains("Configuration cache problems found in this build.", it.output) } } + .also(block) private fun builder( gradleVersion: String, @@ -91,13 +99,14 @@ abstract class IntelliJPlatformTestBase { args: List = emptyList(), ) = GradleRunner.create() - .withProjectDir(dir) + .withProjectDir(dir.toFile()) .withGradleVersion(gradleVersion) .forwardOutput() .withPluginClasspath() // .withDebug(debugEnabled) .withTestKitDir(File(gradleHome)) .withArguments( + "-Dorg.gradle.kotlin.dsl.scriptCompilationAvoidance=false", // workaround for https://github.com/gradle/gradle/issues/25412 *projectProperties .run { this + mapOf("platformVersion" to System.getenv("PLATFORM_VERSION")).filterNot { it.value == null } } .map { "-P${it.key}=${it.value}" } @@ -118,7 +127,7 @@ abstract class IntelliJPlatformTestBase { private fun getPluginClasspath(): List { //Get the default classpath val defaultClasspath = DefaultGradleRunner() - .withProjectDir(dir) + .withProjectDir(dir.toFile()) .withPluginClasspath() .pluginClasspath @@ -130,6 +139,7 @@ abstract class IntelliJPlatformTestBase { } return defaultClasspath } + protected fun assertNotContains(expected: String, actual: String) { // https://stackoverflow.com/questions/10934743/formatting-output-so-that-intellij-idea-shows-diffs-for-two-texts assertFalse( @@ -140,6 +150,9 @@ abstract class IntelliJPlatformTestBase { ) } + protected fun assertFileContent(file: Path?, @Language("xml") expectedContent: String) = + assertEquals(expectedContent.trim(), file?.readText()?.replace("\r", "")?.trim()) + protected fun assertFileContent(file: File?, @Language("xml") expectedContent: String) = assertEquals(expectedContent.trim(), file?.readText()?.replace("\r", "")?.trim()) From 806841b4aa5b8e9c7fec9d19f8db2a9eaa4ba75e Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Thu, 9 Nov 2023 09:53:09 +0100 Subject: [PATCH 040/347] Tasks and Tests cleanup. Finalizing: - DownloadAndroidStudioProductReleasesXmlTask - DownloadIdeaProductReleasesXmlTask - ListProductsReleasesTask - PrintProductsReleasesTask --- .../gradle/IntelliJPluginConstants.kt | 13 +- .../gradle/plugins/IntelliJPlatformPlugin.kt | 91 +- .../plugins/IntelliJPlatformTasksPlugin.kt | 40 +- ...loadAndroidStudioProductReleasesXmlTask.kt | 26 +- .../DownloadIdeaProductReleasesXmlTask.kt | 32 +- .../gradle/tasks/ListProductsReleasesTask.kt | 59 +- .../gradle/tasks/PatchPluginXmlTask.kt | 11 +- .../gradle/tasks/PrintBundledPluginsTask.kt | 8 +- .../gradle/tasks/PrintProductsReleasesTask.kt | 21 +- .../tasks/VerifyPluginConfigurationTask.kt | 2 +- .../intellij/platform/gradle/tasks/tasks.kt | 8 + .../intellij/platform/gradle/utils.kt | 4 +- .../gradle/utils/DependenciesDownloader.kt | 4 +- .../platform/gradle/IntelliJPluginSpecBase.kt | 133 +- ...AndroidStudioProductReleasesXmlTaskSpec.kt | 25 + .../DownloadIdeaProductReleasesXmlTaskSpec.kt | 25 + .../tasks/ListProductsReleasesTaskSpec.kt | 199 +- .../tasks/PrintProductsReleasesTaskSpec.kt | 46 + .../products-releases/idea-releases.xml | 13202 +++++++++------- 19 files changed, 7792 insertions(+), 6157 deletions(-) create mode 100644 src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadAndroidStudioProductReleasesXmlTaskSpec.kt create mode 100644 src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIdeaProductReleasesXmlTaskSpec.kt create mode 100644 src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintProductsReleasesTaskSpec.kt diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginConstants.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginConstants.kt index 497d4b998a..47d3f158fe 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginConstants.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginConstants.kt @@ -53,14 +53,18 @@ object IntelliJPluginConstants { object Tasks { const val BUILD_PLUGIN = "buildPlugin" // TODO: check + const val DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML = "downloadAndroidStudioProductReleasesXml" + const val DOWNLOAD_IDEA_PRODUCT_RELEASES_XML = "downloadIdeaProductReleasesXml" const val INITIALIZE_INTELLIJ_PLATFORM_PLUGIN = "initializeIntellijPlatformPlugin" const val INSTRUMENTED_JAR = "instrumentedJar" // TODO: check const val LIST_BUNDLED_PLUGINS = "listBundledPlugins" + const val LIST_PRODUCTS_RELEASES = "listProductsReleases" const val PATCH_PLUGIN_XML = "patchPluginXml" // TODO: check const val PREPARE_SANDBOX = "prepareSandbox" // TODO: check const val PREPARE_TESTING_SANDBOX = "prepareTestingSandbox" // TODO: check const val PREPARE_UI_TESTING_SANDBOX = "prepareUiTestingSandbox" // TODO: check const val PRINT_BUNDLED_PLUGINS = "printBundledPlugins" + const val PRINT_PRODUCTS_RELEASES = "printProductsReleases" const val RUN_IDE = "runIde" // TODO: check const val RUN_PLUGIN_VERIFIER = "runPluginVerifier" // TODO: check const val SETUP_DEPENDENCIES = "setupDependencies" @@ -78,23 +82,21 @@ object IntelliJPluginConstants { } object Locations { + const val ANDROID_STUDIO_PRODUCTS_RELEASES_URL = "https://jb.gg/android-studio-releases-list.xml" const val CACHE_REDIRECTOR = "https://cache-redirector.jetbrains.com" const val GITHUB_REPOSITORY = "https://github.com/jetbrains/gradle-intellij-plugin" + const val IDEA_PRODUCTS_RELEASES_URL = "https://www.jetbrains.com/updates/updates.xml" const val JETBRAINS_RUNTIME_REPOSITORY = "$CACHE_REDIRECTOR/intellij-jbr" const val PLUGIN_VERIFIER_REPOSITORY = "$CACHE_REDIRECTOR/packages.jetbrains.team/maven/p/intellij-plugin-verifier/intellij-plugin-verifier" } const val BUILD_SEARCHABLE_OPTIONS_TASK_NAME = "buildSearchableOptions" const val CLASSPATH_INDEX_CLEANUP_TASK_NAME = "classpathIndexCleanup" - const val DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML_TASK_NAME = "downloadAndroidStudioProductReleasesXml" - const val DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME = "downloadIdeaProductReleasesXml" const val DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME = "downloadRobotServerPlugin" const val DOWNLOAD_ZIP_SIGNER_TASK_NAME = "downloadZipSigner" const val INSTRUMENT_CODE_TASK_NAME = "instrumentCode" const val INSTRUMENT_TEST_CODE_TASK_NAME = "instrumentTestCode" const val JAR_SEARCHABLE_OPTIONS_TASK_NAME = "jarSearchableOptions" - const val LIST_PRODUCTS_RELEASES_TASK_NAME = "listProductsReleases" - const val PRINT_PRODUCTS_RELEASES_TASK_NAME = "printProductsReleases" const val PUBLISH_PLUGIN_TASK_NAME = "publishPlugin" const val RUN_IDE_FOR_UI_TESTS_TASK_NAME = "runIdeForUiTests" @@ -116,7 +118,6 @@ object IntelliJPluginConstants { // INSTRUMENT_TEST_CODE_TASK_NAME, // JAR_SEARCHABLE_OPTIONS_TASK_NAME, Tasks.LIST_BUNDLED_PLUGINS, -// LIST_PRODUCTS_RELEASES_TASK_NAME, Tasks.PATCH_PLUGIN_XML, Tasks.PREPARE_SANDBOX, Tasks.PREPARE_TESTING_SANDBOX, @@ -167,8 +168,6 @@ object IntelliJPluginConstants { const val RELEASE_SUFFIX_CUSTOM_SNAPSHOT = "-CUSTOM-SNAPSHOT" const val MARKETPLACE_HOST = "https://plugins.jetbrains.com" - const val IDEA_PRODUCTS_RELEASES_URL = "https://www.jetbrains.com/updates/updates.xml" - const val ANDROID_STUDIO_PRODUCTS_RELEASES_URL = "https://jb.gg/android-studio-releases-list.xml" const val INTELLIJ_DEPENDENCIES = "${Locations.CACHE_REDIRECTOR}/intellij-dependencies" const val DEFAULT_INTELLIJ_REPOSITORY = "${Locations.CACHE_REDIRECTOR}/www.jetbrains.com/intellij-repository" const val DEFAULT_INTELLIJ_PLUGINS_REPOSITORY = "${Locations.CACHE_REDIRECTOR}/plugins.jetbrains.com/maven" diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformPlugin.kt index 3540a18551..fdc5a84374 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformPlugin.kt @@ -33,18 +33,14 @@ import org.jetbrains.intellij.platform.gradle.* import org.jetbrains.intellij.platform.gradle.BuildFeature.NO_SEARCHABLE_OPTIONS_WARNING import org.jetbrains.intellij.platform.gradle.BuildFeature.PAID_PLUGIN_SEARCHABLE_OPTIONS_WARNING import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType.* -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.ANDROID_STUDIO_PRODUCTS_RELEASES_URL import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.BUILD_SEARCHABLE_OPTIONS_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.CLASSPATH_INDEX_CLEANUP_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DEFAULT_IDEA_VERSION -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML_TASK_NAME -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DOWNLOAD_ROBOT_SERVER_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.DOWNLOAD_ZIP_SIGNER_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Extensions.INTELLIJ_PLATFORM import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.IDEA_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.IDEA_PLUGINS_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.IDEA_PRODUCTS_RELEASES_URL import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.INSTRUMENTED_JAR_CONFIGURATION_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.INSTRUMENTED_JAR_PREFIX import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.INSTRUMENT_CODE_TASK_NAME @@ -52,10 +48,8 @@ import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.INSTRUMENT import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.INTELLIJ_DEPENDENCIES import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.JAR_SEARCHABLE_OPTIONS_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.JAVA_COMPILER_ANT_TASKS_MAVEN_METADATA -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.MARKETPLACE_HOST import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PERFORMANCE_TEST_CONFIGURATION_NAME -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PRINT_PRODUCTS_RELEASES_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PUBLISH_PLUGIN_TASK_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.RELEASE_SUFFIX_EAP import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.RELEASE_SUFFIX_EAP_CANDIDATE @@ -80,13 +74,10 @@ import org.jetbrains.intellij.platform.gradle.utils.DependenciesDownloader import org.jetbrains.intellij.platform.gradle.utils.ivyRepository import org.jetbrains.intellij.platform.gradle.utils.mavenRepository import org.jetbrains.intellij.pluginRepository.PluginRepositoryFactory -import org.jetbrains.intellij.tasks.DownloadAndroidStudioProductReleasesXmlTask -import org.jetbrains.intellij.tasks.DownloadIdeaProductReleasesXmlTask import java.io.File import java.net.URL import java.time.LocalDateTime import java.time.format.DateTimeFormatter -import java.util.* abstract class IntelliJPlatformPlugin : Plugin { @@ -157,7 +148,6 @@ abstract class IntelliJPlatformPlugin : Plugin { configureClassPathIndexCleanupTask(project, ideaDependencyProvider) configureInstrumentation(project, extension, ideaDependencyProvider) configureDownloadRobotServerPluginTask(project) - configureListProductsReleasesTask(project, extension) configureRunIdeTask(project) configureRunIdePerformanceTestTask(project, extension) configureRunIdeForUiTestsTask(project) @@ -303,7 +293,7 @@ abstract class IntelliJPlatformPlugin : Plugin { val hasJavaPluginDependency = plugins.contains("java") || plugins.contains("com.intellij.java") if (!hasJavaPluginDependency && File(ideaDependency.classes, "plugins/java").exists()) { sourcePluginXmlFiles(project).forEach { path -> - parsePluginXml(path, context)?.dependencies?.forEach { + parsePluginXml(path)?.dependencies?.forEach { if (it.dependencyId == "com.intellij.modules.java") { throw BuildException("The project depends on 'com.intellij.modules.java' module but doesn't declare a compile dependency on it.\nPlease delete 'depends' tag from '${path}' or add Java plugin to Gradle dependencies (https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html#java)") } @@ -575,8 +565,8 @@ abstract class IntelliJPlatformPlugin : Plugin { project.tasks.withType { outputDir.convention(project.layout.buildDirectory.dir(SEARCHABLE_OPTIONS_DIR_NAME)) showPaidPluginWarning.convention(project.isBuildFeatureEnabled(PAID_PLUGIN_SEARCHABLE_OPTIONS_WARNING).map { - it && sourcePluginXmlFiles(project).any { - parsePluginXml(it, context)?.productDescriptor != null + it && sourcePluginXmlFiles(project).any { file -> + parsePluginXml(file)?.productDescriptor != null } }) @@ -593,7 +583,7 @@ abstract class IntelliJPlatformPlugin : Plugin { val taskContext = logCategory() val prepareSandboxTaskProvider = project.tasks.named(prepareSandBoxTaskName) val initializeIntelliJPlatformPluginTaskProvider = project.tasks.named(Tasks.INITIALIZE_INTELLIJ_PLATFORM_PLUGIN) - val pluginIds = sourcePluginXmlFiles(project).mapNotNull { parsePluginXml(it, taskContext)?.id } + val pluginIds = sourcePluginXmlFiles(project).mapNotNull { parsePluginXml(it)?.id } // ideDir.convention(ideaDependencyProvider.map { // project.file(it.classes.path) @@ -861,7 +851,7 @@ abstract class IntelliJPlatformPlugin : Plugin { } val testTasks = project.tasks.withType() - val pluginIds = sourcePluginXmlFiles(project).mapNotNull { parsePluginXml(it, context)?.id } + val pluginIds = sourcePluginXmlFiles(project).mapNotNull { parsePluginXml(it)?.id } val buildNumberProvider = ideaDependencyProvider.map { it.buildNumber } @@ -1082,77 +1072,6 @@ abstract class IntelliJPlatformPlugin : Plugin { } } - private fun configureListProductsReleasesTask(project: Project, extension: IntelliJPluginExtension) { - info(context, "Configuring list products task") - - val resolveReleasesUrl = { url: String -> - // TODO: migrate to `project.resources.binary` whenever it's available. Ref: https://github.com/gradle/gradle/issues/25237 - project.resources.text - .fromUri(url) - .runCatching { asFile("UTF-8") } - .onFailure { error(context, "Cannot resolve product releases", it) } - .getOrDefault("") - } - - val patchPluginXmlTaskProvider = - project.tasks.named(Tasks.PATCH_PLUGIN_XML) - val downloadIdeaProductReleasesXmlTaskProvider = - project.tasks.register(DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME) - val downloadAndroidStudioProductReleasesXmlTaskProvider = - project.tasks.register(DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML_TASK_NAME) - val listProductsReleasesTaskProvider = - project.tasks.register(LIST_PRODUCTS_RELEASES_TASK_NAME) - - project.tasks.withType { - releasesUrl.convention(IDEA_PRODUCTS_RELEASES_URL) - - from(releasesUrl.map(resolveReleasesUrl)) { - rename { "idea_product_releases.xml" } - } - into(temporaryDir) - } - - project.tasks.withType { - releasesUrl.convention(ANDROID_STUDIO_PRODUCTS_RELEASES_URL) - - from(releasesUrl.map(resolveReleasesUrl)) { - rename { "android_studio_product_releases.xml" } - } - into(temporaryDir) - } - - project.tasks.withType { - ideaProductReleasesUpdateFiles - .from(downloadIdeaProductReleasesXmlTaskProvider.map { - it.outputs.files.asFileTree - }) - androidStudioProductReleasesUpdateFiles - .from(downloadAndroidStudioProductReleasesXmlTaskProvider.map { - it.outputs.files.asFileTree - }) - outputFile.convention( - project.layout.buildDirectory.file("$LIST_PRODUCTS_RELEASES_TASK_NAME.txt") - ) - types.convention(extension.type.map { listOf(it) }) -// sinceBuild.convention(patchPluginXmlTaskProvider.flatMap { it.sinceBuild }) -// untilBuild.convention(patchPluginXmlTaskProvider.flatMap { it.untilBuild }) - releaseChannels.convention(EnumSet.allOf(ListProductsReleasesTask.Channel::class.java)) - - dependsOn(DOWNLOAD_IDE_PRODUCT_RELEASES_XML_TASK_NAME) - dependsOn(DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML_TASK_NAME) - dependsOn(Tasks.PATCH_PLUGIN_XML) - } - - project.tasks.register(PRINT_PRODUCTS_RELEASES_TASK_NAME) - project.tasks.withType { - inputFile.convention(listProductsReleasesTaskProvider.flatMap { listProductsReleasesTaskProvider -> - listProductsReleasesTaskProvider.outputFile - }) - - dependsOn(LIST_PRODUCTS_RELEASES_TASK_NAME) - } - } - private fun configureProcessResources(project: Project) { info(context, "Configuring resources task") val patchPluginXmlTaskProvider = project.tasks.named(Tasks.PATCH_PLUGIN_XML) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformTasksPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformTasksPlugin.kt index 06e0f714f5..2e4c10b45e 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformTasksPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/plugins/IntelliJPlatformTasksPlugin.kt @@ -20,6 +20,7 @@ import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_TAS import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Sandbox import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.TASKS import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.asPath import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformExtension import org.jetbrains.intellij.platform.gradle.info import org.jetbrains.intellij.platform.gradle.propertyProviders.IntelliJPlatformArgumentProvider @@ -30,6 +31,7 @@ import org.jetbrains.intellij.platform.gradle.tasks.* import java.io.File import java.nio.file.Path import java.util.* +import kotlin.io.path.name abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlugin(PLUGIN_TASKS_ID) { @@ -41,12 +43,16 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug with(tasks) { InitializeIntelliJPlatformPluginTask.register(project) SetupDependenciesTask.register(project) + configurePatchPluginXmlTask() ListBundledPluginsTask.register(project) PrintBundledPluginsTask.register(project) + DownloadAndroidStudioProductReleasesXmlTask.register(project) + DownloadIdeaProductReleasesXmlTask.register(project) + ListProductsReleasesTask.register(project) + PrintProductsReleasesTask.register(project) configurePrepareSandboxTasks() configureBuildPluginTask() - configurePatchPluginXmlTask() configureRunPluginVerifierTask() configureVerifyPluginTask() configureVerifyPluginConfigurationTask() @@ -140,12 +146,12 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug configureTask(Tasks.PATCH_PLUGIN_XML) { val extension = project.the() - inputFile.convention(project.provider { + inputFile.convention(project.layout.file(project.provider { project.sourceSets.getByName(MAIN_SOURCE_SET_NAME).resources.srcDirs.map { it.resolve("META-INF/plugin.xml") }.firstOrNull { it.exists() } - }) - outputFile.convention(inputFile.map { - temporaryDir.resolve(it.name) - }) + })) + outputFile.convention(project.layout.file( + inputFile.map { temporaryDir.resolve(it.asPath.name) } + )) extension.pluginConfiguration.let { pluginId.convention(it.id) @@ -162,8 +168,16 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug } it.ideaVersion.let { ideaVersion -> - sinceBuild.convention(ideaVersion.sinceBuild) - untilBuild.convention(ideaVersion.untilBuild) + sinceBuild.convention( + ideaVersion.sinceBuild.orElse(project.provider { + with(platformVersion) { "$major.$minor" } + }) + ) + untilBuild.convention( + ideaVersion.untilBuild.orElse(project.provider { + with(platformVersion) { "$major.*" } + }) + ) } it.vendor.let { vendor -> @@ -246,10 +260,10 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug kotlinVersion.convention(project.provider { project.extensions.getByName("kotlin").withGroovyBuilder { getProperty("coreLibrariesVersion") as String } }) - kotlinStdlibDefaultDependency.convention(project.providers.gradleProperty(IntelliJPluginConstants.KOTLIN_STDLIB_DEFAULT_DEPENDENCY_PROPERTY_NAME) - .map { it.toBoolean() }) - kotlinIncrementalUseClasspathSnapshot.convention(project.providers.gradleProperty(IntelliJPluginConstants.KOTLIN_INCREMENTAL_USE_CLASSPATH_SNAPSHOT) - .map { it.toBoolean() }) + kotlinStdlibDefaultDependency.convention( + project.providers.gradleProperty(IntelliJPluginConstants.KOTLIN_STDLIB_DEFAULT_DEPENDENCY_PROPERTY_NAME).map { it.toBoolean() }) + kotlinIncrementalUseClasspathSnapshot.convention( + project.providers.gradleProperty(IntelliJPluginConstants.KOTLIN_INCREMENTAL_USE_CLASSPATH_SNAPSHOT).map { it.toBoolean() }) } project.tasks.withType { @@ -457,7 +471,7 @@ abstract class IntelliJPlatformTasksPlugin : IntelliJPlatformAbstractProjectPlug dependsOn(Tasks.BUILD_PLUGIN) dependsOn(Tasks.VERIFY_PLUGIN) - dependsOn(IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME) + dependsOn(Tasks.LIST_PRODUCTS_RELEASES) val isIdeVersionsEmpty = localPaths.flatMap { localPaths -> ideVersions.map { ideVersions -> diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt index 361e87e8a5..dd97b9eff7 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadAndroidStudioProductReleasesXmlTask.kt @@ -1,25 +1,23 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradle.tasks +import org.gradle.api.Project import org.gradle.api.provider.Property import org.gradle.api.tasks.CacheableTask import org.gradle.api.tasks.Input import org.gradle.api.tasks.Optional import org.gradle.api.tasks.Sync -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Locations import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import org.jetbrains.intellij.platform.gradle.logCategory +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks -@Deprecated(message = "CHECK") @CacheableTask abstract class DownloadAndroidStudioProductReleasesXmlTask : Sync() { - private val context = logCategory() - /** * Represents the property that holds the URL for releases. - * Default value: [IntelliJPluginConstants.ANDROID_STUDIO_PRODUCTS_RELEASES_URL] + * Default value: [Locations.ANDROID_STUDIO_PRODUCTS_RELEASES_URL] */ @get:Input @get:Optional @@ -29,4 +27,18 @@ abstract class DownloadAndroidStudioProductReleasesXmlTask : Sync() { group = PLUGIN_GROUP_NAME description = "Downloads XML files containing the Android Studio product release information." } + + companion object { + fun register(project: Project) = + project.configureTask(Tasks.DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML) { + releasesUrl.convention(Locations.ANDROID_STUDIO_PRODUCTS_RELEASES_URL) + + from(releasesUrl.map { + project.resolveResourceFromUrl(it) + }) { + rename { "android_studio_product_releases.xml" } + } + into(temporaryDir) + } + } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIdeaProductReleasesXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIdeaProductReleasesXmlTask.kt index 83141c08ae..b98d7fd926 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIdeaProductReleasesXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIdeaProductReleasesXmlTask.kt @@ -1,30 +1,44 @@ // Copyright 2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -package org.jetbrains.intellij.tasks +package org.jetbrains.intellij.platform.gradle.tasks +import org.gradle.api.Project import org.gradle.api.provider.Property -import org.gradle.api.tasks.* -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants +import org.gradle.api.tasks.CacheableTask +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.Optional +import org.gradle.api.tasks.Sync +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Locations import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME -import java.io.File +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks -@Deprecated(message = "CHECK") @CacheableTask abstract class DownloadIdeaProductReleasesXmlTask : Sync() { /** * Represents the property that holds the URL for releases. - * Default value: [IntelliJPluginConstants.IDEA_PRODUCTS_RELEASES_URL] + * Default value: [Locations.IDEA_PRODUCTS_RELEASES_URL] */ @get:Input @get:Optional abstract val releasesUrl: Property - @get:Internal - abstract val inputFile: Property - init { group = PLUGIN_GROUP_NAME description = "Downloads XML files containing the IntelliJ IDEA product release information." } + + companion object { + fun register(project: Project) = + project.configureTask(Tasks.DOWNLOAD_IDEA_PRODUCT_RELEASES_XML) { + releasesUrl.convention(Locations.IDEA_PRODUCTS_RELEASES_URL) + + from(releasesUrl.map { + project.resolveResourceFromUrl(it) + }) { + rename { "idea_product_releases.xml" } + } + into(temporaryDir) + } + } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTask.kt index d482c93d0b..904e4d37e4 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTask.kt @@ -4,18 +4,24 @@ package org.jetbrains.intellij.platform.gradle.tasks import com.jetbrains.plugin.structure.base.utils.outputStream import org.gradle.api.DefaultTask +import org.gradle.api.Project import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.RegularFileProperty import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.api.provider.SetProperty import org.gradle.api.tasks.* +import org.gradle.api.tasks.Optional +import org.gradle.kotlin.dsl.named import org.jetbrains.intellij.platform.gradle.* import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType.AndroidStudio import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradle.model.AndroidStudioReleases import org.jetbrains.intellij.platform.gradle.model.ProductsReleases import org.jetbrains.intellij.platform.gradle.model.XmlExtractor +import org.jetbrains.intellij.platform.gradle.tasks.base.PlatformVersionAware +import java.util.* /** * List all available IntelliJ-based IDE releases with their updates. @@ -31,9 +37,8 @@ import org.jetbrains.intellij.platform.gradle.model.XmlExtractor * * @see [PrintProductsReleasesTask] */ -@Deprecated(message = "CHECK") @CacheableTask -abstract class ListProductsReleasesTask : DefaultTask() { +abstract class ListProductsReleasesTask : DefaultTask(), PlatformVersionAware { /** * Path to the products releases update files. By default, one is downloaded from [IntelliJPluginConstants.IDEA_PRODUCTS_RELEASES_URL]. @@ -64,7 +69,7 @@ abstract class ListProductsReleasesTask : DefaultTask() { */ @get:Input @get:Optional - abstract val types: ListProperty + abstract val types: ListProperty /** * Lower boundary of the listed results in marketing product version format, like `2020.2.1`. @@ -144,12 +149,9 @@ abstract class ListProductsReleasesTask : DefaultTask() { untilBuild.orNull .takeUnless { it.isNullOrBlank() || sinceVersion.isPresent } } - ?.replace("*", "9999") + ?.replace("*", "99999") ?.run(Version::parse) - val types = types.get().mapNotNull { - IntelliJPlatformType.fromCode(it) - } val channels = releaseChannels.get() fun testVersion(version: Version?, build: Version?): Boolean { @@ -167,7 +169,11 @@ abstract class ListProductsReleasesTask : DefaultTask() { val result = releases.map(ProductsReleases::products).flatten().asSequence() .flatMap { product -> product.codes.map { it to product }.asSequence() } - .filter { (type) -> types.contains(IntelliJPlatformType.fromCode(type)) } + .filter { (type) -> + runCatching { IntelliJPlatformType.fromCode(type) } + .map { types.get().contains(it) } + .getOrElse { false } + } .flatMap { (type, product) -> product.channels.map { type to it }.asSequence() } .filter { (_, channel) -> channels.contains(Channel.valueOf(channel.status.uppercase())) } .flatMap { (type, channel) -> @@ -185,7 +191,7 @@ abstract class ListProductsReleasesTask : DefaultTask() { .distinct() .toList() - val androidStudioResult = when (types.contains(AndroidStudio)) { + val androidStudioResult = when (types.get().contains(AndroidStudio)) { true -> androidStudioReleases.flatMap { release -> release.items .asSequence() @@ -222,4 +228,39 @@ abstract class ListProductsReleasesTask : DefaultTask() { enum class Channel { EAP, MILESTONE, BETA, RELEASE, CANARY, PATCH, RC, } + + companion object { + fun register(project: Project) = + project.configureTask(Tasks.LIST_PRODUCTS_RELEASES) { + val downloadIdeaProductReleasesXmlTaskProvider = + project.tasks.named(Tasks.DOWNLOAD_IDEA_PRODUCT_RELEASES_XML) + val downloadAndroidStudioProductReleasesXmlTaskProvider = + project.tasks.named(Tasks.DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML) + val patchPluginXmlTaskProvider = project.tasks.named(Tasks.PATCH_PLUGIN_XML) + + ideaProductReleasesUpdateFiles.from(downloadIdeaProductReleasesXmlTaskProvider.map { + it.outputs.files.asFileTree + }) + androidStudioProductReleasesUpdateFiles.from(downloadAndroidStudioProductReleasesXmlTaskProvider.map { + it.outputs.files.asFileTree + }) + outputFile.convention( + project.layout.buildDirectory.file("${Tasks.LIST_PRODUCTS_RELEASES}.txt") + ) + types.convention(project.provider { + listOf(platformType) + }) + sinceBuild.convention(patchPluginXmlTaskProvider.flatMap { + it.sinceBuild + }) + untilBuild.convention(patchPluginXmlTaskProvider.flatMap { + it.untilBuild + }) + releaseChannels.convention(EnumSet.allOf(Channel::class.java)) + + dependsOn(downloadIdeaProductReleasesXmlTaskProvider) + dependsOn(downloadAndroidStudioProductReleasesXmlTaskProvider) + dependsOn(patchPluginXmlTaskProvider) + } + } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTask.kt index ba19e0e9d3..85001c4943 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PatchPluginXmlTask.kt @@ -5,18 +5,19 @@ package org.jetbrains.intellij.platform.gradle.tasks import com.jetbrains.plugin.structure.intellij.utils.JDOMUtil import org.gradle.api.DefaultTask import org.gradle.api.Project +import org.gradle.api.file.RegularFileProperty import org.gradle.api.provider.Property import org.gradle.api.provider.Provider import org.gradle.api.tasks.* import org.jdom2.Document import org.jdom2.Element import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.asPath import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformExtension import org.jetbrains.intellij.platform.gradle.logCategory import org.jetbrains.intellij.platform.gradle.tasks.base.PlatformVersionAware import org.jetbrains.intellij.platform.gradle.transformXml import org.jetbrains.intellij.platform.gradle.warn -import java.io.File import kotlin.io.path.inputStream /** @@ -33,10 +34,10 @@ abstract class PatchPluginXmlTask : DefaultTask(), PlatformVersionAware { @get:SkipWhenEmpty @get:InputFile @get:PathSensitive(PathSensitivity.RELATIVE) - abstract val inputFile: Property + abstract val inputFile: RegularFileProperty @get:OutputFile - abstract val outputFile: Property + abstract val outputFile: RegularFileProperty /** * @see [IntelliJPlatformExtension.PluginConfiguration.id] @@ -146,8 +147,8 @@ abstract class PatchPluginXmlTask : DefaultTask(), PlatformVersionAware { @TaskAction fun patchPluginXml() { - val inputPath = inputFile.get().toPath() - val outputPath = outputFile.get().toPath() + val inputPath = inputFile.asPath + val outputPath = outputFile.asPath val sinceBuildValue = sinceBuild.orNull ?: with(platformVersion) { "$major.$minor" diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintBundledPluginsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintBundledPluginsTask.kt index ab2c334a3d..c0e15e565c 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintBundledPluginsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintBundledPluginsTask.kt @@ -9,6 +9,8 @@ import org.gradle.api.tasks.* import org.gradle.kotlin.dsl.named import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.asPath +import kotlin.io.path.readText /** * Prints the output produced by the [ListBundledPluginsTask] task. @@ -31,15 +33,15 @@ abstract class PrintBundledPluginsTask : DefaultTask() { } @TaskAction - fun printBundledPlugins() = println(inputFile.asFile.get().readText()) + fun printBundledPlugins() = println(inputFile.asPath.readText()) companion object { fun register(project: Project) = project.configureTask(Tasks.PRINT_BUNDLED_PLUGINS) { val listBundledPluginsTaskProvider = project.tasks.named(Tasks.LIST_BUNDLED_PLUGINS) - inputFile.convention(listBundledPluginsTaskProvider.flatMap { listBundledPluginsTask -> - listBundledPluginsTask.outputFile + inputFile.convention(listBundledPluginsTaskProvider.flatMap { + it.outputFile }) dependsOn(listBundledPluginsTaskProvider) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintProductsReleasesTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintProductsReleasesTask.kt index 52b4bc1b05..3f0d21de3b 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintProductsReleasesTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintProductsReleasesTask.kt @@ -3,16 +3,20 @@ package org.jetbrains.intellij.platform.gradle.tasks import org.gradle.api.DefaultTask +import org.gradle.api.Project import org.gradle.api.file.RegularFileProperty import org.gradle.api.tasks.* +import org.gradle.kotlin.dsl.named import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.PLUGIN_GROUP_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.asPath +import kotlin.io.path.readText /** * Prints the output produced by the [ListProductsReleasesTask] task. * * @see [ListProductsReleasesTask] */ -@Deprecated(message = "CHECK") @UntrackedTask(because = "Prints the output produced by the listProductsReleases task") abstract class PrintProductsReleasesTask : DefaultTask() { @@ -29,5 +33,18 @@ abstract class PrintProductsReleasesTask : DefaultTask() { } @TaskAction - fun printProductsReleases() = println(inputFile.asFile.get().readText()) + fun printProductsReleases() = println(inputFile.asPath.readText()) + + companion object { + fun register(project: Project) = + project.configureTask(Tasks.PRINT_PRODUCTS_RELEASES) { + val listProductsReleasesTaskProvider = project.tasks.named(Tasks.LIST_PRODUCTS_RELEASES) + + inputFile.convention(listProductsReleasesTaskProvider.flatMap { + it.outputFile + }) + + dependsOn(listProductsReleasesTaskProvider) + } + } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTask.kt index c62da91c97..42fa7eb8a9 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/VerifyPluginConfigurationTask.kt @@ -148,7 +148,7 @@ abstract class VerifyPluginConfigurationTask @Inject constructor( val oldPluginVerifierDownloadPath = providers.systemProperty("user.home").map { "$it/.pluginVerifier/ides" }.get().let(Path::of).toAbsolutePath() sequence { - pluginXmlFiles.get().mapNotNull { parsePluginXml(it.toPath(), context) }.forEach { plugin -> + pluginXmlFiles.get().mapNotNull { parsePluginXml(it.toPath()) }.forEach { plugin -> val sinceBuild = plugin.ideaVersion.sinceBuild.let(Version::parse) val sinceBuildJavaVersion = sinceBuild.let(::getPlatformJavaVersion) val sinceBuildKotlinApiVersion = sinceBuild.let(::getPlatformKotlinVersion)?.run { Version.parse("$major.$minor") } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/tasks.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/tasks.kt index c7bc69b9a9..2f37e2d4ec 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/tasks.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/tasks.kt @@ -169,3 +169,11 @@ internal inline fun Project.configureTask(vararg names: Strin tasks.withType(configuration) } + +// TODO: migrate to `project.resources.binary` whenever it's available. Ref: https://github.com/gradle/gradle/issues/25237 +internal fun Project.resolveResourceFromUrl(url: String) = + resources.text + .fromUri(url) + .runCatching { asFile("UTF-8") } + .onFailure { logger.error("Cannot resolve product releases", it) } + .getOrDefault("") diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils.kt index 49ce3bac18..be47beb12b 100755 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils.kt @@ -58,13 +58,13 @@ internal fun sourcePluginXmlFiles(project: Project) = project .map { it.resolve("META-INF/plugin.xml") } .filter { it.exists() && it.length > 0 } -internal fun parsePluginXml(pluginXml: Path, logCategory: String?) = runCatching { +internal fun parsePluginXml(pluginXml: Path) = runCatching { pluginXml.inputStream().use { val document = JDOMUtil.loadDocument(it) PluginBeanExtractor.extractPluginBean(document) } }.getOrElse { - warn(logCategory, "Cannot read: $pluginXml. Skipping", it) + logger.warn("Cannot read: $pluginXml. Skipping", it) null } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/DependenciesDownloader.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/DependenciesDownloader.kt index 28337e49f0..f74b8f88d5 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/DependenciesDownloader.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/DependenciesDownloader.kt @@ -12,7 +12,7 @@ import org.gradle.api.artifacts.repositories.IvyArtifactRepository import org.gradle.api.artifacts.repositories.MavenArtifactRepository import org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler import org.gradle.kotlin.dsl.create -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.ANDROID_STUDIO_PRODUCTS_RELEASES_URL +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Locations import org.jetbrains.intellij.platform.gradle.error import org.jetbrains.intellij.platform.gradle.info import org.jetbrains.intellij.platform.gradle.repositoryVersion @@ -128,5 +128,5 @@ internal fun DependenciesDownloader.getAndroidStudioReleases(context: String?) = ext = "xml", ) }, { - ivyRepository(ANDROID_STUDIO_PRODUCTS_RELEASES_URL) + ivyRepository(Locations.ANDROID_STUDIO_PRODUCTS_RELEASES_URL) }).firstOrNull()?.toPath() diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpecBase.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpecBase.kt index b9fab3e2eb..62be35a112 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpecBase.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/IntelliJPluginSpecBase.kt @@ -24,8 +24,8 @@ import kotlin.test.assertTrue abstract class IntelliJPluginSpecBase : IntelliJPlatformTestBase() { val pluginsRepository: String = System.getProperty("plugins.repository", DEFAULT_INTELLIJ_PLUGINS_REPOSITORY) - val intellijVersion = System.getProperty("test.intellij.version").takeUnless { it.isNullOrEmpty() } - ?: throw GradleException("'test.intellij.version' isn't provided") + val intellijVersion = + System.getProperty("test.intellij.version").takeUnless { it.isNullOrEmpty() } ?: throw GradleException("'test.intellij.version' isn't provided") val testMarkdownPluginVersion = System.getProperty("test.markdownPlugin.version").takeUnless { it.isNullOrEmpty() } ?: throw GradleException("'test.markdownPlugin.version' isn't provided") @@ -41,7 +41,7 @@ abstract class IntelliJPluginSpecBase : IntelliJPlatformTestBase() { if (gradleScan) { settingsFile.groovy( - """ + """ plugins { id("com.gradle.enterprise") version("3.12.6") } @@ -63,12 +63,16 @@ abstract class IntelliJPluginSpecBase : IntelliJPlatformTestBase() { buildFile.groovy( """ + import java.util.* + import org.jetbrains.intellij.platform.gradle.* + import org.jetbrains.intellij.platform.gradle.tasks.* + plugins { id("java") id("org.jetbrains.intellij.platform") id("org.jetbrains.kotlin.jvm") version "$kotlinPluginVersion" } - + kotlin { jvmToolchain { languageVersion = JavaLanguageVersion.of(17) @@ -90,20 +94,20 @@ abstract class IntelliJPluginSpecBase : IntelliJPlatformTestBase() { } } -// intellij { -// pluginsRepositories { -// maven('$pluginsRepository') -// } -// instrumentCode = false -// } -// buildSearchableOptions { -// enabled = false -// } - - // Define tasks with a minimal set of tasks required to build a source set -// sourceSets.all { -// task(it.getTaskName('build', 'SourceSet'), dependsOn: it.output) -// } + // intellij { + // pluginsRepositories { + // maven('$pluginsRepository') + // } + // instrumentCode = false + // } + // buildSearchableOptions { + // enabled = false + // } + + // Define tasks with a minimal set of tasks required to build a source set + // sourceSets.all { + // task(it.getTaskName('build', 'SourceSet'), dependsOn: it.output) + // } """.trimIndent() ) @@ -115,6 +119,58 @@ abstract class IntelliJPluginSpecBase : IntelliJPlatformTestBase() { ) } + fun buildFile( + repositories: String = + """ + mavenCentral() + + intellijPlatform { + releases() + } + """.trimIndent(), + dependencies: String = + """ + intellijPlatform { + intellijIdeaCommunity("$intellijVersion") + } + """.trimIndent(), + tasks: String = "", + ) { + buildFile.writeText("") + buildFile.groovy( + """ + import java.util.* + import org.jetbrains.intellij.platform.gradle.* + import org.jetbrains.intellij.platform.gradle.tasks.* + + plugins { + id("java") + id("org.jetbrains.intellij.platform") + id("org.jetbrains.kotlin.jvm") version "$kotlinPluginVersion" + } + + kotlin { + jvmToolchain { + languageVersion = JavaLanguageVersion.of(17) + vendor = JvmVendorSpec.JETBRAINS + } + } + + repositories { + $repositories + } + + dependencies { + $dependencies + } + + tasks { + $tasks + } + """.trimIndent() + ) + } + fun writeTestFile() = file("src/test/java/AppTest.java").java( """ import java.lang.String; @@ -138,8 +194,7 @@ abstract class IntelliJPluginSpecBase : IntelliJPlatformTestBase() { fun tasks(groupName: String): List = build(ProjectInternal.TASKS_TASK).output.lines().run { val start = indexOfFirst { it.equals("$groupName tasks", ignoreCase = true) } + 2 - drop(start).takeWhile { !it.startsWith('-') }.dropLast(1).map { it.substringBefore(' ') } - .filterNot { it.isEmpty() } + drop(start).takeWhile { !it.startsWith('-') }.dropLast(1).map { it.substringBefore(' ') }.filterNot { it.isEmpty() } } protected fun directory(path: String) = dir.resolve(path).createDirectories() @@ -158,13 +213,9 @@ abstract class IntelliJPluginSpecBase : IntelliJPlatformTestBase() { return file.toFile() } - protected fun file(path: String) = path - .run { takeIf { startsWith('/') } ?: dir.resolve(this).pathString } - .split('/') - .run { File(dropLast(1).joinToString("/")) to last() } - .apply { if (!first.exists()) first.mkdirs() } - .run { File(first, second) } - .apply { createNewFile() } + protected fun file(path: String) = + path.run { takeIf { startsWith('/') } ?: dir.resolve(this).pathString }.split('/').run { File(dropLast(1).joinToString("/")) to last() } + .apply { if (!first.exists()) first.mkdirs() }.run { File(first, second) }.apply { createNewFile() } protected fun writeJavaFile() = file("src/main/java/App.java").java( """ @@ -211,37 +262,29 @@ abstract class IntelliJPluginSpecBase : IntelliJPlatformTestBase() { protected fun assertContains(expected: String, actual: String) { // https://stackoverflow.com/questions/10934743/formatting-output-so-that-intellij-idea-shows-diffs-for-two-texts assertTrue( - actual.contains(expected), - """ + actual.contains(expected), """ expected:<$expected> but was:<$actual> """.trimIndent() ) } @Suppress("SameParameterValue") - protected fun assertZipContent(zip: ZipFile, path: String, expectedContent: String) = - assertEquals(expectedContent, fileText(zip, path)) + protected fun assertZipContent(zip: ZipFile, path: String, expectedContent: String) = assertEquals(expectedContent, fileText(zip, path)) @Suppress("SameParameterValue") - protected fun extractFile(zipFile: ZipFile, path: String): File = - File.createTempFile("gradle-test", "").apply { - deleteOnExit() - FileUtils.copyInputStreamToFile(zipFile.getInputStream(zipFile.getEntry(path)), this) - } + protected fun extractFile(zipFile: ZipFile, path: String): File = File.createTempFile("gradle-test", "").apply { + deleteOnExit() + FileUtils.copyInputStreamToFile(zipFile.getInputStream(zipFile.getEntry(path)), this) + } - protected fun fileText(zipFile: ZipFile, path: String) = zipFile - .getInputStream(zipFile.getEntry(path)) - .use { - it.bufferedReader() - .use(BufferedReader::readText) - .replace("\r", "") - .trim() - } + protected fun fileText(zipFile: ZipFile, path: String) = zipFile.getInputStream(zipFile.getEntry(path)).use { + it.bufferedReader().use(BufferedReader::readText).replace("\r", "").trim() + } protected fun collectPaths(zipFile: ZipFile) = zipFile.entries().toList().mapNotNull { it.name }.toSet() protected fun collectPaths(directory: Path) = collectPaths(directory.toFile()) - + protected fun collectPaths(directory: File): Set { assert(directory.exists()) return directory.walkTopDown().filterNot { it.isDirectory }.map { diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadAndroidStudioProductReleasesXmlTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadAndroidStudioProductReleasesXmlTaskSpec.kt new file mode 100644 index 0000000000..54e44ae696 --- /dev/null +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadAndroidStudioProductReleasesXmlTaskSpec.kt @@ -0,0 +1,25 @@ +package org.jetbrains.intellij.platform.gradle.tasks + +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase +import kotlin.io.path.exists +import kotlin.test.Test +import kotlin.test.assertFalse +import kotlin.test.assertTrue + +class DownloadAndroidStudioProductReleasesXmlTaskSpec : IntelliJPluginSpecBase() { + + @Test + fun `download resource`() { + val file = buildDirectory + .resolve("tmp") + .resolve(Tasks.DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML) + .resolve("android_studio_product_releases.xml") + + assertFalse(file.exists()) + + build(Tasks.DOWNLOAD_ANDROID_STUDIO_PRODUCT_RELEASES_XML) + + assertTrue(file.exists()) + } +} diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIdeaProductReleasesXmlTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIdeaProductReleasesXmlTaskSpec.kt new file mode 100644 index 0000000000..7803c98c8b --- /dev/null +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/DownloadIdeaProductReleasesXmlTaskSpec.kt @@ -0,0 +1,25 @@ +package org.jetbrains.intellij.platform.gradle.tasks + +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase +import kotlin.io.path.exists +import kotlin.test.Test +import kotlin.test.assertFalse +import kotlin.test.assertTrue + +class DownloadIdeaProductReleasesXmlTaskSpec : IntelliJPluginSpecBase() { + + @Test + fun `download resource`() { + val file = buildDirectory + .resolve("tmp") + .resolve(Tasks.DOWNLOAD_IDEA_PRODUCT_RELEASES_XML) + .resolve("idea_product_releases.xml") + + assertFalse(file.exists()) + + build(Tasks.DOWNLOAD_IDEA_PRODUCT_RELEASES_XML) + + assertTrue(file.exists()) + } +} diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTaskSpec.kt index 85cc95a2b0..7fe7495087 100644 --- a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTaskSpec.kt +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ListProductsReleasesTaskSpec.kt @@ -2,7 +2,7 @@ package org.jetbrains.intellij.platform.gradle.tasks -import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.LIST_PRODUCTS_RELEASES_TASK_NAME +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase import kotlin.io.path.readText import kotlin.test.BeforeTest @@ -16,20 +16,19 @@ class ListProductsReleasesTaskSpec : IntelliJPluginSpecBase() { private val androidStudioReleasesPath = resolveResourcePath("products-releases/android-studio-products-releases.xml") private val outputFile - get() = buildDirectory.resolve("$LIST_PRODUCTS_RELEASES_TASK_NAME.txt") + get() = buildDirectory.resolve("${Tasks.LIST_PRODUCTS_RELEASES}.txt") @BeforeTest override fun setup() { super.setup() - buildFile.groovy( + buildFile.kotlin( """ - intellij { - version = "2020.1" - } - listProductsReleases { - ideaProductReleasesUpdateFiles.setFrom(['$ideaReleasesPath']) - androidStudioProductReleasesUpdateFiles.setFrom(['$androidStudioReleasesPath']) + tasks { + listProductsReleases { + ideaProductReleasesUpdateFiles.from("$ideaReleasesPath") + androidStudioProductReleasesUpdateFiles.from("$androidStudioReleasesPath") + } } """.trimIndent() ) @@ -37,11 +36,11 @@ class ListProductsReleasesTaskSpec : IntelliJPluginSpecBase() { @Test fun `get IDEs list for the current platformType, sinceBuild and untilBuild`() { - build(LIST_PRODUCTS_RELEASES_TASK_NAME) + build(Tasks.LIST_PRODUCTS_RELEASES) assertEquals( """ - IC-2020.1.4 + IC-2022.3.3 """.trimIndent(), outputFile.readText(), ) @@ -51,20 +50,20 @@ class ListProductsReleasesTaskSpec : IntelliJPluginSpecBase() { fun `get IDEs list for the current platformType`() { buildFile.groovy( """ - listProductsReleases { - sinceVersion = "201" + tasks { + listProductsReleases { + sinceVersion.set("231") + } } """.trimIndent() ) - build(LIST_PRODUCTS_RELEASES_TASK_NAME) + build(Tasks.LIST_PRODUCTS_RELEASES) assertEquals( """ - IC-2021.2.2 - IC-2021.1.3 - IC-2020.3.4 - IC-2020.2.4 - IC-2020.1.4 + IC-2023.3 + IC-2023.2.4 + IC-2023.1.5 """.trimIndent(), outputFile.readText(), ) @@ -74,14 +73,16 @@ class ListProductsReleasesTaskSpec : IntelliJPluginSpecBase() { fun `get IDEs list for the current platformType and limited versions scope`() { buildFile.groovy( """ - listProductsReleases { - sinceVersion = "2020.3" - untilVersion = "2021.2.1" + tasks { + listProductsReleases { + sinceVersion.set("2020.3") + untilVersion.set("2021.2.1") + } } """.trimIndent() ) - build(LIST_PRODUCTS_RELEASES_TASK_NAME) + build(Tasks.LIST_PRODUCTS_RELEASES) assertEquals( """ IC-2021.2.1 @@ -96,17 +97,19 @@ class ListProductsReleasesTaskSpec : IntelliJPluginSpecBase() { fun `get IDEs list using sinceBuild and untilBuild`() { buildFile.groovy( """ - patchPluginXml { - sinceBuild = "203" - untilBuild = "212.*" + tasks { + patchPluginXml { + sinceBuild.set("2020.3") + untilBuild.set("2021.2.1") + } } """.trimIndent() ) - build(LIST_PRODUCTS_RELEASES_TASK_NAME) + build(Tasks.LIST_PRODUCTS_RELEASES) assertEquals( """ - IC-2021.2.2 + IC-2021.2.1 IC-2021.1.3 IC-2020.3.4 """.trimIndent(), @@ -116,24 +119,23 @@ class ListProductsReleasesTaskSpec : IntelliJPluginSpecBase() { @Test fun `get IDEs list using sinceBuild despite it is lower than intellij_version`() { - buildFile.groovy( + buildFile( + tasks = """ - intellij { - version = "2021.1" - } patchPluginXml { - sinceBuild = "203" - untilBuild = "212.*" + sinceBuild.set("222") + untilBuild.set("232.*") } - """.trimIndent() + """.trimIndent(), ) - build(LIST_PRODUCTS_RELEASES_TASK_NAME) + build(Tasks.LIST_PRODUCTS_RELEASES) assertEquals( """ - IC-2021.2.2 - IC-2021.1.3 - IC-2020.3.4 + IC-2023.2.4 + IC-2023.1.5 + IC-2022.3.3 + IC-2022.2.5 """.trimIndent(), outputFile.readText(), ) @@ -141,19 +143,19 @@ class ListProductsReleasesTaskSpec : IntelliJPluginSpecBase() { @Test fun `get IDEs list for the custom platformType and platformVersion defined in intellij`() { - buildFile.groovy( + buildFile( + dependencies = """ - intellij { - type = "PY" - version = "2021.1" + intellijPlatform { + pycharmCommunity("$intellijVersion") } """.trimIndent() ) - build(LIST_PRODUCTS_RELEASES_TASK_NAME) + build(Tasks.LIST_PRODUCTS_RELEASES) assertEquals( """ - PY-2021.1.3 + PC-2022.3.3 """.trimIndent(), outputFile.readText(), ) @@ -163,20 +165,20 @@ class ListProductsReleasesTaskSpec : IntelliJPluginSpecBase() { fun `get IDEs list without EAP releases`() { buildFile.groovy( """ - import org.jetbrains.intellij.platform.gradle.tasks.ListProductsReleasesTask.Channel - - listProductsReleases { - sinceVersion = "2021.1" - releaseChannels = EnumSet.of(Channel.RELEASE) + tasks { + listProductsReleases { + sinceVersion.set("2023.1") + releaseChannels.set(EnumSet.of(ListProductsReleasesTask.Channel.RELEASE)) + } } """.trimIndent() ) - build(LIST_PRODUCTS_RELEASES_TASK_NAME) + build(Tasks.LIST_PRODUCTS_RELEASES) assertEquals( """ - IC-2021.2.1 - IC-2021.1.3 + IC-2023.2.4 + IC-2023.1.5 """.trimIndent(), outputFile.readText(), ) @@ -186,22 +188,27 @@ class ListProductsReleasesTaskSpec : IntelliJPluginSpecBase() { fun `get IDEs list for the multiple platformTypes`() { buildFile.groovy( """ - listProductsReleases { - sinceVersion = "2021.1" - types = ["IU", "PS", "PY"] + tasks { + listProductsReleases { + sinceVersion.set("2023.1") + types.addAll(listOf("IU", "PS", "PY").map { IntelliJPlatformType.fromCode(it) }) + } } """.trimIndent() ) - build(LIST_PRODUCTS_RELEASES_TASK_NAME) + build(Tasks.LIST_PRODUCTS_RELEASES) assertEquals( """ - IU-2021.2.2 - IU-2021.1.3 - PS-2021.2.2 - PS-2021.1.4 - PY-2021.2.2 - PY-2021.1.3 + IU-2023.3 + IU-2023.2.4 + IU-2023.1.5 + PS-2023.3 + PS-2023.2.3 + PS-2023.1.4 + PY-2023.3 + PY-2023.2.4 + PY-2023.1.4 """.trimIndent(), outputFile.readText(), ) @@ -211,30 +218,31 @@ class ListProductsReleasesTaskSpec : IntelliJPluginSpecBase() { fun `productsReleasesUpdateFiles uses values from updatePaths`() { buildFile.groovy( """ - - // disable the download task, so it doesn't contribute - tasks.downloadIdeaProductReleasesXml.configure { enabled = false } - - listProductsReleases { - sinceVersion = "2021.1" - types = ["IU", "PS", "PY"] - - ideaProductReleasesUpdateFiles.setFrom(['$ideaReleasesPath']) - - // no values set for productsReleasesUpdateFiles + tasks { + downloadIdeaProductReleasesXml { + enabled = false + } + listProductsReleases { + sinceVersion.set("2023.1") + types.addAll(listOf("IU", "PS", "PY").map { IntelliJPlatformType.fromCode(it) }) + ideaProductReleasesUpdateFiles.from("$ideaReleasesPath") + } } """.trimIndent() ) - build(LIST_PRODUCTS_RELEASES_TASK_NAME) + build(Tasks.LIST_PRODUCTS_RELEASES) assertEquals( """ - IU-2021.2.2 - IU-2021.1.3 - PS-2021.2.2 - PS-2021.1.4 - PY-2021.2.2 - PY-2021.1.3 + IU-2023.3 + IU-2023.2.4 + IU-2023.1.5 + PS-2023.3 + PS-2023.2.3 + PS-2023.1.4 + PY-2023.3 + PY-2023.2.4 + PY-2023.1.4 """.trimIndent(), outputFile.readText(), ) @@ -244,19 +252,19 @@ class ListProductsReleasesTaskSpec : IntelliJPluginSpecBase() { fun `get Android Studio releases`() { buildFile.groovy( """ - listProductsReleases { - sinceVersion = "2021.1" - types = ["AI"] + tasks { + listProductsReleases { + types.add(IntelliJPlatformType.AndroidStudio) + } } """.trimIndent() ) - build(LIST_PRODUCTS_RELEASES_TASK_NAME) + build(Tasks.LIST_PRODUCTS_RELEASES) assertEquals( """ - AI-2021.3.1.7 - AI-2021.2.1.11 - AI-2021.1.1.22 + AI-2022.3.1.20 + AI-2023.1.1.1 """.trimIndent(), outputFile.readText(), ) @@ -266,20 +274,19 @@ class ListProductsReleasesTaskSpec : IntelliJPluginSpecBase() { fun `get Android Studio releases for Release channel`() { buildFile.groovy( """ - import org.jetbrains.intellij.platform.gradle.tasks.ListProductsReleasesTask.Channel - - listProductsReleases { - sinceVersion = "2021.1" - types = ["AI"] - releaseChannels = EnumSet.of(Channel.RELEASE) + tasks { + listProductsReleases { + types.add(IntelliJPlatformType.AndroidStudio) + releaseChannels.set(EnumSet.of(ListProductsReleasesTask.Channel.RELEASE)) + } } """.trimIndent() ) - build(LIST_PRODUCTS_RELEASES_TASK_NAME) + build(Tasks.LIST_PRODUCTS_RELEASES) assertEquals( """ - AI-2021.1.1.20 + AI-2022.3.1.18 """.trimIndent(), outputFile.readText(), ) diff --git a/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintProductsReleasesTaskSpec.kt b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintProductsReleasesTaskSpec.kt new file mode 100644 index 0000000000..9f4f63cd48 --- /dev/null +++ b/src/test/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrintProductsReleasesTaskSpec.kt @@ -0,0 +1,46 @@ +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. + +package org.jetbrains.intellij.platform.gradle.tasks + +import org.jetbrains.intellij.platform.gradle.IntelliJPluginConstants.Tasks +import org.jetbrains.intellij.platform.gradle.IntelliJPluginSpecBase +import kotlin.test.Test + +class PrintProductsReleasesTaskSpec : IntelliJPluginSpecBase() { + + @Test + fun `print product releases`() { + build(Tasks.PRINT_PRODUCTS_RELEASES) { + assertContains( + """ + > Task :${Tasks.PRINT_PRODUCTS_RELEASES} + IC-2022.3.3 + """.trimIndent(), + output, + ) + } + } + + @Test + fun `print product releases for a wider range`() { + buildFile( + tasks = + """ + patchPluginXml { + untilBuild.set("232.*") + } + """.trimIndent() + ) + build(Tasks.PRINT_PRODUCTS_RELEASES) { + assertContains( + """ + > Task :${Tasks.PRINT_PRODUCTS_RELEASES} + IC-2023.2.4 + IC-2023.1.5 + IC-2022.3.3 + """.trimIndent(), + output, + ) + } + } +} diff --git a/src/test/resources/products-releases/idea-releases.xml b/src/test/resources/products-releases/idea-releases.xml index a980fd827e..74edd6e3c3 100644 --- a/src/test/resources/products-releases/idea-releases.xml +++ b/src/test/resources/products-releases/idea-releases.xml @@ -1,6079 +1,7541 @@ - - OC - - - AppCode 2021.2.1 is here!

-

Bug fixes

-
    -
  • Unable to view code coverage on "development pods" (OC-21060)
  • -
  • CocoaPods product references are resolved to a wrong file (OC-21837)
  • + + OC + + + A bug-fix update, AppCode 2023.1.4, is available for download!

    +

    This build fixes a problem with an incorrect opening of KMM projects in AppCode.

    +

    For more details, please see the release notes.

    ]]>
    +
+