Created
September 14, 2016 14:12
-
-
Save arfoll/311d3aa01a3e6d78fce65d81f3d1b78c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Author: Stefan Andritoiu <[email protected]> | |
# Copyright (c) 2016 Intel Corporation. | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, | |
# distribute, sublicense, and/or sell copies of the Software, and to | |
# permit persons to whom the Software is furnished to do so, subject to | |
# the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be | |
# included in all copies or substantial portions of the Software. | |
# | |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | |
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | |
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 <java_sources_folder>" | |
exit 1 | |
fi | |
JAVA_FOLDER=$1 | |
cd $JAVA_FOLDER | |
VERSION=`ls mraa-*.pom | sed 's/mraa\-\([0-9]\+\.[0-9]\+\.[0-9]\+\)\.pom/\1/'` | |
#make maven directory | |
rm -rf maven/ | |
mkdir maven/ | |
mkdir maven/mraa/ | |
#copy sources | |
#cp ls -1 *.java| grep -E '^[A-Z].*'| xargs -I'{}' cp {} maven/ | |
cp *.java maven/mraa/ | |
cd maven/ | |
#create javadoc jar | |
javadoc mraa -d mraa-javadoc/ | |
cd mraa-javadoc/ | |
jar cvf mraa-"$VERSION"-javadoc.jar * | |
cd .. | |
cp mraa-javadoc/mraa-"$VERSION"-javadoc.jar . | |
#create sources jar | |
jar cvf mraa-"$VERSION"-sources.jar mraa/ | |
#copy jar | |
cp ../mraa.jar mraa-"$VERSION".jar | |
#copy pom file | |
cp ../mraa-"$VERSION".pom mraa-"$VERSION".pom | |
#create PGP signatures | |
/home/jenkins/sf/SignFile -s cl -cf mraa-"$VERSION".jar.asc mraa-"$VERSION".jar | |
/home/jenkins/sf/SignFile-s cl -cf mraa-"$VERSION".pom.asc mraa-"$VERSION".pom | |
/home/jenkins/sf/SignFile -s cl -cf mraa-"$VERSION"-javadoc.jar.asc mraa-"$VERSION"-javadoc.jar | |
/home/jenkins/sf/SignFile -s cl -cf mraa-"$VERSION"-sources.jar.asc mraa-"$VERSION"-sources.jar | |
#bundle | |
jar cvf bundle-"$VERSION".jar \ | |
mraa-"$VERSION".jar.asc mraa-"$VERSION".jar \ | |
mraa-"$VERSION".pom.asc mraa-"$VERSION".pom \ | |
mraa-"$VERSION"-javadoc.jar.asc mraa-"$VERSION"-javadoc.jar \ | |
mraa-"$VERSION"-sources.jar.asc mraa-"$VERSION"-sources.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment