Skip to content

Commit f7829f8

Browse files
Googlercopybara-github
authored andcommitted
Rename Factory-level ExecutionTransitionFactory.create to createFactory
This also provides better consistency with other TransitionFactory that only use `create` to return Transition. PiperOrigin-RevId: 520458312 Change-Id: Icc0a2e208a2777ab34651fbd7c46f9974dad87ae
1 parent 57426bc commit f7829f8

46 files changed

Lines changed: 220 additions & 220 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/main/java/com/google/devtools/build/lib/analysis/Allowlist.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private Allowlist() {}
5050
public static Attribute.Builder<Label> getAttributeFromAllowlistName(String allowlistName) {
5151
String attributeName = getAttributeNameFromAllowlistName(allowlistName).iterator().next();
5252
return attr(attributeName, LABEL)
53-
.cfg(ExecutionTransitionFactory.create())
53+
.cfg(ExecutionTransitionFactory.createFactory())
5454
.mandatoryProviders(PackageGroupConfiguredTarget.PROVIDER.id());
5555
}
5656

src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -215,31 +215,31 @@ public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env)
215215
// Input files for every test action
216216
.add(
217217
attr("$test_wrapper", LABEL)
218-
.cfg(ExecutionTransitionFactory.create())
218+
.cfg(ExecutionTransitionFactory.createFactory())
219219
.singleArtifact()
220220
.value(env.getToolsLabel("//tools/test:test_wrapper")))
221221
.add(
222222
attr("$xml_writer", LABEL)
223-
.cfg(ExecutionTransitionFactory.create())
223+
.cfg(ExecutionTransitionFactory.createFactory())
224224
.singleArtifact()
225225
.value(env.getToolsLabel("//tools/test:xml_writer")))
226226
.add(
227227
attr("$test_runtime", LABEL_LIST)
228-
.cfg(ExecutionTransitionFactory.create())
228+
.cfg(ExecutionTransitionFactory.createFactory())
229229
.value(getTestRuntimeLabelList(env)))
230230
.add(
231231
attr("$test_setup_script", LABEL)
232-
.cfg(ExecutionTransitionFactory.create())
232+
.cfg(ExecutionTransitionFactory.createFactory())
233233
.singleArtifact()
234234
.value(env.getToolsLabel("//tools/test:test_setup")))
235235
.add(
236236
attr("$xml_generator_script", LABEL)
237-
.cfg(ExecutionTransitionFactory.create())
237+
.cfg(ExecutionTransitionFactory.createFactory())
238238
.singleArtifact()
239239
.value(env.getToolsLabel("//tools/test:test_xml_generator")))
240240
.add(
241241
attr("$collect_coverage_script", LABEL)
242-
.cfg(ExecutionTransitionFactory.create())
242+
.cfg(ExecutionTransitionFactory.createFactory())
243243
.singleArtifact()
244244
.value(env.getToolsLabel("//tools/test:collect_coverage")))
245245
// Input files for test actions collecting code coverage
@@ -250,7 +250,7 @@ public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env)
250250
// Used in the one-per-build coverage report generation action.
251251
.add(
252252
attr(":coverage_report_generator", LABEL)
253-
.cfg(ExecutionTransitionFactory.create())
253+
.cfg(ExecutionTransitionFactory.createFactory())
254254
.value(
255255
coverageReportGeneratorAttribute(
256256
env.getToolsLabel(DEFAULT_COVERAGE_REPORT_GENERATOR_VALUE))))
@@ -313,7 +313,7 @@ public static RuleClass.Builder commonCoreAndStarlarkAttributes(RuleClass.Builde
313313
.add(
314314
attr("visibility", NODEP_LABEL_LIST)
315315
.orderIndependent()
316-
.cfg(ExecutionTransitionFactory.create())
316+
.cfg(ExecutionTransitionFactory.createFactory())
317317
.nonconfigurable(
318318
"special attribute integrated more deeply into Bazel's core logic"))
319319
.add(
@@ -348,20 +348,20 @@ public static RuleClass.Builder commonCoreAndStarlarkAttributes(RuleClass.Builde
348348
.add(attr("features", STRING_LIST).orderIndependent())
349349
.add(
350350
attr(":action_listener", LABEL_LIST)
351-
.cfg(ExecutionTransitionFactory.create())
351+
.cfg(ExecutionTransitionFactory.createFactory())
352352
.value(ACTION_LISTENER))
353353
.add(
354354
attr(RuleClass.COMPATIBLE_ENVIRONMENT_ATTR, LABEL_LIST)
355355
.allowedRuleClasses(ConstraintConstants.ENVIRONMENT_RULE)
356-
.cfg(ExecutionTransitionFactory.create())
356+
.cfg(ExecutionTransitionFactory.createFactory())
357357
.allowedFileTypes(FileTypeSet.NO_FILE)
358358
.dontCheckConstraints()
359359
.nonconfigurable(
360360
"special logic for constraints and select: see ConstraintSemantics"))
361361
.add(
362362
attr(RuleClass.RESTRICTED_ENVIRONMENT_ATTR, LABEL_LIST)
363363
.allowedRuleClasses(ConstraintConstants.ENVIRONMENT_RULE)
364-
.cfg(ExecutionTransitionFactory.create())
364+
.cfg(ExecutionTransitionFactory.createFactory())
365365
.allowedFileTypes(FileTypeSet.NO_FILE)
366366
.dontCheckConstraints()
367367
.nonconfigurable(
@@ -371,7 +371,7 @@ public static RuleClass.Builder commonCoreAndStarlarkAttributes(RuleClass.Builde
371371
.nonconfigurable("stores configurability keys"))
372372
.add(
373373
attr(RuleClass.APPLICABLE_LICENSES_ATTR, LABEL_LIST)
374-
.cfg(ExecutionTransitionFactory.create())
374+
.cfg(ExecutionTransitionFactory.createFactory())
375375
.allowedFileTypes(FileTypeSet.NO_FILE)
376376
// TODO(b/148601291): Require provider to be "LicenseInfo".
377377
.dontCheckConstraints()

src/main/java/com/google/devtools/build/lib/analysis/config/ExecutionTransitionFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ public class ExecutionTransitionFactory
4444
* Returns a new {@link ExecutionTransitionFactory} for the default {@link
4545
* com.google.devtools.build.lib.packages.ExecGroup}.
4646
*/
47-
public static ExecutionTransitionFactory create() {
47+
public static ExecutionTransitionFactory createFactory() {
4848
return new ExecutionTransitionFactory(DEFAULT_EXEC_GROUP_NAME);
4949
}
5050

5151
/**
5252
* Returns a new {@link ExecutionTransitionFactory} for the given {@link
5353
* com.google.devtools.build.lib.packages.ExecGroup}.
5454
*/
55-
public static ExecutionTransitionFactory create(String execGroup) {
55+
public static ExecutionTransitionFactory createFactory(String execGroup) {
5656
return new ExecutionTransitionFactory(execGroup);
5757
}
5858

src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ && containsNonNoneKey(arguments, ALLOW_SINGLE_FILE_ARG)) {
244244
"'cfg = \"host\"' is deprecated and should no longer be used. Please use "
245245
+ "'cfg = \"exec\"' instead.");
246246
}
247-
builder.cfg(ExecutionTransitionFactory.create());
247+
builder.cfg(ExecutionTransitionFactory.createFactory());
248248
} else if (trans.equals("exec")) {
249-
builder.cfg(ExecutionTransitionFactory.create());
249+
builder.cfg(ExecutionTransitionFactory.createFactory());
250250
} else if (trans instanceof ExecutionTransitionFactory) {
251251
builder.cfg((ExecutionTransitionFactory) trans);
252252
} else if (trans instanceof SplitTransition) {

src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public BuildSetting stringListSetting(Boolean flag, Boolean repeatable) throws E
5555
@Override
5656
public ExecutionTransitionFactory exec(Object execGroupUnchecked) {
5757
return execGroupUnchecked == Starlark.NONE
58-
? ExecutionTransitionFactory.create()
59-
: ExecutionTransitionFactory.create((String) execGroupUnchecked);
58+
? ExecutionTransitionFactory.createFactory()
59+
: ExecutionTransitionFactory.createFactory((String) execGroupUnchecked);
6060
}
6161

6262
@Override

src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,47 +195,47 @@ public static RuleClass getTestBaseRule(RuleDefinitionEnvironment env) {
195195
// Input files for every test action
196196
.add(
197197
attr("$test_wrapper", LABEL)
198-
.cfg(ExecutionTransitionFactory.create())
198+
.cfg(ExecutionTransitionFactory.createFactory())
199199
.singleArtifact()
200200
.value(labelCache.get(toolsRepository + "//tools/test:test_wrapper")))
201201
.add(
202202
attr("$xml_writer", LABEL)
203-
.cfg(ExecutionTransitionFactory.create())
203+
.cfg(ExecutionTransitionFactory.createFactory())
204204
.singleArtifact()
205205
.value(labelCache.get(toolsRepository + "//tools/test:xml_writer")))
206206
.add(
207207
attr("$test_runtime", LABEL_LIST)
208-
.cfg(ExecutionTransitionFactory.create())
208+
.cfg(ExecutionTransitionFactory.createFactory())
209209
// Getting this default value through the getTestRuntimeLabelList helper ensures
210210
// we reuse the same ImmutableList<Label> instance for each $test_runtime attr.
211211
.value(getTestRuntimeLabelList(env)))
212212
.add(
213213
attr("$test_setup_script", LABEL)
214-
.cfg(ExecutionTransitionFactory.create())
214+
.cfg(ExecutionTransitionFactory.createFactory())
215215
.singleArtifact()
216216
.value(labelCache.get(toolsRepository + "//tools/test:test_setup")))
217217
.add(
218218
attr("$xml_generator_script", LABEL)
219-
.cfg(ExecutionTransitionFactory.create())
219+
.cfg(ExecutionTransitionFactory.createFactory())
220220
.singleArtifact()
221221
.value(labelCache.get(toolsRepository + "//tools/test:test_xml_generator")))
222222
.add(
223223
attr("$collect_coverage_script", LABEL)
224-
.cfg(ExecutionTransitionFactory.create())
224+
.cfg(ExecutionTransitionFactory.createFactory())
225225
.singleArtifact()
226226
.value(labelCache.get(toolsRepository + "//tools/test:collect_coverage")))
227227
// Input files for test actions collecting code coverage
228228
.add(
229229
attr(":coverage_support", LABEL)
230-
.cfg(ExecutionTransitionFactory.create())
230+
.cfg(ExecutionTransitionFactory.createFactory())
231231
.value(
232232
BaseRuleClasses.coverageSupportAttribute(
233233
labelCache.get(
234234
toolsRepository + BaseRuleClasses.DEFAULT_COVERAGE_SUPPORT_VALUE))))
235235
// Used in the one-per-build coverage report generation action.
236236
.add(
237237
attr(":coverage_report_generator", LABEL)
238-
.cfg(ExecutionTransitionFactory.create())
238+
.cfg(ExecutionTransitionFactory.createFactory())
239239
.value(
240240
BaseRuleClasses.coverageReportGeneratorAttribute(
241241
labelCache.get(

src/main/java/com/google/devtools/build/lib/bazel/rules/android/BazelAndroidLocalTestRule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment envi
8686
.removeAttribute(":java_launcher") // Input files for test actions collecting code coverage
8787
.add(
8888
attr(":lcov_merger", LABEL)
89-
.cfg(ExecutionTransitionFactory.create())
89+
.cfg(ExecutionTransitionFactory.createFactory())
9090
.value(BaseRuleClasses.getCoverageOutputGeneratorLabel()))
9191
.cfg(
9292
new ConfigFeatureFlagTransitionFactory(AndroidFeatureFlagSetProvider.FEATURE_FLAG_ATTR))

src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcTestRule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env)
5050
.override(attr("stamp", TRISTATE).value(TriState.NO))
5151
.add(
5252
attr(":lcov_merger", LABEL)
53-
.cfg(ExecutionTransitionFactory.create())
53+
.cfg(ExecutionTransitionFactory.createFactory())
5454
.value(BaseRuleClasses.getCoverageOutputGeneratorLabel()))
5555
.add(
5656
attr("$collect_cc_coverage", LABEL)
57-
.cfg(ExecutionTransitionFactory.create())
57+
.cfg(ExecutionTransitionFactory.createFactory())
5858
.singleArtifact()
5959
.value(env.getToolsLabel("//tools/test:collect_cc_coverage")))
6060
.build();

src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCppRuleClasses.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ <li> DYNAMIC, in which all libraries are linked dynamically (if a dynamic versio
368368
.add(attr("linkstatic", BOOLEAN).value(true))
369369
.add(
370370
attr("$def_parser", LABEL)
371-
.cfg(ExecutionTransitionFactory.create())
371+
.cfg(ExecutionTransitionFactory.createFactory())
372372
.singleArtifact()
373373
.value(
374374
new Attribute.ComputedDefault() {

src/main/java/com/google/devtools/build/lib/bazel/rules/genrule/BazelGenRuleRule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env)
4141
.setOutputToGenfiles()
4242
.add(
4343
attr("$genrule_setup", LABEL)
44-
.cfg(ExecutionTransitionFactory.create())
44+
.cfg(ExecutionTransitionFactory.createFactory())
4545
.value(env.getToolsLabel(GENRULE_SETUP_LABEL)))
4646

4747
// TODO(bazel-team): stamping doesn't seem to work. Fix it or remove attribute.

0 commit comments

Comments
 (0)