-
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.
Migrate platform-related skylark objects to skylarkbuildapi
RELNOTES: None. PiperOrigin-RevId: 198086078
- Loading branch information
Showing
11 changed files
with
217 additions
and
69 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
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
28 changes: 28 additions & 0 deletions
28
src/main/java/com/google/devtools/build/lib/skylarkbuildapi/platform/BUILD
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,28 @@ | ||
# Description: | ||
# This package contains interfaces representing the skylark "build API" | ||
# (but not the implementation of that API). Ultimately, this package | ||
# may be broken out of the Bazel package hierarchy to be standalone. | ||
# Thus, this package should not depend on Bazel-specific packages (only | ||
# those which contain pure-Skylark concepts, such as the interpreter or | ||
# annotation interfaces). | ||
|
||
package(default_visibility = ["//src:__subpackages__"]) | ||
|
||
licenses(["notice"]) # Apache 2.0 | ||
|
||
filegroup( | ||
name = "srcs", | ||
srcs = glob(["**"]), | ||
) | ||
|
||
java_library( | ||
name = "platform", | ||
srcs = glob(["*.java"]), | ||
deps = [ | ||
"//src/main/java/com/google/devtools/build/lib:skylarkinterface", | ||
"//src/main/java/com/google/devtools/build/lib/cmdline", | ||
"//src/main/java/com/google/devtools/build/lib/skylarkbuildapi", | ||
"//third_party:guava", | ||
"//third_party:jsr305", | ||
], | ||
) |
39 changes: 39 additions & 0 deletions
39
...java/com/google/devtools/build/lib/skylarkbuildapi/platform/ConstraintSettingInfoApi.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,39 @@ | ||
// Copyright 2018 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.skylarkbuildapi.platform; | ||
|
||
import com.google.devtools.build.lib.cmdline.Label; | ||
import com.google.devtools.build.lib.skylarkbuildapi.StructApi; | ||
import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable; | ||
import com.google.devtools.build.lib.skylarkinterface.SkylarkModule; | ||
import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory; | ||
|
||
/** | ||
* Info object representing a specific constraint setting that may be used to define a platform. | ||
*/ | ||
@SkylarkModule( | ||
name = "ConstraintSettingInfo", | ||
doc = "A specific constraint setting that may be used to define a platform.", | ||
category = SkylarkModuleCategory.PROVIDER | ||
) | ||
public interface ConstraintSettingInfoApi extends StructApi { | ||
|
||
@SkylarkCallable( | ||
name = "label", | ||
doc = "The label of the target that created this constraint.", | ||
structField = true | ||
) | ||
public Label label(); | ||
} |
48 changes: 48 additions & 0 deletions
48
...n/java/com/google/devtools/build/lib/skylarkbuildapi/platform/ConstraintValueInfoApi.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,48 @@ | ||
// Copyright 2018 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.skylarkbuildapi.platform; | ||
|
||
import com.google.devtools.build.lib.cmdline.Label; | ||
import com.google.devtools.build.lib.skylarkbuildapi.StructApi; | ||
import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable; | ||
import com.google.devtools.build.lib.skylarkinterface.SkylarkModule; | ||
import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory; | ||
|
||
/** | ||
* Info object representing a value for a constraint setting that can be used to define a platform. | ||
*/ | ||
@SkylarkModule( | ||
name = "ConstraintValueInfo", | ||
doc = "A value for a constraint setting that can be used to define a platform.", | ||
category = SkylarkModuleCategory.PROVIDER | ||
) | ||
public interface ConstraintValueInfoApi extends StructApi { | ||
|
||
@SkylarkCallable( | ||
name = "constraint", | ||
doc = | ||
"The <a href=\"ConstraintSettingInfo.html\">ConstraintSettingInfo</a> this value can be " | ||
+ "applied to.", | ||
structField = true | ||
) | ||
public ConstraintSettingInfoApi constraint(); | ||
|
||
@SkylarkCallable( | ||
name = "label", | ||
doc = "The label of the target that created this constraint value.", | ||
structField = true | ||
) | ||
public Label label(); | ||
} |
56 changes: 56 additions & 0 deletions
56
src/main/java/com/google/devtools/build/lib/skylarkbuildapi/platform/PlatformInfoApi.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,56 @@ | ||
// Copyright 2018 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.skylarkbuildapi.platform; | ||
|
||
import com.google.devtools.build.lib.cmdline.Label; | ||
import com.google.devtools.build.lib.skylarkbuildapi.StructApi; | ||
import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable; | ||
import com.google.devtools.build.lib.skylarkinterface.SkylarkModule; | ||
import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory; | ||
|
||
/** | ||
* Info object representing data about a specific platform. | ||
*/ | ||
@SkylarkModule( | ||
name = "PlatformInfo", | ||
doc = "Provides access to data about a specific platform.", | ||
category = SkylarkModuleCategory.PROVIDER | ||
) | ||
public interface PlatformInfoApi<ConstraintValueInfoT extends ConstraintValueInfoApi> | ||
extends StructApi { | ||
|
||
@SkylarkCallable( | ||
name = "label", | ||
doc = "The label of the target that created this platform.", | ||
structField = true | ||
) | ||
public Label label(); | ||
|
||
@SkylarkCallable( | ||
name = "constraints", | ||
doc = | ||
"The <a href=\"ConstraintValueInfo.html\">ConstraintValueInfo</a> instances that define " | ||
+ "this platform.", | ||
structField = true | ||
) | ||
public Iterable<ConstraintValueInfoT> constraints(); | ||
|
||
@SkylarkCallable( | ||
name = "remoteExecutionProperties", | ||
doc = "Properties that are available for the use of remote execution.", | ||
structField = true | ||
) | ||
public String remoteExecutionProperties(); | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/com/google/devtools/build/lib/skylarkbuildapi/platform/ToolchainInfoApi.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,30 @@ | ||
// Copyright 2018 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.skylarkbuildapi.platform; | ||
|
||
import com.google.devtools.build.lib.skylarkbuildapi.StructApi; | ||
import com.google.devtools.build.lib.skylarkinterface.SkylarkModule; | ||
import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory; | ||
|
||
/** | ||
* Info object representing data about a specific toolchain. | ||
*/ | ||
@SkylarkModule( | ||
name = "ToolchainInfo", | ||
doc = "Provides access to data about a specific toolchain.", | ||
category = SkylarkModuleCategory.PROVIDER | ||
) | ||
public interface ToolchainInfoApi extends StructApi { | ||
} |