diff --git a/.github/workflows/ScalaCI.yml b/.github/workflows/ScalaCI.yml index 7684eac..d280e1e 100644 --- a/.github/workflows/ScalaCI.yml +++ b/.github/workflows/ScalaCI.yml @@ -11,22 +11,29 @@ on: jobs: build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - name: Set up JDK 17 uses: actions/setup-java@v1 with: java-version: 17 - + cache: 'sbt' - name: Build run: sbt compile + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + cache: 'sbt' - name: Check Style run: sbt check - + test: runs-on: ubuntu-latest steps: @@ -35,38 +42,26 @@ jobs: uses: actions/setup-java@v1 with: java-version: 17 - + cache: 'sbt' - name: Test run: sbt test - # - name: Run Test - # if: success() || failure() - # run: sbt coverage test - # - # - name: Aggregate coverage report - # run: sbt coverageAggregate - # - # - name: Upload test coverage report - # run: bash <(curl -s https://codecov.io/bash) - verification: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - name: Set up JDK 17 uses: actions/setup-java@v1 with: java-version: 17 - + cache: 'sbt' - name: Check Binary Compatibility run: sbt runPluginVerifier ci: runs-on: ubuntu-20.04 - needs: [ build, test, verification] + needs: [ build, lint, test, verification] steps: - name: Aggregate outcomes run: echo "build succeeded" diff --git a/.scala-steward.conf b/.scala-steward.conf new file mode 100644 index 0000000..1dfc933 --- /dev/null +++ b/.scala-steward.conf @@ -0,0 +1 @@ +updates.ignore = [ { groupId = "org.scalameta", artifactId = "scalafmt-core" } ] \ No newline at end of file diff --git a/build.sbt b/build.sbt index 1565054..d6a73e3 100644 --- a/build.sbt +++ b/build.sbt @@ -6,11 +6,13 @@ lazy val logbackVersion = "1.4.14" lazy val graphvizVersion = "0.18.1" lazy val joorVersion = "0.9.15" lazy val scalatestVersion = "3.2.16" -lazy val pluginVerifierVersion = "1.301" +lazy val pluginVerifierVersion = "1.305" +lazy val ktVersion = "1.9.10" -// https://youtrack.jetbrains.com/articles/IDEA-A-2100661425/IntelliJ-IDEA-2023.1-Latest-Builds -lazy val intellijVersion = "231.9392.1" -lazy val pluginVersion = s"0.3.0-RC1-$intellijVersion" +// https://youtrack.jetbrains.com/articles/IDEA-A-2100661679/IntelliJ-IDEA-2023.3-Latest-Builds +// NOTE: Latest-Builds 233 +lazy val intellijVersion = "233.11799.241" +lazy val pluginVersion = s"0.3.0-$intellijVersion" ThisBuild / version := pluginVersion @@ -54,8 +56,7 @@ lazy val `sbt-dependency-analyzer` = (project in file(".")) pluginVerifierOptions := pluginVerifierOptions.value.copy( version = pluginVerifierVersion, // use a specific verifier version offline = true, // forbid the verifier from reaching the internet - failureLevels = - Set(FailureLevel.INTERNAL_API_USAGES, FailureLevel.COMPATIBILITY_PROBLEMS, FailureLevel.COMPATIBILITY_WARNINGS) + failureLevels = Set(FailureLevel.COMPATIBILITY_PROBLEMS, FailureLevel.COMPATIBILITY_WARNINGS) ), Global / intellijAttachSources := true, intellijPlugins ++= Seq("com.intellij.java", "com.intellij.java-i18n", "org.intellij.scala").map(_.toPlugin), @@ -74,7 +75,7 @@ lazy val `sbt-dependency-analyzer` = (project in file(".")) "org.jooq" % "joor" % joorVersion, "org.scalatest" %% "scalatest" % scalatestVersion % Test ), - kotlinVersion := "1.9.21", + kotlinVersion := ktVersion, Compile / unmanagedSourceDirectories += baseDirectory.value / "src" / "main" / "kotlin", packageLibraryMappings ++= Seq( "org.jetbrains.kotlin" % ".*" % ".*" -> None, diff --git a/project/Commands.scala b/project/Commands.scala index 5faa4de..04bc597 100644 --- a/project/Commands.scala +++ b/project/Commands.scala @@ -1,10 +1,5 @@ import sbt.Command -/** @author - * 梦境迷离 - * @since 2023/4/25 - * @version 1.0 - */ object Commands { val FmtSbtCommand = Command.command("fmt")(state => "scalafmtSbt" :: "scalafmtAll" :: state) diff --git a/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/DependencyAnalyzerViewImpl.kt b/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/DependencyAnalyzerViewImpl.kt index 2cdfe25..2abf8b0 100644 --- a/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/DependencyAnalyzerViewImpl.kt +++ b/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/DependencyAnalyzerViewImpl.kt @@ -79,7 +79,6 @@ class DependencyAnalyzerViewImpl( private var dependencyScopeFilter by dependencyScopeFilterProperty private var showDependencyWarnings by showDependencyWarningsProperty private var showDependencyGroupId by showDependencyGroupIdProperty - private var showDependencySize by showDependencySizeProperty private var dependencyModel by dependencyModelProperty private var dependency by dependencyProperty @@ -337,7 +336,7 @@ class DependencyAnalyzerViewImpl( ExternalSystemBundle.message("external.system.dependency.analyzer.groupId.show") } val showDependencySizeAction = toggleAction(showDependencySizeProperty).apply { - templatePresentation.text = "Show Size" + templatePresentation.text = SbtDependencyExternalBundle.message("analyzer.external.showSize.name") } val viewOptionsButton = popupActionGroup(showDependencyGroupIdAction, showDependencySizeAction).apply { diff --git a/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/SbtDependencyExternalBundle.kt b/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/SbtDependencyExternalBundle.kt new file mode 100644 index 0000000..fe2df33 --- /dev/null +++ b/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/SbtDependencyExternalBundle.kt @@ -0,0 +1,15 @@ +package bitlap.sbt.analyzer.jbexternal + +import com.intellij.DynamicBundle +import org.jetbrains.annotations.* + +class SbtDependencyExternalBundle : DynamicBundle(BUNDLE) { + companion object { + const val BUNDLE = "messages.SbtPluginExternalBundle" + private val INSTANCE = SbtDependencyExternalBundle() + + @Nls + fun message(@NotNull @PropertyKey(resourceBundle = BUNDLE) key: String, @NotNull vararg params: Any): String = + INSTANCE.getMessage(key, params) + } +} \ No newline at end of file diff --git a/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/package-info.java b/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/package-info.kt similarity index 67% rename from src/main/kotlin/bitlap/sbt/analyzer/jbexternal/package-info.java rename to src/main/kotlin/bitlap/sbt/analyzer/jbexternal/package-info.kt index c2cbd6f..635fb20 100644 --- a/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/package-info.java +++ b/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/package-info.kt @@ -1,8 +1,6 @@ +package bitlap.sbt.analyzer.jbexternal + /** * NOTE: Kotlin code can only be referenced and cannot refer to code in src/main/scala * The code for this package is almost copied from https://github.com/JetBrains/intellij-community - * - * @author 梦境迷离 - * @version 1.0, 2023/10/7 */ -package bitlap.sbt.analyzer.jbexternal; diff --git a/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/util/ExternalProjectUiUtil.kt b/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/util/ExternalProjectUiUtil.kt index 820d143..ceddae1 100644 --- a/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/util/ExternalProjectUiUtil.kt +++ b/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/util/ExternalProjectUiUtil.kt @@ -33,10 +33,10 @@ internal class ExternalProjectSelector( } init { - val dropDownLink = ExternalProjectDropDownLink(property, externalProjects) - .apply { border = JBUI.Borders.empty(BORDER, ICON_TEXT_GAP / 2, BORDER, BORDER) } - val label = JLabel(projectIcon) - .apply { border = JBUI.Borders.empty(BORDER, BORDER, BORDER, ICON_TEXT_GAP / 2) } + val dropDownLink = ExternalProjectDropDownLink(property, externalProjects).apply { + border = JBUI.Borders.empty(BORDER, ICON_TEXT_GAP / 2, BORDER, BORDER) + } + val label = JLabel(projectIcon).apply { border = JBUI.Borders.empty(BORDER, BORDER, BORDER, ICON_TEXT_GAP / 2) } .apply { labelFor = dropDownLink } layout = com.intellij.ide.plugins.newui.HorizontalLayout(0) @@ -46,14 +46,11 @@ internal class ExternalProjectSelector( } private fun createPopup( - externalProjects: List, - onChange: (DependencyAnalyzerProject) -> Unit + externalProjects: List, onChange: (DependencyAnalyzerProject) -> Unit ): JBPopup { - val content = ExternalProjectPopupContent(externalProjects) - .apply { whenMousePressed { onChange(selectedValue) } } - return JBPopupFactory.getInstance() - .createComponentPopupBuilder(content, null) - .createPopup() + val content = + ExternalProjectPopupContent(externalProjects).apply { whenMousePressed { onChange(selectedValue) } } + return JBPopupFactory.getInstance().createComponentPopupBuilder(content, null).createPopup() .apply { content.whenMousePressed(listener = ::closeOk) } } @@ -77,32 +74,22 @@ internal class ExternalProjectSelector( isSelected: Boolean, cellHasFocus: Boolean ): Component { - return JLabel() - .apply { if (value != null) icon = projectIcon } - .apply { if (value != null) text = value.title } - .apply { border = emptyListCellBorder(list, index) } + return JLabel().apply { if (value != null) icon = projectIcon } + .apply { if (value != null) text = value.title }.apply { border = emptyListCellBorder(list, index) } .apply { iconTextGap = JBUI.scale(ICON_TEXT_GAP) } .apply { background = if (isSelected) list.selectionBackground else list.background } .apply { foreground = if (isSelected) list.selectionForeground else list.foreground } - .apply { isOpaque = true } - .apply { isEnabled = list.isEnabled } - .apply { font = list.font } + .apply { isOpaque = true }.apply { isEnabled = list.isEnabled }.apply { font = list.font } } } private inner class ExternalProjectDropDownLink( property: ObservableMutableProperty, externalProjects: List, - ) : DropDownLink( - property.get(), - { createPopup(externalProjects, it::selectedItem.setter) } - ) { - override fun popupPoint() = - super.popupPoint() - .apply { x += insets.left } - .apply { x -= JBUI.scale(BORDER) } - .apply { x -= projectIcon.iconWidth } - .apply { x -= JBUI.scale(ICON_TEXT_GAP) } + ) : DropDownLink(property.get(), + { createPopup(externalProjects, it::selectedItem.setter) }) { + override fun popupPoint() = super.popupPoint().apply { x += insets.left }.apply { x -= JBUI.scale(BORDER) } + .apply { x -= projectIcon.iconWidth }.apply { x -= JBUI.scale(ICON_TEXT_GAP) } override fun itemToString(item: DependencyAnalyzerProject?): String = when (item) { null -> ExternalSystemBundle.message("external.system.dependency.analyzer.projects.empty") diff --git a/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/util/ScopeUiUtil.kt b/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/util/ScopeUiUtil.kt index 4a6fcc2..4afe821 100644 --- a/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/util/ScopeUiUtil.kt +++ b/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/util/ScopeUiUtil.kt @@ -1,9 +1,13 @@ // Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package bitlap.sbt.analyzer.jbexternal.util -import org.apache.commons.lang.StringUtils import java.awt.Component -import javax.swing.* +import javax.swing.JCheckBox +import javax.swing.JLabel +import javax.swing.JList +import javax.swing.JPanel +import javax.swing.ListCellRenderer +import javax.swing.ListSelectionModel import com.intellij.ide.nls.NlsMessages import com.intellij.openapi.externalSystem.dependency.analyzer.DependencyAnalyzerDependency.Scope @@ -12,10 +16,10 @@ import com.intellij.openapi.observable.properties.GraphProperty import com.intellij.openapi.observable.properties.ObservableMutableProperty import com.intellij.openapi.observable.properties.PropertyGraph import com.intellij.openapi.observable.util.bind -import com.intellij.openapi.ui.popup.JBPopup -import com.intellij.openapi.ui.popup.JBPopupFactory import com.intellij.openapi.observable.util.whenItemSelected import com.intellij.openapi.observable.util.whenMousePressed +import com.intellij.openapi.ui.popup.JBPopup +import com.intellij.openapi.ui.popup.JBPopupFactory import com.intellij.openapi.util.NlsSafe import com.intellij.ui.ListUtil import com.intellij.ui.components.DropDownLink @@ -26,11 +30,12 @@ import com.intellij.util.ui.ThreeStateCheckBox @Suppress("DEPRECATION") internal class SearchScopeSelector(property: ObservableMutableProperty>) : JPanel() { init { - val dropDownLink = SearchScopeDropDownLink(property) - .apply { border = JBUI.Borders.empty(BORDER, ICON_TEXT_GAP / 2, BORDER, BORDER) } - val label = JLabel(ExternalSystemBundle.message("external.system.dependency.analyzer.scope.label")) - .apply { border = JBUI.Borders.empty(BORDER, BORDER, BORDER, ICON_TEXT_GAP / 2) } - .apply { labelFor = dropDownLink } + val dropDownLink = SearchScopeDropDownLink(property).apply { + border = JBUI.Borders.empty(BORDER, ICON_TEXT_GAP / 2, BORDER, BORDER) + } + val label = JLabel(ExternalSystemBundle.message("external.system.dependency.analyzer.scope.label")).apply { + border = JBUI.Borders.empty(BORDER, BORDER, BORDER, ICON_TEXT_GAP / 2) + }.apply { labelFor = dropDownLink } layout = com.intellij.ide.plugins.newui.HorizontalLayout(0) border = JBUI.Borders.empty() @@ -102,40 +107,27 @@ private class SearchScopePopupContent(scopes: List) : JBList, onChange: (List) -> Unit): JBPopup { val content = SearchScopePopupContent(scopes) content.afterChange(onChange) - return JBPopupFactory.getInstance() - .createComponentPopupBuilder(content, null) - .createPopup() + return JBPopupFactory.getInstance().createComponentPopupBuilder(content, null).createPopup() } } } private class SearchScopePropertyRenderer : ListCellRenderer { override fun getListCellRendererComponent( - list: JList, - value: ScopeProperty, - index: Int, - isSelected: Boolean, - cellHasFocus: Boolean + list: JList, value: ScopeProperty, index: Int, isSelected: Boolean, cellHasFocus: Boolean ): Component { val checkBox = when (value) { - is ScopeProperty.Any -> - ThreeStateCheckBox(ExternalSystemBundle.message("external.system.dependency.analyzer.scope.any")) - .apply { isThirdStateEnabled = false } - .apply { state = value.property.get() } - .bind(value.property) - - is ScopeProperty.Just -> - JCheckBox(value.scope.title) - .apply { this@apply.isSelected = value.property.get() } - .bind(value.property) + is ScopeProperty.Any -> ThreeStateCheckBox(ExternalSystemBundle.message("external.system.dependency.analyzer.scope.any")).apply { + isThirdStateEnabled = false + }.apply { state = value.property.get() }.bind(value.property) + + is ScopeProperty.Just -> JCheckBox(value.scope.title).apply { this@apply.isSelected = value.property.get() } + .bind(value.property) } - return checkBox - .apply { border = emptyListCellBorder(list, index, if (index > 0) 1 else 0) } + return checkBox.apply { border = emptyListCellBorder(list, index, if (index > 0) 1 else 0) } .apply { background = if (isSelected) list.selectionBackground else list.background } .apply { foreground = if (isSelected) list.selectionForeground else list.foreground } - .apply { isOpaque = true } - .apply { isEnabled = list.isEnabled } - .apply { font = list.font } + .apply { isOpaque = true }.apply { isEnabled = list.isEnabled }.apply { font = list.font } } } @@ -143,11 +135,8 @@ private class SearchScopeDropDownLink( property: ObservableMutableProperty> ) : DropDownLink>( property.get(), - { SearchScopePopupContent.createPopup(property.get(), it::selectedItem.setter) } -) { - override fun popupPoint() = - super.popupPoint() - .apply { x += insets.left } + { SearchScopePopupContent.createPopup(property.get(), it::selectedItem.setter) }) { + override fun popupPoint() = super.popupPoint().apply { x += insets.left } override fun itemToString(item: List): @NlsSafe String { return when { @@ -155,7 +144,7 @@ private class SearchScopeDropDownLink( !item.any { it.isSelected } -> ExternalSystemBundle.message("external.system.dependency.analyzer.scope.none") else -> { val scopes = item.filter { it.isSelected }.map { it.scope.title } - StringUtils.abbreviate(NlsMessages.formatNarrowAndList(scopes), 30) + abbreviate(NlsMessages.formatNarrowAndList(scopes), 30) } } } @@ -169,8 +158,7 @@ private class SearchScopeDropDownLink( } internal class ScopeItem( - val scope: Scope, - val isSelected: Boolean + val scope: Scope, val isSelected: Boolean ) { override fun toString() = "$isSelected: $scope" } diff --git a/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/util/StringUtils.kt b/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/util/StringUtils.kt new file mode 100644 index 0000000..23a6021 --- /dev/null +++ b/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/util/StringUtils.kt @@ -0,0 +1,55 @@ +package bitlap.sbt.analyzer.jbexternal.util + +import org.apache.commons.lang3.StringUtils + +/** + * Copy from commons-lang3 [[org.apache.commons.lang.StringUtils]] + */ +fun abbreviate(str: String, maxWidth: Int): String { + return abbreviate(str, "...", 0, maxWidth) +} + +fun abbreviate(str: String, abbrevMarker: String, maxWidth: Int): String { + return abbreviate(str, abbrevMarker, 0, maxWidth) +} + +fun abbreviate(str: String, abbrevMarker: String, stringOffset: Int, maxWidth: Int): String { + var offset = stringOffset + return if (StringUtils.isNotEmpty(str) && "" == abbrevMarker && maxWidth > 0) { + StringUtils.substring(str, 0, maxWidth) + } else if (StringUtils.isAnyEmpty(str, abbrevMarker)) { + str + } else { + val abbrevMarkerLength = abbrevMarker.length + val minAbbrevWidth = abbrevMarkerLength + 1 + val minAbbrevWidthOffset = abbrevMarkerLength + abbrevMarkerLength + 1 + if (maxWidth < minAbbrevWidth) { + throw IllegalArgumentException(String.format("Minimum abbreviation width is %d", minAbbrevWidth)) + } else { + val strLen = str.length + if (strLen <= maxWidth) { + str + } else { + if (offset > strLen) { + offset = strLen + } + if (strLen - offset < maxWidth - abbrevMarkerLength) { + offset = strLen - (maxWidth - abbrevMarkerLength) + } + if (offset <= abbrevMarkerLength + 1) { + str.substring(0, maxWidth - abbrevMarkerLength) + abbrevMarker + } else if (maxWidth < minAbbrevWidthOffset) { + throw IllegalArgumentException( + String.format( + "Minimum abbreviation width with offset is %d", minAbbrevWidthOffset + ) + ) + } else { + if (offset + maxWidth - abbrevMarkerLength < strLen) abbrevMarker + abbreviate( + str.substring(offset), abbrevMarker, maxWidth - abbrevMarkerLength + ) else abbrevMarker + str.substring(strLen - (maxWidth - abbrevMarkerLength)) + } + } + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/util/UiUtils.kt b/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/util/UiUtils.kt index 0328c2e..ff95b13 100644 --- a/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/util/UiUtils.kt +++ b/src/main/kotlin/bitlap/sbt/analyzer/jbexternal/util/UiUtils.kt @@ -37,7 +37,8 @@ import com.intellij.util.ui.components.BorderLayoutPanel import com.intellij.util.ui.tree.TreeUtil -internal val PROJECT_ICON: Icon = IconLoader.getIcon("/icons/sbt_dependency_analyzer.svg", DependencyAnalyzerManager::class.java) +internal val PROJECT_ICON: Icon = + IconLoader.getIcon("/icons/sbt_dependency_analyzer.svg", DependencyAnalyzerManager::class.java) internal const val BORDER = 6 internal const val INDENT = 16 internal const val ICON_TEXT_GAP = 4 @@ -122,18 +123,17 @@ internal fun popupActionGroup(vararg actions: AnAction) = DefaultActionGroup(*ac internal fun AnAction.asActionButton(place: String) = ActionButton(this, templatePresentation.clone(), place, ActionToolbar.DEFAULT_MINIMUM_BUTTON_SIZE).apply { - border = JBUI.Borders.empty(ACTION_BORDER) - } + border = JBUI.Borders.empty(ACTION_BORDER) + } internal fun separator() = JLabel(AllIcons.General.Divider).apply { border = JBUI.Borders.empty(ACTION_BORDER) } .apply { font = JBUI.Fonts.toolbarSmallComboBoxFont() } internal fun expandTreeAction(tree: JTree) = action { TreeUtil.expandAll(tree) }.apply { - templatePresentation.text = - ExternalSystemBundle.message("external.system.dependency.analyzer.resolved.tree.expand") - }.apply { templatePresentation.icon = AllIcons.Actions.Expandall } + templatePresentation.text = ExternalSystemBundle.message("external.system.dependency.analyzer.resolved.tree.expand") +}.apply { templatePresentation.icon = AllIcons.Actions.Expandall } internal fun collapseTreeAction(tree: JTree) = action { TreeUtil.collapseAll(tree, 0) }.apply { - templatePresentation.text = - ExternalSystemBundle.message("external.system.dependency.analyzer.resolved.tree.collapse") - }.apply { templatePresentation.icon = AllIcons.Actions.Collapseall } + templatePresentation.text = + ExternalSystemBundle.message("external.system.dependency.analyzer.resolved.tree.collapse") +}.apply { templatePresentation.icon = AllIcons.Actions.Collapseall } diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 0196f8e..f4d2fdb 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -2,10 +2,12 @@ org.bitlap.sbtDependencyAnalyzer Sbt Dependency Analyzer - 0.3.0-RC1-231.9392.1 + 0.3.0-233.11799.241 Bitlap - + + + com.intellij.modules.platform com.intellij.modules.lang @@ -126,11 +128,18 @@ 0.3.0-233.11799.241 +
    +
  • Support idea 2023.3.
  • +
