File tree Expand file tree Collapse file tree 4 files changed +26
-4
lines changed
kotlin/com/github/blarc/ai/commits/intellij/plugin Expand file tree Collapse file tree 4 files changed +26
-4
lines changed Original file line number Diff line number Diff line change 22
33## [ Unreleased]
44
5+ ### Fixed
6+
7+ - Make SVN dependency optional.
8+
59## [ 2.11.0] - 2025-04-24
610
711### Added
Original file line number Diff line number Diff line change @@ -100,17 +100,19 @@ object AICommitsUtils {
100100 changes.mapNotNull {
101101 it.virtualFile?.let { virtualFile ->
102102 VcsUtil .getVcsFor(project, virtualFile)?.let { vcs ->
103- when (vcs) {
104- is SvnVcs -> {
103+ when {
104+ isSvnAvailable() && vcs is SvnVcs -> {
105105 SvnUtil .getUrl(vcs, VfsUtilCore .virtualToIoFile(virtualFile))?.let { url ->
106106 extractSvnBranchName(url.toDecodedString())
107107 }
108108 }
109- is GitVcs -> {
109+
110+ vcs is GitVcs -> {
110111 GitRepositoryManager .getInstance(project)
111112 .getRepositoryForFile(it.virtualFile)
112113 ?.currentBranchName
113114 }
115+
114116 else -> {
115117 null
116118 }
@@ -203,4 +205,17 @@ object AICommitsUtils {
203205 fun getIDELocale (): Locale {
204206 return DynamicBundle .getLocale()
205207 }
208+
209+ private fun isClassAvailable (className : String ): Boolean {
210+ return try {
211+ Class .forName(className)
212+ true
213+ } catch (e: ClassNotFoundException ) {
214+ false
215+ }
216+ }
217+
218+ private fun isSvnAvailable (): Boolean {
219+ return isClassAvailable(" org.jetbrains.idea.svn.SvnVcs" ) && isClassAvailable(" org.jetbrains.idea.svn.SvnUtil" )
220+ }
206221}
Original file line number Diff line number Diff line change 6868 Read more: https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html -->
6969 <depends >com.intellij.modules.platform</depends >
7070 <depends >Git4Idea</depends >
71- <depends >Subversion</depends >
71+ <depends optional = " true " config-file = " subversion.xml " >Subversion</depends >
7272
7373 <applicationListeners >
7474
Original file line number Diff line number Diff line change 1+ <idea-plugin >
2+ <!-- This file contains Subversion-specific extensions that will be loaded only when Subversion plugin is available -->
3+ </idea-plugin >
You can’t perform that action at this time.
0 commit comments