aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell
diff options
context:
space:
mode:
authorGravatar wjywbs <wjywbs@gmail.com>2015-11-25 18:07:41 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2015-11-26 13:18:12 +0000
commit92d8f82161eaf59f48ec7465e01c53f877e030b2 (patch)
tree7ecc3effc9a4c33037f3ad6a94a037f3d257344e /src/test/shell
parent9e091ddef4dbbd97a2bff75948c474fe4127e541 (diff)
Download the sha1 of the jar file from maven in generate_workspace.
The sha1 is not calculated yet for local jars. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/635 MOS_MIGRATED_REVID=108717022
Diffstat (limited to 'src/test/shell')
-rwxr-xr-xsrc/test/shell/bazel/generate_workspace_test.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/test/shell/bazel/generate_workspace_test.sh b/src/test/shell/bazel/generate_workspace_test.sh
index d96e35e2cb..fff3690812 100755
--- a/src/test/shell/bazel/generate_workspace_test.sh
+++ b/src/test/shell/bazel/generate_workspace_test.sh
@@ -69,8 +69,13 @@ public class $groupId {
}
}
EOF
+ local jar_path=$pkg_dir/$artifactId-$version.jar
${bazel_javabase}/bin/javac $TEST_TMPDIR/$groupId.java
- ${bazel_javabase}/bin/jar cf $pkg_dir/$artifactId-$version.jar $TEST_TMPDIR/$groupId.class
+ ${bazel_javabase}/bin/jar cf $jar_path $TEST_TMPDIR/$groupId.class
+
+ local sha1=$(shasum $jar_path | awk '{print $1}')
+ echo -n $sha1 > $jar_path.sha1
+ echo $sha1
}
function get_workspace_file() {
@@ -83,7 +88,7 @@ function get_build_file() {
function test_pom() {
# Create a maven repo
- make_artifact blorp glorp 1.2.3
+ local sha1=$(make_artifact blorp glorp 1.2.3)
# Create a pom that references the artifacts.
cat > $TEST_TMPDIR/pom.xml <<EOF
@@ -118,6 +123,7 @@ EOF
assert_contains "artifact = \"blorp:glorp:1.2.3\"," ws
assert_contains "repository = \"http://localhost:$fileserver_port/\"," ws
+ assert_contains "sha1 = \"$sha1\"," ws
assert_contains "\"@blorp_glorp//jar\"," build
}