Skip to content

Commit

Permalink
🧱 Fix Gradle project (QD-9459)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiulpin committed Jul 9, 2024
1 parent 5436cb0 commit cef6958
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 85 deletions.
34 changes: 1 addition & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF >> common/build.gradle.kts
publishing {
publications {
create<MavenPublication>("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 }}
Expand Down
39 changes: 0 additions & 39 deletions common/build.gradle.kts

This file was deleted.

2 changes: 1 addition & 1 deletion common/update-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down
35 changes: 29 additions & 6 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ repositories {
}

dependencies {
implementation(project(":common"))
testImplementation(gradleTestKit())
testImplementation(kotlin("test"))
testImplementation(kotlin("test-junit"))
Expand All @@ -60,11 +59,6 @@ val sourcesJar = tasks.register<Jar>("sourcesJar") {
from(sourceSets.main.get().allSource)
}

artifacts {
archives(javadocJar)
archives(sourcesJar)
}

tasks {
test {
val testGradleHome = layout.buildDirectory.asFile.get().resolve("testGradleHome")
Expand Down Expand Up @@ -93,3 +87,32 @@ gradlePlugin {
tags = properties("tags").map { it.split(',') }
}
}

publishing {
publications {
create<MavenPublication>("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")
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Project> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,5 @@ plugins {
}

include(
":plugin",
":common",
":plugin"
)

0 comments on commit cef6958

Please sign in to comment.