Skip to content

Commit

Permalink
Create build script for making releases
Browse files Browse the repository at this point in the history
  • Loading branch information
pschord committed Jul 27, 2016
1 parent b9b522f commit d6de0fc
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
*.pyc
*.stackdump
.gdb_history

# Build artifacts
build-log*
pscrypto-lib
3 changes: 3 additions & 0 deletions Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@ else
lib-name = lib$(1).so
exe-name = $(1)
endif

export OS
export ARCH
2 changes: 1 addition & 1 deletion external/psf-cryptopp
Submodule psf-cryptopp updated 1 files
+1 −1 integer.cpp
43 changes: 43 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash
set -ue

CONFIGS=3
BUILD_MATRIX_PREFIX=("x86_64-w64-mingw32-" "i686-w64-mingw32-" "x86_64-linux-gnu-")
BUILD_MATRIX_ARTIFACT=("pscrypto.dll" "pscrypto.dll" "libpscrypto.so")
BUILD_MATRIX_JAVA_FOLDER=("win32-x86-64" "win32-x86" "linux-x86-64")

BUILD_DEST="pscrypto-lib"
read -p "What version: " VERSION

mkdir -p "$BUILD_DEST"

echo "Now building $CONFIGS pscrypto configs for v$VERSION"

for i in `seq 1 $CONFIGS`; do
iter=$(( $i-1 ))
javaFolder=${BUILD_MATRIX_JAVA_FOLDER[$iter]}

export PREFIX=${BUILD_MATRIX_PREFIX[$iter]}

echo "Now building $javaFolder..."
make clean > /dev/null 2>&1
make -j > "build-log-${javaFolder}.txt" 2>&1

mkdir -p "$BUILD_DEST/$javaFolder"
cp "pscrypto/${BUILD_MATRIX_ARTIFACT[$iter]}" "$BUILD_DEST/$javaFolder/"
done

echo "Builds ${BUILD_MATRIX_JAVA_FOLDER[*]} complete"
echo "Build folder: $BUILD_DEST"

cat <<EOF > "$BUILD_DEST/README.txt"
This contains native PSCrypto libraries for use in the JVM.
See https://github.com/psforever/PSCrypto for more details.
EOF

cat <<EOF > "$BUILD_DEST/VERSION.txt"
$VERSION
EOF

echo "Build listing: "
ls -R $BUILD_DEST

0 comments on commit d6de0fc

Please sign in to comment.