Skip to content

Commit

Permalink
Merge pull request #2213 from digma-ai/support-242
Browse files Browse the repository at this point in the history
Support 242
  • Loading branch information
shalom938 authored Jun 14, 2024
2 parents 651b9d6 + 8656880 commit d9cc39c
Show file tree
Hide file tree
Showing 20 changed files with 149 additions and 90 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build-workflow:
strategy:
matrix:
profile: [ p231, p232, p233, p241 ]
profile: [ p231, p232, p233, p241, p242 ]
uses: ./.github/workflows/build-workflow.yml
with:
build-profile: ${{ matrix.profile }}
Expand All @@ -20,7 +20,7 @@ jobs:
# plugin-verifier-workflow:
# strategy:
# matrix:
# profile: [ p231, p232, p233, p241 ]
# profile: [ p231, p232, p233, p241, p242 ]
# uses: ./.github/workflows/plugin-verifier-workflow.yml
# with:
# build-profile: ${{ matrix.profile }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build-workflow:
strategy:
matrix:
profile: [ p231, p232, p233, p241 ]
profile: [ p231, p232, p233, p241, p242 ]
uses: ./.github/workflows/build-workflow.yml
with:
build-profile: ${{ matrix.profile }}
Expand All @@ -18,7 +18,7 @@ jobs:
build-workflow-with-rider:
strategy:
matrix:
profile: [ p231, p232, p233, p241 ]
profile: [ p231, p232, p233, p241, p242 ]
uses: ./.github/workflows/build-workflow.yml
with:
build-profile: ${{ matrix.profile }}
Expand All @@ -31,7 +31,7 @@ jobs:
needs: [ build-workflow,build-workflow-with-rider ]
strategy:
matrix:
profile: [ p231, p232, p233, p241 ]
profile: [ p231, p232, p233, p241, p242 ]
uses: ./.github/workflows/plugin-verifier-workflow.yml
with:
build-profile: ${{ matrix.profile }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build-workflow:
strategy:
matrix:
profile: [ p231, p232, p233, p241 ]
profile: [ p231, p232, p233, p241, p242 ]
uses: ./.github/workflows/build-workflow.yml
with:
build-profile: ${{ matrix.profile }}
Expand All @@ -19,7 +19,7 @@ jobs:
build-workflow-with-rider:
strategy:
matrix:
profile: [ p231, p232, p233, p241 ]
profile: [ p231, p232, p233, p241, p242 ]
uses: ./.github/workflows/build-workflow.yml
with:
build-profile: ${{ matrix.profile }}
Expand All @@ -31,7 +31,7 @@ jobs:
needs: [ build-workflow,build-workflow-with-rider ]
strategy:
matrix:
profile: [ p231, p232, p233, p241 ]
profile: [ p231, p232, p233, p241, p242 ]
uses: ./.github/workflows/plugin-verifier-workflow.yml
with:
build-profile: ${{ matrix.profile }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
publish-workflow:
strategy:
matrix:
profile: [ p231, p232, p233, p241 ]
profile: [ p231, p232, p233, p241, p242 ]
uses: ./.github/workflows/publish-workflow.yml
with:
build-profile: ${{ matrix.profile }}
Expand Down
12 changes: 7 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ plugins {
}


//the platformType is determined dynamically based on other property.
//we build with IU,RD,PC,PY etc. we also runIde with different platform type.
//it enables launching different IDEs with different versions and still let the other modules
//compile correctly. most modules always compile with the same platform type.
//see method dynamicPlatformType for details.
//the platformType determines which platform we build with, it may be IC,IU,PC,PY,RD.
//it is a good way for us to test that we don't have leaking usages of classes that exist in one platform
//but don't exist in another.
//this module should be compatible with all IDEs, and thus it should build with IC,IU,RD with no issues.
//the platformType is determined dynamically based on other property,
// we have for example buildWithRider,buildWIthUltimate.
//the other modules either also build with dynamic platform type or always build with the same type.
val platformType: IntelliJPlatformType by extra(dynamicPlatformType(project))


Expand Down
4 changes: 4 additions & 0 deletions building-how-to/build-all-profiles-short.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ for i in {1..5}; do echo; done

echo "############ building with 241 ################"
./gradlew clean buildPlugin -PbuildProfile=p241
for i in {1..5}; do echo; done

echo "############ building with 242 ################"
./gradlew clean buildPlugin -PbuildProfile=p242
7 changes: 6 additions & 1 deletion building-how-to/build-all-profiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ set -e
## check that profile aliases work
./gradlew clean buildPlugin -PbuildProfile=lowest
./gradlew clean buildPlugin -PbuildProfile=latest
#./gradlew clean buildPlugin -PbuildProfile=eap
./gradlew clean buildPlugin -PbuildProfile=eap


./gradlew clean buildPlugin -PbuildProfile=p231
./gradlew clean buildPlugin -PbuildProfile=p232
./gradlew clean buildPlugin -PbuildProfile=p233
./gradlew clean buildPlugin -PbuildProfile=p241
./gradlew clean buildPlugin -PbuildProfile=p242


###################### idea ultimate
Expand All @@ -29,6 +30,7 @@ set -e
./gradlew clean buildPlugin -PbuildWIthUltimate=true -PbuildProfile=p232
./gradlew clean buildPlugin -PbuildWIthUltimate=true -PbuildProfile=p233
./gradlew clean buildPlugin -PbuildWIthUltimate=true -PbuildProfile=p241
./gradlew clean buildPlugin -PbuildWIthUltimate=true -PbuildProfile=p242



Expand All @@ -38,6 +40,7 @@ set -e
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p232
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p233
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p241
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p242

###################### pycharm

Expand All @@ -46,6 +49,7 @@ set -e
#./gradlew clean buildPlugin -PbuildWithPycharm=true -PbuildProfile=p232
#./gradlew clean buildPlugin -PbuildWithPycharm=true -PbuildProfile=p233
#./gradlew clean buildPlugin -PbuildWithPycharm=true -PbuildProfile=p241
#./gradlew clean buildPlugin -PbuildWithPycharm=true -PbuildProfile=p242


###################### pycharm pro
Expand All @@ -55,4 +59,5 @@ set -e
#./gradlew clean buildPlugin -PbuildWithPycharmPro=true -PbuildProfile=p232
#./gradlew clean buildPlugin -PbuildWithPycharmPro=true -PbuildProfile=p233
#./gradlew clean buildPlugin -PbuildWithPycharmPro=true -PbuildProfile=p241
#./gradlew clean buildPlugin -PbuildWithPycharmPro=true -PbuildProfile=p242

9 changes: 6 additions & 3 deletions building-how-to/build-and-verify-all-profiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ set -e
## check that profile aliases work
./gradlew clean buildPlugin verifyPlugin -PbuildProfile=lowest
./gradlew clean buildPlugin verifyPlugin -PbuildProfile=latest
#./gradlew clean buildPlugin verifyPlugin -PbuildProfile=eap

# todo: add 242
./gradlew clean buildPlugin verifyPlugin -PbuildProfile=eap

./gradlew clean buildPlugin verifyPlugin -PbuildProfile=p231
./gradlew clean buildPlugin verifyPlugin -PbuildProfile=p232
./gradlew clean buildPlugin verifyPlugin -PbuildProfile=p233
./gradlew clean buildPlugin verifyPlugin -PbuildProfile=p241
./gradlew clean buildPlugin verifyPlugin -PbuildProfile=p242


###################### idea ultimate
Expand All @@ -28,6 +27,7 @@ set -e
./gradlew clean buildPlugin verifyPlugin -PbuildWIthUltimate=true -PbuildProfile=p232
./gradlew clean buildPlugin verifyPlugin -PbuildWIthUltimate=true -PbuildProfile=p233
./gradlew clean buildPlugin verifyPlugin -PbuildWIthUltimate=true -PbuildProfile=p241
./gradlew clean buildPlugin verifyPlugin -PbuildWIthUltimate=true -PbuildProfile=p242



Expand All @@ -37,6 +37,7 @@ set -e
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p232
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p233
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p241
./gradlew clean buildPlugin -PbuildWithRider=true -PbuildProfile=p242

###################### pycharm

Expand All @@ -45,6 +46,7 @@ set -e
#./gradlew clean buildPlugin -PbuildWithPycharm=true -PbuildProfile=p232
#./gradlew clean buildPlugin -PbuildWithPycharm=true -PbuildProfile=p233
#./gradlew clean buildPlugin -PbuildWithPycharm=true -PbuildProfile=p241
#./gradlew clean buildPlugin -PbuildWithPycharm=true -PbuildProfile=p242


###################### pycharm pro
Expand All @@ -54,4 +56,5 @@ set -e
#./gradlew clean buildPlugin -PbuildWithPycharmPro=true -PbuildProfile=p232
#./gradlew clean buildPlugin -PbuildWithPycharmPro=true -PbuildProfile=p233
#./gradlew clean buildPlugin -PbuildWithPycharmPro=true -PbuildProfile=p241
#./gradlew clean buildPlugin -PbuildWithPycharmPro=true -PbuildProfile=p242

4 changes: 2 additions & 2 deletions building-how-to/building-how-to.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ add new run configurations for the new profile.
as new releases come out, older versions become more difficult to maintain because of API changes or build system changes,
sometimes new releases require changes in gradle build scripts that will not work with older versions.
we try to keep support for as many releases as possible without too much work. if it becomes too difficult to support
older releases we can remove the oldest profiles.
older releases we can remove the oldest profile.
we must support at least 2 versions plus the next EAP.

to remove a profile do the revers of adding a profile.
Expand Down Expand Up @@ -93,7 +93,7 @@ need to map the profile name to a suitable rd-gen version and also support the c
profiles are declared in buildSrc/src/main/kotlin/common/BuildProfile.kt
a profile holds a few properties for the project, mainly platformVersion,riderVersion and more.
data class BuildProfile(
val profile: BuildProfiles.Profiles,
val profile: BuildProfiles.Profile,
val platformVersion: String,
val riderVersion: String,
val pycharmVersion: String,
Expand Down
3 changes: 3 additions & 0 deletions building-how-to/verify-all-profiles-short.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ for i in {1..5}; do echo; done

echo "############ verifyPlugin with 241 ################"
./gradlew clean verifyPlugin -PbuildProfile=p241

echo "############ verifyPlugin with 242 ################"
./gradlew clean verifyPlugin -PbuildProfile=p242
81 changes: 37 additions & 44 deletions common-build-logic/src/main/kotlin/common/BuildProfile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ fun Project.currentProfile(): BuildProfile = BuildProfiles.currentProfile(this)

object BuildProfiles {

enum class Profiles { p231, p232, p233, p241, p242 }
enum class Profile { p231, p232, p233, p241, p242 }

fun Profiles.greaterThan(other:Profiles):Boolean{
fun Profile.greaterThan(other:Profile):Boolean{
val thisNumber = this.name.substring(1).toInt()
val otherNumber = other.name.substring(1).toInt()
return thisNumber > otherNumber
Expand All @@ -89,18 +89,18 @@ object BuildProfiles {
profileToUse = profileAliases[it] as String
}

Profiles.valueOf(profileToUse)
Profile.valueOf(profileToUse)

} ?: Profiles.p231
} ?: Profile.p231

return profiles[selectedProfile] ?: throw GradleException("can not find profile $selectedProfile")
}

//update this list as new profiles are added or removed
private val profileAliases = mapOf(
"lowest" to Profiles.p231.name,
"latest" to Profiles.p241.name,
"eap" to Profiles.p242.name,
"lowest" to Profile.p231.name,
"latest" to Profile.p241.name,
"eap" to Profile.p242.name,
)


Expand All @@ -117,13 +117,18 @@ object BuildProfiles {
//https://www.jetbrains.com/intellij-repository/releases/
//https://www.jetbrains.com/intellij-repository/snapshots/

//the java and kotlin version required for each release is here:
//see https://github.com/JetBrains/intellij-platform-gradle-plugin/blob/92e4348bcc64d6b958f7fb53f043aa61719566ca/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/PlatformJavaVersions.kt
///see https://github.com/JetBrains/intellij-platform-gradle-plugin/blob/92e4348bcc64d6b958f7fb53f043aa61719566ca/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/PlatformKotlinVersions.kt


//see building-how-to/*

Profiles.p231 to BuildProfile(
profile = Profiles.p231,
platformVersion = "2023.1.6",
riderVersion = "2023.1.4",
pycharmVersion = "2023.1.5",
Profile.p231 to BuildProfile(
profile = Profile.p231,
platformVersion = "2023.1.7",
riderVersion = "2023.1.7",
pycharmVersion = "2023.1.7",
riderTargetFramework = "net472",
riderResharperVersionConstant = "PROFILE_2023_1",
platformVersionCode = "231",
Expand All @@ -133,11 +138,11 @@ object BuildProfiles {
javaVersion = JavaVersion.VERSION_17.majorVersion
),

Profiles.p232 to BuildProfile(
profile = Profiles.p232,
platformVersion = "2023.2.6",
riderVersion = "2023.2.3",
pycharmVersion = "2023.2.6",
Profile.p232 to BuildProfile(
profile = Profile.p232,
platformVersion = "2023.2.7",
riderVersion = "2023.2.5",
pycharmVersion = "2023.2.7",
riderTargetFramework = "net472",
riderResharperVersionConstant = "PROFILE_2023_2",
platformVersionCode = "232",
Expand All @@ -148,12 +153,12 @@ object BuildProfiles {
),


Profiles.p233 to BuildProfile(
Profile.p233 to BuildProfile(

profile = Profiles.p233,
platformVersion = "2023.3.4",
riderVersion = "2023.3.3",
pycharmVersion = "2023.3.3",
profile = Profile.p233,
platformVersion = "2023.3.7",
riderVersion = "2023.3.6",
pycharmVersion = "2023.3.7",
riderTargetFramework = "net472",
riderResharperVersionConstant = "PROFILE_2023_2",
platformVersionCode = "233",
Expand All @@ -164,12 +169,12 @@ object BuildProfiles {
),


Profiles.p241 to BuildProfile(
Profile.p241 to BuildProfile(

profile = Profiles.p241,
profile = Profile.p241,
platformVersion = "2024.1.3",
riderVersion = "2024.1.2",
pycharmVersion = "2024.1.2",
riderVersion = "2024.1.3",
pycharmVersion = "2024.1.3",
riderTargetFramework = "net8.0",
riderResharperVersionConstant = "PROFILE_2023_2",
platformVersionCode = "241",
Expand All @@ -181,16 +186,13 @@ object BuildProfiles {



//todo: probably needs java 21, see in intellij plugin PlatformJavaVersions.kt and PlatformKotlinVersions.kt
//see https://github.com/JetBrains/intellij-platform-gradle-plugin/blob/92e4348bcc64d6b958f7fb53f043aa61719566ca/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/PlatformJavaVersions.kt
///see https://github.com/JetBrains/intellij-platform-gradle-plugin/blob/92e4348bcc64d6b958f7fb53f043aa61719566ca/src/main/kotlin/org/jetbrains/intellij/platform/gradle/utils/PlatformKotlinVersions.kt
Profiles.p242 to BuildProfile(
Profile.p242 to BuildProfile(

isEAP = true,
profile = Profiles.p242,
platformVersion = "242-EAP-SNAPSHOT",
riderVersion = "2024.2-SNAPSHOT",
pycharmVersion = "242-EAP-SNAPSHOT",
profile = Profile.p242,
platformVersion = "242.16677-EAP-CANDIDATE-SNAPSHOT",
riderVersion = "2024.2-EAP2-SNAPSHOT",
pycharmVersion = "242.16677-EAP-CANDIDATE-SNAPSHOT",
riderTargetFramework = "net8.0",
riderResharperVersionConstant = "PROFILE_2023_2",
platformVersionCode = "242",
Expand All @@ -204,17 +206,8 @@ object BuildProfiles {

}

/*
* Notes:
* pythonPluginVersion:
* pythonPluginVersion is necessary when building the python module with type=IC, in that case the version needs to be compatible
* with the IC platform version. if building the python module with type=PC then pythonPluginVersion is not relevant.
* building with type=PC means more disk space in GitHub.
* currently we build python with type=PC because matching the pythonPluginVersion and latest EAP build is not always possible,
* sometimes it takes time before there is a compatible python plugin version. and anyway it's easier to just build with PC.
*/
data class BuildProfile(
val profile: BuildProfiles.Profiles,
val profile: BuildProfiles.Profile,
val isEAP: Boolean = false,
val platformVersion: String,
val riderVersion: String,
Expand Down
Loading

0 comments on commit d9cc39c

Please sign in to comment.