Refactored fabric PipeconfLoader to automatically build pipeconfs

Fabric.p4 is evolving in a way that will allow multiple profiles (e.g.
fabric, fabric-spgw, fabric-int, etc). Moreover, we need to support
multiple targets (e.g. BMv2, Tofino, etc.) as well as platforms
(variant of a target). Maintaining a pipeconf for each
profile/target/platform is time-consuming.

The new PipeconfLoader automatically builds pipeconfs based on the
available p4c compiler outputs available in the 'resources' directory.
This approach removes the need to maintain separate pipeconfs like
fabric-pro. Those interested in using fabric.p4 with targets other than
BMv2, will simply need to place the appropriate target/platform-specific
P4 compiler outputs in the resource directory.

Change-Id: I58d208a1837e747357373b2296cb950f13799ed6
diff --git a/pipelines/fabric/src/main/resources/bmv2-compile.sh b/pipelines/fabric/src/main/resources/bmv2-compile.sh
new file mode 100755
index 0000000..d92a5c4
--- /dev/null
+++ b/pipelines/fabric/src/main/resources/bmv2-compile.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+set -ex
+
+BMV2_CPU_PORT="255"
+BMV2_PP_FLAGS="-DTARGET_BMV2 -DCPU_PORT=${BMV2_CPU_PORT}"
+
+PROFILE=$1
+OTHER_PP_FLAGS=$2
+
+OUT_DIR=./p4c-out/${PROFILE}/bmv2/default
+
+mkdir -p ${OUT_DIR}
+
+p4c-bm2-ss --arch v1model \
+        -o ${OUT_DIR}/bmv2.json \
+        ${BMV2_PP_FLAGS} ${OTHER_PP_FLAGS} \
+        --p4runtime-file ${OUT_DIR}/p4info.txt \
+        --p4runtime-format text \
+        fabric.p4