mirror of
https://github.com/google/nomulus.git
synced 2025-08-06 01:35:17 +02:00
Upgrade Nomulus to latest Closure Rules
Significant technical debt has been eliminated. The latest best practices are also now adopted for dealing with runfiles and dealing with files across repositories. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=140762937
This commit is contained in:
parent
79a72387ee
commit
59f4984083
28 changed files with 193 additions and 361 deletions
|
@ -29,9 +29,9 @@ zip_contents_test(
|
|||
name = "zip_emptyMapping_leavesShortPathsInTact",
|
||||
src = "basic.zip",
|
||||
contents = {
|
||||
"javatests/google/registry/builddefs/generated.txt": "generated",
|
||||
"javatests/google/registry/builddefs/hello.txt": "hello",
|
||||
"javatests/google/registry/builddefs/world.txt": "world",
|
||||
"domain_registry/javatests/google/registry/builddefs/generated.txt": "generated",
|
||||
"domain_registry/javatests/google/registry/builddefs/hello.txt": "hello",
|
||||
"domain_registry/javatests/google/registry/builddefs/world.txt": "world",
|
||||
},
|
||||
)
|
||||
|
||||
|
@ -39,7 +39,7 @@ zip_file(
|
|||
name = "stripped",
|
||||
srcs = ["hello.txt"],
|
||||
out = "stripped.zip",
|
||||
mappings = {"javatests/google/registry/builddefs": ""},
|
||||
mappings = {"domain_registry/javatests/google/registry/builddefs": ""},
|
||||
)
|
||||
|
||||
zip_contents_test(
|
||||
|
@ -57,8 +57,8 @@ zip_file(
|
|||
],
|
||||
out = "repath.zip",
|
||||
mappings = {
|
||||
"javatests/google/registry/builddefs": "a/b/c",
|
||||
"javatests/google/registry/builddefs/generated.txt": "x/y/z/generated.txt",
|
||||
"domain_registry/javatests/google/registry/builddefs": "a/b/c",
|
||||
"domain_registry/javatests/google/registry/builddefs/generated.txt": "x/y/z/generated.txt",
|
||||
},
|
||||
)
|
||||
|
||||
|
@ -76,7 +76,7 @@ zip_file(
|
|||
name = "overridden",
|
||||
srcs = ["override/hello.txt"],
|
||||
out = "overridden.zip",
|
||||
mappings = {"javatests/google/registry/builddefs/override": "a/b/c"},
|
||||
mappings = {"domain_registry/javatests/google/registry/builddefs/override": "a/b/c"},
|
||||
deps = [":repath"],
|
||||
)
|
||||
|
||||
|
|
|
@ -14,15 +14,15 @@
|
|||
|
||||
"""Build rule for unit testing the zip_file() rule."""
|
||||
|
||||
load('//java/google/registry/builddefs:defs.bzl', 'ZIPPER', 'runpath')
|
||||
load('//java/google/registry/builddefs:defs.bzl', 'ZIPPER')
|
||||
|
||||
def _impl(ctx):
|
||||
"""Implementation of zip_contents_test() rule."""
|
||||
cmd = [
|
||||
'set -e',
|
||||
'repo="$(pwd)"',
|
||||
'zipper="${repo}/%s"' % runpath(ctx.file._zipper),
|
||||
'archive="${repo}/%s"' % runpath(ctx.file.src),
|
||||
'zipper="${repo}/%s"' % ctx.file._zipper.short_path,
|
||||
'archive="${repo}/%s"' % ctx.file.src.short_path,
|
||||
('listing="$("${zipper}" v "${archive}"' +
|
||||
' | grep -v ^d | awk \'{print $3}\' | LC_ALL=C sort)"'),
|
||||
'if [[ "${listing}" != "%s" ]]; then' % (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue