diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d29ef72..f2b90d58 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,39 +26,7 @@ jobs: - name: Run linters and test run: ./gradlew clean :plugin:build :plugin:publishPlugins -Pgradle.publish.key=${{ secrets.GRADLE_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_TOKEN }} -PbuildNumber=${{ env.PATCH_VERSION }} - name: Publish JAR to Space - run: | - cat <> common/build.gradle.kts - publishing { - publications { - create("common") { - groupId = group.toString() - artifactId = "cli" - version = version.toString() - from(components["java"]) - artifact(tasks["jarSources"]) - pom { - url.set("https://github.com/JetBrains/qodana-action") - licenses { - license { - name.set("Apache-2.0") - url.set("https://github.com/JetBrains/qodana-action/blob/main/LICENSE") - } - } - } - } - } - repositories { - maven { - url = uri("https://packages.jetbrains.team/maven/p/sa/maven-public") - credentials { - username = System.getenv("JB_SPACE_INTELLIJ_CLIENT_ID") - password = System.getenv("JB_SPACE_INTELLIJ_CLIENT_SECRET") - } - } - } - } - EOF - ./gradlew :common:publish + run: ./gradlew :plugin:publish -PbuildNumber=${{ env.PATCH_VERSION }} env: JB_SPACE_INTELLIJ_CLIENT_ID: ${{ secrets.MAVEN_SPACE_USERNAME }} JB_SPACE_INTELLIJ_CLIENT_SECRET: ${{ secrets.MAVEN_SPACE_PASSWORD }} diff --git a/common/build.gradle.kts b/common/build.gradle.kts deleted file mode 100644 index 16d8ed5a..00000000 --- a/common/build.gradle.kts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2021-2024 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -fun properties(key: String) = providers.gradleProperty(key) -fun environment(key: String) = providers.environmentVariable(key) - -plugins { - `maven-publish` - `kotlin-dsl` - `java-library` -} - -val kotlinVersion by extra(libs.versions.kotlin.get()) - -group = "org.jetbrains.qodana.common" -version = "${properties("majorVersion").get()}.${properties("buildNumber").get()}" - -kotlin { - jvmToolchain(8) - version = "2024.1.8" -} - -tasks.register("jarSources") { - archiveClassifier.set("sources") - from(sourceSets.main.get().allSource) -} diff --git a/common/update-cli.js b/common/update-cli.js index 61d0ba2c..0f151b58 100644 --- a/common/update-cli.js +++ b/common/update-cli.js @@ -6,7 +6,7 @@ const {readFileSync} = require("fs"); const {execSync} = require("child_process"); const path = require("path"); const cliJsonPath = "./cli.json"; -const checksumsKtPath = "../common/src/main/kotlin/org/jetbrains/qodana/cli/Checksums.kt"; +const checksumsKtPath = "../plugin/src/main/kotlin/org/jetbrains/qodana/Checksums.kt"; const PLATFORMS = ["windows", "linux", "darwin"]; const ARCHS = ["x86_64", "arm64"]; diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index a3a931b8..138c6519 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -37,7 +37,6 @@ repositories { } dependencies { - implementation(project(":common")) testImplementation(gradleTestKit()) testImplementation(kotlin("test")) testImplementation(kotlin("test-junit")) @@ -60,11 +59,6 @@ val sourcesJar = tasks.register("sourcesJar") { from(sourceSets.main.get().allSource) } -artifacts { - archives(javadocJar) - archives(sourcesJar) -} - tasks { test { val testGradleHome = layout.buildDirectory.asFile.get().resolve("testGradleHome") @@ -93,3 +87,32 @@ gradlePlugin { tags = properties("tags").map { it.split(',') } } } + +publishing { + publications { + create("common") { + groupId = group.toString() + artifactId = "cli" + version = version.toString() + from(components["java"]) + pom { + url.set("https://github.com/JetBrains/qodana-action") + licenses { + license { + name.set("Apache-2.0") + url.set("https://github.com/JetBrains/qodana-action/blob/main/LICENSE") + } + } + } + } + } + repositories { + maven { + url = uri("https://packages.jetbrains.team/maven/p/sa/maven-public") + credentials { + username = System.getenv("JB_SPACE_INTELLIJ_CLIENT_ID") + password = System.getenv("JB_SPACE_INTELLIJ_CLIENT_SECRET") + } + } + } +} diff --git a/common/src/main/kotlin/org/jetbrains/qodana/cli/Checksums.kt b/plugin/src/main/kotlin/org/jetbrains/qodana/Checksums.kt similarity index 98% rename from common/src/main/kotlin/org/jetbrains/qodana/cli/Checksums.kt rename to plugin/src/main/kotlin/org/jetbrains/qodana/Checksums.kt index 73bd198f..65bbbc2d 100644 --- a/common/src/main/kotlin/org/jetbrains/qodana/cli/Checksums.kt +++ b/plugin/src/main/kotlin/org/jetbrains/qodana/Checksums.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.qodana.cli +package org.jetbrains.qodana // CHECKSUMS is a map of Qodana CLI versions binaries and their checksums. // Note: the content of this file is generated by the build script. Do not modify it manually. diff --git a/common/src/main/kotlin/org/jetbrains/qodana/cli/Qodana.kt b/plugin/src/main/kotlin/org/jetbrains/qodana/Qodana.kt similarity index 99% rename from common/src/main/kotlin/org/jetbrains/qodana/cli/Qodana.kt rename to plugin/src/main/kotlin/org/jetbrains/qodana/Qodana.kt index d4c07d88..19cca1a8 100644 --- a/common/src/main/kotlin/org/jetbrains/qodana/cli/Qodana.kt +++ b/plugin/src/main/kotlin/org/jetbrains/qodana/Qodana.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.qodana.cli +package org.jetbrains.qodana import java.io.File import java.io.FileInputStream diff --git a/plugin/src/main/kotlin/org/jetbrains/qodana/QodanaPlugin.kt b/plugin/src/main/kotlin/org/jetbrains/qodana/QodanaPlugin.kt index ea011f12..df935d6b 100644 --- a/plugin/src/main/kotlin/org/jetbrains/qodana/QodanaPlugin.kt +++ b/plugin/src/main/kotlin/org/jetbrains/qodana/QodanaPlugin.kt @@ -19,7 +19,6 @@ package org.jetbrains.qodana import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.plugins.PluginInstantiationException -import org.jetbrains.qodana.cli.Installer import org.jetbrains.qodana.tasks.QodanaScanTask class QodanaPlugin : Plugin { diff --git a/plugin/src/main/kotlin/org/jetbrains/qodana/tasks/QodanaScanTask.kt b/plugin/src/main/kotlin/org/jetbrains/qodana/tasks/QodanaScanTask.kt index 89637a6d..ea2acaa6 100644 --- a/plugin/src/main/kotlin/org/jetbrains/qodana/tasks/QodanaScanTask.kt +++ b/plugin/src/main/kotlin/org/jetbrains/qodana/tasks/QodanaScanTask.kt @@ -21,7 +21,7 @@ import org.gradle.api.GradleException import org.gradle.api.provider.ListProperty import org.gradle.api.tasks.* import org.gradle.kotlin.dsl.property -import org.jetbrains.qodana.cli.Installer +import org.jetbrains.qodana.Installer import org.jetbrains.qodana.QodanaPluginConstants.QODANA_ENV import org.jetbrains.qodana.QodanaPluginConstants.QODANA_ENV_NAME import java.io.ByteArrayOutputStream diff --git a/settings.gradle.kts b/settings.gradle.kts index ec83ef5c..a6a64344 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -29,6 +29,5 @@ plugins { } include( - ":plugin", - ":common", + ":plugin" ) \ No newline at end of file