summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile122
1 files changed, 99 insertions, 23 deletions
diff --git a/Makefile b/Makefile
index 29acc367f4..40f8d18568 100644
--- a/Makefile
+++ b/Makefile
@@ -52,7 +52,7 @@ endif
.NOTPARALLEL: node_modules
node_modules: package.json
- npm update # Install dependencies but don't run our own install script.
+ npm install --ignore-scripts # Install dependencies but don't run our own install script.
BUILD_DEPS += .mason/mason
BUILD_DEPS += Makefile
@@ -273,8 +273,10 @@ ideploy:
idocument:
OUTPUT=$(OUTPUT) ./platform/ios/scripts/document.sh
-style-code-darwin:
+.PHONY: darwin-style-code
+darwin-style-code:
node platform/darwin/scripts/generate-style-code.js
+style-code: darwin-style-code
endif
#### Linux targets #####################################################
@@ -292,7 +294,9 @@ $(LINUX_BUILD): $(BUILD_DEPS)
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DWITH_CXX11ABI=$(shell scripts/check-cxx11abi.sh) \
-DWITH_COVERAGE=${WITH_COVERAGE} \
- -DWITH_OSMESA=${WITH_OSMESA})
+ -DIS_CI_BUILD=${CI} \
+ -DWITH_OSMESA=${WITH_OSMESA} \
+ -DWITH_EGL=${WITH_EGL})
.PHONY: linux
linux: glfw-app render offline
@@ -385,9 +389,11 @@ $(QT_BUILD): $(BUILD_DEPS)
-DMASON_PLATFORM=$(BUILD_PLATFORM) \
-DMASON_PLATFORM_VERSION=$(BUILD_PLATFORM_VERSION) \
-DWITH_QT_DECODERS=${WITH_QT_DECODERS} \
+ -DWITH_QT_I18N=${WITH_QT_I18N} \
-DWITH_QT_4=${WITH_QT_4} \
-DWITH_CXX11ABI=$(shell scripts/check-cxx11abi.sh) \
- -DWITH_COVERAGE=${WITH_COVERAGE})
+ -DWITH_COVERAGE=${WITH_COVERAGE} \
+ -DIS_CI_BUILD=${CI})
ifeq ($(HOST_PLATFORM), macos)
@@ -399,9 +405,11 @@ $(MACOS_QT_PROJ_PATH): $(BUILD_DEPS)
-DMASON_PLATFORM=$(BUILD_PLATFORM) \
-DMASON_PLATFORM_VERSION=$(BUILD_PLATFORM_VERSION) \
-DWITH_QT_DECODERS=${WITH_QT_DECODERS} \
+ -DWITH_QT_I18N=${WITH_QT_I18N} \
-DWITH_QT_4=${WITH_QT_4} \
-DWITH_CXX11ABI=$(shell scripts/check-cxx11abi.sh) \
- -DWITH_COVERAGE=${WITH_COVERAGE})
+ -DWITH_COVERAGE=${WITH_COVERAGE} \
+ -DIS_CI_BUILD=${CI})
@# Create Xcode schemes so that we can use xcodebuild from the command line. CMake doesn't
@# create these automatically.
@@ -461,20 +469,24 @@ test-node: node
#### Android targets ###########################################################
-ANDROID_ENV = platform/android/scripts/toolchain.sh
-ANDROID_ABIS = arm-v5 arm-v7 arm-v8 x86 x86-64 mips
+MBGL_ANDROID_ENV = platform/android/scripts/toolchain.sh
+MBGL_ANDROID_ABIS = arm-v5 arm-v7 arm-v8 x86 x86-64 mips
+MBGL_ANDROID_LOCAL_WORK_DIR = /data/local/tmp/core-tests
+MBGL_ANDROID_LIBDIR = lib$(if $(filter arm-v8 x86-64,$1),64)
+MBGL_ANDROID_DALVIKVM = dalvikvm$(if $(filter arm-v8 x86-64,$1),64,32)
-.PHONY: style-code-android
-style-code-android: $(BUILD_DEPS)
+.PHONY: android-style-code
+android-style-code:
node platform/android/scripts/generate-style-code.js
+style-code: android-style-code
define ANDROID_RULES
-build/android-$1/$(BUILDTYPE): style-code-android
+build/android-$1/$(BUILDTYPE): $(BUILD_DEPS)
mkdir -p build/android-$1/$(BUILDTYPE)
build/android-$1/$(BUILDTYPE)/toolchain.cmake: platform/android/scripts/toolchain.sh build/android-$1/$(BUILDTYPE)
- $(ANDROID_ENV) $1 > build/android-$1/$(BUILDTYPE)/toolchain.cmake
+ $(MBGL_ANDROID_ENV) $1 > build/android-$1/$(BUILDTYPE)/toolchain.cmake
build/android-$1/$(BUILDTYPE)/Makefile: build/android-$1/$(BUILDTYPE)/toolchain.cmake platform/android/config.cmake
cd build/android-$1/$(BUILDTYPE) && cmake ../../.. -G Ninja \
@@ -483,38 +495,100 @@ build/android-$1/$(BUILDTYPE)/Makefile: build/android-$1/$(BUILDTYPE)/toolchain.
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DMBGL_PLATFORM=android
+.PHONY: android-test-lib-$1
+android-test-lib-$1: build/android-$1/$(BUILDTYPE)/Makefile
+ $(NINJA) $(NINJA_ARGS) -j$(JOBS) -C build/android-$1/$(BUILDTYPE) mbgl-test
+
.PHONY: android-lib-$1
android-lib-$1: build/android-$1/$(BUILDTYPE)/Makefile
- $(NINJA) $(NINJA_ARGS) -j$(JOBS) -C build/android-$1/$(BUILDTYPE) all
+ $(NINJA) $(NINJA_ARGS) -j$(JOBS) -C build/android-$1/$(BUILDTYPE) mapbox-gl example-custom-layer
.PHONY: android-$1
android-$1: android-lib-$1
- cd platform/android && ./gradlew --parallel --max-workers=$(JOBS) assemble$(BUILDTYPE)
+ cd platform/android && ./gradlew --parallel --max-workers=$(JOBS) :MapboxGLAndroidSDKTestApp:assemble$(BUILDTYPE)
+
+run-android-core-test-$1: android-test-lib-$1
+ # Compile main sources and extract the classes (using the test app to get all transitive dependencies in one place)
+ cd platform/android && ./gradlew :MapboxGLAndroidSDKTestApp:assembleDebug
+ unzip -o platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk/MapboxGLAndroidSDKTestApp-debug.apk classes.dex -d build/android-$1/$(BUILDTYPE)
+
+ #Compile Test runner
+ find platform/android/src/test -name "*.java" > build/android-$1/$(BUILDTYPE)/java-sources.txt
+ javac -sourcepath platform/android/src/test -d build/android-$1/$(BUILDTYPE) -source 1.7 -target 1.7 @build/android-$1/$(BUILDTYPE)/java-sources.txt
+ #Combine and dex
+ cd build/android-$1/$(BUILDTYPE) && $(ANDROID_HOME)/build-tools/25.0.0/dx --dex --output=test.jar *.class classes.dex
+
+ #Ensure clean state on the device
+ adb shell "rm -Rf $(MBGL_ANDROID_LOCAL_WORK_DIR) && mkdir -p $(MBGL_ANDROID_LOCAL_WORK_DIR)/test"
+
+ # Generate zipped asset files
+ cd test/fixtures/api && zip -r assets.zip assets && cd -
+ cd test/fixtures/storage && zip -r assets.zip assets && cd -
+
+ #Push all needed files to the device
+ adb push build/android-$1/$(BUILDTYPE)/test.jar $(MBGL_ANDROID_LOCAL_WORK_DIR) > /dev/null 2>&1
+ adb push test/fixtures $(MBGL_ANDROID_LOCAL_WORK_DIR)/test > /dev/null 2>&1
+ adb push build/android-$1/$(BUILDTYPE)/stripped/libmapbox-gl.so $(MBGL_ANDROID_LOCAL_WORK_DIR) > /dev/null 2>&1
+ adb push build/android-$1/$(BUILDTYPE)/stripped/libmbgl-test.so $(MBGL_ANDROID_LOCAL_WORK_DIR) > /dev/null 2>&1
+
+ #Kick off the tests
+ adb shell "export LD_LIBRARY_PATH=/system/$(MBGL_ANDROID_LIBDIR):$(MBGL_ANDROID_LOCAL_WORK_DIR) && cd $(MBGL_ANDROID_LOCAL_WORK_DIR) && $(MBGL_ANDROID_DALVIKVM) -cp $(MBGL_ANDROID_LOCAL_WORK_DIR)/test.jar Main"
+
+ #Gather the results
+ adb shell "cd $(MBGL_ANDROID_LOCAL_WORK_DIR) && tar -cvzf results.tgz test/fixtures/* > /dev/null 2>&1"
+ adb pull $(MBGL_ANDROID_LOCAL_WORK_DIR)/results.tgz build/android-$1/$(BUILDTYPE)/ > /dev/null 2>&1
+
+.PHONY: run-android-$1
+run-android-$1: android-$1
+ cd platform/android && ./gradlew :MapboxGLAndroidSDKTestApp:installDebug && adb shell am start -n com.mapbox.mapboxsdk.testapp/.activity.FeatureOverviewActivity
apackage: android-lib-$1
endef
-$(foreach abi,$(ANDROID_ABIS),$(eval $(call ANDROID_RULES,$(abi))))
+$(foreach abi,$(MBGL_ANDROID_ABIS),$(eval $(call ANDROID_RULES,$(abi))))
.PHONY: android
android: android-arm-v7
-.PHONY: android-test
-android-test:
- cd platform/android && ./gradlew testDebugUnitTest --continue
+.PHONY: run-android
+run-android: run-android-arm-v7
+
+.PHONY: run-android-unit-test
+run-android-unit-test:
+ cd platform/android && ./gradlew :MapboxGLAndroidSDKTestApp:testDebugUnitTest --continue
+
+.PHONY: android-ui-test
+android-ui-test:
+ cd platform/android && ./gradlew :MapboxGLAndroidSDKTestApp:assembleDebug --continue && ./gradlew :MapboxGLAndroidSDKTestApp:assembleAndroidTest --continue
-.PHONY: android-test-apk
-android-test-apk:
- cd platform/android && ./gradlew assembleDebug --continue && ./gradlew assembleAndroidTest --continue
+.PHONY: run-android-ui-test
+run-android-ui-test:
+ cd platform/android && ./gradlew :MapboxGLAndroidSDKTestApp:connectedAndroidTest -i
+
+.PHONY: run-android-ui-test-aws
+run-android-ui-test-aws:
+ cd platform/android && ./gradlew devicefarmUpload
+
+.PHONY: run-android-ui-test-spoon
+run-android-ui-test-spoon:
+ cd platform/android && ./gradlew spoon
.PHONY: apackage
apackage:
- cd platform/android && ./gradlew --parallel-threads=$(JOBS) assemble$(BUILDTYPE)
+ cd platform/android && ./gradlew --parallel --max-workers=$(JOBS) assemble$(BUILDTYPE)
-.PHONY: android-generate-test
-android-generate-test:
+.PHONY: test-code-android
+test-code-android:
node platform/android/scripts/generate-test-code.js
+.PHONY: android-ndk-stack
+android-ndk-stack:
+ adb logcat | ndk-stack -sym build/android-arm-v7/Debug
+
+.PHONY: android-checkstyle
+android-checkstyle:
+ cd platform/android && ./gradlew checkstyle
+
#### Miscellaneous targets #####################################################
.PHONY: style-code
@@ -526,6 +600,8 @@ clean:
-rm -rf ./build \
./platform/android/MapboxGLAndroidSDK/build \
./platform/android/MapboxGLAndroidSDKTestApp/build \
+ ./platform/android/MapboxGLAndroidSDKWearTestApp/build \
+ ./platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/activity/gen \
./platform/android/MapboxGLAndroidSDK/src/main/jniLibs \
./platform/android/MapboxGLAndroidSDKTestApp/src/main/jniLibs \
./platform/android/MapboxGLAndroidSDK/src/main/assets