libmobilecoin-ios-artifacts/Dockerfile
Adam Mork 256d3216cd
Masked Amount V1/V2 Changes (#52)
### Motivation

Support the MaskedAmount v1/v2 changes coming for v4.0.0 of the enclave.

### In this PR
* Pass in a versioned MaskedAmount to the relevant calls
* Create a "legacy" view.proto file so we can re-use serialized data in some Swift unit-tests
* Version increment to trigger a release.

### Future Work
* Convert unit-tests to use new proto, remove "legacy" view.proto

Co-authored-by: Cary A. Bakker <cary@mobilecoin.com>
Co-authored-by: mobilecoin-ci <mobilecoin-ci@mobilecoin.com>
2022-12-08 15:03:56 -08:00

86 lines
2.6 KiB
Docker

FROM swift:focal as plugins
RUN apt-get -q update && apt-get -q install -y --no-install-recommends \
make \
&& rm -r /var/lib/apt/lists/*
ARG grpc_swift_version
WORKDIR /root
RUN git clone --depth 1 -b $grpc_swift_version https://github.com/grpc/grpc-swift.git
WORKDIR grpc-swift
RUN make plugins
FROM swift:focal as build
RUN apt-get -q update && apt-get -q install -y --no-install-recommends \
libprotobuf-dev \
protobuf-compiler \
protobuf-compiler-grpc \
&& rm -r /var/lib/apt/lists/*
COPY --from=plugins \
/root/grpc-swift/protoc-gen-grpc-swift \
/root/grpc-swift/protoc-gen-swift \
/root/grpc-swift-plugins/bin/
ENV PATH="/root/grpc-swift-plugins/bin:${PATH}"
WORKDIR /root/project
COPY Vendor/mobilecoin/api/proto/blockchain.proto \
Vendor/mobilecoin/api/proto/external.proto \
Vendor/mobilecoin/api/proto/printable.proto \
Vendor/mobilecoin/api/proto/quorum_set.proto \
Vendor/mobilecoin/api/proto/watcher.proto \
Vendor/mobilecoin/api/proto/
COPY Vendor/mobilecoin/attest/api/proto/attest.proto \
Vendor/mobilecoin/attest/api/proto/
COPY Vendor/mobilecoin/consensus/api/proto/consensus_client.proto \
Vendor/mobilecoin/consensus/api/proto/consensus_common.proto \
Vendor/mobilecoin/consensus/api/proto/consensus_config.proto \
Vendor/mobilecoin/consensus/api/proto/
COPY Vendor/mobilecoin/fog/report/api/proto/report.proto \
Vendor/mobilecoin/fog/report/api/proto/
COPY Vendor/mobilecoin/fog/api/proto/fog_common.proto \
Vendor/mobilecoin/fog/api/proto/kex_rng.proto \
Vendor/mobilecoin/fog/api/proto/ledger.proto \
Vendor/mobilecoin/fog/api/proto/view.proto \
libmobilecoin/legacy/legacyview.proto \
Vendor/mobilecoin/fog/api/proto/
RUN mkdir -p Sources/Generated/Proto
RUN protoc \
--swift_out=Sources/Generated/Proto \
--swift_opt=Visibility=Public \
--grpc-swift_out=Sources/Generated/Proto \
--grpc-swift_opt=Client=true,Server=false,Visibility=Public \
-IVendor/mobilecoin/api/proto \
-IVendor/mobilecoin/attest/api/proto \
-IVendor/mobilecoin/consensus/api/proto \
-IVendor/mobilecoin/fog/api/proto \
-IVendor/mobilecoin/fog/report/api/proto \
external.proto \
blockchain.proto \
printable.proto \
quorum_set.proto \
watcher.proto \
attest.proto \
consensus_client.proto \
consensus_common.proto \
consensus_config.proto \
report.proto \
fog_common.proto \
kex_rng.proto \
ledger.proto \
view.proto \
legacyview.proto
FROM scratch
COPY --from=build \
/root/project/Sources/Generated/Proto/ \
/Sources/Generated/Proto/