Skip to content

Commit

Permalink
try build
Browse files Browse the repository at this point in the history
  • Loading branch information
CppCXY committed Feb 10, 2025
1 parent f6a7081 commit f03c31d
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import de.undercouch.gradle.tasks.download.Download
import org.gradle.internal.os.OperatingSystem

plugins {
id("java")
Expand All @@ -7,11 +8,33 @@ plugins {
id("de.undercouch.download") version "5.6.0"
}

data class BuildData(
val ideaSDKShortVersion: String,
// https://www.jetbrains.com/intellij-repository/releases
val ideaSDKVersion: String,
val sinceBuild: String,
val untilBuild: String,
val type: String = "IC"
)

val buildDataList = listOf(
BuildData(
ideaSDKShortVersion = "243",
ideaSDKVersion = "2024.3",
sinceBuild = "243",
untilBuild = "251.*",
)
)

group = "com.cppcxy"
val emmyluaAnalyzerVersion = "0.4.6"
val emmyDebuggerVersion = "1.8.2"

val emmyluaAnalyzerProjectUrl = "https://github.com/CppCXY/emmylua-analyzer-rust"
val buildVersion = System.getProperty("IDEA_VER") ?: buildDataList.first().ideaSDKShortVersion
val buildVersionData = buildDataList.find { it.ideaSDKShortVersion == buildVersion }!!
val runnerNumber = System.getenv("RUNNER_NUMBER") ?: "Dev"
// temporary fix
version = "${emmyluaAnalyzerVersion.replaceFirst("^0", "1")}.${runnerNumber}-IDEA${buildVersion}"

task("download", type = Download::class) {
src(
Expand Down Expand Up @@ -108,16 +131,12 @@ task("install", type = Copy::class) {
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellijPlatform {
buildSearchableOptions = false

projectName = "IntelliJ-EmmyLua2"

version = buildVersionData.ideaSDKVersion
type = buildVersionData.type
sandboxDir = "${project.buildDir}/${buildVersionData.ideaSDKShortVersion}/idea-sandbox"
pluginConfiguration {
name = "EmmyLua2"

ideaVersion {
sinceBuild = "251"
untilBuild = "251.*"
}
}

publishing {
Expand Down Expand Up @@ -167,7 +186,8 @@ tasks {
}

patchPluginXml {
dependsOn("install")
sinceBuild.set(buildVersionData.sinceBuild)
untilBuild.set(buildVersionData.untilBuild)
}

buildPlugin {
Expand Down

0 comments on commit f03c31d

Please sign in to comment.