+ +

0.3.0-RC1-231.9392.1

    -
  • Add sdap.sbt to .git/info/exclude file.
  • +
  • Add `sdap.sbt` to .git/info/exclude file.
  • Add Show Size to show jar package size.
  • -
  • Add shortcuts to open the analysis view: Ctrl + Shift + L.
  • +
  • Add shortcuts to open the analysis view: `Ctrl + Shift + L`.
diff --git a/src/main/resources/messages/SbtPluginExternalBundle.properties b/src/main/resources/messages/SbtPluginExternalBundle.properties new file mode 100644 index 0000000..e74f863 --- /dev/null +++ b/src/main/resources/messages/SbtPluginExternalBundle.properties @@ -0,0 +1 @@ +analyzer.external.showSize.name=Show Size \ No newline at end of file diff --git a/src/main/scala/bitlap/sbt/analyzer/Constants.scala b/src/main/scala/bitlap/sbt/analyzer/Constants.scala index 0104101..fb013b5 100644 --- a/src/main/scala/bitlap/sbt/analyzer/Constants.scala +++ b/src/main/scala/bitlap/sbt/analyzer/Constants.scala @@ -2,29 +2,25 @@ package bitlap.sbt.analyzer import scala.concurrent.duration.* -/** @author - * 梦境迷离 - * @version 1.0,2023/8/10 - */ object Constants: - final val Separator: String = "/" - final val LineSeparator: String = "\n" + final val SEPARATOR: String = "/" + final val LINE_SEPARATOR: String = "\n" - final val ColonSeparator: String = ":" - final val EmptyString: String = "" + final val ARTIFACT_SEPARATOR: String = ":" + final val EMPTY_STRING: String = "" - final val SingleSbtModule = "__Single_Module__" - final val RootSbtModule = "__Root_Module__" + final val SINGLE_SBT_MODULE = "__Single_Module__" + final val ROOT_SBT_MODULE = "__Root_Module__" - final val Project = "project" + final val PROJECT = "project" - final val Protobuf = "protobuf" + final val PROTOBUF = "protobuf" - final val Timeout = 10.minutes + final val TIMEOUT = 10.minutes - final val IntervalTimeout = 1010.milliseconds + final val INTERVAL_TIMEOUT = 1010.milliseconds - final val ChangeNotesSeparator = "" + final val CHANGE_NOTES_SEPARATOR = "" end Constants diff --git a/src/main/scala/bitlap/sbt/analyzer/DependencyScopeEnum.scala b/src/main/scala/bitlap/sbt/analyzer/DependencyScopeEnum.scala index 0804308..5286af0 100644 --- a/src/main/scala/bitlap/sbt/analyzer/DependencyScopeEnum.scala +++ b/src/main/scala/bitlap/sbt/analyzer/DependencyScopeEnum.scala @@ -1,9 +1,5 @@ package bitlap.sbt.analyzer -/** @author - * 梦境迷离 - * @version 1.0,2023/8/3 - */ enum DependencyScopeEnum: // see https://github.com/JetBrains/intellij-scala/blob/idea232.x/sbt/sbt-impl/src/org/jetbrains/sbt/language/utils/SbtDependencyCommon.scala case Compile, Provided, Test diff --git a/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerConfigurable.scala b/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerConfigurable.scala index 7c401a9..b5d3613 100644 --- a/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerConfigurable.scala +++ b/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerConfigurable.scala @@ -6,10 +6,6 @@ import com.intellij.openapi.options.* import com.intellij.openapi.options.Configurable.Composite import com.intellij.openapi.project.Project -/** @author - * 梦境迷离 - * @version 1.0,2023/9/7 - */ final class SbtDependencyAnalyzerConfigurable(project: Project) extends SearchableConfigurable { // create a ui form diff --git a/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerContributor.scala b/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerContributor.scala index 06eb946..07a7596 100644 --- a/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerContributor.scala +++ b/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerContributor.scala @@ -39,10 +39,6 @@ import com.intellij.openapi.project.Project import kotlin.jvm.functions -/** @author - * 梦境迷离 - * @version 1.0,2023/8/1 - */ final class SbtDependencyAnalyzerContributor(project: Project) extends DependencyAnalyzerContributor { import SbtDependencyAnalyzerContributor.* @@ -228,7 +224,7 @@ final class SbtDependencyAnalyzerContributor(project: Project) extends Dependenc // we don't actively delete configurations val settingsState = SettingsState.getSettings(project) val org = settingsState.organization - if (org != null && org != Constants.EmptyString) { + if (org != null && org != Constants.EMPTY_STRING) { return org } @@ -260,7 +256,7 @@ final class SbtDependencyAnalyzerContributor(project: Project) extends Dependenc private def getOrRefreshData(moduleData: ModuleData): JList[DependencyScopeNode] = // use to link dependencies between modules. // obtain the mapping of module name to file path. - if (moduleData.getModuleName == Constants.Project) return Collections.emptyList() + if (moduleData.getModuleName == Constants.PROJECT) return Collections.emptyList() val result = configurationNodesMap.computeIfAbsent( moduleData.getLinkedExternalProjectPath, diff --git a/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerPanel.form b/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerPanel.form index 0638bfa..4e87957 100644 --- a/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerPanel.form +++ b/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerPanel.form @@ -1,17 +1,25 @@
- - + + + + + + + + + + - + - + - + @@ -20,84 +28,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + - + + + + - + + + + + - + - + + + + + + + + diff --git a/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerPanel.java b/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerPanel.java index 21bf850..c43c1ca 100644 --- a/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerPanel.java +++ b/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerPanel.java @@ -2,16 +2,15 @@ import bitlap.sbt.analyzer.util.Notifications$; import com.intellij.openapi.project.Project; -import com.intellij.uiDesigner.core.GridConstraints; -import com.intellij.uiDesigner.core.GridLayoutManager; import com.intellij.uiDesigner.core.Spacer; +import com.jgoodies.forms.layout.CellConstraints; +import com.jgoodies.forms.layout.FormLayout; import javax.swing.*; import java.awt.*; /** - * @author 梦境迷离 - * @version 1.0, 2023/9/8 + * TODO create panel by kotlin DSL */ @SuppressWarnings("unchecked") public class SbtDependencyAnalyzerPanel { @@ -34,7 +33,7 @@ boolean isModified() { boolean disableAnalyzeCompile = settings.getDisableAnalyzeCompile() == compileCheckBox.isSelected(); boolean disableAnalyzeTest = settings.getDisableAnalyzeTest() == testCheckBox.isSelected(); boolean disableAnalyzeProvided = settings.getDisableAnalyzeProvided() == providedCheckBox.isSelected(); - boolean fileCacheTimeout = String.valueOf(settings.fileCacheTimeout()).equals(fileCache.getText()); + boolean fileCacheTimeout = String.valueOf(settings.fileCacheTimeout()).equals(fileCache.getText()); boolean org = settings.getOrganization() == null && organization.getText() == null || (organization.getText() != null && organization.getText().equals(settings.getOrganization())); @@ -90,46 +89,76 @@ void from() { */ private void $$$setupUI$$$() { mainPanel = new JPanel(); - mainPanel.setLayout(new GridLayoutManager(4, 4, new Insets(0, 0, 0, 0), 0, 0, true, false)); + mainPanel.setLayout(new FormLayout("fill:d:grow,fill:d:grow,fill:d:grow,fill:d:grow,fill:d:grow", "center:max(d;4px):noGrow,center:32px:noGrow,center:max(d;4px):noGrow,center:12px:grow")); mainPanel.setAlignmentX(0.0f); mainPanel.setAlignmentY(0.0f); mainPanel.setAutoscrolls(false); - mainPanel.setMaximumSize(new Dimension(-1, -1)); + mainPanel.setMaximumSize(new Dimension(400, 120)); mainPanel.setMinimumSize(new Dimension(-1, -1)); - mainPanel.setPreferredSize(new Dimension(600, 120)); + mainPanel.setPreferredSize(new Dimension(350, 120)); final JLabel label1 = new JLabel(); + label1.setMaximumSize(new Dimension(80, 30)); + label1.setMinimumSize(new Dimension(-1, -1)); + label1.setPreferredSize(new Dimension(80, 30)); label1.setText("Disable Scope:"); - mainPanel.add(label1, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + CellConstraints cc = new CellConstraints(); + mainPanel.add(label1, cc.xy(1, 3)); final JLabel label2 = new JLabel(); + label2.setMaximumSize(new Dimension(80, 30)); + label2.setMinimumSize(new Dimension(-1, -1)); + label2.setPreferredSize(new Dimension(80, 30)); label2.setText("Organization:"); - mainPanel.add(label2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + mainPanel.add(label2, cc.xy(1, 2)); testCheckBox = new JCheckBox(); + testCheckBox.setMaximumSize(new Dimension(60, 25)); + testCheckBox.setMinimumSize(new Dimension(-1, -1)); + testCheckBox.setPreferredSize(new Dimension(60, 25)); testCheckBox.setText("Test"); - mainPanel.add(testCheckBox, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + mainPanel.add(testCheckBox, cc.xy(2, 3)); compileCheckBox = new JCheckBox(); + compileCheckBox.setMaximumSize(new Dimension(60, 25)); + compileCheckBox.setMinimumSize(new Dimension(-1, -1)); + compileCheckBox.setPreferredSize(new Dimension(60, 25)); compileCheckBox.setText("Compile"); - mainPanel.add(compileCheckBox, new GridConstraints(2, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + mainPanel.add(compileCheckBox, cc.xy(3, 3)); providedCheckBox = new JCheckBox(); + providedCheckBox.setMaximumSize(new Dimension(60, 25)); + providedCheckBox.setMinimumSize(new Dimension(-1, -1)); + providedCheckBox.setPreferredSize(new Dimension(60, 25)); providedCheckBox.setText("Provided"); - mainPanel.add(providedCheckBox, new GridConstraints(2, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + mainPanel.add(providedCheckBox, cc.xy(4, 3)); final JLabel label3 = new JLabel(); + label3.setMaximumSize(new Dimension(80, 30)); + label3.setMinimumSize(new Dimension(-1, -1)); + label3.setPreferredSize(new Dimension(80, 30)); label3.setText("File Cache Timeout:"); - mainPanel.add(label3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + mainPanel.add(label3, cc.xy(1, 1)); fileCache = new JTextField(); - fileCache.setColumns(4); + fileCache.setColumns(8); fileCache.setHorizontalAlignment(2); + fileCache.setMaximumSize(new Dimension(112, 30)); + fileCache.setMinimumSize(new Dimension(-1, -1)); + fileCache.setPreferredSize(new Dimension(112, 30)); fileCache.setText("3600"); - mainPanel.add(fileCache, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + mainPanel.add(fileCache, cc.xy(2, 1, CellConstraints.FILL, CellConstraints.DEFAULT)); organization = new JTextField(); - organization.setColumns(12); + organization.setColumns(8); organization.setHorizontalAlignment(2); + organization.setMaximumSize(new Dimension(112, 30)); + organization.setMinimumSize(new Dimension(-1, -1)); + organization.setPreferredSize(new Dimension(112, 30)); organization.setText(""); - mainPanel.add(organization, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + mainPanel.add(organization, cc.xy(2, 2)); final JLabel label4 = new JLabel(); + label4.setMaximumSize(new Dimension(60, 30)); + label4.setMinimumSize(new Dimension(-1, -1)); + label4.setPreferredSize(new Dimension(60, 30)); label4.setText("seconds"); - mainPanel.add(label4, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + mainPanel.add(label4, cc.xy(3, 1, CellConstraints.FILL, CellConstraints.DEFAULT)); final Spacer spacer1 = new Spacer(); - mainPanel.add(spacer1, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + mainPanel.add(spacer1, cc.xyw(1, 4, 4, CellConstraints.CENTER, CellConstraints.FILL)); + final Spacer spacer2 = new Spacer(); + mainPanel.add(spacer2, cc.xywh(5, 1, 1, 4, CellConstraints.FILL, CellConstraints.DEFAULT)); } /** diff --git a/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerPlugin.scala b/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerPlugin.scala index 918ec11..d991555 100644 --- a/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerPlugin.scala +++ b/src/main/scala/bitlap/sbt/analyzer/SbtDependencyAnalyzerPlugin.scala @@ -4,10 +4,6 @@ import com.intellij.ide.plugins.IdeaPluginDescriptor import com.intellij.ide.plugins.PluginManagerCore import com.intellij.openapi.extensions.PluginId -/** @author - * 梦境迷离 - * @version 1.0,2023/9/1 - */ object SbtDependencyAnalyzerPlugin { val PLUGIN_ID = "org.bitlap.sbtDependencyAnalyzer" diff --git a/src/main/scala/bitlap/sbt/analyzer/SettingsState.scala b/src/main/scala/bitlap/sbt/analyzer/SettingsState.scala index 4397e0f..3336987 100644 --- a/src/main/scala/bitlap/sbt/analyzer/SettingsState.scala +++ b/src/main/scala/bitlap/sbt/analyzer/SettingsState.scala @@ -19,10 +19,6 @@ import com.intellij.util.xmlb.annotations.Transient import kotlin.jvm.Volatile -/** @author - * 梦境迷离 - * @version 1.0,2023/9/7 - */ @State(name = "SbtDependencyAnalyzer.Settings", storages = Array(new Storage("bitlap.sbt.dependency.analyzer.xml"))) final class SettingsState extends PersistentStateComponent[SettingsState] { diff --git a/src/main/scala/bitlap/sbt/analyzer/action/BaseRefreshDependenciesAction.scala b/src/main/scala/bitlap/sbt/analyzer/action/BaseRefreshDependenciesAction.scala index 50e0195..1c8bc1b 100644 --- a/src/main/scala/bitlap/sbt/analyzer/action/BaseRefreshDependenciesAction.scala +++ b/src/main/scala/bitlap/sbt/analyzer/action/BaseRefreshDependenciesAction.scala @@ -10,10 +10,6 @@ import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskType import com.intellij.openapi.externalSystem.service.internal.ExternalSystemProcessingManager import com.intellij.openapi.project.* -/** @author - * 梦境迷离 - * @version 1.0,2023/9/5 - */ abstract class BaseRefreshDependenciesAction extends DumbAwareAction() { lazy val eventText: String diff --git a/src/main/scala/bitlap/sbt/analyzer/action/SbtDependencyAnalyzerAction.scala b/src/main/scala/bitlap/sbt/analyzer/action/SbtDependencyAnalyzerAction.scala index ebcd380..245fcb3 100644 --- a/src/main/scala/bitlap/sbt/analyzer/action/SbtDependencyAnalyzerAction.scala +++ b/src/main/scala/bitlap/sbt/analyzer/action/SbtDependencyAnalyzerAction.scala @@ -17,10 +17,6 @@ import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil import com.intellij.openapi.externalSystem.view.* import com.intellij.openapi.module.Module -/** @author - * 梦境迷离 - * @version 1.0,2023/8/1 - */ final class ViewDependencyAnalyzerAction extends AbstractSbtDependencyAnalyzerAction[ExternalSystemNode[?]]: getTemplatePresentation.setText(SbtDependencyAnalyzerBundle.message("analyzer.action.name")) diff --git a/src/main/scala/bitlap/sbt/analyzer/action/SbtDependencyAnalyzerGoToAction.scala b/src/main/scala/bitlap/sbt/analyzer/action/SbtDependencyAnalyzerGoToAction.scala index 9096c44..e43e110 100644 --- a/src/main/scala/bitlap/sbt/analyzer/action/SbtDependencyAnalyzerGoToAction.scala +++ b/src/main/scala/bitlap/sbt/analyzer/action/SbtDependencyAnalyzerGoToAction.scala @@ -66,7 +66,7 @@ final class SbtDependencyAnalyzerGoToAction extends DependencyAnalyzerGoToAction if ( DependencyScopeEnum.values.exists(d => d.toString - .toLowerCase() == dc.getCoordinates.getVersion.toLowerCase || Constants.Protobuf == dc.getCoordinates.getVersion.toLowerCase + .toLowerCase() == dc.getCoordinates.getVersion.toLowerCase || Constants.PROTOBUF == dc.getCoordinates.getVersion.toLowerCase ) ) { dc.getCoordinates.getArtifactId == coordinates.getArtifactId && dc.getCoordinates.getGroupId == coordinates.getGroupId diff --git a/src/main/scala/bitlap/sbt/analyzer/action/SbtRefreshDependenciesAction.scala b/src/main/scala/bitlap/sbt/analyzer/action/SbtRefreshDependenciesAction.scala index fad8282..1f9fbb4 100644 --- a/src/main/scala/bitlap/sbt/analyzer/action/SbtRefreshDependenciesAction.scala +++ b/src/main/scala/bitlap/sbt/analyzer/action/SbtRefreshDependenciesAction.scala @@ -11,10 +11,6 @@ import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.externalSystem.importing.ImportSpecBuilder import com.intellij.openapi.externalSystem.util.ExternalSystemUtil -/** @author - * 梦境迷离 - * @version 1.0,2023/8/23 - */ final class SbtRefreshDependenciesAction extends BaseRefreshDependenciesAction: override lazy val eventText: String = SbtDependencyAnalyzerBundle.message("analyzer.refresh.dependencies.text") diff --git a/src/main/scala/bitlap/sbt/analyzer/action/SbtRefreshSnapshotDependenciesAction.scala b/src/main/scala/bitlap/sbt/analyzer/action/SbtRefreshSnapshotDependenciesAction.scala index 1d8d702..e24865a 100644 --- a/src/main/scala/bitlap/sbt/analyzer/action/SbtRefreshSnapshotDependenciesAction.scala +++ b/src/main/scala/bitlap/sbt/analyzer/action/SbtRefreshSnapshotDependenciesAction.scala @@ -10,10 +10,6 @@ import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.externalSystem.importing.ImportSpecBuilder import com.intellij.openapi.externalSystem.util.ExternalSystemUtil -/** @author - * 梦境迷离 - * @version 1.0,2023/8/23 - */ final class SbtRefreshSnapshotDependenciesAction extends BaseRefreshDependenciesAction: override lazy val eventText: String = diff --git a/src/main/scala/bitlap/sbt/analyzer/activity/BaseProjectActivity.scala b/src/main/scala/bitlap/sbt/analyzer/activity/BaseProjectActivity.scala index 9d10190..0734bc5 100644 --- a/src/main/scala/bitlap/sbt/analyzer/activity/BaseProjectActivity.scala +++ b/src/main/scala/bitlap/sbt/analyzer/activity/BaseProjectActivity.scala @@ -6,10 +6,6 @@ import com.intellij.openapi.startup.ProjectActivity import kotlin.coroutines.Continuation -/** @author - * 梦境迷离 - * @version 1.0,2023/9/1 - */ abstract class BaseProjectActivity(private val runOnlyOnce: Boolean = false) extends ProjectActivity { private var veryFirstProjectOpening: Boolean = true diff --git a/src/main/scala/bitlap/sbt/analyzer/activity/PluginUpdateActivity.scala b/src/main/scala/bitlap/sbt/analyzer/activity/PluginUpdateActivity.scala index 6cb7505..9e32dc6 100644 --- a/src/main/scala/bitlap/sbt/analyzer/activity/PluginUpdateActivity.scala +++ b/src/main/scala/bitlap/sbt/analyzer/activity/PluginUpdateActivity.scala @@ -14,10 +14,6 @@ import com.intellij.util.ui.JBUI import analyzer.util.Notifications -/** @author - * 梦境迷离 - * @version 1.0,2023/9/1 - */ object PluginUpdateActivity: private val InitialVersion = "0.0.0" private lazy val VersionProperty = s"${SbtDependencyAnalyzerPlugin.PLUGIN_ID}.version" @@ -61,7 +57,7 @@ final class PluginUpdateActivity extends BaseProjectActivity { ): Boolean = { val latestChangeNotes = if (plugin.getChangeNotes == null) "
" - else plugin.getChangeNotes.split(Constants.ChangeNotesSeparator)(0) + else plugin.getChangeNotes.split(Constants.CHANGE_NOTES_SEPARATOR)(0) val title = SbtDependencyAnalyzerBundle.message( "analyzer.notification.updated.title", plugin.getName, diff --git a/src/main/scala/bitlap/sbt/analyzer/activity/WhatsNew.scala b/src/main/scala/bitlap/sbt/analyzer/activity/WhatsNew.scala index 9deb9eb..9e6426e 100644 --- a/src/main/scala/bitlap/sbt/analyzer/activity/WhatsNew.scala +++ b/src/main/scala/bitlap/sbt/analyzer/activity/WhatsNew.scala @@ -12,10 +12,6 @@ import com.intellij.openapi.project.Project import com.intellij.openapi.util.Conditions import com.intellij.ui.jcef.JBCefApp -/** @author - * 梦境迷离 - * @version 1.0,2023/9/2 - */ object WhatsNew: private lazy val Log = Logger.getInstance(classOf[WhatsNew.type]) private val ReleaseNotes = "https://github.com/bitlap/intellij-sbt-dependency-analyzer/releases/tag/v" @@ -53,7 +49,7 @@ object WhatsNew: BrowserUtil.browse(url) } }, - ModalityState.NON_MODAL, + ModalityState.nonModal(), Conditions.is(project.getDisposed) ) } else { diff --git a/src/main/scala/bitlap/sbt/analyzer/model/AnalyzerException.scala b/src/main/scala/bitlap/sbt/analyzer/model/AnalyzerException.scala index a0f1250..3092397 100644 --- a/src/main/scala/bitlap/sbt/analyzer/model/AnalyzerException.scala +++ b/src/main/scala/bitlap/sbt/analyzer/model/AnalyzerException.scala @@ -2,10 +2,6 @@ package bitlap.sbt.analyzer.model import bitlap.sbt.analyzer.DependencyScopeEnum -/** @author - * 梦境迷离 - * @version 1.0,2023/8/25 - */ sealed abstract class AnalyzerException(msg: String) extends RuntimeException(msg) final case class AnalyzerCommandNotFoundException(msg: String) extends AnalyzerException(msg) diff --git a/src/main/scala/bitlap/sbt/analyzer/model/ArtifactInfo.scala b/src/main/scala/bitlap/sbt/analyzer/model/ArtifactInfo.scala index d091347..240d625 100644 --- a/src/main/scala/bitlap/sbt/analyzer/model/ArtifactInfo.scala +++ b/src/main/scala/bitlap/sbt/analyzer/model/ArtifactInfo.scala @@ -5,7 +5,7 @@ import bitlap.sbt.analyzer.Constants final case class ArtifactInfo(id: Int, group: String, artifact: String, version: String) { override def toString: String = { - s"$group${Constants.ColonSeparator}$artifact${Constants.ColonSeparator}$version" + s"$group${Constants.ARTIFACT_SEPARATOR}$artifact${Constants.ARTIFACT_SEPARATOR}$version" } } diff --git a/src/main/scala/bitlap/sbt/analyzer/model/ModuleContext.scala b/src/main/scala/bitlap/sbt/analyzer/model/ModuleContext.scala index 946ef1a..645fc47 100644 --- a/src/main/scala/bitlap/sbt/analyzer/model/ModuleContext.scala +++ b/src/main/scala/bitlap/sbt/analyzer/model/ModuleContext.scala @@ -2,10 +2,6 @@ package bitlap.sbt.analyzer.model import bitlap.sbt.analyzer.DependencyScopeEnum -/** @author - * 梦境迷离 - * @version 1.0,2023/8/4 - */ final case class ModuleContext( analysisFile: String, currentModuleId: String, diff --git a/src/main/scala/bitlap/sbt/analyzer/package.scala b/src/main/scala/bitlap/sbt/analyzer/package.scala index 78839aa..d584d61 100644 --- a/src/main/scala/bitlap/sbt/analyzer/package.scala +++ b/src/main/scala/bitlap/sbt/analyzer/package.scala @@ -21,11 +21,6 @@ import com.intellij.openapi.module.Module import com.intellij.openapi.project.Project import com.intellij.openapi.util.Key -/** @author - * 梦境迷离 - * @version 1.0,2023/8/1 - */ - lazy val Module_Data: Key[ModuleData] = Key.create[ModuleData]("SbtDependencyAnalyzerContributor.ModuleData") given ExecutionContext = ExecutionContext.Implicits.global @@ -77,7 +72,7 @@ def findModule(project: Project, projectPath: String): Module = { findModule(project, moduleNode.getData) } -def waitInterval(sleep: Duration = Constants.IntervalTimeout): Unit = { +def waitInterval(sleep: Duration = Constants.INTERVAL_TIMEOUT): Unit = { try { Thread.sleep(sleep.toMillis) } catch { diff --git a/src/main/scala/bitlap/sbt/analyzer/parser/AnalyzedDotFileParser.scala b/src/main/scala/bitlap/sbt/analyzer/parser/AnalyzedDotFileParser.scala index 7f86be6..222784d 100644 --- a/src/main/scala/bitlap/sbt/analyzer/parser/AnalyzedDotFileParser.scala +++ b/src/main/scala/bitlap/sbt/analyzer/parser/AnalyzedDotFileParser.scala @@ -21,9 +21,6 @@ import model.* /** Parse the dot file generated by task `dependencyDot`. dot file: sees * https://en.wikipedia.org/wiki/DOT_(graph_description_language) - * @author - * 梦境迷离 - * @version 1.0,2023/8/3 */ object AnalyzedDotFileParser: lazy val instance: AnalyzedFileParser = new AnalyzedDotFileParser diff --git a/src/main/scala/bitlap/sbt/analyzer/parser/AnalyzedFileParser.scala b/src/main/scala/bitlap/sbt/analyzer/parser/AnalyzedFileParser.scala index 645d2d9..4208a14 100644 --- a/src/main/scala/bitlap/sbt/analyzer/parser/AnalyzedFileParser.scala +++ b/src/main/scala/bitlap/sbt/analyzer/parser/AnalyzedFileParser.scala @@ -5,10 +5,6 @@ import bitlap.sbt.analyzer.model.* import com.intellij.buildsystem.model.unified.UnifiedCoordinates import com.intellij.openapi.externalSystem.model.project.dependencies.* -/** @author - * 梦境迷离 - * @version 1.0,2023/8/3 - */ trait AnalyzedFileParser { val fileType: AnalyzedFileType diff --git a/src/main/scala/bitlap/sbt/analyzer/parser/AnalyzedParserFactory.scala b/src/main/scala/bitlap/sbt/analyzer/parser/AnalyzedParserFactory.scala index 02b227f..d704e58 100644 --- a/src/main/scala/bitlap/sbt/analyzer/parser/AnalyzedParserFactory.scala +++ b/src/main/scala/bitlap/sbt/analyzer/parser/AnalyzedParserFactory.scala @@ -1,9 +1,5 @@ package bitlap.sbt.analyzer.parser -/** @author - * 梦境迷离 - * @version 1.0,2023/8/3 - */ object AnalyzedParserFactory { def getInstance(builder: AnalyzedFileType): AnalyzedFileParser = { diff --git a/src/main/scala/bitlap/sbt/analyzer/parser/DotUtil.scala b/src/main/scala/bitlap/sbt/analyzer/parser/DotUtil.scala index 6137e9c..7a9504b 100644 --- a/src/main/scala/bitlap/sbt/analyzer/parser/DotUtil.scala +++ b/src/main/scala/bitlap/sbt/analyzer/parser/DotUtil.scala @@ -20,10 +20,6 @@ import guru.nidi.graphviz.model.MutableGraph import guru.nidi.graphviz.parse.Parser import model.ModuleContext -/** @author - * 梦境迷离 - * @version 1.0,2023/8/3 - */ object DotUtil { private val LOG = Logger.getInstance(classOf[DotUtil.type]) @@ -48,7 +44,7 @@ object DotUtil { if (vfsFile != null) { VfsUtil.markDirtyAndRefresh(false, false, false, vfsFile) } else { - if (System.currentTimeMillis() - start > Constants.Timeout.toMillis) { + if (System.currentTimeMillis() - start > Constants.TIMEOUT.toMillis) { LOG.error(s"Cannot get dot file: $file") Notifications.notifyParseFileError(file) return null diff --git a/src/main/scala/bitlap/sbt/analyzer/task/DependencyDotTask.scala b/src/main/scala/bitlap/sbt/analyzer/task/DependencyDotTask.scala index d6ebea5..ecf9391 100644 --- a/src/main/scala/bitlap/sbt/analyzer/task/DependencyDotTask.scala +++ b/src/main/scala/bitlap/sbt/analyzer/task/DependencyDotTask.scala @@ -16,9 +16,6 @@ import com.intellij.openapi.project.Project /** Process the `sbt dependencyDot` command, when the command execution is completed, use a callback to parse the file * content. - * @author - * 梦境迷离 - * @version 1.0,2023/8/19 */ final class DependencyDotTask extends SbtShellDependencyAnalysisTask: diff --git a/src/main/scala/bitlap/sbt/analyzer/task/LibraryDependenciesTask.scala b/src/main/scala/bitlap/sbt/analyzer/task/LibraryDependenciesTask.scala index 7342250..036f0c1 100644 --- a/src/main/scala/bitlap/sbt/analyzer/task/LibraryDependenciesTask.scala +++ b/src/main/scala/bitlap/sbt/analyzer/task/LibraryDependenciesTask.scala @@ -11,9 +11,6 @@ import Constants.* import SbtShellOutputAnalysisTask.* /** TODO: Process the `sbt libraryDependencies` command, get all user explicitly declared dependencies. - * @author - * 梦境迷离 - * @version 1.0,2023/8/19 */ final class LibraryDependenciesTask extends SbtShellOutputAnalysisTask[Map[String, List[LibraryModuleID]]]: @@ -43,7 +40,7 @@ final class LibraryDependenciesTask extends SbtShellOutputAnalysisTask[Map[Strin }.collect { case Some(value) => value } - return Map(SingleSbtModule -> libraries) + return Map(SINGLE_SBT_MODULE -> libraries) } // multi-module @@ -56,8 +53,8 @@ final class LibraryDependenciesTask extends SbtShellOutputAnalysisTask[Map[Strin moduleIdSbtLibrariesMap.map { (k, v) => val key = k match case libraryDependenciesInputRegex(_, _, moduleName, _, _) => moduleName.trim - case rootLibraryDependenciesInputRegex(_, _) => RootSbtModule - case _ => EmptyString + case rootLibraryDependenciesInputRegex(_, _) => ROOT_SBT_MODULE + case _ => EMPTY_STRING val value = v match case shellOutputResultRegex(_, _, output) => @@ -71,7 +68,7 @@ final class LibraryDependenciesTask extends SbtShellOutputAnalysisTask[Map[Strin key -> value }.collect { - case (k, v) if k != EmptyString => k -> v + case (k, v) if k != EMPTY_STRING => k -> v }.toMap end executeCommand diff --git a/src/main/scala/bitlap/sbt/analyzer/task/ModuleNameTask.scala b/src/main/scala/bitlap/sbt/analyzer/task/ModuleNameTask.scala index 6e6c39c..9f9a8ea 100644 --- a/src/main/scala/bitlap/sbt/analyzer/task/ModuleNameTask.scala +++ b/src/main/scala/bitlap/sbt/analyzer/task/ModuleNameTask.scala @@ -11,9 +11,6 @@ import Constants.* /** Process the `sbt moduleName` command, get all module names in sbt, it refers to the module name declared through * `name =: ` in `build.sbt` instead of Intellij IDEA. - * @author - * 梦境迷离 - * @version 1.0,2023/8/19 */ final class ModuleNameTask extends SbtShellOutputAnalysisTask[Map[String, String]]: import SbtShellOutputAnalysisTask.* @@ -43,22 +40,22 @@ final class ModuleNameTask extends SbtShellOutputAnalysisTask[Map[String, String for (i <- 0 until mms.size - 1 by 2) { moduleIdSbtModuleNameMap.put(mms(i).trim, mms(i + 1).trim) } - } else if (mms.size == 1) moduleIdSbtModuleNameMap.put(SingleSbtModule, mms(0)) + } else if (mms.size == 1) moduleIdSbtModuleNameMap.put(SINGLE_SBT_MODULE, mms(0)) moduleIdSbtModuleNameMap.map { (k, v) => val key = k match case moduleNameInputRegex(_, _, moduleName, _, _) => moduleName.trim - case rootModuleNameInputRegex(_, _) => RootSbtModule - case SingleSbtModule => SingleSbtModule - case _ => EmptyString + case rootModuleNameInputRegex(_, _) => ROOT_SBT_MODULE + case SINGLE_SBT_MODULE => SINGLE_SBT_MODULE + case _ => EMPTY_STRING val value = v match case shellOutputResultRegex(_, _, sbtModuleName) => sbtModuleName.trim - case _ => EmptyString + case _ => EMPTY_STRING key -> value - }.filter(kv => kv._1 != EmptyString && kv._2 != EmptyString).toMap + }.filter(kv => kv._1 != EMPTY_STRING && kv._2 != EMPTY_STRING).toMap end executeCommand diff --git a/src/main/scala/bitlap/sbt/analyzer/task/OrganizationTask.scala b/src/main/scala/bitlap/sbt/analyzer/task/OrganizationTask.scala index fcb1c94..859e284 100644 --- a/src/main/scala/bitlap/sbt/analyzer/task/OrganizationTask.scala +++ b/src/main/scala/bitlap/sbt/analyzer/task/OrganizationTask.scala @@ -3,10 +3,6 @@ package bitlap.sbt.analyzer.task import com.intellij.openapi.project.Project /** Process the `sbt organization` command, get current project organization as artifact's groupId. - * - * @author - * 梦境迷离 - * @version 1.0,2023/8/19 */ final class OrganizationTask extends SbtShellOutputAnalysisTask[String]: diff --git a/src/main/scala/bitlap/sbt/analyzer/task/RefreshSnapshotsTask.scala b/src/main/scala/bitlap/sbt/analyzer/task/RefreshSnapshotsTask.scala index 9bebec3..a5af521 100644 --- a/src/main/scala/bitlap/sbt/analyzer/task/RefreshSnapshotsTask.scala +++ b/src/main/scala/bitlap/sbt/analyzer/task/RefreshSnapshotsTask.scala @@ -10,10 +10,6 @@ import com.intellij.openapi.project.Project import util.SbtUtils /** Process the `set csrConfiguration;update` command, load fresh snapshots for analysis plugin. - * - * @author - * 梦境迷离 - * @version 1.0,2023/8/19 */ final class RefreshSnapshotsTask extends SbtShellOutputAnalysisTask[Unit]: diff --git a/src/main/scala/bitlap/sbt/analyzer/task/ReloadTask.scala b/src/main/scala/bitlap/sbt/analyzer/task/ReloadTask.scala index bbaabec..0bd0c57 100644 --- a/src/main/scala/bitlap/sbt/analyzer/task/ReloadTask.scala +++ b/src/main/scala/bitlap/sbt/analyzer/task/ReloadTask.scala @@ -3,10 +3,6 @@ package bitlap.sbt.analyzer.task import com.intellij.openapi.project.Project /** Process the `sbt reload` command, load new setting for sbt shell. - * - * @author - * 梦境迷离 - * @version 1.0,2023/8/19 */ final class ReloadTask extends SbtShellOutputAnalysisTask[Unit]: diff --git a/src/main/scala/bitlap/sbt/analyzer/task/SbtShellDependencyAnalysisTask.scala b/src/main/scala/bitlap/sbt/analyzer/task/SbtShellDependencyAnalysisTask.scala index 020bb4e..ddfbe64 100644 --- a/src/main/scala/bitlap/sbt/analyzer/task/SbtShellDependencyAnalysisTask.scala +++ b/src/main/scala/bitlap/sbt/analyzer/task/SbtShellDependencyAnalysisTask.scala @@ -17,9 +17,6 @@ import parser.* import util.DependencyUtils.* /** Tasks depend on the `addDependencyTreePlugin` plugin of the SBT. - * @author - * 梦境迷离 - * @version 1.0,2023/8/11 */ trait SbtShellDependencyAnalysisTask: @@ -39,12 +36,12 @@ trait SbtShellDependencyAnalysisTask: project: Project, moduleData: ModuleData, scope: DependencyScopeEnum - )(rootNode: String => DependencyScopeNode): DependencyScopeNode = { - val comms = SbtShellCommunication.forProject(project) - val moduleId = moduleData.getId.split(" ")(0) - val promise = Promise[Boolean]() - val file = moduleData.getLinkedExternalProjectPath + analysisFilePath(scope, parserTypeEnum) - val result = comms + )(buildNodeFunc: String => DependencyScopeNode): DependencyScopeNode = { + val shellCommunication = SbtShellCommunication.forProject(project) + val moduleId = moduleData.getId.split(" ")(0) + val promise = Promise[Boolean]() + val file = moduleData.getLinkedExternalProjectPath + analysisFilePath(scope, parserTypeEnum) + val result = shellCommunication .command( getScopedCommandKey(moduleId, scope, parserTypeEnum.cmd), new StringBuilder(), @@ -81,14 +78,14 @@ trait SbtShellDependencyAnalysisTask: ) ) } - case SbtShellCommunication.TaskStart => + case _ => } ) .flatMap(_ => promise.future) - Await.result(result, Constants.Timeout) - rootNode(file) + Await.result(result, Constants.TIMEOUT) + buildNodeFunc(file) } end SbtShellDependencyAnalysisTask diff --git a/src/main/scala/bitlap/sbt/analyzer/task/SbtShellOutputAnalysisTask.scala b/src/main/scala/bitlap/sbt/analyzer/task/SbtShellOutputAnalysisTask.scala index e685495..c15a2a4 100644 --- a/src/main/scala/bitlap/sbt/analyzer/task/SbtShellOutputAnalysisTask.scala +++ b/src/main/scala/bitlap/sbt/analyzer/task/SbtShellOutputAnalysisTask.scala @@ -13,23 +13,15 @@ import com.intellij.openapi.project.Project import Constants.* /** Tasks depend on the output of the SBT console. - * - * @author - * 梦境迷离 - * @version 1.0,2023/8/11 */ trait SbtShellOutputAnalysisTask[T]: private val log = Logger.getInstance(getClass) protected final def getCommandOutputLines(project: Project, command: String): List[String] = - val comms = SbtShellCommunication.forProject(project) - val executed: Future[StringBuilder] = comms.command( - command, - new StringBuilder(), - SbtShellCommunication.messageAggregator - ) - val res = Await.result(executed.map(_.result()), Constants.Timeout) - val result = res.split(Constants.LineSeparator).toList.filter(_.startsWith("[info]")) + val shellCommunication = SbtShellCommunication.forProject(project) + val executed: Future[String] = shellCommunication.command(command) + val res = Await.result(executed, Constants.TIMEOUT) + val result = res.split(Constants.LINE_SEPARATOR).toList.filter(_.startsWith("[info]")) if (result.isEmpty) { log.warn("Sbt Dependency Analyzer cannot find any output lines") } diff --git a/src/main/scala/bitlap/sbt/analyzer/util/DependencyUtils.scala b/src/main/scala/bitlap/sbt/analyzer/util/DependencyUtils.scala index caf83f3..177f921 100644 --- a/src/main/scala/bitlap/sbt/analyzer/util/DependencyUtils.scala +++ b/src/main/scala/bitlap/sbt/analyzer/util/DependencyUtils.scala @@ -8,6 +8,7 @@ import java.util.concurrent.atomic.AtomicLong import scala.jdk.CollectionConverters.* +import org.jetbrains.plugins.scala.ScalaVersion import org.jetbrains.plugins.scala.extensions.* import org.jetbrains.plugins.scala.lang.psi.api.expr.ScInfixExpr import org.jetbrains.plugins.scala.project.* @@ -30,10 +31,6 @@ import com.intellij.openapi.util.text.StringUtil import model.* import parser.* -/** @author - * 梦境迷离 - * @version 1.0,2023/8/7 - */ object DependencyUtils { final val DefaultConfiguration = toDAScope("default") @@ -123,8 +120,8 @@ object DependencyUtils { mds.filter(_.isInstanceOf[ArtifactDependencyNodeImpl]).foreach { node => val artifact = getArtifactInfoFromDisplayName(None, node.getDisplayName) - val artifactId = artifact.map(_.artifact).getOrElse(Constants.EmptyString) - val group = artifact.map(_.group).getOrElse(Constants.EmptyString) + val artifactId = artifact.map(_.artifact).getOrElse(Constants.EMPTY_STRING) + val group = artifact.map(_.group).getOrElse(Constants.EMPTY_STRING) // Use artifact to determine whether there are modules in the dependency. if ( context.ideaModuleIdSbtModuleNames.values @@ -145,8 +142,8 @@ object DependencyUtils { context.ideaModuleIdSbtModuleNames.getOrElse( context.currentModuleId, context.ideaModuleIdSbtModuleNames.getOrElse( - Constants.SingleSbtModule, - context.ideaModuleIdSbtModuleNames.getOrElse(Constants.RootSbtModule, context.currentModuleId) + Constants.SINGLE_SBT_MODULE, + context.ideaModuleIdSbtModuleNames.getOrElse(Constants.ROOT_SBT_MODULE, context.currentModuleId) ) ) @@ -200,7 +197,7 @@ object DependencyUtils { val projectPath = ideaModuleName .flatMap(m => context.ideaModuleNamePaths.get(m)) - .getOrElse(context.ideaModuleNamePaths.getOrElse(sbtModuleName, Constants.EmptyString)) + .getOrElse(context.ideaModuleNamePaths.getOrElse(sbtModuleName, Constants.EMPTY_STRING)) val p = new ProjectDependencyNodeImpl( dn.getId, @@ -238,7 +235,7 @@ object DependencyUtils { def declaredDependencies(module: OpenapiModule.Module): java.util.List[DeclaredDependency] = try { // Check whether the IDE is in Dumb Mode. If it is, return empty list instead proceeding // if (DumbService.getInstance(module.getProject).isDumb) return Collections.emptyList() - val scalaVer = SbtDependencyUtils.getScalaVerFromModule(module) + val scalaVer = module.scalaMinorVersion.map(_.major).getOrElse(ScalaVersion.default.major) inReadAction({ val libDeps = SbtDependencyUtils diff --git a/src/main/scala/bitlap/sbt/analyzer/util/Notifications.scala b/src/main/scala/bitlap/sbt/analyzer/util/Notifications.scala index 3e2b90d..15542c3 100644 --- a/src/main/scala/bitlap/sbt/analyzer/util/Notifications.scala +++ b/src/main/scala/bitlap/sbt/analyzer/util/Notifications.scala @@ -41,8 +41,8 @@ object Notifications { "addSbtPlugin(\"net.virtual-void\" % \"sbt-dependency-graph\" % \"0.8.2\")" } } - "// -- This file was mechanically generated by Sbt Dependency Analyzer Plugin: Do not edit! -- //" + Constants.LineSeparator - + line + Constants.LineSeparator + "// -- This file was mechanically generated by Sbt Dependency Analyzer Plugin: Do not edit! -- //" + Constants.LINE_SEPARATOR + + line + Constants.LINE_SEPARATOR } def notifyParseFileError(file: String): Unit = { @@ -102,11 +102,11 @@ object Notifications { val gitExclude = VfsUtil.findRelativeFile(basePath, ".git", "info", "exclude") val gitExcludeDoc = gitExclude.document() if (gitExcludeDoc != null) { - val ignoreText = "project" + Constants.Separator + pluginSbtFileName + val ignoreText = "project" + Constants.SEPARATOR + pluginSbtFileName if (gitExcludeDoc.getText != null && !gitExcludeDoc.getText.contains(ignoreText)) { gitExcludeDoc.setReadOnly(false) gitExcludeDoc.setText( - gitExcludeDoc.getText + Constants.LineSeparator + ignoreText + Constants.LineSeparator + gitExcludeDoc.getText + Constants.LINE_SEPARATOR + ignoreText + Constants.LINE_SEPARATOR ) } } @@ -118,7 +118,7 @@ object Notifications { if (isSdapAutoGenerate) { doc.setText(sdapText) } else { - doc.setText(doc.getText + Constants.LineSeparator + sdapText) + doc.setText(doc.getText + Constants.LINE_SEPARATOR + sdapText) } // if intellij not enable auto-reload // force refresh project diff --git a/src/main/scala/bitlap/sbt/analyzer/util/SbtUtils.scala b/src/main/scala/bitlap/sbt/analyzer/util/SbtUtils.scala index 8a0931b..404b98d 100644 --- a/src/main/scala/bitlap/sbt/analyzer/util/SbtUtils.scala +++ b/src/main/scala/bitlap/sbt/analyzer/util/SbtUtils.scala @@ -31,10 +31,6 @@ import com.intellij.openapi.project.* import com.intellij.openapi.roots.OrderRootType import com.intellij.openapi.roots.libraries.LibraryTablesRegistrar -/** @author - * 梦境迷离 - * @version 1.0,2023/8/24 - */ object SbtUtils { private val log = Logger.getInstance(getClass) diff --git a/src/test/scala/bitlap/sbt/analyzer/DotUtilSpec.scala b/src/test/scala/bitlap/sbt/analyzer/DotUtilSpec.scala index 4098e62..8ae12e8 100644 --- a/src/test/scala/bitlap/sbt/analyzer/DotUtilSpec.scala +++ b/src/test/scala/bitlap/sbt/analyzer/DotUtilSpec.scala @@ -13,10 +13,6 @@ import org.scalatest.flatspec.AnyFlatSpec import guru.nidi.graphviz.model.* -/** @author - * 梦境迷离 - * @version 1.0,2023/8/8 - */ class DotUtilSpec extends AnyFlatSpec { "parse file as MutableNode" should "ok" in { diff --git a/src/test/scala/bitlap/sbt/analyzer/SbtShellTaskRegex.scala b/src/test/scala/bitlap/sbt/analyzer/SbtShellTaskRegex.scala index 7afc8b0..0b002af 100644 --- a/src/test/scala/bitlap/sbt/analyzer/SbtShellTaskRegex.scala +++ b/src/test/scala/bitlap/sbt/analyzer/SbtShellTaskRegex.scala @@ -4,10 +4,6 @@ import bitlap.sbt.analyzer.task.SbtShellOutputAnalysisTask import org.scalatest.flatspec.AnyFlatSpec -/** @author - * 梦境迷离 - * @version 1.0,2023/8/11 - */ class SbtShellTaskRegex extends AnyFlatSpec { "regex match" should "ok" in {