2018-09-06 13:47:33 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Script to generate protobuf Java code. Called by gradle to compile the
|
|
|
|
# protobuf spec file to Java source. Generates the file
|
|
|
|
# hirs/attestationca/configuration/provisionerTpm2/ProvisionerTpm2.java.
|
|
|
|
|
|
|
|
dir=$(pwd)
|
|
|
|
# Relative paths are different when building locally versus on CI
|
|
|
|
if [[ "$dir" == *"package"* ]]; then
|
2024-11-01 19:13:54 +00:00
|
|
|
SRC_DIR=$dir/../../../../../../HIRS_Provisioner.NET/hirs/Resources
|
2018-09-06 13:47:33 +00:00
|
|
|
DEST_DIR=$dir/../src/main/java
|
|
|
|
else
|
2024-11-01 19:13:54 +00:00
|
|
|
SRC_DIR=../../HIRS_Provisioner.NET/hirs/Resources
|
2018-09-06 13:47:33 +00:00
|
|
|
DEST_DIR=../src/main/java
|
|
|
|
fi
|
|
|
|
protoc -I=$SRC_DIR --java_out=$DEST_DIR $SRC_DIR/ProvisionerTpm2.proto
|