Plugin gitiles stable-2.11 manual branch build with BUCK
<!-- Managed by Jenkins Job Builder -->
false
20
-1
20
-1
hudson.model.Item.Discover:anonymous
hudson.model.Item.ExtendedRead:anonymous
hudson.model.Item.Read:anonymous
REFS_CHANGE
Refs change as provided by Download/Checkout eg: refs/changes/21/75721/1
2
origin
+refs/heads/*:refs/remotes/origin/*
https://gerrit.googlesource.com/plugins/gitiles
gerrit
+refs/heads/*:refs/remotes/gerrit/*
https://gerrit.googlesource.com/gerrit
origin/stable-2.11
false
Default
false
true
false
false
10
true
false
false
false
false
#!/bin/bash -e
# NOTE: All Gerrit plugins currently depend on, at a minimum
# the bucklets repo, and most plugins don't build outside the
# Gerrit tree, even with bucklets. As a result, we need to
# graft the plugin onto the Gerrit repo. We do this by checking
# out the proper version of Gerrit, removing the plugin if it
# exists, then use git read-tree to put the plugin we're
# building in place.
git checkout gerrit/stable-2.11
rm -rf plugins/gitiles
git fetch https://gerrit.googlesource.com/plugins/gitiles $REFS_CHANGE
git read-tree -u --prefix=plugins/gitiles FETCH_HEAD
TARGETS=$(echo "plugins/{name}:{name}" | sed -e 's/{name}/gitiles/g')
SOURCE_LEVEL=$(grep "source_level" .buckconfig || echo "source_level=7")
. set-java.sh $(echo $SOURCE_LEVEL | cut -d '=' -f 2 | tr -d '[[:space:]]')
buck build -v 3 $TARGETS
for JAR in $(buck targets --show_output $TARGETS | awk '{print $2}')
do
PLUGIN_VERSION=$(git describe --always origin/stable-2.11)
echo -e "Implementation-Version: $PLUGIN_VERSION" > MANIFEST.MF
jar ufm $JAR MANIFEST.MF && rm MANIFEST.MF
DEST_JAR=buck-out/gen/plugins/gitiles/$(basename $JAR)
[ "$JAR" -ef "$DEST_JAR" ] || mv $JAR $DEST_JAR
echo "$PLUGIN_VERSION" > buck-out/gen/plugins/gitiles/$(basename $JAR-version)
done
buck-out/gen/plugins/gitiles/*gitiles*.jar*,
false
false
false
false
true
true
30