Skip to content

Commit 6b4d9f2

Browse files
Googlercopybara-github
authored andcommitted
Use better naming for one-version allowlist for tests: rename it from oneversion_enforcement_allowlist to oneversion_allowlist_for_tests
PiperOrigin-RevId: 550598799 Change-Id: I4d7e47e2df808c3727f84b7aceeff5f7041bb9a8
1 parent ec89e2e commit 6b4d9f2

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

src/main/java/com/google/devtools/build/lib/rules/java/JavaToolchain.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ public ConfiguredTarget create(RuleContext ruleContext)
8181
FilesToRunProvider singleJar = ruleContext.getExecutablePrerequisite("singlejar");
8282
FilesToRunProvider oneVersion = ruleContext.getExecutablePrerequisite("oneversion");
8383
Artifact oneVersionAllowlist = ruleContext.getPrerequisiteArtifact("oneversion_whitelist");
84-
Artifact oneVersionEnforcementAllowlist =
85-
ruleContext.getPrerequisiteArtifact("oneversion_enforcement_allowlist");
84+
Artifact oneVersionAllowlistForTests =
85+
ruleContext.getPrerequisiteArtifact("oneversion_allowlist_for_tests");
8686
Artifact genClass = ruleContext.getPrerequisiteArtifact("genclass");
8787
Artifact depsChecker = ruleContext.getPrerequisiteArtifact("deps_checker");
8888
Artifact timezoneData = ruleContext.getPrerequisiteArtifact("timezone_data");
@@ -185,7 +185,7 @@ public ConfiguredTarget create(RuleContext ruleContext)
185185
singleJar,
186186
oneVersion,
187187
oneVersionAllowlist,
188-
oneVersionEnforcementAllowlist,
188+
oneVersionAllowlistForTests,
189189
genClass,
190190
depsChecker,
191191
timezoneData,

src/main/java/com/google/devtools/build/lib/rules/java/JavaToolchainProvider.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public static JavaToolchainProvider create(
113113
FilesToRunProvider singleJar,
114114
@Nullable FilesToRunProvider oneVersion,
115115
@Nullable Artifact oneVersionAllowlist,
116-
@Nullable Artifact oneVersionEnforcementAllowlist,
116+
@Nullable Artifact oneVersionAllowlistForTests,
117117
Artifact genClass,
118118
@Nullable Artifact depsChecker,
119119
@Nullable Artifact timezoneData,
@@ -141,7 +141,7 @@ public static JavaToolchainProvider create(
141141
singleJar,
142142
oneVersion,
143143
oneVersionAllowlist,
144-
oneVersionEnforcementAllowlist,
144+
oneVersionAllowlistForTests,
145145
genClass,
146146
depsChecker,
147147
timezoneData,
@@ -175,7 +175,7 @@ public static JavaToolchainProvider create(
175175
private final FilesToRunProvider singleJar;
176176
@Nullable private final FilesToRunProvider oneVersion;
177177
@Nullable private final Artifact oneVersionAllowlist;
178-
@Nullable private final Artifact oneVersionEnforcementAllowlist;
178+
@Nullable private final Artifact oneVersionAllowlistForTests;
179179
private final Artifact genClass;
180180
@Nullable private final Artifact depsChecker;
181181
@Nullable private final Artifact timezoneData;
@@ -209,7 +209,7 @@ private JavaToolchainProvider(
209209
FilesToRunProvider singleJar,
210210
@Nullable FilesToRunProvider oneVersion,
211211
@Nullable Artifact oneVersionAllowlist,
212-
@Nullable Artifact oneVersionEnforcementAllowlist,
212+
@Nullable Artifact oneVersionAllowlistForTests,
213213
Artifact genClass,
214214
@Nullable Artifact depsChecker,
215215
@Nullable Artifact timezoneData,
@@ -242,7 +242,7 @@ private JavaToolchainProvider(
242242
this.singleJar = singleJar;
243243
this.oneVersion = oneVersion;
244244
this.oneVersionAllowlist = oneVersionAllowlist;
245-
this.oneVersionEnforcementAllowlist = oneVersionEnforcementAllowlist;
245+
this.oneVersionAllowlistForTests = oneVersionAllowlistForTests;
246246
this.genClass = genClass;
247247
this.depsChecker = depsChecker;
248248
this.timezoneData = timezoneData;
@@ -375,19 +375,19 @@ public Artifact getOneVersionAllowlist() {
375375
}
376376

377377
/**
378-
* Return the {@link Artifact} of the one-version-enforcement allowlist used by the one-version
378+
* Return the {@link Artifact} of the one-version allowlist for tests used by the one-version
379379
* compliance checker.
380380
*/
381381
@Nullable
382-
public Artifact oneVersionEnforcementAllowlist() {
383-
return oneVersionEnforcementAllowlist;
382+
public Artifact oneVersionAllowlistForTests() {
383+
return oneVersionAllowlistForTests;
384384
}
385385

386386
@Override
387387
@Nullable
388-
public Artifact getOneVersionEnforcementAllowlist(StarlarkThread thread) throws EvalException {
388+
public Artifact getOneVersionAllowlistForTests(StarlarkThread thread) throws EvalException {
389389
checkPrivateAccess(thread);
390-
return oneVersionEnforcementAllowlist();
390+
return oneVersionAllowlistForTests();
391391
}
392392

393393
/** Returns the {@link Artifact} of the GenClass deploy jar */

src/main/java/com/google/devtools/build/lib/rules/java/JavaToolchainRule.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,11 @@ The Java target version (e.g., '6' or '7'). It specifies for which Java runtime
257257
.cfg(ExecutionTransitionFactory.createFactory())
258258
.allowedFileTypes(FileTypeSet.ANY_FILE)
259259
.exec())
260-
/* <!-- #BLAZE_RULE(java_toolchain).ATTRIBUTE(oneversion_enforcement_allowlist) -->
261-
Label of the one-version-enforcement allowlist.
260+
/* <!-- #BLAZE_RULE(java_toolchain).ATTRIBUTE(oneversion_allowlist_for_tests) -->
261+
Label of the one-version allowlist for tests.
262262
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
263263
.add(
264-
attr("oneversion_enforcement_allowlist", LABEL)
264+
attr("oneversion_allowlist_for_tests", LABEL)
265265
.singleArtifact()
266266
// This needs to be in the execution configuration.
267267
.cfg(ExecutionTransitionFactory.createFactory())

src/main/java/com/google/devtools/build/lib/starlarkbuildapi/java/JavaToolchainStarlarkApiProviderApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ public interface JavaToolchainStarlarkApiProviderApi extends StructApi {
8686
FileApi getOneVersionAllowlist();
8787

8888
@StarlarkMethod(
89-
name = "one_version_enforcement_allowlist",
89+
name = "one_version_allowlist_for_tests",
9090
doc = "The allowlist used by the One-Version compliance checker to disable enforcement",
9191
useStarlarkThread = true,
9292
allowReturnNones = true)
9393
@Nullable
94-
FileApi getOneVersionEnforcementAllowlist(StarlarkThread thread) throws EvalException;
94+
FileApi getOneVersionAllowlistForTests(StarlarkThread thread) throws EvalException;
9595

9696
@StarlarkMethod(
9797
name = "bootclasspath",

0 commit comments

Comments
 (0)