Skip to content

Commit

Permalink
Fix windows related bug, fix #7
Browse files Browse the repository at this point in the history
  • Loading branch information
parttimenerd committed Feb 3, 2023
1 parent 597e564 commit 5edd19c
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@

## [Unreleased]

## [0.0.5]

### Fixed
- Fixed plugin logo color
- It was different in the web and in Java renderings
- Fix Windows related issue #7

## [0.0.4]

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ dependencies {
implementation("me.bechberger:jfrtofp:0.0.2-SNAPSHOT") {
isChanging = true
}
implementation("me.bechberger:ap-loader-all:2.9-3")
implementation("me.bechberger:ap-loader-all:2.9-4")
}

tasks.test {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pluginGroup = me.bechberger
pluginName = intellij-profiler-plugin
# SemVer format -> https://semver.org
pluginVersion = 0.0.4
pluginVersion = 0.0.5

# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.intellij.execution.Executor
import com.intellij.icons.AllIcons
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.IconLoader
import one.profiler.AsyncProfilerLoader
import me.bechberger.jfrplugin.util.isAsyncProfilerSupported
import javax.swing.Icon

class APExecutor : Executor() {
Expand Down Expand Up @@ -50,7 +50,7 @@ class APExecutor : Executor() {
}

override fun isApplicable(project: Project): Boolean {
return AsyncProfilerLoader.isSupported()
return isAsyncProfilerSupported()
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.intellij.execution.RunConfigurationExtension
import com.intellij.execution.configurations.JavaParameters
import com.intellij.execution.configurations.RunConfigurationBase
import com.intellij.execution.configurations.RunnerSettings
import one.profiler.AsyncProfilerLoader
import me.bechberger.jfrplugin.util.isAsyncProfilerSupported
import org.jdom.Element

/**
Expand All @@ -21,7 +21,7 @@ class APPluginRunConfigurationExtension : RunConfigurationExtension() {
}

override fun isEnabledFor(configuration: RunConfigurationBase<*>, runnerSettings: RunnerSettings?): Boolean {
return AsyncProfilerLoader.isSupported()
return isAsyncProfilerSupported()
}

override fun <T : RunConfigurationBase<*>> updateJavaParameters(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ import me.bechberger.jfrplugin.config.deleteJFRFile
import me.bechberger.jfrplugin.config.jfrFile
import me.bechberger.jfrplugin.config.jfrVirtualFile
import me.bechberger.jfrplugin.config.profilerConfig
import me.bechberger.jfrplugin.util.isAsyncProfilerSupported
import one.profiler.AsyncProfilerLoader
import org.jetbrains.concurrency.Promise

class APProgramRunner : DefaultJavaProgramRunner() {

override fun canRun(executorId: String, profile: RunProfile): Boolean {
return AsyncProfilerLoader.isSupported() && try {
return isAsyncProfilerSupported() && try {
(
executorId == APExecutor.EXECUTOR_ID &&
profile !is RunConfigurationWithSuppressedDefaultRunAction &&
Expand Down
9 changes: 9 additions & 0 deletions src/main/kotlin/me/bechberger/jfrplugin/util/APUtils.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package me.bechberger.jfrplugin.util

import one.profiler.AsyncProfilerLoader

fun isAsyncProfilerSupported() = try {
AsyncProfilerLoader.isSupported()
} catch (_: Throwable) {
false
}
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<idea-plugin>
<id>me.bechberger.jfrplugin</id>
<name>Java JFR Profiler</name>
<version>0.0.4</version>
<version>0.0.5</version>
<vendor email="[email protected]" url="https://mostlynerdless.de">Johannes Bechberger</vendor>

<change-notes>
Expand Down

0 comments on commit 5edd19c

Please sign in to comment.