Skip to content

Commit

Permalink
feat: Build simplified (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
PrzemyslawSwiderski authored Sep 8, 2024
1 parent 81d4b0e commit 11b974c
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 166 deletions.
43 changes: 1 addition & 42 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,47 +131,6 @@ jobs:
name: tests-result
path: ${{ github.workspace }}/build/reports/tests

# Upload the Kover report to CodeCov
- name: Upload Code Coverage Report
uses: codecov/codecov-action@v4
with:
files: ${{ github.workspace }}/build/reports/kover/report.xml

# Run Qodana inspections and provide report
inspectCode:
name: Inspect code
needs: [ build ]
runs-on: ubuntu-latest
permissions:
contents: write
checks: write
pull-requests: write
steps:

# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
large-packages: false

# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21

# Run Qodana inspections
- name: Qodana - Code Inspection
uses: JetBrains/[email protected]
with:
cache-default-branch-only: true

# Run plugin structure verification along with IntelliJ Plugin Verifier
verify:
name: Verify plugin
Expand Down Expand Up @@ -227,7 +186,7 @@ jobs:
releaseDraft:
name: Release draft
if: github.event_name != 'pull_request'
needs: [ build, test, inspectCode, verify ]
needs: [ build, test, verify ]
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.gradle
build
.kotlin
# Intellij
.idea
.intellijPlatform
.qodana
25 changes: 0 additions & 25 deletions .run/Run IDE for UI Tests.run.xml

This file was deleted.

24 changes: 0 additions & 24 deletions .run/Run Qodana.run.xml

This file was deleted.

71 changes: 30 additions & 41 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,22 @@ plugins {
alias(libs.plugins.kotlin) // Kotlin support
alias(libs.plugins.intelliJPlatform) // Gradle IntelliJ Plugin
alias(libs.plugins.changelog) // Gradle Changelog Plugin
alias(libs.plugins.qodana) // Gradle Qodana Plugin
alias(libs.plugins.kover) // Gradle Kover Plugin
alias(libs.plugins.pythonPlugin) // Python Plugin (https://github.com/PrzemyslawSwiderski/python-gradle-plugin)
}

val javaVersion: String by project

group = providers.gradleProperty("pluginGroup").get()
version = providers.gradleProperty("pluginVersion").get()
val pluginGroup: String by project
val pluginVersion: String by project
val platformType: String by project
val platformVersion: String by project
val platformBundledPlugins: String by project
val platformPlugins: String by project
val pluginRepositoryUrl: String by project
val pluginSinceBuild: String by project
val pluginUntilBuild: String by project

group = pluginGroup
version = pluginVersion

// Set the JVM language level used to build the project.
kotlin {
Expand Down Expand Up @@ -48,13 +55,13 @@ dependencies {

// IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
intellijPlatform {
create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion"))
create(platformType, platformVersion)

// Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
bundledPlugins(platformBundledPlugins.split(','))

// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
plugins(platformPlugins.split(','))

instrumentationTools()
pluginVerifier()
Expand All @@ -67,7 +74,7 @@ dependencies {
// Configure IntelliJ Platform Gradle Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html
intellijPlatform {
pluginConfiguration {
version = providers.gradleProperty("pluginVersion")
version = pluginVersion

// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
description = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
Expand All @@ -84,20 +91,19 @@ intellijPlatform {

val changelog = project.changelog // local variable for configuration cache compatibility
// Get the latest available change notes from the changelog file
changeNotes = providers.gradleProperty("pluginVersion").map { pluginVersion ->
with(changelog) {
renderItem(
(getOrNull(pluginVersion) ?: getUnreleased())
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.HTML,
)
}
changeNotes = with(changelog) {
renderItem(
(getOrNull(pluginVersion) ?: getUnreleased())
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.HTML,
)
}


ideaVersion {
sinceBuild = providers.gradleProperty("pluginSinceBuild")
untilBuild = providers.gradleProperty("pluginUntilBuild")
sinceBuild = pluginSinceBuild
untilBuild = pluginUntilBuild
}
}

Expand All @@ -112,8 +118,7 @@ intellijPlatform {
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
channels = providers.gradleProperty("pluginVersion")
.map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) }
channels = listOf(pluginVersion.substringAfter('-', "").substringBefore('.').ifEmpty { "default" })
}

pluginVerification {
Expand All @@ -126,7 +131,7 @@ intellijPlatform {
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
groups = listOf("Added", "Changed", "Removed")
repositoryUrl = providers.gradleProperty("pluginRepositoryUrl")
repositoryUrl = pluginRepositoryUrl
}

pythonPlugin {
Expand All @@ -135,26 +140,10 @@ pythonPlugin {
condaVersion = "py312_24.1.2-0"
}

// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
kover {
reports {
total {
xml {
onCheck = true
}
}
}
currentProject {
instrumentation {
// https://github.com/JetBrains/intellij-platform-gradle-plugin/issues/1702
excludedClasses.add("org.apache.velocity.*")
}
}
}

tasks {
wrapper {
gradleVersion = providers.gradleProperty("gradleVersion").get()
val gradleVersion: String by project
this.gradleVersion = gradleVersion
}

test {
Expand Down
17 changes: 0 additions & 17 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,15 @@ pluginUntilBuild=242.*
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
# Available versions -> https://www.jetbrains.com/idea/download/other.html
# IntellijIdea community
#platformType=IC
# PyCharm community
platformType=IC
platformVersion=2024.2
#
#
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP
platformPlugins=PythonCore:242.20224.300
# Example: platformBundledPlugins = com.intellij.java
platformBundledPlugins=com.intellij.java,org.toml.lang
#
#
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
# Python Core plugin versions https://plugins.jetbrains.com/plugin/7322-python-community-edition/versions
# Intellij Idea
intellijPlugins=PythonCore:242.20224.300,\
com.intellij.java,\
org.toml.lang
#
# PyCharm
# Java plugin versions https://plugins.jetbrains.com/plugin/7322-python-community-edition/versions
pyCharmPlugins=PythonCore,\
org.toml.lang
#
# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion=8.10
javaVersion=21
Expand Down
4 changes: 0 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ junit = "5.11.0"
kotlin = "2.0.20"
changelog = "2.2.1"
intelliJPlatform = "2.0.1"
qodana = "2024.1.9"
kover = "0.8.3"
pythonPlugin = "2.7.3"

[libraries]
Expand All @@ -20,6 +18,4 @@ jupiterEngine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", ve
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
intelliJPlatform = { id = "org.jetbrains.intellij.platform", version.ref = "intelliJPlatform" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
qodana = { id = "org.jetbrains.qodana", version.ref = "qodana" }
pythonPlugin = { id = "com.pswidersk.python-plugin", version.ref = "pythonPlugin" }
12 changes: 0 additions & 12 deletions qodana.yml

This file was deleted.

0 comments on commit 11b974c

Please sign in to comment.