-
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.
Allow cquery to filter out incompatible targets
This patch exposes the `IncompatiblePlatformProvider` to Starlark just enough that it can be used with `cquery`'s `platforms()` function. I added an example of this to the documentation. The motivation here is to let users filter out incompatible targets from queries that provide things like the list of targets to build for CI. This patch is minimal on purpose. It does not allow users to instantiate an `IncompatiblePlatformProvider` in Starlark. This may be added in a future patch to address a different use case.
- Loading branch information
Showing
7 changed files
with
107 additions
and
7 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
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
14 changes: 14 additions & 0 deletions
14
.../google/devtools/build/lib/starlarkbuildapi/platform/IncompatiblePlatformProviderApi.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,14 @@ | ||
package com.google.devtools.build.lib.starlarkbuildapi.platform; | ||
|
||
import com.google.devtools.build.docgen.annot.DocCategory; | ||
import net.starlark.java.annot.StarlarkBuiltin; | ||
import net.starlark.java.eval.StarlarkValue; | ||
|
||
@StarlarkBuiltin( | ||
name = "IncompatiblePlatformProvider", | ||
doc = "An interface for targets that are incompatible with the target platform. See " | ||
+ "<a href='../../platforms.html#detecting-incompatible-targets-using-bazel-cquery'>" | ||
+ "Detecting incompatible targets using <code>bazel query</code></a> for more " | ||
+ "information.", | ||
category = DocCategory.PROVIDER) | ||
public interface IncompatiblePlatformProviderApi extends StarlarkValue {} |
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