Skip to content

Commit

Permalink
Merge pull request #6 from BlinkID/feature/sdk-publishing-scripts
Browse files Browse the repository at this point in the history
Added util scripts for building maven bundle
  • Loading branch information
i1E authored Jan 16, 2024
2 parents d5f23ed + ed08cf4 commit 8a3f4d0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
9 changes: 9 additions & 0 deletions libs/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
SDK_NAMES=(capture-core capture-ux)
SDK_VERSIONS=()

for i in "${!SDK_NAMES[@]}"; do
sdkName=${SDK_NAMES[$i]}
SDK_VERSIONS[$i]=$(grep --max-count=1 '<version>' pom-$sdkName.xml | cut -d ">" -f 2 | cut -d '<' -f 1)
echo $sdkName version: ${SDK_VERSIONS[$i]}
done
27 changes: 27 additions & 0 deletions libs/createMavenBundle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

source config.sh

for i in "${!SDK_NAMES[@]}"; do
sdkName=${SDK_NAMES[$i]}
sdkVersion=${SDK_VERSIONS[$i]}

tmpDir=./tmp-$sdkName
tmpDest=$tmpDir/com/microblink/$sdkName/$sdkVersion

mkdir -p $tmpDest
cp $sdkName-$sdkVersion.aar $tmpDest/$sdkName-$sdkVersion.aar
cp pom-$sdkName.xml $tmpDest/$sdkName-$sdkVersion.pom

pushd $tmpDest > /dev/null
md5 -q $sdkName-$sdkVersion.pom > $sdkName-$sdkVersion.pom.md5
md5 -q $sdkName-$sdkVersion.aar > $sdkName-$sdkVersion.aar.md5
shasum $sdkName-$sdkVersion.pom | cut -d ' ' -f 1 > $sdkName-$sdkVersion.pom.sha1
shasum $sdkName-$sdkVersion.aar | cut -d ' ' -f 1 > $sdkName-$sdkVersion.aar.sha1
gpg -ab $sdkName-$sdkVersion.pom
gpg -ab $sdkName-$sdkVersion.aar
popd > /dev/null

(cd $tmpDir && zip -r ../$sdkName-$sdkVersion-maven-bundle.zip .)
rm -r $tmpDir
done
10 changes: 7 additions & 3 deletions libs/installToLocalMaven.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash
version=1.2.0

mvn install:install-file -Dfile="capture-core-$version.aar" -DpomFile=pom-capture-core.xml -DcreateChecksum=true
mvn install:install-file -Dfile="capture-ux-$version.aar" -DpomFile=pom-capture-ux.xml -DcreateChecksum=true
source config.sh

for i in "${!SDK_NAMES[@]}"; do
sdkName=${SDK_NAMES[$i]}
sdkVersion=${SDK_VERSIONS[$i]}
mvn install:install-file -Dfile="$sdkName-$sdkVersion.aar" -DpomFile=pom-$sdkName.xml -DcreateChecksum=true
done

0 comments on commit 8a3f4d0

Please sign in to comment.