File tree Expand file tree Collapse file tree 4 files changed +35
-2
lines changed
kotlin/xyz/block/tools/monorepo/idea Expand file tree Collapse file tree 4 files changed +35
-2
lines changed Original file line number Diff line number Diff line change 55** .DS_Store
66build /
77.intellijPlatform /
8- * .bak
8+ * .bak
9+ .kotlin
Original file line number Diff line number Diff line change @@ -10,14 +10,15 @@ dependencies {
1010 intellijPlatform {
1111 intellijIdeaUltimate(" 2024.3.2" )
1212 pluginVerifier(" 1.381" )
13+ bundledPlugin(" com.intellij.gradle" )
1314 }
1415}
1516
1617version = System .getenv(" IJ_PLUGIN_VERSION" ) ? : " 0.1.0" // IJ_PLUGIN_VERSION env var available in CI
1718
1819val pluginName = " gradle-monorepo"
1920val sinceBuildMajorVersion = " 233" // corresponds to 2023.3.x versions
20- val sinceIdeVersionForVerification = " 241.14494.240 " // corresponds to the 2024.1 version
21+ val sinceIdeVersionForVerification = " 243.21565.193 " // corresponds to the 2024.3 version
2122val untilIdeVersion = properties[" IIC.release.version" ] as String
2223val untilBuildMajorVersion = untilIdeVersion.substringBefore(' .' )
2324
Original file line number Diff line number Diff line change 1+ package xyz.block.tools.monorepo.idea
2+
3+ import com.intellij.openapi.diagnostic.Logger
4+ import com.intellij.openapi.externalSystem.model.DataNode
5+ import com.intellij.openapi.externalSystem.model.project.ProjectData
6+ import com.intellij.openapi.vcs.FileStatusManager
7+ import org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension
8+
9+ class RefreshProjectViewExtension : AbstractProjectResolverExtension () {
10+
11+ override fun resolveFinished (projectDataNode : DataNode <ProjectData ?>) {
12+ super .resolveFinished(projectDataNode)
13+ val project = resolverCtx.externalSystemTaskId.findProject()
14+ if (project == null ) {
15+ logger.warn(" Project is null, cannot refresh the project view" )
16+ } else if (! project.getService(ConfigurationService ::class .java).pluginEnabled) {
17+ logger.info(" The gradle-monorepo plugin is not enabled for the current project" )
18+ } else {
19+ logger.info(" Forcing a refresh of the project view" )
20+ FileStatusManager .getInstance(project).fileStatusesChanged()
21+ }
22+ }
23+
24+ companion object {
25+ private val logger = Logger .getInstance(RefreshProjectViewExtension ::class .java)
26+ }
27+ }
Original file line number Diff line number Diff line change 55 <description >Improves the developer experience working in a gradle monorepo project</description >
66 <vendor url =" https://block.xyz/" >Block</vendor >
77 <depends >com.intellij.modules.platform</depends >
8+ <depends >com.intellij.gradle</depends >
89 <extensions defaultExtensionNs =" com.intellij" >
910 <directoryIndexExcludePolicy
1011 implementation =" xyz.block.tools.monorepo.idea.InactiveProjectExcludeDirPolicy" />
1112 </extensions >
13+ <extensions defaultExtensionNs =" org.jetbrains.plugins.gradle" >
14+ <projectResolve implementation =" xyz.block.tools.monorepo.idea.RefreshProjectViewExtension" />
15+ </extensions >
1216</idea-plugin >
You can’t perform that action at this time.
0 commit comments