Skip to content

Commit

Permalink
Use better naming for one-version allowlist for tests: rename it from…
Browse files Browse the repository at this point in the history
… `oneversion_enforcement_allowlist` to `oneversion_allowlist_for_tests`

PiperOrigin-RevId: 550598799
Change-Id: I4d7e47e2df808c3727f84b7aceeff5f7041bb9a8
  • Loading branch information
Googler authored and copybara-github committed Jul 24, 2023
1 parent ec89e2e commit 6b4d9f2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public ConfiguredTarget create(RuleContext ruleContext)
FilesToRunProvider singleJar = ruleContext.getExecutablePrerequisite("singlejar");
FilesToRunProvider oneVersion = ruleContext.getExecutablePrerequisite("oneversion");
Artifact oneVersionAllowlist = ruleContext.getPrerequisiteArtifact("oneversion_whitelist");
Artifact oneVersionEnforcementAllowlist =
ruleContext.getPrerequisiteArtifact("oneversion_enforcement_allowlist");
Artifact oneVersionAllowlistForTests =
ruleContext.getPrerequisiteArtifact("oneversion_allowlist_for_tests");
Artifact genClass = ruleContext.getPrerequisiteArtifact("genclass");
Artifact depsChecker = ruleContext.getPrerequisiteArtifact("deps_checker");
Artifact timezoneData = ruleContext.getPrerequisiteArtifact("timezone_data");
Expand Down Expand Up @@ -185,7 +185,7 @@ public ConfiguredTarget create(RuleContext ruleContext)
singleJar,
oneVersion,
oneVersionAllowlist,
oneVersionEnforcementAllowlist,
oneVersionAllowlistForTests,
genClass,
depsChecker,
timezoneData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public static JavaToolchainProvider create(
FilesToRunProvider singleJar,
@Nullable FilesToRunProvider oneVersion,
@Nullable Artifact oneVersionAllowlist,
@Nullable Artifact oneVersionEnforcementAllowlist,
@Nullable Artifact oneVersionAllowlistForTests,
Artifact genClass,
@Nullable Artifact depsChecker,
@Nullable Artifact timezoneData,
Expand Down Expand Up @@ -141,7 +141,7 @@ public static JavaToolchainProvider create(
singleJar,
oneVersion,
oneVersionAllowlist,
oneVersionEnforcementAllowlist,
oneVersionAllowlistForTests,
genClass,
depsChecker,
timezoneData,
Expand Down Expand Up @@ -175,7 +175,7 @@ public static JavaToolchainProvider create(
private final FilesToRunProvider singleJar;
@Nullable private final FilesToRunProvider oneVersion;
@Nullable private final Artifact oneVersionAllowlist;
@Nullable private final Artifact oneVersionEnforcementAllowlist;
@Nullable private final Artifact oneVersionAllowlistForTests;
private final Artifact genClass;
@Nullable private final Artifact depsChecker;
@Nullable private final Artifact timezoneData;
Expand Down Expand Up @@ -209,7 +209,7 @@ private JavaToolchainProvider(
FilesToRunProvider singleJar,
@Nullable FilesToRunProvider oneVersion,
@Nullable Artifact oneVersionAllowlist,
@Nullable Artifact oneVersionEnforcementAllowlist,
@Nullable Artifact oneVersionAllowlistForTests,
Artifact genClass,
@Nullable Artifact depsChecker,
@Nullable Artifact timezoneData,
Expand Down Expand Up @@ -242,7 +242,7 @@ private JavaToolchainProvider(
this.singleJar = singleJar;
this.oneVersion = oneVersion;
this.oneVersionAllowlist = oneVersionAllowlist;
this.oneVersionEnforcementAllowlist = oneVersionEnforcementAllowlist;
this.oneVersionAllowlistForTests = oneVersionAllowlistForTests;
this.genClass = genClass;
this.depsChecker = depsChecker;
this.timezoneData = timezoneData;
Expand Down Expand Up @@ -375,19 +375,19 @@ public Artifact getOneVersionAllowlist() {
}

/**
* Return the {@link Artifact} of the one-version-enforcement allowlist used by the one-version
* Return the {@link Artifact} of the one-version allowlist for tests used by the one-version
* compliance checker.
*/
@Nullable
public Artifact oneVersionEnforcementAllowlist() {
return oneVersionEnforcementAllowlist;
public Artifact oneVersionAllowlistForTests() {
return oneVersionAllowlistForTests;
}

@Override
@Nullable
public Artifact getOneVersionEnforcementAllowlist(StarlarkThread thread) throws EvalException {
public Artifact getOneVersionAllowlistForTests(StarlarkThread thread) throws EvalException {
checkPrivateAccess(thread);
return oneVersionEnforcementAllowlist();
return oneVersionAllowlistForTests();
}

/** Returns the {@link Artifact} of the GenClass deploy jar */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,11 @@ The Java target version (e.g., '6' or '7'). It specifies for which Java runtime
.cfg(ExecutionTransitionFactory.createFactory())
.allowedFileTypes(FileTypeSet.ANY_FILE)
.exec())
/* <!-- #BLAZE_RULE(java_toolchain).ATTRIBUTE(oneversion_enforcement_allowlist) -->
Label of the one-version-enforcement allowlist.
/* <!-- #BLAZE_RULE(java_toolchain).ATTRIBUTE(oneversion_allowlist_for_tests) -->
Label of the one-version allowlist for tests.
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.add(
attr("oneversion_enforcement_allowlist", LABEL)
attr("oneversion_allowlist_for_tests", LABEL)
.singleArtifact()
// This needs to be in the execution configuration.
.cfg(ExecutionTransitionFactory.createFactory())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ public interface JavaToolchainStarlarkApiProviderApi extends StructApi {
FileApi getOneVersionAllowlist();

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

@StarlarkMethod(
name = "bootclasspath",
Expand Down

0 comments on commit 6b4d9f2

Please sign in to comment.