Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for 243 realease - Switching to PackageApiClientService provided by the platform #194

Merged
Merged
1 change: 1 addition & 0 deletions .github/workflows/TrustKotlinGradlePluginPatch.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import kotlin.io.path.listDirectoryEntries
import org.w3c.dom.Document
import org.w3c.dom.Element

//todo delete if not useful
fscarponi marked this conversation as resolved.
Show resolved Hide resolved
val domFileName = "builtinRegistry"

println("Scouting registry files")
Expand Down
3 changes: 1 addition & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ plugins {
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-SNAPSHOT"
val baseVersion = "243-SNAPSHOT"

version = when (val ref = getenv("GITHUB_REF")) {
null -> baseVersion
Expand Down
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ dependencies {
implementation(libs.poet.kotlin)
implementation(libs.flexmark)
implementation(libs.gradle.intellij.platform.plugin)
implementation(libs.kotlin.serialization.gradle.plugin)
}
10 changes: 1 addition & 9 deletions buildSrc/src/main/kotlin/Utils.kt
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
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<PluginDependency>) =
id(plugin.get().pluginId)

const val PACKAGE_SEARCH_PLUGIN_ID = "com.jetbrains.packagesearch.intellij-plugin"
const val INTELLIJ_VERSION = "243.18137.10"
const val INTELLIJ_VERSION = "243.21565.23"

fun String.containsAny(toDelete: List<String>) =
toDelete.any { it in this }
Expand Down
2 changes: 1 addition & 1 deletion kmp-modifier/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
alias(packageSearchCatalog.plugins.kotlin.jvm)
id(packageSearchCatalog.plugins.idea.gradle.plugin.base)
alias(packageSearchCatalog.plugins.dokka)
alias(packageSearchCatalog.plugins.kotlin.plugin.serialization)
id(packageSearchCatalog.plugins.kotlin.plugin.serialization)
`maven-publish`
}

Expand Down
1 change: 0 additions & 1 deletion nitrite-java
Submodule nitrite-java deleted from be77b1
29 changes: 13 additions & 16 deletions packagesearch.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
assertk = "0.28.1"
caffeine = "3.1.6"
commonsCodec = "1.16.0"
composeDesktop = "1.6.11"
composeDesktop = "1.7.0"
coroutines = "1.8.0"
detekt = "1.23.6"
dokka = "1.9.20"
flexmark = "0.64.8"
foojay = "0.5.0"
gradlePublishPlugin = "1.1.0"
ideStarter = "LATEST-EAP-SNAPSHOT"
idea = "2024.2"
idea = "2024.3"
ideaGradlePlugin = "1.17.3"
newIdeaGradlePlugin = "2.1.0"
jewel = "0.19.6"
jewel = "0.26"
jewelSnapshot = "1.0.0-SNAPSHOT"
junit = "5.10.2"
junit4 = "4.13.2"
kotlin = "2.0.20"
kotlin = "2.0.21"
kotlinPoet = "1.15.2"
kotlinterGradlePlugin = "3.12.0"
kotlinxDatetime = "0.5.0"
kotlinxSerialization = "1.6.3"
kotlinxSerialization = "1.7.3"
ktor = "2.3.5"
logback = "1.4.11"
nitrite = "3.4.4"
logback = "1.4.12"
newIdeaGradlePlugin = "2.1.0"
packagesearchApiModels = "3.1.0"
xmlutilsSerialization = "0.86.2"

