// Copyright 2014 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.devtools.build.lib.packages; import com.google.common.base.Objects; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe; import com.google.devtools.build.lib.skylarkbuildapi.FilesetEntryApi; import com.google.devtools.build.lib.skylarkinterface.SkylarkPrinter; import com.google.devtools.build.lib.skylarkinterface.SkylarkValue; import com.google.devtools.build.lib.vfs.PathFragment; import java.util.Collection; import java.util.Collections; import java.util.LinkedHashSet; import java.util.List; import java.util.Locale; import java.util.Set; import javax.annotation.Nullable; /** * FilesetEntry is a value object used to represent a "FilesetEntry" inside a "Fileset" BUILD rule. */ @Immutable @ThreadSafe public final class FilesetEntry implements SkylarkValue, FilesetEntryApi { public static final SymlinkBehavior DEFAULT_SYMLINK_BEHAVIOR = SymlinkBehavior.COPY; public static final String DEFAULT_STRIP_PREFIX = "."; public static final String STRIP_PREFIX_WORKSPACE = "%workspace%"; @Override public boolean isImmutable() { // TODO(laszlocsomor): set this to true. I think we could do this right now, but am not sure. // Maybe we have to verify that Skylark recognizes every member's type to be recursively // immutable; as of 15/01/2016 this is not true for enum types in general, to name an example. return false; } public static List makeStringList(List