diff --git a/.gitignore b/.gitignore index b5ae735e..59d49cc3 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ allure-results/ !.idea/codeStyles/* !.idea/dictionaries/* +.intellijPlatform/ \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index f47cff79..a28f1ea4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,18 +1,21 @@ @file:Suppress("UnstableApiUsage") import java.lang.System.getenv -import org.jetbrains.packagesearch.gradle.getStringOrNull -import org.jetbrains.packagesearch.gradle.pkgsSpace plugins { - `version-catalog` - `maven-publish` - `build-config` + alias(packageSearchCatalog.plugins.shadow) apply false + alias(packageSearchCatalog.plugins.dokka) apply false + alias(packageSearchCatalog.plugins.kotlin.jvm) apply false + alias(packageSearchCatalog.plugins.kotlin.plugin.serialization) apply false + alias(packageSearchCatalog.plugins.kotlin.plugin.compose) apply false + alias(packageSearchCatalog.plugins.compose.desktop) apply false + alias(packageSearchCatalog.plugins.kotlinter) apply false } allprojects { group = "org.jetbrains.packagesearch" - val baseVersion = "242.99999-SNAPSHOT" + val baseVersion = "242-SNAPSHOT" + version = when (val ref = getenv("GITHUB_REF")) { null -> baseVersion else -> when { @@ -20,40 +23,4 @@ allprojects { else -> baseVersion } } - - repositories { - google() - mavenCentral() - maven("https://repo.gradle.org/gradle/libs-releases") - maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") - maven("https://packages.jetbrains.team/maven/p/kpm/public") - maven("https://www.jetbrains.com/intellij-repository/snapshots") - maven("https://cache-redirector.jetbrains.com/intellij-dependencies") - maven("https://packages.jetbrains.team/maven/p/ij/intellij-sdk-nightly") { - credentials { - username = getenv("SPACE_INTELLIJ_NIGHTLIES_USERNAME") - ?: project.extra.getStringOrNull("space.intellij.username") - password = getenv("SPACE_INTELLIJ_NIGHTLIES_TOKEN") - ?: project.extra.getStringOrNull("space.intellij.password") - } - } - } } - -catalog { - versionCatalog { - from(files("packagesearch.versions.toml")) - } -} - -publishing { - repositories { - pkgsSpace(project) - } - publications { - create("versionCatalog") { - from(components["versionCatalog"]) - artifactId = "packagesearch-version-catalog" - } - } -} \ No newline at end of file diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index e76929b0..8a454bac 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -2,33 +2,13 @@ plugins { `kotlin-dsl` - kotlin("plugin.serialization") version packageSearchCatalog.versions.kotlin.get() } group = "org.jetbrains.packagesearch" version = "1.0.0-SNAPSHOT" -gradlePlugin { - plugins { - create("packagesearch") { - id = "build-config" - displayName = "Package Search Build Configurations" - implementationClass = "org.jetbrains.packagesearch.gradle.PackageSearchPlugin" - description = "Package Search Build Configurations" - } - } -} - dependencies { - implementation(packageSearchCatalog.kotlin.gradle.plugin) - implementation(packageSearchCatalog.gradle.intellij.platform.plugin) - implementation(packageSearchCatalog.dokka.gradle.plugin) - implementation(packageSearchCatalog.foojay.resolver.gradle.plugin) - implementation(packageSearchCatalog.detekt.gradle.plugin) - implementation(packageSearchCatalog.kotlinter.gradle.plugin) - implementation(packageSearchCatalog.shadow.gradle.plugin) - implementation(packageSearchCatalog.kotlinx.serialization.json) - implementation(packageSearchCatalog.poet.kotlin) - implementation(packageSearchCatalog.xmlutils.serialization) - implementation(packageSearchCatalog.flexmark) + implementation(libs.poet.kotlin) + implementation(libs.flexmark) + implementation(libs.gradle.intellij.platform.plugin) } diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts index f58b0d92..37633504 100644 --- a/buildSrc/settings.gradle.kts +++ b/buildSrc/settings.gradle.kts @@ -8,7 +8,7 @@ dependencyResolutionManagement { gradlePluginPortal() } versionCatalogs { - create("packageSearchCatalog") { + create("libs") { from(files("../packagesearch.versions.toml")) } } diff --git a/buildSrc/src/main/kotlin/Utils.kt b/buildSrc/src/main/kotlin/Utils.kt index 3f23f571..6325fef9 100644 --- a/buildSrc/src/main/kotlin/Utils.kt +++ b/buildSrc/src/main/kotlin/Utils.kt @@ -1,6 +1,29 @@ +import java.io.File +import org.gradle.api.plugins.ExtraPropertiesExtension import org.gradle.api.provider.Provider +import org.gradle.api.tasks.Sync +import org.gradle.api.tasks.TaskProvider +import org.gradle.kotlin.dsl.DependencyHandlerScope import org.gradle.kotlin.dsl.PluginDependenciesSpecScope +import org.gradle.kotlin.dsl.getByType +import org.gradle.kotlin.dsl.version import org.gradle.plugin.use.PluginDependency +import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformDependenciesExtension fun PluginDependenciesSpecScope.id(plugin: Provider) = - id(plugin.get().pluginId) \ No newline at end of file + id(plugin.get().pluginId) + +const val PACKAGE_SEARCH_PLUGIN_ID = "com.jetbrains.packagesearch.intellij-plugin" +const val INTELLIJ_VERSION = "243.18137.10" + +fun String.containsAny(toDelete: List) = + toDelete.any { it in this } + + +val JAR_NAMES_TO_REMOVE = listOf( + "kotlin-stdlib", + "slf4j", + "kotlin-reflect", + "kotlinx-coroutines", + "logback", +) diff --git a/buildSrc/src/main/kotlin/org/jetbrains/packagesearch/gradle/Application.kt b/buildSrc/src/main/kotlin/org/jetbrains/packagesearch/gradle/Application.kt deleted file mode 100644 index 707a4eb2..00000000 --- a/buildSrc/src/main/kotlin/org/jetbrains/packagesearch/gradle/Application.kt +++ /dev/null @@ -1,86 +0,0 @@ -@file:Suppress("unused") - -package org.jetbrains.packagesearch.gradle - -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable -import nl.adaptivity.xmlutil.serialization.XmlSerialName -import nl.adaptivity.xmlutil.serialization.XmlValue - -@Serializable -@XmlSerialName("application") -data class Application( - val components: List, -) { - object Laf { - val newUiStrings = listOf("ExperimentalDark", "ExperimentalLight") - - val DARK = Application( - listOf( - Component( - name = "LafManager", - autodetect = "true", - laf = Laf( - className = "com.intellij.ide.ui.laf.darcula.DarculaLaf", - themeId = "ExperimentalDark" - ) - ) - ) - ) - val LIGHT = Application( - listOf( - Component( - name = "LafManager", - autodetect = "true", - laf = Laf( - className = "com.intellij.ide.ui.laf.IntelliJLaf", - themeId = "ExperimentalLight" - ) - ) - ) - ) - } -} - -@Serializable -@XmlSerialName("component") -data class Component( - val name: String, - val autodetect: String? = null, - val options: List