From c4202817dd4490ecf6e87ae8db1d96acc9a6b220 Mon Sep 17 00:00:00 2001 From: val-fed Date: Tue, 14 May 2019 21:52:24 +0300 Subject: [PATCH 1/2] Check out the existence of http_archive in WORKSPACE --- .../http_archive_deps/HttpArchiveDepsGenerator.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/build_file_generator/http_archive_deps/HttpArchiveDepsGenerator.java b/tools/build_file_generator/http_archive_deps/HttpArchiveDepsGenerator.java index b3c4bda4f..1b9fbfc12 100644 --- a/tools/build_file_generator/http_archive_deps/HttpArchiveDepsGenerator.java +++ b/tools/build_file_generator/http_archive_deps/HttpArchiveDepsGenerator.java @@ -73,6 +73,10 @@ public HttpArchiveDepsList getHttpArchiveDeps( httpArchive = currentHttpArchive; } } + if (httpArchive.getName().isEmpty()) { + log.atWarning().log("Can't find %s http_archive in WORKSPACE file,", httpArchiveName); + continue; + } if (areCommitIdsTheSame(httpArchiveName, getCommitId(httpArchive.getStripPrefix()))) { log.atInfo().log( "Commit id in WORKSPACE file and commit id in \'%s\' file for \'%s\' http_archive " @@ -231,7 +235,11 @@ private boolean areCommitIdsTheSame(String httpArchiveName, String workspaceComm break; } } - return workspaceCommitId.equals(prototxtCommitId); + if (prototxtCommitId.isEmpty()) { + return false; + } else { + return workspaceCommitId.equals(prototxtCommitId); + } } private String shortenTarget(String fullTargetName) { From d6173070626213fae24b8a18f0a38398deb2df8e Mon Sep 17 00:00:00 2001 From: val-fed Date: Tue, 14 May 2019 22:07:08 +0300 Subject: [PATCH 2/2] Remove the comma --- .../http_archive_deps/HttpArchiveDepsGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_file_generator/http_archive_deps/HttpArchiveDepsGenerator.java b/tools/build_file_generator/http_archive_deps/HttpArchiveDepsGenerator.java index 1b9fbfc12..aadc69b80 100644 --- a/tools/build_file_generator/http_archive_deps/HttpArchiveDepsGenerator.java +++ b/tools/build_file_generator/http_archive_deps/HttpArchiveDepsGenerator.java @@ -74,7 +74,7 @@ public HttpArchiveDepsList getHttpArchiveDeps( } } if (httpArchive.getName().isEmpty()) { - log.atWarning().log("Can't find %s http_archive in WORKSPACE file,", httpArchiveName); + log.atWarning().log("Can't find %s http_archive in WORKSPACE file", httpArchiveName); continue; } if (areCommitIdsTheSame(httpArchiveName, getCommitId(httpArchive.getStripPrefix()))) {