forked from rtyley/spongycastle-old
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuse-maven-layout.sh
executable file
·71 lines (58 loc) · 2.48 KB
/
use-maven-layout.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
63
64
65
66
67
68
69
70
#!/bin/bash
function move_file {
mkdir -p `dirname $2`
mv $1 $2
}
function move_files {
echo Moving $1 to $2
for FILENAME in `find $1 -type f -print`
do
move_file $FILENAME `echo $FILENAME | sed -e "s,$1,$2,"`
done
}
function move_files_of_type {
echo Moving $1 to $2 for files of type $3
for FILENAME in `find $1 -type f -name "*.$3" -print`
do
move_file $FILENAME `echo $FILENAME | sed -e "s,$1,$2,"`
done
}
function transplant_package {
module=$1
pkg=$2
echo "mod = $module -- full package name = $pkg"
for filetype in "java" "html"
do
move_files_of_type crypto/src/$pkg $module/src/main/java/$pkg $filetype
done
for filetype in "java" "html"
do
move_files_of_type crypto/test/src/$pkg $module/src/test/java/$pkg $filetype
done
move_files crypto/src/$pkg $module/src/main/resources/$pkg
move_files crypto/test/src/$pkg $module/src/test/resources/$pkg
move_files crypto/test/data/$pkg $module/src/test/resources/$pkg
}
function transplant_packages {
module=$1
for package in ${@:2}
do
transplant_package $module org/bouncycastle/$package
done
}
transplant_packages bcmail-jdk15on {mail,cms/test}
transplant_packages bcpg-jdk15on {openpgp,bcpg}
transplant_packages bcpkix-jdk15on {cert,cms,eac,pkcs,mozilla,ocsp/test,operator,openssl,tsp,voms}
transplant_packages bcprov-jdk15on {i18n,jcajce,jce,ocsp,x509}
transplant_package bc-light-jdk15on org/bouncycastle
move_files crypto/test/data/PKITS bcprov-jdk15on/src/test/resources/PKITS
move_files crypto/test/data/openpgp bcpg-jdk15on/src/test/resources/openpgp
move_files crypto/test/data/rfc4134 bcmail-jdk15on/src/test/resources/rfc4134
move_files crypto/bzip2/src bc-bzip2/src/main/java
# crypto/test/src/org/bouncycastle/i18n/test/I18nTestMessages_en.properties
# bcprov-jdk15on/src/test/java/org/bouncycastle/i18n/test/I18nTestMessages_en.properties -- initial copy
# bcprov-jdk15on/src/test/resources/org/bouncycastle/i18n/test/I18nTestMessages_en.properties -- SHOULD BE
# bcprov-jdk15on/src/test/resources/java/org/bouncycastle/i18n/test/I18nTestMessages_en.properties -- NOT
# crypto/src/org/bouncycastle/x509/CertPathReviewerMessages.properties
# bcprov-jdk15on/src/main/java/org/bouncycastle/x509/CertPathReviewerMessages.properties -- initial copy
# bcprov-jdk15on/src/main/resources/bouncycastle/x509/CertPathReviewerMessages.properties -- NOT