Merge branch 'stable-3.1' into stable-3.2

* stable-3.1:
  Update git submodules
  AccountResolver: limit number of ambiguous accounts in error message
  Update highlightjs to 10.5.0

Change-Id: Ib49b3bb95a606db0d0418d9d2e467aadba330768
This commit is contained in:
David Ostrovsky
2021-01-14 23:34:30 +01:00
4 changed files with 3632 additions and 645 deletions

View File

@@ -109,7 +109,10 @@ public class AccountResolver {
return result.asList().stream() return result.asList().stream()
.map(a -> formatForException(result, a)) .map(a -> formatForException(result, a))
.collect(joining("\n", "Account '" + result.input() + "' is ambiguous:\n", "")); .limit(3)
.collect(
joining(
"\n", "Account '" + result.input() + "' is ambiguous (at most 3 shown):\n", ""));
} }
private static String formatForException(Result result, AccountState state) { private static String formatForException(Result result, AccountState state) {

View File

@@ -269,7 +269,8 @@ public class AccountResolverTest {
() -> search("foo", searchers, allVisible()).asUnique()); () -> search("foo", searchers, allVisible()).asUnique());
assertThat(thrown) assertThat(thrown)
.hasMessageThat() .hasMessageThat()
.isEqualTo("Account 'foo' is ambiguous:\n1: Anonymous Name (1)\n2: Anonymous Name (2)"); .isEqualTo(
"Account 'foo' is ambiguous (at most 3 shown):\n1: Anonymous Name (1)\n2: Anonymous Name (2)");
} }
@Test @Test
@@ -311,7 +312,8 @@ public class AccountResolverTest {
.new Result( .new Result(
"foo", ImmutableList.of(newAccount(3), newAccount(1)), ImmutableList.of()))) "foo", ImmutableList.of(newAccount(3), newAccount(1)), ImmutableList.of())))
.hasMessageThat() .hasMessageThat()
.isEqualTo("Account 'foo' is ambiguous:\n1: Anonymous Name (1)\n3: Anonymous Name (3)"); .isEqualTo(
"Account 'foo' is ambiguous (at most 3 shown):\n1: Anonymous Name (1)\n3: Anonymous Name (3)");
} }
@Test @Test

View File

@@ -26,27 +26,10 @@ languages included. Build it with the following:
$> ln -s ../../highlightjs-closure-templates/soy.js src/languages/soy.js $> ln -s ../../highlightjs-closure-templates/soy.js src/languages/soy.js
$> mkdir test/detect/soy && ln -s ../../../highlightjs-closure-templates/test/detect/soy/default.txt test/detect/soy/default.txt $> mkdir test/detect/soy && ln -s ../../../highlightjs-closure-templates/test/detect/soy/default.txt test/detect/soy/default.txt
$> npm install $> npm install
$> node tools/build.js -n $> node tools/build.js
The resulting JS file will appear in the "build" directory of the Highlight.js The resulting minified JS file will appear in the "build" directory of the Highlight.js
repo under the name "highlight.pack.js". repo under the name "highlight.min.js".
## Minification
Minify the file using closure-compiler using the command below.
$> wget https://dl.google.com/closure-compiler/compiler-latest.zip
$> unzip compiler-latest.zip
$> mv closure-compiler-*.jar closure-compiler.jar
$> java -jar ./closure-compiler.jar \
--js build/highlight.js \
--js_output_file build/highlight.min.js
Copy the header comment that appears on the first line of
build/highlight.pack.js and add it to the start of build/highlight.min.js.
## Finish ## Finish

File diff suppressed because one or more lines are too long