@@ -23,20 +23,54 @@ plugins {
2323 id(" de.undercouch.download" ).version(" 5.3.0" )
2424}
2525
26+ data class BuildData (
27+ val ideaSDKShortVersion : String ,
28+ // https://www.jetbrains.com/intellij-repository/releases
29+ val ideaSDKVersion : String ,
30+ val sinceBuild : String ,
31+ val untilBuild : String ,
32+ val archiveName : String = " EmmyLua2-AttachDebugger" ,
33+ val jvmTarget : String = " 17" ,
34+ val targetCompatibilityLevel : JavaVersion = JavaVersion .VERSION_17 ,
35+ // https://github.com/JetBrains/gradle-intellij-plugin/issues/403#issuecomment-542890849
36+ val instrumentCodeCompilerVersion : String = ideaSDKVersion,
37+ val type : String = " IU"
38+ )
39+
40+ val buildDataList = listOf (
41+ BuildData (
42+ ideaSDKShortVersion = " 242" ,
43+ ideaSDKVersion = " 2024.2" ,
44+ sinceBuild = " 232" ,
45+ untilBuild = " 242.*" ,
46+ )
47+ )
48+
49+ group = " com.cppcxy"
50+ val emmyluaDebuggerVersion = " 1.8.2"
51+ val emmyluaDebuggerProjectUrl = " https://github.com/EmmyLua/EmmyLuaDebugger"
52+
53+ val buildVersion = System .getProperty(" IDEA_VER" ) ? : buildDataList.first().ideaSDKShortVersion
54+
55+ val buildVersionData = buildDataList.find { it.ideaSDKShortVersion == buildVersion }!!
56+
57+ val runnerNumber = System .getenv(" RUNNER_NUMBER" ) ? : " Dev"
58+
59+ version = " ${emmyluaDebuggerVersion} .${runnerNumber} -IDEA${buildVersion} "
60+
2661repositories {
2762 mavenCentral()
2863}
2964
3065intellij {
3166 pluginName.set(" EmmyLua2-AttachDebugger" )
32- version.set(" 2023.3 " )
33- type.set(" IC " ) // Target IDE Platform
34- sandboxDir.set(" ${project.buildDir} /idea-sandbox" )
67+ version.set(buildVersionData.ideaSDKVersion )
68+ type.set(buildVersionData.type ) // Target IDE Platform
69+ sandboxDir.set(" ${project.buildDir} /${buildVersionData.ideaSDKShortVersion} / idea-sandbox" )
3570 plugins.set(listOf (" com.cppcxy.Intellij-EmmyLua:0.7.1.20-IDEA242" ))
3671}
3772
38- val emmyluaDebuggerVersion = " 1.8.2"
39- val emmyluaDebuggerProjectUrl = " https://github.com/EmmyLua/EmmyLuaDebugger"
73+
4074
4175task(" downloadDebugger" , type = Download ::class ) {
4276 src(arrayOf(
@@ -71,15 +105,18 @@ tasks {
71105 // Set the JVM compatibility versions
72106 withType<JavaCompile > {
73107 sourceCompatibility = " 17"
74- targetCompatibility = " 17 "
108+ targetCompatibility = " 21 "
75109 }
76110 withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > {
77- kotlinOptions.jvmTarget = " 17"
111+ kotlinOptions.jvmTarget = buildVersionData.jvmTarget
112+ }
113+ instrumentCode {
114+ compilerVersion.set(buildVersionData.instrumentCodeCompilerVersion)
78115 }
79116
80117 patchPluginXml {
81- sinceBuild.set(" 233 " )
82- untilBuild.set(" 242.* " )
118+ sinceBuild.set(buildVersionData.sinceBuild )
119+ untilBuild.set(buildVersionData.untilBuild )
83120 }
84121
85122 signPlugin {
0 commit comments