#!/bin/bash ## -- FILE ------------------------------------------------------------------ ## name : bouncycastle-to-maven-layout.sh ## project : intelliCard: MobileKeyStore ## created : Leon Poyyayil - 2013-08-01 ## language : Linux shell script ## environment: GNU bash ## copyright : (c) 2013-2014 by intelliCard AG, Switzerland ## license : this is corporate property of intelliCard AG ## -------------------------------------------------------------------------- # this script is based on the use-maven-layout.sh script from spongycastle # but cleaned up and enhanced to support later versions than 1.47 and to # properly function with filenames that contain spaces. ## adapted by Dario Incalza - 2014-08-12 function move_file { # echo Moving $1 to $2 mkdir -p `dirname "$2"` mv "$1" "$2" } function move_files { if [ -d "$1" ]; then echo " $1/**/*.* => $2" find "$1" -type f -print0 | while read -d '' -r FILENAME do NEWFILENAME=`echo "$FILENAME" | sed -e "s,$1,$2,"` move_file "$FILENAME" "$NEWFILENAME" done fi } echo "- java source files ..." move_files crypto/mail/src/main/java bc-mail/src/main/java move_files crypto/pg/src/main/java bc-pg/src/main/java move_files crypto/pkix/src/main/java bc-pkix/src/main/java move_files crypto/prov/src/main/java bc-prov/src/main/java move_files crypto/core/src/main/java bc-light/src/main/java move_files crypto/util/src/main/java bc-util/src/main/java echo "- javadoc resource files ..." move_files crypto/mail/src/main/javadoc bc-mail/src/main/javadoc move_files crypto/pg/src/main/javadoc bc-pg/src/main/javadoc move_files crypto/pkix/src/main/javadoc bc-pkix/src/main/javadoc move_files crypto/prov/src/main/javadoc bc-prov/src/main/javadoc move_files crypto/core/src/main/javadoc bc-light/src/main/javadoc move_files crypto/util/src/main/javadoc bc-util/src/main/javadoc echo "- resource files ..." move_files crypto/mail/src/main/resources bc-mail/src/main/resources move_files crypto/pkix/src/main/resources bc-pkix/src/main/resources move_files crypto/prov/src/main/resources bc-prov/src/main/resources echo "- unit test source files ..." move_files crypto/core/src/test/java bc-test/src/test/java move_files crypto/mail/src/test/java bc-test/src/test/java move_files crypto/pg/src/test/java bc-test/src/test/java move_files crypto/pkix/src/test/java bc-test/src/test/java move_files crypto/prov/src/test/java bc-test/src/test/java move_files crypto/util/src/test/java bc-test/src/test/java echo "- unit test data files ..." pushd crypto/pkix/src/test/resources/org/bouncycastle/tsp/test/20170316_Testdaten >/dev/null if [ -d "BSI TR-ESOR C.2 TestData" ]; then # avoid space in path ... mv "BSI TR-ESOR C.2 TestData" "BSI_TR-ESOR_C.2_TestData" fi popd >/dev/null move_files crypto/core/src/test/data bc-test/src/test/resources move_files crypto/core/src/test/resources bc-test/src/test/resources move_files crypto/mail/src/test/resources bc-test/src/test/resources move_files crypto/pg/src/test/resources bc-test/src/test/resources move_files crypto/pkix/src/test/resources bc-test/src/test/resources move_files crypto/prov/src/test/resources bc-test/src/test/resources move_files crypto/util/src/test/resources bc-test/src/test/resources echo "- documentation" mkdir -p doc mv crypto/*.html doc mv crypto/docs/releasenotes.html doc mv crypto/docs/specifications.html doc echo "- cleanup" rm -rf crypto ## -- EOF -------------------------------------------------------------------