You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.4 KiB

  1. #!/bin/bash
  2. #Move out of the build folder
  3. cd ../..
  4. packageProject ()
  5. {
  6. local LOCAL_VERSION=$1
  7. RELEASE=$3
  8. ROOT=$PWD
  9. cd $2
  10. #Getting variables that are produced by the script
  11. NAME=$(head -1 ./name.info)
  12. PACKAGENAME=$NAME-$LOCAL_VERSION
  13. PACKAGETAR=$PACKAGENAME.tar
  14. PACKAGEGZ=$PACKAGENAME.tgz
  15. PACKAGEXZ=$PACKAGENAME.txz
  16. PACKAGEZIP=$PACKAGENAME.zip
  17. TARGET=$PWD/target
  18. #Packaging Jar Distributable
  19. cd target/release/
  20. echo "creating $PACKAGETAR in $TARGET"
  21. tar -cvf $RELEASE/$PACKAGETAR .
  22. echo "creating $PACKAGEGZ in $TARGET"
  23. gzip -c $RELEASE/$PACKAGETAR > $RELEASE/$PACKAGEGZ
  24. echo "creating $PACKAGEXZ in $TARGET"
  25. xz -c $RELEASE/$PACKAGETAR > $RELEASE/$PACKAGEXZ
  26. #Remove the tar that was originally used to compress
  27. rm $RELEASE/$PACKAGETAR
  28. echo "creating $PACKAGEZIP in $TARGET"
  29. zip -r $RELEASE/$PACKAGEZIP ./*
  30. #Removing prebuilt jar in target
  31. rm $TARGET/*.jar
  32. #Copying Jar to target for archiving
  33. cp ./*.jar $TARGET
  34. cd $ROOT
  35. }
  36. #Getting variables that are produced by the script
  37. VERSIONSTRING=$(head -1 ./version.info)
  38. RELEASE="$PWD/target"
  39. #make sure release exists and is empty
  40. if [ -d $RELEASE ]; then
  41. rm -R $RELEASE
  42. fi
  43. mkdir $RELEASE
  44. #packageProject $VERSIONSTRING "./cli" $RELEASE
  45. packageProject $VERSIONSTRING "./gui" $RELEASE
  46. #packageProject $VERSIONSTRING "./daemon" $RELEASE