Skip to content

Commit

Permalink
BEGIN_PUBLIC
Browse files Browse the repository at this point in the history
Update references to proguard_whitelister
END_PUBLIC

PiperOrigin-RevId: 683776851
Change-Id: If5c33e2fc314b3b0aaa27ec66b979cfa5bd07a5c
  • Loading branch information
cushon authored and copybara-github committed Oct 8, 2024
1 parent a3b8e31 commit e3cd986
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
6 changes: 3 additions & 3 deletions tools/jdk/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ filegroup(
"launcher_flag_alias.bzl",
"local_java_repository.bzl",
"nosystemjdk/README",
"proguard_whitelister.py",
"proguard_whitelister_test.py",
"proguard_whitelister_test_input.pgcfg",
"proguard_allowlister.py",
"proguard_allowlister_test.py",
"proguard_allowlister_test_input.pgcfg",
"remote_java_repository.bzl",
"toolchain_utils.bzl",
":java_stub_template.txt",
Expand Down
18 changes: 12 additions & 6 deletions tools/jdk/BUILD.tools
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,25 @@ filegroup(
visibility = ["//tools:__pkg__"],
)

py_binary(
# TODO(cushon): Delete this alias in the fullness of time.
alias(
name = "proguard_whitelister",
actual = ":proguard_allowlister",
)

py_binary(
name = "proguard_allowlister",
srcs = [
"proguard_whitelister.py",
"proguard_allowlister.py",
],
)

py_test(
name = "proguard_whitelister_test",
srcs = ["proguard_whitelister_test.py"],
data = ["proguard_whitelister_test_input.pgcfg"],
name = "proguard_allowlister_test",
srcs = ["proguard_allowlister_test.py"],
data = ["proguard_allowlister_test_input.pgcfg"],
deps = [
":proguard_whitelister",
":proguard_allowlister",
],
)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,30 @@

# Do not edit this line. Copybara replaces it with PY2 migration helper.

from tools.jdk import proguard_whitelister
from tools.jdk import proguard_allowlister


class ProguardConfigValidatorTest(unittest.TestCase):

def _CreateValidator(self, input_path, output_path):
return proguard_whitelister.ProguardConfigValidator(input_path, output_path)
return proguard_allowlister.ProguardConfigValidator(input_path, output_path)

def testValidConfig(self):
input_path = os.path.join(
os.path.dirname(__file__), "proguard_whitelister_test_input.pgcfg")
os.path.dirname(__file__), "proguard_allowlister_test_input.pgcfg")
tmpdir = os.environ["TEST_TMPDIR"]
output_path = os.path.join(tmpdir, "proguard_whitelister_test_output.pgcfg")
output_path = os.path.join(tmpdir, "proguard_allowlister_test_output.pgcfg")
# This will raise an exception if the config is invalid.
self._CreateValidator(input_path, output_path).ValidateAndWriteOutput()
with open(output_path) as output:
self.assertIn("# Merged from %s" % input_path, output.read())

def _TestInvalidConfig(self, invalid_args, config):
tmpdir = os.environ["TEST_TMPDIR"]
input_path = os.path.join(tmpdir, "proguard_whitelister_test_input.pgcfg")
input_path = os.path.join(tmpdir, "proguard_allowlister_test_input.pgcfg")
with open(input_path, "w", encoding="utf-8") as f:
f.write(config)
output_path = os.path.join(tmpdir, "proguard_whitelister_test_output.pgcfg")
output_path = os.path.join(tmpdir, "proguard_allowlister_test_output.pgcfg")
validator = self._CreateValidator(input_path, output_path)
with self.assertRaises(RuntimeError) as error:
validator.ValidateAndWriteOutput()
Expand Down

0 comments on commit e3cd986

Please sign in to comment.