-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathupdateSamplesVersions.sh
executable file
·29 lines (27 loc) · 1.1 KB
/
updateSamplesVersions.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
# publish current snapshot locally and updates passed in samples to use the snapshot.
# this is mainly used for local tests. Watch out to no commit modified files.
if [ $# -eq 0 ]; then
echo "No arguments provided!"
echo "This scripted is used to update sample versions to the latest snapshot."
echo "You should call it by passing one or more samples as arguments."
echo "eg: ./updateSampleVersions.sh samples/java-protobuf-valueentity-counter samples/scala-protobuf-valueentity-counter"
echo "or simply using bash expansion..."
echo "eg: ./updateSampleVersions.sh samples/java-*"
else
source publishLocally.sh
export SDK_VERSION="$SDK_VERSION"
echo "------------------------------------------------------------------------"
for i in "$@"
do
echo
if [ -f $i/pom.xml ]; then
echo "Updating pom.xml file in: $i"
sh ./updateSdkVersions.sh java $i
elif [ -f $i/build.sbt ]; then
echo "Updating plugins.sbt file in: $i"
sh ./updateSdkVersions.sh scala $i
fi
done
echo "------------------------------------------------------------------------"
fi