Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #130 from bridgecrewio/BCE-38714-Downgrades-for-pl…
Browse files Browse the repository at this point in the history
…atform-support

BCE-38714 - Downgrading for platform support
  • Loading branch information
ChananM authored Sep 19, 2024
2 parents fc611d3 + 46ab536 commit ea65b22
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
</option>
<option name="taskNames">
<list>
<option value="runPluginVerifier" />
<option value="verifyPlugin" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2">
<option name="Gradle.BeforeRunTask" enabled="true" tasks="clean" externalProjectPath="$PROJECT_DIR$" vmOptions="" scriptParameters="" />
</method>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
16 changes: 14 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.intellij.platform.gradle.models.ProductRelease
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Expand Down Expand Up @@ -71,7 +73,7 @@ intellijPlatform {
version = properties("pluginVersion")
ideaVersion {
sinceBuild = properties("pluginSinceBuild")
untilBuild = properties("pluginUntilBuild")
untilBuild = provider { null }
}
val changelog = project.changelog // local variable for configuration cache compatibility
// Get the latest available change notes from the changelog file
Expand All @@ -86,6 +88,16 @@ intellijPlatform {
}
}
}
pluginVerification {
ides {
select {
types = listOf(IntelliJPlatformType.fromCode(properties("platformType")))
channels = listOf(ProductRelease.Channel.RELEASE)
sinceBuild = properties("pluginSinceBuild")
untilBuild = provider { null }
}
}
}
}

// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
Expand Down Expand Up @@ -122,7 +134,7 @@ tasks {
withType<KotlinCompile> {
compilerOptions {
jvmTarget = JvmTarget.fromTarget(it)
apiVersion = KotlinVersion.KOTLIN_2_0
apiVersion = KotlinVersion.KOTLIN_1_8
}
}
}
Expand Down
11 changes: 5 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@
pluginGroup = com.github.bridgecrewio.prismajetbrainsidea
pluginName = Prisma Cloud
pluginVersion=1.0.22
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
# See https://jb.gg/intellij-platform-builds-list for available build versions
pluginVerifierIdeVersions=2020.3.4, 2021.1.3, 2021.2.4, 2024.1.6

platformType = IC
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild=203
pluginUntilBuild=242.*
platformVersion=2024.2.1
platformVersion=2023.3.8
platformDownloadSources = true
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
Expand All @@ -25,7 +21,10 @@ platformBundledPlugins=
kotlin.stdlib.default.dependency = false

# Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3
javaVersion=17
# TODO: Change to 21 on next version
javaVersion=11

# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion=8.10.1

org.gradle.jvmargs=-Xmx1024m "-XX:MaxMetaspaceSize=512m
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# libraries
jackson = "2.17.2"
lombok = "1.18.34"
springWeb = "6.1.12"
springWeb = "5.3.39" # TODO: Change to 6.x.x when moving to Java 17+
commons-io = "2.16.1"
slf4j = "2.0.16"
logback = "1.5.6"
Expand All @@ -15,7 +15,7 @@ junitPlatform = "1.9.0"
# plugins
changelog = "2.2.1"
intelliJPlatform = "2.0.1"
kotlin = "2.0.20"
kotlin = "1.8.22" # TODO: Change to 2.0.x on next version
kover = "0.8.3"
qodana = "0.1.13"

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/bridgecrew/log/LoggerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.components.Service;
import org.slf4j.LoggerFactory;

import java.net.URL;

@Service
Expand All @@ -17,8 +18,8 @@ public String getLogFilePath() {
LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
ch.qos.logback.classic.Logger rootLogger = loggerContext.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
Appender<?> appender = rootLogger.getAppender("FILE");
if (appender instanceof FileAppender<?> fileAppender) {
return fileAppender.getFile();
if (appender instanceof FileAppender) {
return ((FileAppender<?>)appender).getFile();
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ import com.intellij.ide.plugins.PluginStateListener
import com.intellij.openapi.components.service
import com.intellij.openapi.extensions.PluginId
import com.intellij.openapi.project.Project
import com.intellij.openapi.startup.ProjectActivity
import com.intellij.openapi.startup.StartupActivity
import com.intellij.openapi.vfs.LocalFileSystem
import org.slf4j.LoggerFactory
import java.util.*

class PostStartupActivity : ProjectActivity {
class PostStartupActivity : StartupActivity {

private val logger = LoggerFactory.getLogger(javaClass)

override suspend fun execute(project: Project) {
override fun runActivity(project: Project) {
ApplicationServiceUtil.getService(LoggerService::class.java).initializeLogger()
val version = PluginManagerCore.getPlugin(PluginId.getId("com.github.bridgecrewio.prismacloud"))?.version
logger.info("Starting Prisma Cloud JetBrains plugin version $version")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.bridgecrew.ui.actions
import com.bridgecrew.analytics.AnalyticsService
import com.bridgecrew.services.scan.CheckovScanService
import com.intellij.icons.AllIcons
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.Presentation
Expand All @@ -20,9 +19,10 @@ object CheckovScanAction : AnAction(), DumbAware {
presentation.isEnabled = false
}

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}
// TODO: Uncomment when moving to Kotlin 2 + Java 21
// override fun getActionUpdateThread(): ActionUpdateThread {
// return ActionUpdateThread.EDT
// }

override fun actionPerformed(actionEvent: AnActionEvent) {
val project = actionEvent.project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.bridgecrew.ui.actions
import com.bridgecrew.icons.CheckovIcons
import com.bridgecrew.log.LoggerService
import com.bridgecrew.util.ApplicationServiceUtil
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.Presentation
Expand All @@ -22,9 +21,10 @@ class ShowLogFileAction : AnAction(), DumbAware {
presentation.icon = CheckovIcons.showLogsIcon
}

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}
// TODO: Uncomment when moving to Kotlin 2 + Java 21
// override fun getActionUpdateThread(): ActionUpdateThread {
// return ActionUpdateThread.EDT
// }

override fun actionPerformed(event: AnActionEvent) {
val logFilePath = ApplicationServiceUtil.getService(LoggerService::class.java).getLogFilePath()
Expand Down

0 comments on commit ea65b22

Please sign in to comment.