-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
into `ArtifactTracker` and `RenderJarArtifactTracker` interfaces. Even though their implementations can share a common infrastructure they do not need to share it. These interfaces are used by different callers and thus making them separate makes it easier to understand the intended usage of each method. 1. Do not rename `ArtifactTracker` to `DependencyArtifactTracker` to avoid too much noise in this change. 2. Do not split the implementation yet. A few more changes are needed before it can happen. PiperOrigin-RevId: 575854279
- Loading branch information
1 parent
f6a9844
commit 22fe29e
Showing
11 changed files
with
117 additions
and
47 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
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
41 changes: 41 additions & 0 deletions
41
base/src/com/google/idea/blaze/base/qsync/ArtifactTrackerUpdateResult.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,41 @@ | ||
/* | ||
* Copyright 2023 The Bazel Authors. 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.google.idea.blaze.base.qsync; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import com.google.common.collect.ImmutableSet; | ||
import java.nio.file.Path; | ||
|
||
/** | ||
* A result of updating artifact cache. | ||
* | ||
* <p>Instances of this class describe the difference between the state of the artifact cache before | ||
* and after the operation. They do not represent the result of build action that produced these | ||
* artifacts. | ||
* | ||
* <p><b>DO NOT USE</b> for purposes other than logging or displaying the result in the UI. | ||
*/ | ||
@AutoValue | ||
public abstract class ArtifactTrackerUpdateResult { | ||
public abstract ImmutableSet<Path> updatedFiles(); | ||
|
||
public abstract ImmutableSet<String> removedKeys(); | ||
|
||
public static ArtifactTrackerUpdateResult create( | ||
ImmutableSet<Path> updatedFiles, ImmutableSet<String> removedKeys) { | ||
return new AutoValue_ArtifactTrackerUpdateResult(updatedFiles, removedKeys); | ||
} | ||
} |
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
34 changes: 34 additions & 0 deletions
34
base/src/com/google/idea/blaze/base/qsync/RenderJarArtifactTracker.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,34 @@ | ||
/* | ||
* Copyright 2023 The Bazel Authors. 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.google.idea.blaze.base.qsync; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
import com.google.idea.blaze.base.scope.BlazeContext; | ||
import com.google.idea.blaze.common.Label; | ||
import com.google.idea.blaze.exception.BuildException; | ||
import java.io.File; | ||
import java.util.Set; | ||
|
||
/** A local cache of built render jarss. */ | ||
public interface RenderJarArtifactTracker { | ||
|
||
/** Fetches, caches and sets up new render jar artifacts. */ | ||
ArtifactTrackerUpdateResult update( | ||
Set<Label> targets, RenderJarInfo renderJarInfo, BlazeContext context) throws BuildException; | ||
|
||
/** Returns the list of render jars */ | ||
ImmutableList<File> getRenderJars(); | ||
} |
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