From c080a46571fb87f2fc827c7ac093d41671c148e3 Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Wed, 12 Apr 2017 09:52:30 -0700 Subject: [PATCH] Fix some issues with the deploy script and deploy a new version for android Summary: Fix some issues with the deploy script and deploy a new version for android Reviewed By: passy Differential Revision: D4876006 fbshipit-source-id: ddafb8349e1c77ab5afd9a823103fb6a1dfabb1d --- android/build.gradle | 4 ++-- java/build.gradle | 4 ++-- scripts/build_natives_for_gradle.sh | 23 +++++++++++++---------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index e0c93f96..8ef83685 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,7 @@ apply plugin: 'maven-publish' targetCompatibility = '1.7' sourceCompatibility = '1.7' -version = '1.4.0' +version = '1.4.1' group = 'com.facebook.yoga.android' android { @@ -25,7 +25,7 @@ android { } dependencies { - compile 'com.facebook.yoga:yoga:1.2.0' + compile 'com.facebook.yoga:yoga:1.4.1' } task sourcesJar(type: Jar) { diff --git a/java/build.gradle b/java/build.gradle index b694e46c..4578bdb9 100644 --- a/java/build.gradle +++ b/java/build.gradle @@ -6,13 +6,13 @@ apply plugin: 'maven-publish' targetCompatibility = '1.7' sourceCompatibility = '1.7' -version = '1.4.0' +version = '1.4.1' group = 'com.facebook.yoga' // We currently build the native libraries with buck and bundle them together // at this point into the AAR task buckBuildAndCopy(type: Exec) { - commandLine '../scripts/build_natives_for_gradle.sh' + commandLine "$rootDir/scripts/build_natives_for_gradle.sh" } android { diff --git a/scripts/build_natives_for_gradle.sh b/scripts/build_natives_for_gradle.sh index 690d6cdd..e570e1c5 100755 --- a/scripts/build_natives_for_gradle.sh +++ b/scripts/build_natives_for_gradle.sh @@ -1,5 +1,8 @@ #!/bin/bash +set -e +BASEDIR=$(dirname $0) + DESTINATIONS=( "build/buck-out/jniLibs/x86" "build/buck-out/jniLibs/x86_64" @@ -22,22 +25,22 @@ done # There must be a better way to get gnustl_shared than building the android target. # But for now, we include that target simply for that shared library... echo "Build libgnustl_shared.so" -~/mybuck/bin/buck build //android/sample:sample +buck build //android/sample:sample -cp "../buck-out/gen/android/sample/sample#X86,android-strip,libgnustl_shared.so/libgnustl_shared.so" "${DESTINATIONS[0]}" -cp "../buck-out/gen/android/sample/sample#X86_64,android-strip,libgnustl_shared.so/libgnustl_shared.so" "${DESTINATIONS[1]}" -cp "../buck-out/gen/android/sample/sample#ARMV7,android-strip,libgnustl_shared.so/libgnustl_shared.so" "${DESTINATIONS[2]}" -cp "../buck-out/gen/android/sample/sample#ARM64,android-strip,libgnustl_shared.so/libgnustl_shared.so" "${DESTINATIONS[3]}" +cp "$BASEDIR/../buck-out/gen/android/sample/sample#X86,android-strip,libgnustl_shared.so/libgnustl_shared.so" "${DESTINATIONS[0]}" +cp "$BASEDIR/../buck-out/gen/android/sample/sample#X86_64,android-strip,libgnustl_shared.so/libgnustl_shared.so" "${DESTINATIONS[1]}" +cp "$BASEDIR/../buck-out/gen/android/sample/sample#ARMV7,android-strip,libgnustl_shared.so/libgnustl_shared.so" "${DESTINATIONS[2]}" +cp "$BASEDIR/../buck-out/gen/android/sample/sample#ARM64,android-strip,libgnustl_shared.so/libgnustl_shared.so" "${DESTINATIONS[3]}" # This is to clean up after the mess above. Yes, it is required. -~/mybuck/bin/buck clean -rm -r ../buck-out +buck clean +rm -r "$BASEDIR/../buck-out" for (( i=0; i<4; i++ )); do echo "Build ${BUCK_TARGETS[i]}" buck build "//java:jni#${BUCK_TARGETS[i]},shared" - cp "../buck-out/gen/java/jni#${BUCK_TARGETS[i]},shared/libyoga.so" "${DESTINATIONS[i]}" - cp "../buck-out/gen/yoga#${BUCK_TARGETS[i]},shared/libyogacore.so" "${DESTINATIONS[i]}" - cp "../buck-out/gen/lib/fb/fbjni#${BUCK_TARGETS[i]},shared/liblib_fb_fbjni.so" "${DESTINATIONS[i]}" + cp "$BASEDIR/../buck-out/gen/java/jni#${BUCK_TARGETS[i]},shared/libyoga.so" "${DESTINATIONS[i]}" + cp "$BASEDIR/../buck-out/gen/yoga#${BUCK_TARGETS[i]},shared/libyogacore.so" "${DESTINATIONS[i]}" + cp "$BASEDIR/../buck-out/gen/lib/fb/fbjni#${BUCK_TARGETS[i]},shared/liblib_fb_fbjni.so" "${DESTINATIONS[i]}" done