Skip to content

Commit

Permalink
Fix some issues with the deploy script and deploy a new version for a…
Browse files Browse the repository at this point in the history
…ndroid

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
  • Loading branch information
Emil Sjolander authored and facebook-github-bot committed Apr 12, 2017
1 parent 5f050cb commit c080a46
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
23 changes: 13 additions & 10 deletions scripts/build_natives_for_gradle.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

set -e
BASEDIR=$(dirname $0)

DESTINATIONS=(
"build/buck-out/jniLibs/x86"
"build/buck-out/jniLibs/x86_64"
Expand All @@ -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

0 comments on commit c080a46

Please sign in to comment.