Expand All @@ -50,6 +50,7 @@ ij-platform-ide-impl = { module = "com.jetbrains.intellij.platform:ide-impl", ve
jewel-bridge-ij232 = { module = "org.jetbrains.jewel:jewel-ide-laf-bridge-232", version.ref = "jewel" }
jewel-bridge-ij233 = { module = "org.jetbrains.jewel:jewel-ide-laf-bridge-233", version.ref = "jewel" }
jewel-bridge-ij241 = { module = "org.jetbrains.jewel:jewel-ide-laf-bridge-241", version.ref = "jewel" }
jewel-bridge-ij243 = { module= "org.jetbrains.jewel:jewel-ide-laf-bridge-243", version.ref = "jewelSnapshot"}
jewel-foundation = { module = "org.jetbrains.jewel:jewel-foundation", version.ref = "jewel" }
jewel-standalone = { module = "org.jetbrains.jewel:jewel-int-ui-standalone", version.ref = "jewel" }
jewel-ui = { module = "org.jetbrains.jewel:jewel-ui", version.ref = "jewel" }
Expand All @@ -58,6 +59,7 @@ junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", vers
junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit" }
junit-vintage-engine = { module = "org.junit.vintage:junit-vintage-engine", version.ref = "junit" }
junit4-base = { module = "junit:junit", version.ref = "junit4" }
kotlin-serialization-gradle-plugin = {module="org.jetbrains.kotlin:kotlin-serialization", version.ref="kotlin"}
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinxDatetime" }
Expand All @@ -78,14 +80,9 @@ ktor-server-compression = { module = "io.ktor:ktor-server-compression", version.
ktor-server-content-negotiation = { module = "io.ktor:ktor-server-content-negotiation", version.ref = "ktor" }
ktor-server-test-host = { module = "io.ktor:ktor-server-test-host", version.ref = "ktor" }
logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
nitrite = { module = "org.dizitart:nitrite", version.ref = "nitrite" }
nitrite-mvstore-adapter = { module = "org.dizitart:nitrite-mvstore-adapter", version.ref = "nitrite" }
packagesearch-api-client = { module = "org.jetbrains.packagesearch:packagesearch-api-client", version.ref = "packagesearchApiModels" }
packagesearch-api-models = { module = "org.jetbrains.packagesearch:packagesearch-api-models", version.ref = "packagesearchApiModels" }
packagesearch-build-systems-models = { module = "org.jetbrains.packagesearch:packagesearch-build-systems-models", version.ref = "packagesearchApiModels" }
packagesearch-http-models = { module = "org.jetbrains.packagesearch:packagesearch-http-models", version.ref = "packagesearchApiModels" }
poet-kotlin = { module = "com.squareup:kotlinpoet", version.ref = "kotlinPoet" }
potassium-nitrite = { module = "org.dizitart:potassium-nitrite", version.ref = "nitrite" }
xmlutils-serialization = { module = "io.github.pdvrieze.xmlutil:serialization", version.ref = "xmlutilsSerialization" }


Expand All @@ -105,12 +102,12 @@ dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
foojay-resolver = { id = "org.gradle.toolchains.foojay-resolver-convention", version.ref = "foojay" }
gradle-publish-plugin = { id = "com.gradle.plugin-publish", version.ref = "gradlePublishPlugin" }
idea-gradle-plugin = { id = "org.jetbrains.intellij.platform", version.ref = "newIdeaGradlePlugin" }
idea-gradle-plugin-platform = { id = "org.jetbrains.intellij.platform", version.ref = "newIdeaGradlePlugin" }
idea-gradle-plugin-module = { id = "org.jetbrains.intellij.platform.module", version.ref = "newIdeaGradlePlugin" }
idea-gradle-plugin-base = { id = "org.jetbrains.intellij.platform.base", version.ref = "newIdeaGradlePlugin" }
idea-gradle-plugin-module = { id = "org.jetbrains.intellij.platform.module", version.ref = "newIdeaGradlePlugin" }
idea-gradle-plugin-platform = { id = "org.jetbrains.intellij.platform", version.ref = "newIdeaGradlePlugin" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-plugin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlin-plugin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlin-plugin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlinter = { id = "org.jmailen.kotlinter", version.ref = "kotlinterGradlePlugin" }
shadow = { id = "com.gradleup.shadow", version = "8.3.3" }
27 changes: 17 additions & 10 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import com.vladsch.flexmark.html.HtmlRenderer
import com.vladsch.flexmark.parser.Parser
import java.lang.System.getenv
import kotlin.math.max
import org.jetbrains.intellij.platform.gradle.tasks.GenerateManifestTask
import org.jetbrains.intellij.platform.gradle.tasks.PublishPluginTask
import org.jetbrains.kotlin.util.prefixIfNot


plugins {
Expand All @@ -13,11 +15,10 @@ plugins {
alias(packageSearchCatalog.plugins.dokka)
alias(packageSearchCatalog.plugins.compose.desktop)
alias(packageSearchCatalog.plugins.kotlin.plugin.compose)
alias(packageSearchCatalog.plugins.kotlin.plugin.serialization)
id(packageSearchCatalog.plugins.kotlin.plugin.serialization)
alias(packageSearchCatalog.plugins.shadow)
`maven-publish`
}

intellijPlatform {
instrumentCode = false
}
Expand All @@ -32,24 +33,25 @@ dependencies {
intellijIdeaCommunity(INTELLIJ_VERSION)
bundledPlugins(
"org.jetbrains.idea.reposearch",
"com.jetbrains.performancePlugin"
"com.jetbrains.performancePlugin",
)
bundledModule(
"intellij.platform.compose"
)
}

implementation(compose.desktop.linux_arm64)
implementation(compose.desktop.linux_x64)
implementation(compose.desktop.macos_arm64)
implementation(compose.desktop.macos_x64)
implementation(compose.desktop.windows_x64)
implementation(packageSearchCatalog.jewel.bridge.ij241)
implementation(compose.desktop.currentOs) {
exclude(group = "org.jetbrains.compose.material")
exclude(group = "org.jetbrains.kotlinx")
}
implementation(packageSearchCatalog.jewel.bridge.ij243) //compileonly???
implementation(packageSearchCatalog.kotlinx.serialization.core)
implementation(packageSearchCatalog.compose.desktop.components.splitpane) {
exclude(group = "org.jetbrains.compose.runtime")
exclude(group = "org.jetbrains.compose.foundation")
}
implementation(packageSearchCatalog.ktor.client.logging)
implementation(packageSearchCatalog.ktor.client.java)
implementation(packageSearchCatalog.packagesearch.api.models)
implementation(projects.plugin.gradle.base)
implementation(projects.plugin.gradle.kmp)
implementation(projects.plugin.maven)
Expand Down Expand Up @@ -85,10 +87,15 @@ tasks {
changeNotes = getenv("CHANGE_NOTES")
?.let { Parser.builder().build().parse(it) }
?.let { HtmlRenderer.builder().build().render(it) }
?.prefixIfNot("<![CDATA[")
// ?.suffixIfNot("]]>")
fscarponi marked this conversation as resolved.
Show resolved Hide resolved

}

shadowJar {
val generateManifestTask = named<GenerateManifestTask>("generateManifest")
dependsOn(generateManifestTask)
manifest.from(generateManifestTask.flatMap<RegularFile> { it.generatedManifest })
exclude { it.name.containsAny(JAR_NAMES_TO_REMOVE) }
exclude { it.name == "module-info.class" }
exclude { it.name.endsWith("kotlin_module") }
Expand Down
18 changes: 6 additions & 12 deletions plugin/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,20 @@ import org.jetbrains.packagesearch.gradle.GeneratePackageSearchObject
plugins {
alias(packageSearchCatalog.plugins.kotlin.jvm)
alias(packageSearchCatalog.plugins.dokka)
alias(packageSearchCatalog.plugins.kotlin.plugin.serialization)
id(packageSearchCatalog.plugins.kotlin.plugin.serialization)
id(packageSearchCatalog.plugins.idea.gradle.plugin.base)
`maven-publish`
}

dependencies {
intellijPlatform {
intellijIdeaCommunity(INTELLIJ_VERSION)
bundledPlugins(
"org.jetbrains.idea.reposearch",
"com.jetbrains.performancePlugin"
)
}
api(packageSearchCatalog.potassium.nitrite) {
exclude(group = "com.fasterxml.jackson")
exclude(group = "com.fasterxml.jackson.core")
exclude(group = "com.fasterxml.jackson.datatype")
exclude(group = "com.squareup.okhttp3")
exclude(group = "org.slf4j")
}
api(packageSearchCatalog.nitrite.mvstore.adapter) {
exclude(group = "org.slf4j")
}
api(packageSearchCatalog.packagesearch.api.client)
api(packageSearchCatalog.kotlinx.serialization.core)
testRuntimeOnly(packageSearchCatalog.junit.jupiter.api)
testRuntimeOnly(packageSearchCatalog.junit.jupiter.engine)
testImplementation(packageSearchCatalog.kotlinx.coroutines.test)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import com.intellij.util.messages.Topic
import com.jetbrains.packagesearch.plugin.core.data.IconProvider
import com.jetbrains.packagesearch.plugin.core.data.PackageSearchDeclaredMavenPackage
import com.jetbrains.packagesearch.plugin.core.data.PackageSearchDeclaredPackage
import com.jetbrains.packagesearch.plugin.core.services.PackageSearchProjectCachesService
import java.nio.file.Files
import java.nio.file.Path
import kotlin.contracts.ExperimentalContracts
Expand Down Expand Up @@ -194,9 +193,6 @@ fun Application.registryFlow(key: String, defaultValue: Boolean = false) =
}
}.withInitialValue(Registry.`is`(key, defaultValue))

val Project.PackageSearchProjectCachesService
get() = service<PackageSearchProjectCachesService>()

fun ApiPackage.asMavenApiPackage() =
this as? ApiMavenPackage ?: error(
"Package $id is of type '${this::class.simpleName}' " +
Expand Down
3 changes: 2 additions & 1 deletion plugin/gradle/base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
alias(packageSearchCatalog.plugins.kotlin.jvm)
id(packageSearchCatalog.plugins.idea.gradle.plugin.base)
alias(packageSearchCatalog.plugins.dokka)
alias(packageSearchCatalog.plugins.kotlin.plugin.serialization)
id(packageSearchCatalog.plugins.kotlin.plugin.serialization)
`maven-publish`
}

Expand All @@ -18,4 +18,5 @@ dependencies {
)
}
api(projects.plugin.gradle)
compileOnly(projects.plugin.gradle.tooling)
}
Loading
Loading