forked from java-native-access/jna
-
Notifications
You must be signed in to change notification settings - Fork 3
/
create-export-package-metadata.sh
62 lines (52 loc) · 1.46 KB
/
create-export-package-metadata.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env sh
set -e
extract_export_package_value_for_buildxml() {
sed -z -E 's:\r?\n ::g' "$1" \
| grep '^Export-Package' \
| sed 's/^Export-Package: //' \
| sed 's/",/",\n/g' \
| sed 's/1\.0\.0/${osgi.version}/g' \
| sed 's/"/\"/g'
}
rm -rf tmp
mkdir tmp
cp -r src tmp
mvn \
-f create-export-package-metadata-pom.xml \
-DsourceDirectory=tmp/src \
-DoutputDirectory=tmp/target \
-DexportedPackages=com.sun.jna,com.sun.jna.ptr,com.sun.jna.win32 \
clean package
cp -r contrib/platform/src tmp
mvn \
-f create-export-package-metadata-pom.xml \
-DsourceDirectory=tmp/src \
-DoutputDirectory=tmp/target-platform \
-DexportedPackages=\
com.sun.jna.platform,\
com.sun.jna.platform.dnd,\
com.sun.jna.platform.linux,\
com.sun.jna.platform.mac,\
com.sun.jna.platform.unix,\
com.sun.jna.platform.unix.aix,\
com.sun.jna.platform.unix.solaris,\
com.sun.jna.platform.win32,\
com.sun.jna.platform.win32.COM,\
com.sun.jna.platform.win32.COM.tlb,\
com.sun.jna.platform.win32.COM.tlb.imp,\
com.sun.jna.platform.win32.COM.util,\
com.sun.jna.platform.win32.COM.util.annotation,\
com.sun.jna.platform.wince \
-DimportedPackages=com.sun.jna,com.sun.jna.ptr,com.sun.jna.win32 \
clean package
echo 'build.xml: Export-Package:'
echo
extract_export_package_value_for_buildxml tmp/target/META-INF/MANIFEST.MF
echo
echo
echo 'contrib/platform/build.xml: Export-Package:'
echo
extract_export_package_value_for_buildxml tmp/target-platform/META-INF/MANIFEST.MF
echo
echo
rm -r tmp