Paladox | 70d2fcd | 2016-11-23 19:35:16 +0000 | [diff] [blame] | 1 | #!/bin/bash -e |
| 2 | |
Luca Milanesio | 511503c | 2021-12-13 22:21:18 +0000 | [diff] [blame^] | 3 | . set-java.sh 11 |
Luca Milanesio | 66abd9e | 2020-10-23 15:28:43 +0100 | [diff] [blame] | 4 | |
Antonio Barone | 68dc5fe | 2019-08-21 11:02:53 +0100 | [diff] [blame] | 5 | git checkout -fb {branch} gerrit/{branch} |
| 6 | git submodule update --init |
Paladox | 70d2fcd | 2016-11-23 19:35:16 +0000 | [diff] [blame] | 7 | rm -rf plugins/{name} |
| 8 | git read-tree -u --prefix=plugins/{name} origin/{branch} |
Luca Milanesio | 9ccd296 | 2019-12-10 15:20:42 +0000 | [diff] [blame] | 9 | git fetch --tags origin |
Paladox | 70d2fcd | 2016-11-23 19:35:16 +0000 | [diff] [blame] | 10 | |
Thomas Draebing | 783f1e4 | 2020-06-16 17:28:56 +0200 | [diff] [blame] | 11 | for file in external_plugin_deps.bzl package.json |
| 12 | do |
| 13 | if [ -f plugins/{name}/$file ] |
| 14 | then |
| 15 | cp -f plugins/{name}/$file plugins/ |
| 16 | fi |
| 17 | done |
Luca Milanesio | 6374864 | 2017-01-26 10:01:28 +0000 | [diff] [blame] | 18 | |
Paladox | 70d2fcd | 2016-11-23 19:35:16 +0000 | [diff] [blame] | 19 | TARGETS=$(echo "{targets}" | sed -e 's/{{name}}/{name}/g') |
Paladox | 70d2fcd | 2016-11-23 19:35:16 +0000 | [diff] [blame] | 20 | |
David Pursehouse | a19f76a | 2019-10-30 16:07:24 +0900 | [diff] [blame] | 21 | java -fullversion |
Luca Milanesio | 4e82637 | 2019-06-07 15:19:35 +0100 | [diff] [blame] | 22 | bazelisk version |
Luca Milanesio | 4041dd8 | 2020-12-10 15:13:32 +0000 | [diff] [blame] | 23 | bazelisk build $BAZEL_OPTS $TARGETS |
Luca Milanesio | 78fd2e9 | 2020-10-07 13:36:35 +0100 | [diff] [blame] | 24 | bazelisk test $BAZEL_OPTS --test_env DOCKER_HOST=$DOCKER_HOST //tools/bzl:always_pass_test plugins/{name}/... |
Luca Milanesio | 7bd7a36 | 2018-07-31 08:17:06 -0700 | [diff] [blame] | 25 | |
Marcin Czech | 35c8e8c | 2020-07-16 18:34:48 +0200 | [diff] [blame] | 26 | for JAR in $(find bazel-bin/plugins/{name} -maxdepth 1 -name {name}*.jar) |
| 27 | do |
| 28 | PLUGIN_VERSION=$(git describe --always origin/{branch}) |
| 29 | echo -e "Implementation-Version: $PLUGIN_VERSION" > MANIFEST.MF |
| 30 | jar ufm $JAR MANIFEST.MF && rm MANIFEST.MF |
| 31 | DEST_JAR=bazel-bin/plugins/{name}/$(basename $JAR) |
| 32 | [ "$JAR" -ef "$DEST_JAR" ] || mv $JAR $DEST_JAR |
| 33 | echo "$PLUGIN_VERSION" > bazel-bin/plugins/{name}/$(basename $JAR-version) |
| 34 | done |