From 805682a7172c10ce89f8773239e5cf99ce511c99 Mon Sep 17 00:00:00 2001 From: Linus Gasser Date: Mon, 26 Jun 2023 09:56:37 +0200 Subject: [PATCH] Updating Makefile to give instructions to download protoc --- external/Makefile | 11 +++- .../java/ch/epfl/dedis/lib/proto/Evoting.java | 60 +++++++++++++++++++ external/proto/evoting.proto | 2 + 3 files changed, 70 insertions(+), 3 deletions(-) diff --git a/external/Makefile b/external/Makefile index 0f155d863..61aefd479 100644 --- a/external/Makefile +++ b/external/Makefile @@ -15,9 +15,14 @@ do-js: check_protoc check_protoc: - @which protoc || (echo "Install protoc version 3.17.3. On Mac, run \"brew install protobuf@3.17.3\"" && exit 1) - @pv=`protoc --version`; \ + which protoc || $(MAKE) protoc_instructions + pv=`protoc --version`; \ if [ "$$pv" != "libprotoc 3.17.3" ]; then \ echo "Protoc version $$pv is not supported."; \ - exit 1; \ + $(MAKE) protoc_instructions; \ fi + +protoc_instructions: + echo "Please download version 3.17.3 from here:" + echo "https://github.com/protocolbuffers/protobuf/releases/tag/v3.17.3" + exit 1 diff --git a/external/java/src/main/java/ch/epfl/dedis/lib/proto/Evoting.java b/external/java/src/main/java/ch/epfl/dedis/lib/proto/Evoting.java index c5f1c4c81..56afba30c 100644 --- a/external/java/src/main/java/ch/epfl/dedis/lib/proto/Evoting.java +++ b/external/java/src/main/java/ch/epfl/dedis/lib/proto/Evoting.java @@ -13946,16 +13946,28 @@ public interface PartialAdditionalOrBuilder extends com.google.protobuf.MessageOrBuilder { /** + *
+     * All additional points from a single voter.
+     * 
+ * * repeated bytes additionalpoints = 1; * @return A list containing the additionalpoints. */ java.util.List getAdditionalpointsList(); /** + *
+     * All additional points from a single voter.
+     * 
+ * * repeated bytes additionalpoints = 1; * @return The count of additionalpoints. */ int getAdditionalpointsCount(); /** + *
+     * All additional points from a single voter.
+     * 
+ * * repeated bytes additionalpoints = 1; * @param index The index of the element to return. * @return The additionalpoints at the given index. @@ -13963,6 +13975,10 @@ public interface PartialAdditionalOrBuilder extends com.google.protobuf.ByteString getAdditionalpoints(int index); } /** + *
+   * PartialAdditional is used because protobuf cannot handle array of array of bytes.
+   * 
+ * * Protobuf type {@code evoting.PartialAdditional} */ public static final class PartialAdditional extends @@ -14055,6 +14071,10 @@ private PartialAdditional( public static final int ADDITIONALPOINTS_FIELD_NUMBER = 1; private java.util.List additionalpoints_; /** + *
+     * All additional points from a single voter.
+     * 
+ * * repeated bytes additionalpoints = 1; * @return A list containing the additionalpoints. */ @@ -14064,6 +14084,10 @@ private PartialAdditional( return additionalpoints_; } /** + *
+     * All additional points from a single voter.
+     * 
+ * * repeated bytes additionalpoints = 1; * @return The count of additionalpoints. */ @@ -14071,6 +14095,10 @@ public int getAdditionalpointsCount() { return additionalpoints_.size(); } /** + *
+     * All additional points from a single voter.
+     * 
+ * * repeated bytes additionalpoints = 1; * @param index The index of the element to return. * @return The additionalpoints at the given index. @@ -14242,6 +14270,10 @@ protected Builder newBuilderForType( return builder; } /** + *
+     * PartialAdditional is used because protobuf cannot handle array of array of bytes.
+     * 
+ * * Protobuf type {@code evoting.PartialAdditional} */ public static final class Builder extends @@ -14409,6 +14441,10 @@ private void ensureAdditionalpointsIsMutable() { } } /** + *
+       * All additional points from a single voter.
+       * 
+ * * repeated bytes additionalpoints = 1; * @return A list containing the additionalpoints. */ @@ -14418,6 +14454,10 @@ private void ensureAdditionalpointsIsMutable() { java.util.Collections.unmodifiableList(additionalpoints_) : additionalpoints_; } /** + *
+       * All additional points from a single voter.
+       * 
+ * * repeated bytes additionalpoints = 1; * @return The count of additionalpoints. */ @@ -14425,6 +14465,10 @@ public int getAdditionalpointsCount() { return additionalpoints_.size(); } /** + *
+       * All additional points from a single voter.
+       * 
+ * * repeated bytes additionalpoints = 1; * @param index The index of the element to return. * @return The additionalpoints at the given index. @@ -14433,6 +14477,10 @@ public com.google.protobuf.ByteString getAdditionalpoints(int index) { return additionalpoints_.get(index); } /** + *
+       * All additional points from a single voter.
+       * 
+ * * repeated bytes additionalpoints = 1; * @param index The index to set the value at. * @param value The additionalpoints to set. @@ -14449,6 +14497,10 @@ public Builder setAdditionalpoints( return this; } /** + *
+       * All additional points from a single voter.
+       * 
+ * * repeated bytes additionalpoints = 1; * @param value The additionalpoints to add. * @return This builder for chaining. @@ -14463,6 +14515,10 @@ public Builder addAdditionalpoints(com.google.protobuf.ByteString value) { return this; } /** + *
+       * All additional points from a single voter.
+       * 
+ * * repeated bytes additionalpoints = 1; * @param values The additionalpoints to add. * @return This builder for chaining. @@ -14476,6 +14532,10 @@ public Builder addAllAdditionalpoints( return this; } /** + *
+       * All additional points from a single voter.
+       * 
+ * * repeated bytes additionalpoints = 1; * @return This builder for chaining. */ diff --git a/external/proto/evoting.proto b/external/proto/evoting.proto index 1e05b1aa4..f237c9b6c 100644 --- a/external/proto/evoting.proto +++ b/external/proto/evoting.proto @@ -138,6 +138,8 @@ message Partial { repeated PartialAdditional additionalpoints = 4; } +// PartialAdditional is used because protobuf cannot handle array of array of bytes. message PartialAdditional { + // All additional points from a single voter. repeated bytes additionalpoints = 1; }