-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Read repositories on a per project level (#31)
* read repos * deps * use repo explorer * require cache key * include a default * spotless * convert to set * Add generated changelog entries * make lifecycle clearer * use streams * remove unneeded comment * working cache in need of fixing * fix tests * listen for refresh * tidy up code * fix log comment * markups --------- Co-authored-by: Finlay Williams <[email protected]> Co-authored-by: svc-changelog <[email protected]>
- Loading branch information
1 parent
82d2631
commit 2974dc4
Showing
12 changed files
with
239 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
type: improvement | ||
improvement: | ||
description: Read repositories on a per project level | ||
links: | ||
- https://github.com/palantir/gradle-consistent-versions-idea-plugin/pull/31 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...ain/java/com/palantir/gradle/versions/intellij/InvalidateCacheOnGradleProjectRefresh.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* (c) Copyright 2024 Palantir Technologies Inc. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.palantir.gradle.versions.intellij; | ||
|
||
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; | ||
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationEvent; | ||
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener; | ||
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskType; | ||
import org.jetbrains.plugins.gradle.util.GradleConstants; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class InvalidateCacheOnGradleProjectRefresh implements ExternalSystemTaskNotificationListener { | ||
private static final Logger log = LoggerFactory.getLogger(InvalidateCacheOnGradleProjectRefresh.class); | ||
|
||
private final GradleCacheExplorer gradleCacheExplorer; | ||
|
||
public InvalidateCacheOnGradleProjectRefresh(GradleCacheExplorer gradleCacheExplorer) { | ||
this.gradleCacheExplorer = gradleCacheExplorer; | ||
} | ||
|
||
@Override | ||
public final void onSuccess(ExternalSystemTaskId id) { | ||
if (GradleConstants.SYSTEM_ID.equals(id.getProjectSystemId()) | ||
&& id.getType() == ExternalSystemTaskType.RESOLVE_PROJECT) { | ||
log.info("Gradle project refresh finished"); | ||
gradleCacheExplorer.invalidateCache(); | ||
} | ||
} | ||
|
||
@Override | ||
public void onStart(ExternalSystemTaskId id, String workingDir) {} | ||
|
||
@Override | ||
public void onFailure(ExternalSystemTaskId id, Exception exception) {} | ||
|
||
@Override | ||
public void beforeCancel(ExternalSystemTaskId id) {} | ||
|
||
@Override | ||
public void onCancel(ExternalSystemTaskId id) {} | ||
|
||
@Override | ||
public void onStatusChange(ExternalSystemTaskNotificationEvent event) {} | ||
|
||
@Override | ||
public void onTaskOutput(ExternalSystemTaskId id, String text, boolean stdOut) {} | ||
|
||
@Override | ||
public void onEnd(ExternalSystemTaskId id) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.