Skip to content

Commit

Permalink
[7.4.1] Add missing private API for tokenizing javacopts (#24153)
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 587638256
Change-Id: I4aa6b9c2009323e9c4adc7f6e8b5e335a637ed1c

(cherry picked from commit fb446e6)
  • Loading branch information
hvadehra authored Oct 31, 2024
1 parent 3d8da1c commit 4b35a05
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,12 @@ public Sequence<?> expandJavaOpts(
}
}

@Override
public Sequence<?> tokenizeJavacOpts(Sequence<?> opts) throws EvalException {
return StarlarkList.immutableCopyOf(
JavaHelper.tokenizeJavaOptions(Sequence.noneableCast(opts, String.class, "opts")));
}

static boolean isInstanceOfProvider(Object obj, Provider provider) {
if (obj instanceof NativeInfo) {
return ((NativeInfo) obj).getProvider().getKey().equals(provider.getKey());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,4 +751,10 @@ JavaInfoT wrapJavaInfo(Info javaInfo, StarlarkThread thread)
Sequence<?> expandJavaOpts(
StarlarkRuleContextT ctx, String attr, boolean tokenize, boolean execPaths)
throws EvalException, InterruptedException;

@StarlarkMethod(
name = "tokenize_javacopts",
documented = false,
parameters = {@Param(name = "opts")})
Sequence<?> tokenizeJavacOpts(Sequence<?> opts) throws EvalException, InterruptedException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3752,6 +3752,7 @@ public void testNoArgsPrivateAPIsAreIndeedPrivate(String module, String api) thr
"{api: _incompatible_depset_for_java_output_source_jars}",
"{api: wrap_java_info}",
"{api: intern_javac_opts}",
"{api: tokenize_javacopts}",
})
public void testJavaCommonPrivateApis_areNotVisibleToPublicStarlark(String api) throws Exception {
// validate that this api is present on the module, so this test fails when the API is deleted
Expand Down

0 comments on commit 4b35a05

Please sign in to comment.