svn status
svn log --limit 3 > RELEASE_NOTE.txt
cat RELEASE_NOTE.txt
pwd
project_name_prefix="${APP_PROJECT_NAME}_${VERSIONNAME}_${VERSIONCODE}"
#build_pre
cat app/src/main/java/com/baidu/security/scansdk/config/FeatureConfig.java
sed -i 's/android:versionCode=".*"/android:versionCode="'${VERSIONCODE}'"/' app/src/main/AndroidManifest.xml
sed -i 's/android:versionName=".*"/android:versionName="'${VERSIONNAME}'"/' app/src/main/AndroidManifest.xml
cat app/src/main/AndroidManifest.xml
sed -i 's/SDK_VERSION = ".*"/SDK_VERSION = "'${VERSIONNAME}'"/' app/src/main/java/com/baidu/security/scansdk/config/FeatureConfig.java
cat app/src/main/java/com/baidu/security/scansdk/config/FeatureConfig.java
./gradlew clean aR
cd app/build/intermediates/bundles/release/
jar xvf classes.jar
jar cvf ${project_name_prefix}.jar com assets
cd ../../../outputs/aar/
mkdir AAR_VERSION
mkdir JAR_VERSION
mv app-release.aar AAR_VERSION/${project_name_prefix}.aar
mv ../../intermediates/bundles/release/${project_name_prefix}.jar JAR_VERSION/${project_name_prefix}.jar
mv ../../intermediates/bundles/release/jni/armeabi JAR_VERSION/armeabi
tar czvf ${project_name_prefix}.tar.gz AAR_VERSION JAR_VERSION ../../../../RELEASE_NOTE.txt
#mv ${project_name_prefix}.apk ${WORKSPACE}/output/
mv ${project_name_prefix}.tar.gz /home/jenkins/publish/sdk
svn copy https://xxxx/branches/client/${APP_BRANCH} https://xxxxx/tags/client/${project_name_prefix}_PD_BL/ -m "make tag for ${project_name_prefix}"
#build_post
# pubilsh by http
# mv ${WORKSPACE}/output/* /home/jenkins/publish/sdk