-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathbundle
More file actions
executable file
·53 lines (44 loc) · 1.18 KB
/
bundle
File metadata and controls
executable file
·53 lines (44 loc) · 1.18 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
#
# Copyright (C) 2018 Klaus Reimer <k@ailis.de>
# See LICENSE.md for licensing information.
#
# Exit on errors
set -e
# Go to project root directory
cd "$(dirname $0)/.."
# Get version from pom.xml
VERSION=$(sed -nE '0,/<version>/s/.*<version>(.*?)<\/version>.*/\1/p' pom.xml)
# Determine SNAPSHOT version
SNAPSHOT_VERSION=$(echo $VERSION | sed s/-SNAPSHOT//)-SNAPSHOT
# Prepare bundle directory
rm -rf target/bundle/
mkdir -p target/bundle
# Download latest snapshot platform JARs
PLATFORMS="
linux-x86
linux-x86-64
linux-arm
linux-armel
linux-aarch64
win32-x86
win32-x86-64
darwin-x86-64
darwin-aarch64
"
for PLATFORM in $PLATFORMS
do
mvn dependency:copy -Dartifact=org.usb4java:libusb4java:$SNAPSHOT_VERSION:jar:$PLATFORM \
-DoutputDirectory=target/bundle/ -Dmdep.stripVersion=true
mv target/bundle/libusb4java-$PLATFORM.jar target/bundle/libusb4java-$VERSION-$PLATFORM.jar
done
# Copy pom to bundle directory
cp pom.xml target/bundle/libusb4java-$VERSION.pom
# Sign all files
for FILE in target/bundle/*
do
gpg -a --detach-sig $FILE
done
# Create bundle JAR file
cd target/bundle
jar cf ../libusb4java-$VERSION-bundle.jar *