-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cquery --show_config_fragments: capture Make variables.
Any Make variable "$(foo)" is equivalent to requiring "--define foo". This works for native rule logic and Starlark rules routing through https://docs.bazel.build/versions/master/skylark/lib/ctx.html#expand_make_variables, but not Starlark rules routing through https://docs.bazel.build/versions/master/skylark/lib/ctx.html#var. Supports #10613. Added refactoring TODO in #11221. PiperOrigin-RevId: 308632503
- Loading branch information
1 parent
e971d85
commit 31e4479
Showing
9 changed files
with
310 additions
and
107 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
32 changes: 32 additions & 0 deletions
32
src/main/java/com/google/devtools/build/lib/analysis/stringtemplate/Expansion.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,32 @@ | ||
// Copyright 2020 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.analysis.stringtemplate; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import com.google.common.collect.ImmutableSet; | ||
|
||
/** | ||
* Holds the result of expanding a string with make variables: both the new (expanded) string and | ||
* the set of variables that were expanded. | ||
*/ | ||
@AutoValue | ||
public abstract class Expansion { | ||
public static Expansion create(String expansion, ImmutableSet<String> lookedUpVariables) { | ||
return new AutoValue_Expansion(expansion, lookedUpVariables); | ||
} | ||
|
||
public abstract String expansion(); | ||
|
||
public abstract ImmutableSet<String> lookedUpVariables(); | ||
} |
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
Oops, something went wrong.