Skip to content

Commit

Permalink
Publish prebuilt binaries to NPM for easy inclusion in STF.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorccu committed Oct 23, 2016
1 parent 3caf8c7 commit 0ff2af0
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/libs/
/obj/
/libs/
/build/
/prebuilt/
/temp/
16 changes: 16 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/.env
/.gitmodules
/.npmignore
/*.tgz
/build-remote.sh
/CONTRIBUTING.md
/example/
/gdb.setup
/gdb.sh
/jni/
/libs/
/Makefile
/obj/
/run.sh
/temp/
/yarn-error.log
99 changes: 91 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,91 @@
all:
rm -rf build
mkdir -p build/bin build/shared/
cp -R libs/ build/bin/
find build/bin -name '*.so' -print0 | xargs -0 rm
cp -R jni/minicap-shared/aosp/libs/ build/shared/

.PHONY: all
.PHONY: default clean prebuilt

NDKBUILT := \
libs/arm64-v8a/minicap \
libs/arm64-v8a/minicap-nopie \
libs/armeabi-v7a/minicap \
libs/armeabi-v7a/minicap-nopie \
libs/x86/minicap \
libs/x86/minicap-nopie \
libs/x86_64/minicap \
libs/x86_64/minicap-nopie \

default: prebuilt

clean:
ndk-build clean
rm -rf prebuilt

$(NDKBUILT):
ndk-build

# It may feel a bit redundant to list everything here. However it also
# acts as a safeguard to make sure that we really are including everything
# that is supposed to be there.
prebuilt: \
prebuilt/armeabi-v7a/bin/minicap \
prebuilt/armeabi-v7a/bin/minicap-nopie \
prebuilt/armeabi-v7a/lib/android-9/minicap.so \
prebuilt/armeabi-v7a/lib/android-10/minicap.so \
prebuilt/armeabi-v7a/lib/android-14/minicap.so \
prebuilt/armeabi-v7a/lib/android-15/minicap.so \
prebuilt/armeabi-v7a/lib/android-16/minicap.so \
prebuilt/armeabi-v7a/lib/android-17/minicap.so \
prebuilt/armeabi-v7a/lib/android-18/minicap.so \
prebuilt/armeabi-v7a/lib/android-19/minicap.so \
prebuilt/armeabi-v7a/lib/android-21/minicap.so \
prebuilt/armeabi-v7a/lib/android-22/minicap.so \
prebuilt/armeabi-v7a/lib/android-23/minicap.so \
prebuilt/armeabi-v7a/lib/android-24/minicap.so \
prebuilt/armeabi-v7a/lib/android-25/minicap.so \
prebuilt/arm64-v8a/bin/minicap \
prebuilt/arm64-v8a/bin/minicap-nopie \
prebuilt/arm64-v8a/lib/android-21/minicap.so \
prebuilt/arm64-v8a/lib/android-22/minicap.so \
prebuilt/arm64-v8a/lib/android-23/minicap.so \
prebuilt/arm64-v8a/lib/android-24/minicap.so \
prebuilt/arm64-v8a/lib/android-25/minicap.so \
prebuilt/x86/bin/minicap \
prebuilt/x86/bin/minicap-nopie \
prebuilt/x86/lib/android-14/minicap.so \
prebuilt/x86/lib/android-15/minicap.so \
prebuilt/x86/lib/android-16/minicap.so \
prebuilt/x86/lib/android-17/minicap.so \
prebuilt/x86/lib/android-18/minicap.so \
prebuilt/x86/lib/android-19/minicap.so \
prebuilt/x86/lib/android-21/minicap.so \
prebuilt/x86/lib/android-22/minicap.so \
prebuilt/x86/lib/android-23/minicap.so \
prebuilt/x86/lib/android-24/minicap.so \
prebuilt/x86/lib/android-25/minicap.so \
prebuilt/x86_64/bin/minicap \
prebuilt/x86_64/bin/minicap-nopie \
prebuilt/x86_64/lib/android-21/minicap.so \
prebuilt/x86_64/lib/android-22/minicap.so \
prebuilt/x86_64/lib/android-23/minicap.so \
prebuilt/x86_64/lib/android-24/minicap.so \
prebuilt/x86_64/lib/android-25/minicap.so \

prebuilt/%/bin/minicap: libs/%/minicap
mkdir -p $(@D)
cp $^ $@

prebuilt/%/bin/minicap-nopie: libs/%/minicap-nopie
mkdir -p $(@D)
cp $^ $@

prebuilt/armeabi-v7a/lib/%/minicap.so: jni/minicap-shared/aosp/libs/%/armeabi-v7a/minicap.so
mkdir -p $(@D)
cp $^ $@

prebuilt/arm64-v8a/lib/%/minicap.so: jni/minicap-shared/aosp/libs/%/arm64-v8a/minicap.so
mkdir -p $(@D)
cp $^ $@

prebuilt/x86/lib/%/minicap.so: jni/minicap-shared/aosp/libs/%/x86/minicap.so
mkdir -p $(@D)
cp $^ $@

prebuilt/x86_64/lib/%/minicap.so: jni/minicap-shared/aosp/libs/%/x86_64/minicap.so
mkdir -p $(@D)
cp $^ $@
24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "minicap-prebuilt",
"version": "1.0.0",
"description": "Prebuilt binaries of minicap.",
"keywords": [
"minicap"
],
"bugs": {
"url": "https://github.com/openstf/minicap/issues"
},
"license": "Apache-2.0",
"author": {
"name": "The OpenSTF Project",
"email": "contact@openstf.io",
"url": "https://openstf.io"
},
"repository": {
"type": "git",
"url": "https://github.com/openstf/minicap.git"
},
"scripts": {
"prepublish": "make"
}
}

0 comments on commit 0ff2af0

Please sign in to comment.