aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/RepositoryValue.java
diff options
context:
space:
mode:
authorGravatar Lukacs Berki <lberki@google.com>2015-12-09 08:57:08 +0000
committerGravatar Lukacs Berki <lberki@google.com>2015-12-09 14:47:15 +0000
commit6aff7f4f2bf0c6418fb88e967653f2feeb83819e (patch)
tree2e7bf4d0e8acd2ee1359cd314a432e00319c88b3 /src/main/java/com/google/devtools/build/lib/skyframe/RepositoryValue.java
parentcdf0c157750fb663814754f77a6d41b3d36c690d (diff)
Refactor external repository support significantly to solve a number of issues.
In particular: - Separate the implementation of maven_server into a RepositoryFunction and one that creates the MavenServerValue (ideally, maven_server wouldn't exist but we'll have to make to for the time being) - Refactor the logic of determining whether an external repository needs to be re-fetched to RepositoryDelegatorFunction - Make RepositoryFunctions not be SkyFunctions anymore (they are called from RepositoryDelegatorFunction, though, who *is* a SkyFunction) - Add a Skyframe dirtiness checker that makes --nofetch RepositoryValues not be cached - Add a bunch of test cases and javadoc There is only one wart that I know of that remains: changes to BUILD files of new_* repository rules that weren't refetched when their RepositoryValue was initiall created on server restart won't take effect. This is because we don't add those BUILD files to the created RepositoryValue. This will fix itself once the ExternalFilesHelper refactoring is submitted. -- MOS_MIGRATED_REVID=109768345
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/RepositoryValue.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/RepositoryValue.java21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/RepositoryValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/RepositoryValue.java
index 0b29f0ac93..ef9087144c 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/RepositoryValue.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/RepositoryValue.java
@@ -34,24 +34,35 @@ public class RepositoryValue implements SkyValue {
* it. Then user changes will be ignored (in favor of the cached version).
*/
private final Optional<FileValue> overlaidBuildFile;
+ private final boolean fetchingDelayed;
- private RepositoryValue(Path path, Optional<FileValue> overlaidBuildFile) {
+ private RepositoryValue(
+ Path path, Optional<FileValue> overlaidBuildFile, boolean fetchingDelayed) {
this.path = path;
this.overlaidBuildFile = overlaidBuildFile;
+ this.fetchingDelayed = fetchingDelayed;
}
/**
* Creates an immutable external repository.
*/
public static RepositoryValue create(Path repositoryDirectory) {
- return new RepositoryValue(repositoryDirectory, Optional.<FileValue>absent());
+ return new RepositoryValue(repositoryDirectory, Optional.<FileValue>absent(), false);
+ }
+
+ /**
+ * Creates a value that represents a repository whose fetching has been delayed by a
+ * {@code --nofetch} command line option.
+ */
+ public static RepositoryValue fetchingDelayed(Path repositoryDirectory) {
+ return new RepositoryValue(repositoryDirectory, Optional.<FileValue>absent(), true);
}
/**
* Creates an immutable external repository with a mutable BUILD file.
*/
public static RepositoryValue createNew(Path repositoryDirectory, FileValue overlaidBuildFile) {
- return new RepositoryValue(repositoryDirectory, Optional.of(overlaidBuildFile));
+ return new RepositoryValue(repositoryDirectory, Optional.of(overlaidBuildFile), false);
}
/**
@@ -68,6 +79,10 @@ public class RepositoryValue implements SkyValue {
return overlaidBuildFile;
}
+ public boolean isFetchingDelayed() {
+ return fetchingDelayed;
+ }
+
@Override
public boolean equals(Object other) {
if (this == other) {