Merge branch 'stable-2.16' into stable-3.0
* stable-2.16: Bazel: Make build tool chain forward compatible AccountIT: Add test that it is possible to delete all emails Change-Id: I167f1dd776f91628e6bc00691e214982268a97b9
This commit is contained in:
@@ -1098,6 +1098,27 @@ public class AccountIT extends AbstractDaemonTest {
|
|||||||
assertThat(gApi.accounts().self().get().email).isNull();
|
assertThat(gApi.accounts().self().get().email).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Sandboxed
|
||||||
|
public void deleteAllEmails() throws Exception {
|
||||||
|
EmailInput input = new EmailInput();
|
||||||
|
input.email = "foo.bar@example.com";
|
||||||
|
input.noConfirmation = true;
|
||||||
|
gApi.accounts().self().addEmail(input);
|
||||||
|
|
||||||
|
requestScopeOperations.resetCurrentApiUser();
|
||||||
|
Set<String> allEmails = getEmails();
|
||||||
|
assertThat(allEmails).hasSize(2);
|
||||||
|
|
||||||
|
for (String email : allEmails) {
|
||||||
|
gApi.accounts().self().deleteEmail(email);
|
||||||
|
}
|
||||||
|
|
||||||
|
requestScopeOperations.resetCurrentApiUser();
|
||||||
|
assertThat(getEmails()).isEmpty();
|
||||||
|
assertThat(gApi.accounts().self().get().email).isNull();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void deleteEmailFromCustomExternalIdSchemes() throws Exception {
|
public void deleteEmailFromCustomExternalIdSchemes() throws Exception {
|
||||||
String email = "foo.bar@example.com";
|
String email = "foo.bar@example.com";
|
||||||
|
@@ -45,6 +45,8 @@ npm_binary = repository_rule(
|
|||||||
implementation = _npm_binary_impl,
|
implementation = _npm_binary_impl,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ComponentInfo = provider()
|
||||||
|
|
||||||
# for use in repo rules.
|
# for use in repo rules.
|
||||||
def _run_npm_binary_str(ctx, tarball, args):
|
def _run_npm_binary_str(ctx, tarball, args):
|
||||||
python_bin = ctx.which("python")
|
python_bin = ctx.which("python")
|
||||||
@@ -133,31 +135,29 @@ bower_archive = repository_rule(
|
|||||||
def _bower_component_impl(ctx):
|
def _bower_component_impl(ctx):
|
||||||
transitive_zipfiles = depset(
|
transitive_zipfiles = depset(
|
||||||
direct = [ctx.file.zipfile],
|
direct = [ctx.file.zipfile],
|
||||||
transitive = [d.transitive_zipfiles for d in ctx.attr.deps],
|
transitive = [d[ComponentInfo].transitive_zipfiles for d in ctx.attr.deps],
|
||||||
)
|
)
|
||||||
|
|
||||||
transitive_licenses = depset(
|
transitive_licenses = depset(
|
||||||
direct = [ctx.file.license],
|
direct = [ctx.file.license],
|
||||||
transitive = [d.transitive_licenses for d in ctx.attr.deps],
|
transitive = [d[ComponentInfo].transitive_licenses for d in ctx.attr.deps],
|
||||||
)
|
)
|
||||||
|
|
||||||
transitive_versions = depset(
|
transitive_versions = depset(
|
||||||
direct = ctx.files.version_json,
|
direct = ctx.files.version_json,
|
||||||
transitive = [d.transitive_versions for d in ctx.attr.deps],
|
transitive = [d[ComponentInfo].transitive_versions for d in ctx.attr.deps],
|
||||||
)
|
)
|
||||||
|
|
||||||
return struct(
|
return [
|
||||||
|
ComponentInfo(
|
||||||
transitive_licenses = transitive_licenses,
|
transitive_licenses = transitive_licenses,
|
||||||
transitive_versions = transitive_versions,
|
transitive_versions = transitive_versions,
|
||||||
transitive_zipfiles = transitive_zipfiles,
|
transitive_zipfiles = transitive_zipfiles,
|
||||||
)
|
),
|
||||||
|
]
|
||||||
|
|
||||||
_common_attrs = {
|
_common_attrs = {
|
||||||
"deps": attr.label_list(providers = [
|
"deps": attr.label_list(providers = [ComponentInfo]),
|
||||||
"transitive_zipfiles",
|
|
||||||
"transitive_versions",
|
|
||||||
"transitive_licenses",
|
|
||||||
]),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def _js_component(ctx):
|
def _js_component(ctx):
|
||||||
@@ -187,11 +187,13 @@ def _js_component(ctx):
|
|||||||
if ctx.file.license:
|
if ctx.file.license:
|
||||||
licenses.append(ctx.file.license)
|
licenses.append(ctx.file.license)
|
||||||
|
|
||||||
return struct(
|
return [
|
||||||
|
ComponentInfo(
|
||||||
transitive_licenses = depset(licenses),
|
transitive_licenses = depset(licenses),
|
||||||
transitive_versions = depset(),
|
transitive_versions = depset(),
|
||||||
transitive_zipfiles = list([ctx.outputs.zip]),
|
transitive_zipfiles = list([ctx.outputs.zip]),
|
||||||
)
|
),
|
||||||
|
]
|
||||||
|
|
||||||
js_component = rule(
|
js_component = rule(
|
||||||
_js_component,
|
_js_component,
|
||||||
@@ -233,16 +235,16 @@ def _bower_component_bundle_impl(ctx):
|
|||||||
"""A bunch of bower components zipped up."""
|
"""A bunch of bower components zipped up."""
|
||||||
zips = depset()
|
zips = depset()
|
||||||
for d in ctx.attr.deps:
|
for d in ctx.attr.deps:
|
||||||
files = d.transitive_zipfiles
|
files = d[ComponentInfo].transitive_zipfiles
|
||||||
|
|
||||||
# TODO(davido): Make sure the field always contains a depset
|
# TODO(davido): Make sure the field always contains a depset
|
||||||
if type(files) == "list":
|
if type(files) == "list":
|
||||||
files = depset(files)
|
files = depset(files)
|
||||||
zips = depset(transitive = [zips, files])
|
zips = depset(transitive = [zips, files])
|
||||||
|
|
||||||
versions = depset(transitive = [d.transitive_versions for d in ctx.attr.deps])
|
versions = depset(transitive = [d[ComponentInfo].transitive_versions for d in ctx.attr.deps])
|
||||||
|
|
||||||
licenses = depset(transitive = [d.transitive_versions for d in ctx.attr.deps])
|
licenses = depset(transitive = [d[ComponentInfo].transitive_versions for d in ctx.attr.deps])
|
||||||
|
|
||||||
out_zip = ctx.outputs.zip
|
out_zip = ctx.outputs.zip
|
||||||
out_versions = ctx.outputs.version_json
|
out_versions = ctx.outputs.version_json
|
||||||
@@ -272,11 +274,13 @@ def _bower_component_bundle_impl(ctx):
|
|||||||
command = "(echo '{' ; for j in %s ; do cat $j; echo ',' ; done ; echo \\\"\\\":\\\"\\\"; echo '}') > %s" % (" ".join([v.path for v in versions.to_list()]), out_versions.path),
|
command = "(echo '{' ; for j in %s ; do cat $j; echo ',' ; done ; echo \\\"\\\":\\\"\\\"; echo '}') > %s" % (" ".join([v.path for v in versions.to_list()]), out_versions.path),
|
||||||
)
|
)
|
||||||
|
|
||||||
return struct(
|
return [
|
||||||
|
ComponentInfo(
|
||||||
transitive_licenses = licenses,
|
transitive_licenses = licenses,
|
||||||
transitive_versions = versions,
|
transitive_versions = versions,
|
||||||
transitive_zipfiles = zips,
|
transitive_zipfiles = zips,
|
||||||
)
|
),
|
||||||
|
]
|
||||||
|
|
||||||
bower_component_bundle = rule(
|
bower_component_bundle = rule(
|
||||||
_bower_component_bundle_impl,
|
_bower_component_bundle_impl,
|
||||||
@@ -304,7 +308,7 @@ def _bundle_impl(ctx):
|
|||||||
else:
|
else:
|
||||||
bundled = ctx.outputs.html
|
bundled = ctx.outputs.html
|
||||||
destdir = ctx.outputs.html.path + ".dir"
|
destdir = ctx.outputs.html.path + ".dir"
|
||||||
zips = [z for d in ctx.attr.deps for z in d.transitive_zipfiles.to_list()]
|
zips = [z for d in ctx.attr.deps for z in d[ComponentInfo].transitive_zipfiles.to_list()]
|
||||||
|
|
||||||
hermetic_npm_binary = " ".join([
|
hermetic_npm_binary = " ".join([
|
||||||
"python",
|
"python",
|
||||||
@@ -404,7 +408,7 @@ _bundle_rule = rule(
|
|||||||
),
|
),
|
||||||
"pkg": attr.string(mandatory = True),
|
"pkg": attr.string(mandatory = True),
|
||||||
"split": attr.bool(default = True),
|
"split": attr.bool(default = True),
|
||||||
"deps": attr.label_list(providers = ["transitive_zipfiles"]),
|
"deps": attr.label_list(providers = [ComponentInfo]),
|
||||||
"_bundler_archive": attr.label(
|
"_bundler_archive": attr.label(
|
||||||
default = Label("@polymer-bundler//:%s" % _npm_tarball("polymer-bundler")),
|
default = Label("@polymer-bundler//:%s" % _npm_tarball("polymer-bundler")),
|
||||||
allow_single_file = True,
|
allow_single_file = True,
|
||||||
|
Reference in New Issue
Block a user