diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-04-03 15:16:49 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-04-07 18:01:02 -0700 |
commit | f964e40e7e9220d08751d8607af61ac5a7c0794c (patch) | |
tree | d34ca5407188fe3d71396faa8a8acceb52d9bd4b /platform | |
parent | f5d66f362272db034a311d2077dbdb2937c9bbdf (diff) | |
download | qtlocation-mapboxgl-f964e40e7e9220d08751d8607af61ac5a7c0794c.tar.gz |
[build] Refactor and simplify build system
* Main gyp files are now standardized as platform/<platform>/platform.gyp.
* Each platform gyp file defines appropriate loop_lib and headless_lib variables.
* Each platform gyp file includes mbgl.gypi, which defines base targets which may be useful to all platforms.
* CI targets are consistent across platforms: `make $(PLATFORM) && make test-$(PLATFORM)`.
* Renamed the "linux" test app to "glfw". It's now built in OS X CI.
* Android build flakiness is fixed.
* iOS CI builds the bench and iosapp targets.
* Mesa version is now in one place.
* CI scripts use bash "strict mode" and correct error handling.
* All build output goes to the build directory.
* Removed vestigial iOS/OS X/Android Travis scripts.
Diffstat (limited to 'platform')
47 files changed, 1000 insertions, 1453 deletions
diff --git a/platform/android/.gitignore b/platform/android/.gitignore index 57cd31fea2..53e7540178 100644 --- a/platform/android/.gitignore +++ b/platform/android/.gitignore @@ -12,7 +12,6 @@ build/ # JNI MapboxGLAndroidSDK/src/main/jniLibs/ -MapboxGLAndroidSDK/src/main/obj.target/ # Lib assets MapboxGLAndroidSDK/src/main/assets/ diff --git a/platform/android/bitrise.yml b/platform/android/bitrise.yml index f67edac3d8..c1c4407bde 100644 --- a/platform/android/bitrise.yml +++ b/platform/android/bitrise.yml @@ -24,29 +24,15 @@ workflows: envman add --key SKIPCI --value false fi - script: - title: Install Linux Dependencies + title: Build + run_if: '{{enveq "SKIPCI" "false"}}' inputs: - content: |- #!/bin/bash - + set -eu -o pipefail apt-get install -y pkg-config - - script: - title: Build Android SDK For arm - inputs: - - content: |- - #!/bin/bash - - make android -j4 - - is_debug: 'yes' - - script: - title: Run Unit Tests - inputs: - - content: |- - #!/bin/bash - - cd platform/android - ./gradlew testReleaseUnitTest --continue - - is_debug: 'yes' + make android + make test-android - slack: title: Post to Slack run_if: '{{enveq "SKIPCI" "false"}}' @@ -68,47 +54,24 @@ workflows: scheduled: steps: - script: - title: Install Linux Dependencies + title: Build inputs: - content: |- #!/bin/bash + set -eu -o pipefail apt-get install -y pkg-config python-pip python-dev build-essential pip install awscli - - script: - title: Fetch GPG Secring For SDK Signing - inputs: - - content: |- - #!/bin/bash aws s3 cp s3://mapbox/android/signing-credentials/secring.gpg platform/android/MapboxGLAndroidSDK/secring.gpg - opts: - is_expand: true - - script: - title: Inject Signing And Publishing Credentials - inputs: - - content: |- - #!/bin/bash echo "NEXUS_USERNAME=$PUBLISH_NEXUS_USERNAME NEXUS_PASSWORD=$PUBLISH_NEXUS_PASSWORD signing.keyId=$SIGNING_KEYID signing.password=$SIGNING_PASSWORD signing.secretKeyRingFile=secring.gpg" >> platform/android/MapboxGLAndroidSDK/gradle.properties - opts: - is_expand: true - - script: - title: Build Mapbox Android SDK For All ABI - inputs: - - content: |- - #!/bin/bash make apackage -j4 - - script: - title: Publish To Maven Central - inputs: - - content: |- - #!/bin/bash cd platform/android - ./gradlew uploadArchives
\ No newline at end of file + ./gradlew uploadArchives diff --git a/platform/android/mapboxgl-app.gypi b/platform/android/platform.gyp index f9644c8d99..4954c7031c 100644 --- a/platform/android/mapboxgl-app.gypi +++ b/platform/android/platform.gyp @@ -1,69 +1,88 @@ { + 'variables': { + 'loop_lib': 'android', + 'headless_lib': 'none', + }, 'includes': [ - '../../gyp/common.gypi', + '../../mbgl.gypi', ], 'targets': [ - { 'target_name': 'android-lib', + { + 'target_name': 'platform-lib', 'product_name': 'mapbox-gl', 'type': 'shared_library', 'hard_dependency': 1, - 'dependencies': [ - 'mbgl.gyp:core', - 'mbgl.gyp:platform-<(platform_lib)', - 'mbgl.gyp:http-<(http_lib)', - 'mbgl.gyp:asset-<(asset_lib)', + 'core', ], 'include_dirs': [ - '../src', + '../default', + '../../include', + '../../src', # TODO: eliminate ], 'sources': [ - './src/native_map_view.cpp', - './src/jni.cpp', - './src/attach_env.cpp', + 'src/native_map_view.cpp', + 'src/jni.cpp', + 'src/attach_env.cpp', + 'src/log_android.cpp', + 'src/http_request_android.cpp', + 'src/asset_file_source.cpp', + '../default/thread.cpp', + '../default/string_stdlib.cpp', + '../default/image.cpp', + '../default/png_reader.cpp', + '../default/jpeg_reader.cpp', + '../default/default_file_source.cpp', + '../default/online_file_source.cpp', + '../default/mbgl/storage/offline.hpp', + '../default/mbgl/storage/offline.cpp', + '../default/mbgl/storage/offline_database.hpp', + '../default/mbgl/storage/offline_database.cpp', + '../default/mbgl/storage/offline_download.hpp', + '../default/mbgl/storage/offline_download.cpp', + '../default/sqlite3.hpp', + '../default/sqlite3.cpp', ], 'cflags_cc': [ '<@(boost_cflags)', + '<@(rapidjson_cflags)', + '<@(nunicode_cflags)', + '<@(sqlite_cflags)', '<@(variant_cflags)', '<@(jni.hpp_cflags)', + '<@(libzip_cflags)', + '<@(libpng_cflags)', + '<@(libjpeg-turbo_cflags)', ], - 'libraries': [ - '<@(libpng_static_libs)', - '<@(libjpeg-turbo_static_libs)', - '<@(sqlite_static_libs)', - '<@(nunicode_static_libs)', - '<@(libzip_static_libs)', - ], - 'variables': { - 'ldflags': [ + + 'link_settings': { + 'libraries': [ '-llog', '-landroid', '-lEGL', '-lGLESv2', '-lstdc++', '-latomic', - '<@(libpng_ldflags)', - '<@(libjpeg-turbo_ldflags)', + '<@(nunicode_ldflags)', + '<@(nunicode_static_libs)', '<@(sqlite_ldflags)', + '<@(sqlite_static_libs)', '<@(zlib_ldflags)', + '<@(zlib_static_libs)', '<@(libzip_ldflags)', + '<@(libzip_static_libs)', + '<@(libpng_ldflags)', + '<@(libpng_static_libs)', + '<@(libjpeg-turbo_ldflags)', + '<@(libjpeg-turbo_static_libs)', ], }, - 'conditions': [ - ['OS == "mac"', { - 'xcode_settings': { - 'OTHER_LDFLAGS': [ '<@(ldflags)' ], - } - }, { - 'libraries': [ '<@(ldflags)' ], - }] - ], }, - - { 'target_name': 'example-custom-layer-lib', + { + 'target_name': 'example-custom-layer-lib', 'product_name': 'example-custom-layer', 'type': 'shared_library', 'hard_dependency': 1, @@ -76,8 +95,8 @@ '../../include', ], - 'variables': { - 'ldflags': [ + 'link_settings': { + 'libraries': [ '-llog', '-landroid', '-lEGL', @@ -86,24 +105,14 @@ '-latomic', ], }, - - 'conditions': [ - ['OS == "mac"', { - 'xcode_settings': { - 'OTHER_LDFLAGS': [ '<@(ldflags)' ], - } - }, { - 'libraries': [ '<@(ldflags)' ], - }] - ], }, - - { 'target_name': 'androidapp', + { + 'target_name': 'all', 'type': 'none', 'hard_dependency': 1, 'dependencies': [ - 'android-lib', + 'platform-lib', 'example-custom-layer-lib', ], @@ -115,17 +124,11 @@ { 'files': [ '../../common/ca-bundle.crt', - '../../platform/default/resources/api_mapbox_com-digicert.der', - '../../platform/default/resources/api_mapbox_com-geotrust.der', - '../../platform/default/resources/star_tilestream_net.der', + '../default/resources/api_mapbox_com-digicert.der', + '../default/resources/api_mapbox_com-geotrust.der', + '../default/resources/star_tilestream_net.der', ], - 'destination': '<(pwd)/../platform/android/MapboxGLAndroidSDK/src/main/assets' - }, - { - 'files': [ - '<(PRODUCT_DIR)/obj.target' - ], - 'destination': '<(pwd)/../platform/android/MapboxGLAndroidSDK/src/main' + 'destination': '<(DEPTH)/platform/android/MapboxGLAndroidSDK/src/main/assets' }, ], @@ -133,13 +136,13 @@ { 'action_name': 'Strip mapbox library', 'inputs': [ '<(PRODUCT_DIR)/lib.target/libmapbox-gl.so' ], - 'outputs': [ '<(pwd)/../platform/android/MapboxGLAndroidSDK/src/main/jniLibs/$(JNIDIR)/libmapbox-gl.so' ], + 'outputs': [ '<(DEPTH)/platform/android/MapboxGLAndroidSDK/src/main/jniLibs/$(JNIDIR)/libmapbox-gl.so' ], 'action': [ '$(STRIP)', '<@(_inputs)', '-o', '<@(_outputs)' ] }, { 'action_name': 'Strip example custom layer library', 'inputs': [ '<(PRODUCT_DIR)/lib.target/libexample-custom-layer.so' ], - 'outputs': [ '<(pwd)/../platform/android/MapboxGLAndroidSDKTestApp/src/main/jniLibs/$(JNIDIR)/libexample-custom-layer.so' ], + 'outputs': [ '<(DEPTH)/platform/android//MapboxGLAndroidSDKTestApp/src/main/jniLibs/$(JNIDIR)/libexample-custom-layer.so' ], 'action': [ '$(STRIP)', '<@(_inputs)', '-o', '<@(_outputs)' ] } ], diff --git a/platform/android/scripts/defaults.mk b/platform/android/scripts/defaults.mk deleted file mode 100644 index f70c852ed1..0000000000 --- a/platform/android/scripts/defaults.mk +++ /dev/null @@ -1,11 +0,0 @@ -HEADLESS ?= none -PLATFORM ?= android -ASSET ?= zip -HTTP ?= android -LOOP ?= android - -GYP_FLAVOR_SUFFIX=-android - -HOST_VERSION ?= arm-v7 - -ENV = $(shell MASON_ANDROID_ABI=$(HOST_VERSION) ./platform/android/scripts/toolchain.sh) diff --git a/platform/android/scripts/install.sh b/platform/android/scripts/install.sh deleted file mode 100755 index e99c3dc75e..0000000000 --- a/platform/android/scripts/install.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -mapbox_time "checkout_mason" \ -git submodule update --init .mason - -export MASON_PLATFORM=android -export MASON_ANDROID_ABI=${ANDROID_ABI} - -mapbox_time "android_toolchain" \ -./platform/android/scripts/toolchain.sh diff --git a/platform/android/scripts/run.sh b/platform/android/scripts/run.sh deleted file mode 100755 index 9e87298fe9..0000000000 --- a/platform/android/scripts/run.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -# Add Mason to PATH -export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" -export MASON_PLATFORM=android -export MASON_ANDROID_ABI=${ANDROID_ABI} - -################################################################################ -# Build -################################################################################ - -mkdir -p ./platform/android/MapboxGLAndroidSDKTestApp/src/main/res/raw -echo "${MAPBOX_ACCESS_TOKEN}" > ./platform/android/MapboxGLAndroidSDKTestApp/src/main/res/raw/token.txt - -mapbox_time "compile_library" \ -make android-lib HOST_VERSION=${ANDROID_ABI} -j${JOBS} BUILDTYPE=${BUILDTYPE} - -mapbox_time "build_apk" \ -make android HOST_VERSION=${ANDROID_ABI} -j${JOBS} BUILDTYPE=${BUILDTYPE} - -################################################################################ -# Deploy -################################################################################ - -if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then - # Install and add awscli to PATH for uploading the results - mapbox_time "install_awscli" \ - pip install --user awscli - export PATH="`python -m site --user-base`/bin:${PATH}" - - mapbox_time_start "deploy_results" - echo "Deploying results..." - - S3_PREFIX=s3://mapbox/mapbox-gl-native/android/build/${TRAVIS_JOB_NUMBER} - APK_OUTPUTS=./platform/android/MapboxGLAndroidSDKTestApp/build/outputs/apk - JNILIB=`mason env JNIDIR` - - # ARM64 does not build APK for now - if [ ${JNIDIR} != "arm64-v8a" ] ; then - # Upload either the debug or the release build - if [ ${BUILDTYPE} == "Debug" ] ; then - aws s3 cp \ - ${APK_OUTPUTS}/MapboxGLAndroidSDKTestApp-${JNILIB}-debug.apk \ - ${S3_PREFIX}/MapboxGLAndroidSDKTestApp-debug.apk - elif [ ${BUILDTYPE} == "Release" ] ; then - aws s3 cp \ - ${APK_OUTPUTS}/MapboxGLAndroidSDKTestApp-${JNILIB}-release-unsigned.apk \ - ${S3_PREFIX}/MapboxGLAndroidSDKTestApp-release-unsigned.apk - fi - fi - - mapbox_time_finish -fi diff --git a/platform/ios/app/mapboxgl-app.gypi b/platform/ios/app/mapboxgl-app.gypi deleted file mode 100644 index 864755829f..0000000000 --- a/platform/ios/app/mapboxgl-app.gypi +++ /dev/null @@ -1,81 +0,0 @@ -{ - 'includes': [ - '../../../gyp/common.gypi', - ], - 'targets': [ - { - 'target_name': 'iosapp', - 'product_name': 'Mapbox GL', - 'type': 'executable', - 'product_extension': 'app', - 'mac_bundle': 1, - 'mac_bundle_resources': [ - '<!@(find ../platform/ios/app/img -type f)', - './Storyboard.storyboard', - './points.geojson', - './polyline.geojson', - './threestates.geojson', - './Settings.bundle/', - './app-info.plist', - ], - - 'dependencies': [ - 'iossdk', - ], - - 'sources': [ - 'main.m', - 'MBXAppDelegate.h', - 'MBXAppDelegate.m', - 'MBXCustomCalloutView.h', - 'MBXCustomCalloutView.m', - 'MBXOfflinePacksTableViewController.h', - 'MBXOfflinePacksTableViewController.m', - 'MBXViewController.h', - 'MBXViewController.m', - ], - - 'xcode_settings': { - 'SDKROOT': 'iphoneos', - 'SUPPORTED_PLATFORMS': 'iphonesimulator iphoneos', - 'IPHONEOS_DEPLOYMENT_TARGET': '8.0', - 'INFOPLIST_FILE': '../platform/ios/app/app-info.plist', - 'TARGETED_DEVICE_FAMILY': '1,2', - 'COMBINE_HIDPI_IMAGES': 'NO', # disable combining @2x, @3x images into .tiff files - 'COPY_PHASE_STRIP': 'NO', - 'CLANG_ENABLE_OBJC_ARC': 'YES', - 'CLANG_ENABLE_MODULES': 'YES', - 'LD_RUNPATH_SEARCH_PATHS': [ - '$(inherited)', - '@executable_path/Frameworks', - ], - }, - - 'configurations': { - 'Debug': { - 'xcode_settings': { - 'CODE_SIGN_IDENTITY': 'iPhone Developer', - 'COPY_PHASE_STRIP': 'NO', - }, - }, - 'Release': { - 'xcode_settings': { - 'CODE_SIGN_IDENTITY': 'iPhone Distribution', - 'ARCHS': [ "armv7", "armv7s", "arm64", "i386", "x86_64" ], - 'COPY_PHASE_STRIP': 'YES', - }, - }, - }, - - 'copies': [ - { - 'destination': '<(PRODUCT_DIR)/$(FRAMEWORKS_FOLDER_PATH)', - 'files': [ - '<(PRODUCT_DIR)/Mapbox.framework', - ], - 'xcode_code_sign': 1, - }, - ], - } - ] -} diff --git a/platform/ios/benchmark/benchmark-ios.gypi b/platform/ios/benchmark/benchmark-ios.gypi deleted file mode 100644 index 5962a6b338..0000000000 --- a/platform/ios/benchmark/benchmark-ios.gypi +++ /dev/null @@ -1,78 +0,0 @@ -{ - 'includes': [ - '../../../gyp/common.gypi', - ], - 'targets': [ - { 'target_name': 'ios-bench', - 'product_name': 'Bench GL', - 'type': 'executable', - 'product_extension': 'app', - 'mac_bundle': 1, - 'mac_bundle_resources': [ - '<!@(find ../platform/ios/benchmark/img -type f)', - 'assets/glyphs', - 'assets/sprites', - 'assets/tiles', - ], - - 'dependencies': [ - 'iossdk', - ], - - 'sources': [ - './main.m', - './MBXBenchAppDelegate.h', - './MBXBenchAppDelegate.m', - './MBXBenchViewController.h', - './MBXBenchViewController.mm', - './locations.hpp', - './locations.cpp', - ], - - 'xcode_settings': { - 'SDKROOT': 'iphoneos', - 'SUPPORTED_PLATFORMS': 'iphoneos', - 'IPHONEOS_DEPLOYMENT_TARGET': '8.0', - 'INFOPLIST_FILE': '../platform/ios/benchmark/app-info.plist', - 'TARGETED_DEVICE_FAMILY': '1,2', - 'COMBINE_HIDPI_IMAGES': 'NO', # don't merge @2x.png images into .tiff files - 'COPY_PHASE_STRIP': 'NO', - 'CLANG_ENABLE_OBJC_ARC': 'YES', - 'CLANG_ENABLE_MODULES': 'YES', - 'LD_RUNPATH_SEARCH_PATHS': [ - '$(inherited)', - '@executable_path/Frameworks', - ], - 'OTHER_LDFLAGS': [ - '-framework CoreLocation', - ], - }, - - 'configurations': { - 'Debug': { - 'xcode_settings': { - 'CODE_SIGN_IDENTITY': 'iPhone Developer', - 'COPY_PHASE_STRIP': 'NO', - }, - }, - 'Release': { - 'xcode_settings': { - 'CODE_SIGN_IDENTITY': 'iPhone Distribution', - 'ARCHS': [ "armv7", "armv7s", "arm64", "i386", "x86_64" ], - 'COPY_PHASE_STRIP': 'YES', - }, - }, - }, - - 'copies': [ - { - 'destination': '<(PRODUCT_DIR)/$(FRAMEWORKS_FOLDER_PATH)', - 'files': [ - '<(PRODUCT_DIR)/Mapbox.framework', - ], - 'xcode_code_sign': 1, - }, - ], - } - ] -} diff --git a/platform/ios/bitrise.yml b/platform/ios/bitrise.yml index 1322224caf..83dba2239e 100644 --- a/platform/ios/bitrise.yml +++ b/platform/ios/bitrise.yml @@ -28,10 +28,11 @@ workflows: inputs: - content: |- #!/bin/bash - + set -eu -o pipefail gem install jazzy --no-rdoc --no-ri - make ipackage-sim - make itest + export BUILDTYPE=Debug + make ios + make test-ios - is_debug: 'yes' - slack: title: Post to Slack @@ -51,5 +52,3 @@ workflows: failed' - icon_url: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-icon-128.png - icon_url_on_error: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-error-icon-128.png - before_run: - after_run: diff --git a/platform/ios/framework/framework-ios.gypi b/platform/ios/framework/framework-ios.gypi deleted file mode 100644 index 3d733d963a..0000000000 --- a/platform/ios/framework/framework-ios.gypi +++ /dev/null @@ -1,71 +0,0 @@ -{ - 'includes': [ - '../../../gyp/common.gypi', - ], - 'targets': [ - { - 'target_name': 'iossdk', - 'product_name': 'Mapbox', - 'type': 'shared_library', - 'mac_bundle': 1, - - 'dependencies': [ - 'mbgl.gyp:core', - 'mbgl.gyp:platform-<(platform_lib)', - 'mbgl.gyp:http-<(http_lib)', - 'mbgl.gyp:asset-<(asset_lib)', - ], - - 'xcode_settings': { - 'CLANG_ENABLE_OBJC_ARC': 'YES', - 'COMBINE_HIDPI_IMAGES': 'NO', # disable combining @2x, @3x images into .tiff files - 'CURRENT_PROJECT_VERSION': '0', - 'DEFINES_MODULE': 'YES', - 'DYLIB_INSTALL_NAME_BASE': '@rpath', - 'INFOPLIST_FILE': '../platform/ios/framework/Info.plist', - 'IPHONEOS_DEPLOYMENT_TARGET': '8.0', - 'LD_RUNPATH_SEARCH_PATHS': [ - '$(inherited)', - '@executable_path/Frameworks', - '@loader_path/Frameworks', - ], - 'PRODUCT_BUNDLE_IDENTIFIER': 'com.mapbox.sdk.ios', - 'OTHER_LDFLAGS': [ '-stdlib=libc++', '-lstdc++' ], - 'SDKROOT': 'iphoneos', - 'SKIP_INSTALL': 'YES', - 'SUPPORTED_PLATFORMS': [ - 'iphonesimulator', - 'iphoneos', - ], - 'VERSIONING_SYSTEM': 'apple-generic', - }, - - 'mac_framework_headers': [ - 'Mapbox.h', - '<!@(find ../platform/{darwin,ios}/include -type f \! -name \'.*\' \! -name Mapbox.h)', - ], - - 'sources': [ - 'Mapbox.m', - ], - - 'configurations': { - 'Debug': { - 'xcode_settings': { - 'CODE_SIGN_IDENTITY': 'iPhone Developer', - 'DEAD_CODE_STRIPPING': 'YES', - 'GCC_OPTIMIZATION_LEVEL': '0', - }, - }, - 'Release': { - 'xcode_settings': { - 'ARCHS': [ "armv7", "armv7s", "arm64", "i386", "x86_64" ], - 'CODE_SIGN_IDENTITY': 'iPhone Distribution', - 'DEAD_CODE_STRIPPING': 'YES', - 'GCC_OPTIMIZATION_LEVEL': 's', - }, - }, - }, - }, - ] -} diff --git a/platform/ios/platform.gyp b/platform/ios/platform.gyp new file mode 100644 index 0000000000..f182767b56 --- /dev/null +++ b/platform/ios/platform.gyp @@ -0,0 +1,382 @@ +{ + 'variables': { + 'loop_lib': 'darwin', + 'headless_lib': 'eagl', + }, + 'xcode_settings': { + # Force all build output to the build directory. Must + # be an absolute path or xcodebuild will ignore it. + 'SYMROOT': '<!(cd ../../build/ios-all && pwd)', + }, + 'includes': [ + '../../mbgl.gypi', + ], + 'target_defaults': { + 'target_conditions': [ + ['_type == "static_library"', { + 'xcode_settings': { + 'SDKROOT': 'iphoneos', + 'SUPPORTED_PLATFORMS': 'iphonesimulator iphoneos', + 'IPHONEOS_DEPLOYMENT_TARGET': '7.0', + 'TARGETED_DEVICE_FAMILY': '1,2', + 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', + 'CODE_SIGN_IDENTITY': 'iPhone Developer', + }, + 'configurations': { + 'Release': { + 'xcode_settings': { + 'ARCHS': [ "armv7", "armv7s", "arm64", "i386", "x86_64" ], + }, + }, + }, + }], + ], + }, + 'targets': [ + { + 'target_name': 'platform-lib', + 'product_name': 'mbgl-platform-ios', + 'type': 'static_library', + 'standalone_static_library': 1, + 'hard_dependency': 1, + 'dependencies': [ + 'core', + ], + + 'include_dirs': [ + 'include', + '../darwin/include', + '../default', + '../../include', + '../../src', # TODO: eliminate + ], + + 'sources': [ + '../default/asset_file_source.cpp', + '../default/default_file_source.cpp', + '../default/online_file_source.cpp', + '../default/mbgl/storage/offline.hpp', + '../default/mbgl/storage/offline.cpp', + '../default/mbgl/storage/offline_database.hpp', + '../default/mbgl/storage/offline_database.cpp', + '../default/mbgl/storage/offline_download.hpp', + '../default/mbgl/storage/offline_download.cpp', + '../default/sqlite3.hpp', + '../default/sqlite3.cpp', + '../darwin/src/http_request_nsurl.mm', + '../darwin/src/log_nslog.mm', + '../darwin/src/string_nsstring.mm', + '../darwin/src/image.mm', + '../darwin/src/nsthread.mm', + '../darwin/src/reachability.m', + '../darwin/src/NSException+MGLAdditions.h', + '../darwin/src/NSString+MGLAdditions.h', + '../darwin/src/NSString+MGLAdditions.m', + '../darwin/src/MGLTypes.m', + '../darwin/src/MGLStyle.mm', + '../darwin/src/MGLGeometry_Private.h', + '../darwin/src/MGLGeometry.mm', + '../darwin/src/MGLShape.m', + '../darwin/src/MGLMultiPoint_Private.h', + '../darwin/src/MGLMultiPoint.mm', + '../darwin/src/MGLPointAnnotation.m', + '../darwin/src/MGLPolyline.mm', + '../darwin/src/MGLPolygon.mm', + '../darwin/src/MGLMapCamera.mm', + '../darwin/src/MGLOfflinePack.mm', + '../darwin/src/MGLOfflinePack_Private.h', + '../darwin/src/MGLOfflineStorage.mm', + '../darwin/src/MGLOfflineStorage_Private.h', + '../darwin/src/MGLOfflineRegion_Private.h', + '../darwin/src/MGLTilePyramidOfflineRegion.mm', + '../darwin/src/MGLAccountManager_Private.h', + '../darwin/src/MGLAccountManager.m', + '../darwin/src/NSBundle+MGLAdditions.h', + '../darwin/src/NSBundle+MGLAdditions.m', + '../darwin/src/NSProcessInfo+MGLAdditions.h', + '../darwin/src/NSProcessInfo+MGLAdditions.m', + 'src/MGLMapboxEvents.h', + 'src/MGLMapboxEvents.m', + 'src/MGLAPIClient.h', + 'src/MGLAPIClient.m', + 'src/MGLLocationManager.h', + 'src/MGLLocationManager.m', + 'src/MGLMapView.mm', + 'src/MGLUserLocation_Private.h', + 'src/MGLUserLocation.m', + 'src/MGLUserLocationAnnotationView.h', + 'src/MGLUserLocationAnnotationView.m', + 'src/MGLAnnotationImage_Private.h', + 'src/MGLAnnotationImage.m', + 'src/MGLCompactCalloutView.h', + 'src/MGLCompactCalloutView.m', + 'vendor/SMCalloutView/SMCalloutView.h', + 'vendor/SMCalloutView/SMCalloutView.m', + 'vendor/Fabric/FABAttributes.h', + 'vendor/Fabric/FABKitProtocol.h', + 'vendor/Fabric/Fabric.h', + 'vendor/Fabric/Fabric+FABKits.h', + ], + + 'variables': { + 'cflags_cc': [ + '<@(boost_cflags)', + '<@(sqlite_cflags)', + '<@(zlib_cflags)', + '<@(rapidjson_cflags)', + '<@(variant_cflags)', + ], + 'ldflags': [ + '<@(sqlite_ldflags)', + '<@(zlib_ldflags)', + ], + 'libraries': [ + '<@(sqlite_static_libs)', + '<@(zlib_static_libs)', + '$(SDKROOT)/System/Library/Frameworks/CoreGraphics.framework', + '$(SDKROOT)/System/Library/Frameworks/CoreLocation.framework', + '$(SDKROOT)/System/Library/Frameworks/GLKit.framework', + '$(SDKROOT)/System/Library/Frameworks/ImageIO.framework', + '$(SDKROOT)/System/Library/Frameworks/MobileCoreServices.framework', + '$(SDKROOT)/System/Library/Frameworks/OpenGLES.framework', + '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework', + '$(SDKROOT)/System/Library/Frameworks/Security.framework', + '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework', + '$(SDKROOT)/System/Library/Frameworks/UIKit.framework', + ], + }, + + 'xcode_settings': { + 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ], + 'CLANG_ENABLE_OBJC_ARC': 'YES', + 'CLANG_ENABLE_MODULES': 'YES', + }, + + 'link_settings': { + 'libraries': [ '<@(libraries)' ], + 'xcode_settings': { + 'OTHER_LDFLAGS': [ '<@(ldflags)' ], + }, + }, + + 'direct_dependent_settings': { + 'include_dirs': [ + 'include', + '../darwin/include', + '../include', + ], + 'mac_bundle_resources': [ + '<!@(find resources -type f \! -name "README" \! -name \'.*\')', + '<!@(find ../default/resources -type f \! -name "README" \! -name \'.der\')', + ], + }, + }, + { + 'target_name': 'iossdk', + 'product_name': 'Mapbox', + 'type': 'shared_library', + 'mac_bundle': 1, + + 'dependencies': [ + 'platform-lib', + ], + + 'xcode_settings': { + 'CLANG_ENABLE_OBJC_ARC': 'YES', + 'COMBINE_HIDPI_IMAGES': 'NO', # disable combining @2x, @3x images into .tiff files + 'CURRENT_PROJECT_VERSION': '0', + 'DEFINES_MODULE': 'YES', + 'DYLIB_INSTALL_NAME_BASE': '@rpath', + 'INFOPLIST_FILE': 'framework/Info.plist', + 'IPHONEOS_DEPLOYMENT_TARGET': '8.0', + 'LD_RUNPATH_SEARCH_PATHS': [ + '$(inherited)', + '@executable_path/Frameworks', + '@loader_path/Frameworks', + ], + 'PRODUCT_BUNDLE_IDENTIFIER': 'com.mapbox.sdk.ios', + 'OTHER_LDFLAGS': [ '-stdlib=libc++', '-lstdc++' ], + 'SDKROOT': 'iphoneos', + 'SKIP_INSTALL': 'YES', + 'SUPPORTED_PLATFORMS': [ + 'iphonesimulator', + 'iphoneos', + ], + 'VERSIONING_SYSTEM': 'apple-generic', + }, + + 'mac_framework_headers': [ + 'framework/Mapbox.h', + '<!@(find ../{darwin,ios}/include -type f \! -name \'.*\' \! -name Mapbox.h)', + ], + + 'sources': [ + 'framework/Mapbox.m', + ], + + 'configurations': { + 'Debug': { + 'xcode_settings': { + 'CODE_SIGN_IDENTITY': 'iPhone Developer', + 'DEAD_CODE_STRIPPING': 'YES', + 'GCC_OPTIMIZATION_LEVEL': '0', + }, + }, + 'Release': { + 'xcode_settings': { + 'ARCHS': [ "armv7", "armv7s", "arm64", "i386", "x86_64" ], + 'CODE_SIGN_IDENTITY': 'iPhone Distribution', + 'DEAD_CODE_STRIPPING': 'YES', + 'GCC_OPTIMIZATION_LEVEL': 's', + }, + }, + }, + }, + { + 'target_name': 'iosapp', + 'product_name': 'Mapbox GL', + 'type': 'executable', + 'product_extension': 'app', + 'mac_bundle': 1, + 'mac_bundle_resources': [ + '<!@(find app/img -type f)', + 'app/Storyboard.storyboard', + 'app/points.geojson', + 'app/polyline.geojson', + 'app/threestates.geojson', + 'app/Settings.bundle/', + 'app/app-info.plist', + ], + + 'dependencies': [ + 'iossdk', + ], + + 'sources': [ + 'app/main.m', + 'app/MBXAppDelegate.h', + 'app/MBXAppDelegate.m', + 'app/MBXCustomCalloutView.h', + 'app/MBXCustomCalloutView.m', + 'app/MBXOfflinePacksTableViewController.h', + 'app/MBXOfflinePacksTableViewController.m', + 'app/MBXViewController.h', + 'app/MBXViewController.m', + ], + + 'xcode_settings': { + 'SDKROOT': 'iphoneos', + 'SUPPORTED_PLATFORMS': 'iphonesimulator iphoneos', + 'IPHONEOS_DEPLOYMENT_TARGET': '8.0', + 'INFOPLIST_FILE': 'app/app-info.plist', + 'TARGETED_DEVICE_FAMILY': '1,2', + 'COMBINE_HIDPI_IMAGES': 'NO', # disable combining @2x, @3x images into .tiff files + 'COPY_PHASE_STRIP': 'NO', + 'CLANG_ENABLE_OBJC_ARC': 'YES', + 'CLANG_ENABLE_MODULES': 'YES', + 'LD_RUNPATH_SEARCH_PATHS': [ + '$(inherited)', + '@executable_path/Frameworks', + ], + }, + + 'configurations': { + 'Debug': { + 'xcode_settings': { + 'CODE_SIGN_IDENTITY': 'iPhone Developer', + 'COPY_PHASE_STRIP': 'NO', + }, + }, + 'Release': { + 'xcode_settings': { + 'CODE_SIGN_IDENTITY': 'iPhone Distribution', + 'ARCHS': [ "armv7", "armv7s", "arm64", "i386", "x86_64" ], + 'COPY_PHASE_STRIP': 'YES', + }, + }, + }, + + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)/$(FRAMEWORKS_FOLDER_PATH)', + 'files': [ + '<(PRODUCT_DIR)/Mapbox.framework', + ], + 'xcode_code_sign': 1, + }, + ], + }, + { + 'target_name': 'ios-bench', + 'product_name': 'Bench GL', + 'type': 'executable', + 'product_extension': 'app', + 'mac_bundle': 1, + 'mac_bundle_resources': [ + '<!@(find benchmark/img -type f)', + 'benchmark/assets/glyphs', + 'benchmark/assets/sprites', + 'benchmark/assets/tiles', + ], + + 'dependencies': [ + 'iossdk', + ], + + 'sources': [ + 'benchmark/main.m', + 'benchmark/MBXBenchAppDelegate.h', + 'benchmark/MBXBenchAppDelegate.m', + 'benchmark/MBXBenchViewController.h', + 'benchmark/MBXBenchViewController.mm', + 'benchmark/locations.hpp', + 'benchmark/locations.cpp', + ], + + 'xcode_settings': { + 'SDKROOT': 'iphoneos', + 'SUPPORTED_PLATFORMS': 'iphoneos', + 'IPHONEOS_DEPLOYMENT_TARGET': '8.0', + 'INFOPLIST_FILE': 'benchmark/app-info.plist', + 'TARGETED_DEVICE_FAMILY': '1,2', + 'COMBINE_HIDPI_IMAGES': 'NO', # don't merge @2x.png images into .tiff files + 'COPY_PHASE_STRIP': 'NO', + 'CLANG_ENABLE_OBJC_ARC': 'YES', + 'CLANG_ENABLE_MODULES': 'YES', + 'LD_RUNPATH_SEARCH_PATHS': [ + '$(inherited)', + '@executable_path/Frameworks', + ], + 'OTHER_LDFLAGS': [ + '-framework CoreLocation', + ], + }, + + 'configurations': { + 'Debug': { + 'xcode_settings': { + 'CODE_SIGN_IDENTITY': 'iPhone Developer', + 'COPY_PHASE_STRIP': 'NO', + }, + }, + 'Release': { + 'xcode_settings': { + 'CODE_SIGN_IDENTITY': 'iPhone Distribution', + 'ARCHS': [ "armv7", "armv7s", "arm64", "i386", "x86_64" ], + 'COPY_PHASE_STRIP': 'YES', + }, + }, + }, + + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)/$(FRAMEWORKS_FOLDER_PATH)', + 'files': [ + '<(PRODUCT_DIR)/Mapbox.framework', + ], + 'xcode_code_sign': 1, + }, + ], + } + ], +} diff --git a/platform/ios/scripts/after_failure.sh b/platform/ios/scripts/after_failure.sh deleted file mode 100755 index 88a6427f75..0000000000 --- a/platform/ios/scripts/after_failure.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail -set -u - -ls $KIF_SCREENSHOTS/ - -REPO_NAME=$(basename $TRAVIS_REPO_SLUG) - -aws s3 cp $KIF_SCREENSHOTS/ s3://mapbox/$REPO_NAME/ios/tests/$TRAVIS_JOB_NUMBER/ --acl public-read --recursive > /dev/null - -echo http://mapbox.s3.amazonaws.com/$REPO_NAME/ios/tests/$TRAVIS_JOB_NUMBER/index.html diff --git a/platform/ios/scripts/defaults.mk b/platform/ios/scripts/defaults.mk deleted file mode 100644 index 9debff4ce0..0000000000 --- a/platform/ios/scripts/defaults.mk +++ /dev/null @@ -1,9 +0,0 @@ -HEADLESS = eagl -PLATFORM ?= ios -ASSET ?= fs -HTTP ?= nsurl -LOOP ?= darwin - -HOST_VERSION = all - -PROVISIONING_PROFILE ?= 19324a54-7455-4f0b-8e1c-e6957c718ebc diff --git a/platform/ios/scripts/install.sh b/platform/ios/scripts/install.sh deleted file mode 100755 index 437193b1f2..0000000000 --- a/platform/ios/scripts/install.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -git fetch --tags - -mapbox_time "checkout_mason" \ -git submodule update --init .mason - -mapbox_time "install_recent_git" \ -brew install git - -mapbox_time "install_awscli" \ -brew install awscli - -mapbox_time "install_jazzy" \ -gem install jazzy - -mkdir -p ${KIF_SCREENSHOTS} diff --git a/platform/ios/scripts/package.sh b/platform/ios/scripts/package.sh index b0f63478df..02a454aaf7 100755 --- a/platform/ios/scripts/package.sh +++ b/platform/ios/scripts/package.sh @@ -72,12 +72,6 @@ echo ${HASH} echo ${HASH} >> ${VERSION} -step "Creating build files…" -export MASON_PLATFORM=ios -export BUILDTYPE=${BUILDTYPE:-Release} -export HOST=ios -make Xcode/ios - PROJ_VERSION=$(git rev-list --count HEAD) if [[ "${BUILD_FOR_DEVICE}" == true ]]; then @@ -91,13 +85,9 @@ if [[ "${BUILD_FOR_DEVICE}" == true ]]; then DEPLOYMENT_POSTPROCESSING=YES \ CODE_SIGNING_REQUIRED=NO \ CODE_SIGN_IDENTITY= \ - -project ./build/ios-all/gyp/mbgl.xcodeproj \ + -project ./build/ios-all/platform/ios/platform.xcodeproj \ -configuration ${BUILDTYPE} \ - -target core \ - -target platform-ios \ - -target http-nsurl \ - -target asset-fs \ - -target headless-eagl \ + -target platform-lib \ -jobs ${JOBS} fi @@ -112,7 +102,7 @@ if [[ "${BUILD_FOR_DEVICE}" == true ]]; then CURRENT_PROJECT_VERSION=${PROJ_VERSION} \ CODE_SIGNING_REQUIRED=NO \ CODE_SIGN_IDENTITY= \ - -project ./build/ios-all/gyp/ios.xcodeproj \ + -project ./build/ios-all/platform/ios/platform.xcodeproj \ -configuration ${BUILDTYPE} \ -target iossdk \ -jobs ${JOBS} @@ -125,13 +115,9 @@ if [[ ${BUILD_STATIC} == true ]]; then ARCHS="x86_64 i386" \ ONLY_ACTIVE_ARCH=NO \ GCC_GENERATE_DEBUGGING_SYMBOLS=${GCC_GENERATE_DEBUGGING_SYMBOLS} \ - -project ./build/ios-all/gyp/mbgl.xcodeproj \ + -project ./build/ios-all/platform/ios/platform.xcodeproj \ -configuration ${BUILDTYPE} \ - -target core \ - -target platform-ios \ - -target http-nsurl \ - -target asset-fs \ - -target headless-eagl \ + -target platform-lib \ -jobs ${JOBS} fi @@ -143,13 +129,13 @@ if [[ ${BUILD_DYNAMIC} == true ]]; then GCC_GENERATE_DEBUGGING_SYMBOLS=${GCC_GENERATE_DEBUGGING_SYMBOLS} \ ENABLE_BITCODE=${ENABLE_BITCODE} \ CURRENT_PROJECT_VERSION=${PROJ_VERSION} \ - -project ./build/ios-all/gyp/ios.xcodeproj \ + -project ./build/ios-all/platform/ios/platform.xcodeproj \ -configuration ${BUILDTYPE} \ -target iossdk \ -jobs ${JOBS} fi -LIBS=(core.a platform-ios.a asset-fs.a http-nsurl.a) +LIBS=(core.a platform-ios.a) # https://medium.com/@syshen/create-an-ios-universal-framework-148eb130a46c if [[ "${BUILD_FOR_DEVICE}" == true ]]; then @@ -159,22 +145,22 @@ if [[ "${BUILD_FOR_DEVICE}" == true ]]; then libtool -static -no_warning_for_no_symbols \ `find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libgeojsonvt.a` \ -o ${OUTPUT}/static/${NAME}.framework/${NAME} \ - ${LIBS[@]/#/gyp/build/${BUILDTYPE}-iphoneos/libmbgl-} \ - ${LIBS[@]/#/gyp/build/${BUILDTYPE}-iphonesimulator/libmbgl-} + ${LIBS[@]/#/build/ios-all/${BUILDTYPE}-iphoneos/libmbgl-} \ + ${LIBS[@]/#/build/ios-all/${BUILDTYPE}-iphonesimulator/libmbgl-} fi if [[ ${BUILD_DYNAMIC} == true ]]; then step "Copying dynamic framework into place for iOS devices" cp -r \ - gyp/build/${BUILDTYPE}-iphoneos/${NAME}.framework \ + build/ios-all/${BUILDTYPE}-iphoneos/${NAME}.framework \ ${OUTPUT}/dynamic/ - cp -r gyp/build/${BUILDTYPE}-iphoneos/${NAME}.framework.dSYM \ + cp -r build/ios-all/${BUILDTYPE}-iphoneos/${NAME}.framework.dSYM \ ${OUTPUT}/dynamic/ step "Merging simulator dynamic library into device dynamic library…" lipo \ - gyp/build/${BUILDTYPE}-iphoneos/${NAME}.framework/${NAME} \ - gyp/build/${BUILDTYPE}-iphonesimulator/${NAME}.framework/${NAME} \ + build/ios-all/${BUILDTYPE}-iphoneos/${NAME}.framework/${NAME} \ + build/ios-all/${BUILDTYPE}-iphonesimulator/${NAME}.framework/${NAME} \ -create -output ${OUTPUT}/dynamic/${NAME}.framework/${NAME} | echo fi else @@ -184,15 +170,15 @@ else libtool -static -no_warning_for_no_symbols \ `find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libgeojsonvt.a` \ -o ${OUTPUT}/static/${NAME}.framework/${NAME} \ - ${LIBS[@]/#/gyp/build/${BUILDTYPE}-iphonesimulator/libmbgl-} + ${LIBS[@]/#/build/ios-all/${BUILDTYPE}-iphonesimulator/libmbgl-} fi if [[ ${BUILD_DYNAMIC} == true ]]; then step "Copying dynamic framework into place for iOS Simulator…" cp -r \ - gyp/build/${BUILDTYPE}-iphonesimulator/${NAME}.framework \ + build/ios-all/${BUILDTYPE}-iphonesimulator/${NAME}.framework \ ${OUTPUT}/dynamic/${NAME}.framework - cp -r gyp/build/${BUILDTYPE}-iphonesimulator/${NAME}.framework.dSYM \ + cp -r build/ios-all/${BUILDTYPE}-iphonesimulator/${NAME}.framework.dSYM \ ${OUTPUT}/dynamic/ fi fi diff --git a/platform/ios/scripts/run.sh b/platform/ios/scripts/run.sh deleted file mode 100755 index 44c21e7562..0000000000 --- a/platform/ios/scripts/run.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail -set -u - -source ./platform/ios/scripts/setup.sh - -BUILDTYPE=${BUILDTYPE:-Release} - -PUBLISH_TAG=($(git show -s --format=%B | sed -n 's/.*\[publish \([a-z]\{1,\}\)-v\([0-9a-z.\-]\{1,\}\)\].*/\1 \2/p')) -PUBLISH_PLATFORM=${PUBLISH_TAG[0],-} -PUBLISH_VERSION=${PUBLISH_TAG[1],-} - - -################################################################################ -# Build -################################################################################ - -if [[ ${PUBLISH_PLATFORM} = 'ios' ]]; then - # default, with debug symbols - mapbox_time "package_ios_symbols" \ - make ipackage - - mapbox_time "deploy_ios_symbols" - ./platform/ios/scripts/publish.sh "${PUBLISH_VERSION}" symbols - - # no debug symbols, for smaller distribution - mapbox_time "package_ios_stripped" \ - make ipackage-strip - - mapbox_time "deploy_ios_stripped" - ./platform/ios/scripts/publish.sh "${PUBLISH_VERSION}" - - # dynamic, with debug symbols - mapbox_time "package_ios_dynamic" \ - make iframework - - mapbox_time "deploy_ios_dynamic" - ./platform/ios/scripts/publish.sh "${PUBLISH_VERSION}" symbols-dynamic - - # dynamic, without debug symbols - mapbox_time "package_ios_dynamic_stripped" \ - make iframework SYMBOLS=NO - - mapbox_time "deploy_ios_dynamic_stripped" - ./platform/ios/scripts/publish.sh "${PUBLISH_VERSION}" dynamic -else - # build & test iOS - mapbox_time "run_ios_tests" \ - make itest -fi diff --git a/platform/ios/scripts/setup.sh b/platform/ios/scripts/setup.sh deleted file mode 100644 index d115cf9020..0000000000 --- a/platform/ios/scripts/setup.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -# This script is sourced; do not set -e or -o pipefail here. - -# Ensure mason is on the PATH -export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" diff --git a/platform/ios/scripts/test.sh b/platform/ios/scripts/test.sh deleted file mode 100755 index a2515e6fea..0000000000 --- a/platform/ios/scripts/test.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail -set -u - -# No tests for now. KIF tests are too unreliable. diff --git a/platform/linux/README.md b/platform/linux/README.md index 55f3e71dba..910edcb9a6 100644 --- a/platform/linux/README.md +++ b/platform/linux/README.md @@ -33,14 +33,13 @@ Set the environment variable `MAPBOX_ACCESS_TOKEN` to your [Mapbox access token] export MAPBOX_ACCESS_TOKEN=MYTOKEN -Then, you can then proceed to build the library: +Then, you can then proceed to build the test application: - git submodule update --init - make linux + make glfw-app Set an access token as described below, and then run: - make run-linux + make run-glfw-app ### Test diff --git a/platform/linux/main.cpp b/platform/linux/main.cpp deleted file mode 100644 index 98fb32075e..0000000000 --- a/platform/linux/main.cpp +++ /dev/null @@ -1,176 +0,0 @@ -#include <mbgl/mbgl.hpp> -#include <mbgl/util/default_styles.hpp> -#include <mbgl/platform/log.hpp> -#include <mbgl/platform/platform.hpp> -#include <mbgl/platform/default/settings_json.hpp> -#include <mbgl/platform/default/glfw_view.hpp> -#include <mbgl/storage/default_file_source.hpp> - -#include <signal.h> -#include <getopt.h> -#include <fstream> -#include <sstream> -#include <cstdlib> -#include <cstdio> - -namespace { - -std::unique_ptr<GLFWView> view; - -} - -void quit_handler(int) { - if (view) { - mbgl::Log::Info(mbgl::Event::Setup, "waiting for quit..."); - view->setShouldClose(); - } else { - exit(0); - } -} - -int main(int argc, char *argv[]) { - bool fullscreen = false; - bool benchmark = false; - std::string style; - double latitude = 0, longitude = 0; - double bearing = 0, zoom = 1, pitch = 0; - bool skipConfig = false; - - const struct option long_options[] = { - {"fullscreen", no_argument, 0, 'f'}, - {"benchmark", no_argument, 0, 'b'}, - {"style", required_argument, 0, 's'}, - {"lon", required_argument, 0, 'x'}, - {"lat", required_argument, 0, 'y'}, - {"zoom", required_argument, 0, 'z'}, - {"bearing", required_argument, 0, 'r'}, - {"pitch", required_argument, 0, 'p'}, - {0, 0, 0, 0} - }; - - while (true) { - int option_index = 0; - int opt = getopt_long(argc, argv, "fbs:", long_options, &option_index); - if (opt == -1) break; - switch (opt) - { - case 0: - if (long_options[option_index].flag != 0) - break; - case 'f': - fullscreen = true; - break; - case 'b': - benchmark = true; - break; - case 's': - style = std::string("asset://") + std::string(optarg); - break; - case 'x': - longitude = atof(optarg); - skipConfig = true; - break; - case 'y': - latitude = atof(optarg); - skipConfig = true; - break; - case 'z': - zoom = atof(optarg); - skipConfig = true; - break; - case 'r': - bearing = atof(optarg); - skipConfig = true; - break; - case 'p': - pitch = atof(optarg); - skipConfig = true; - break; - default: - break; - } - - } - - // sigint handling - struct sigaction sigIntHandler; - sigIntHandler.sa_handler = quit_handler; - sigemptyset(&sigIntHandler.sa_mask); - sigIntHandler.sa_flags = 0; - sigaction(SIGINT, &sigIntHandler, NULL); - - if (benchmark) { - mbgl::Log::Info(mbgl::Event::General, "BENCHMARK MODE: Some optimizations are disabled."); - } - - view = std::make_unique<GLFWView>(fullscreen, benchmark); - - mbgl::DefaultFileSource fileSource("/tmp/mbgl-cache.db", "."); - - // Set access token if present - const char *token = getenv("MAPBOX_ACCESS_TOKEN"); - if (token == nullptr) { - mbgl::Log::Warning(mbgl::Event::Setup, "no access token set. mapbox.com tiles won't work."); - } else { - fileSource.setAccessToken(std::string(token)); - } - - mbgl::Map map(*view, fileSource); - - // Load settings - mbgl::Settings_JSON settings; - - if (skipConfig) { - map.setLatLngZoom(mbgl::LatLng(latitude, longitude), zoom); - map.setBearing(bearing); - map.setPitch(pitch); - mbgl::Log::Info(mbgl::Event::General, "Location: %f/%f (z%.2f, %.2f deg)", latitude, longitude, zoom, bearing); - } else { - map.setLatLngZoom(mbgl::LatLng(settings.latitude, settings.longitude), settings.zoom); - map.setBearing(settings.bearing); - map.setPitch(settings.pitch); - map.setDebug(mbgl::MapDebugOptions(settings.debug)); - } - - view->setChangeStyleCallback([&map] () { - static uint8_t currentStyleIndex; - - if (++currentStyleIndex == mbgl::util::default_styles::numOrderedStyles) { - currentStyleIndex = 0; - } - - mbgl::util::default_styles::DefaultStyle newStyle = mbgl::util::default_styles::orderedStyles[currentStyleIndex]; - map.setStyleURL(newStyle.url); - view->setWindowTitle(newStyle.name); - - mbgl::Log::Info(mbgl::Event::Setup, "Changed style to: %s", newStyle.name); - }); - - // Load style - if (style.empty()) { - mbgl::util::default_styles::DefaultStyle newStyle = mbgl::util::default_styles::orderedStyles[0]; - style = newStyle.url; - view->setWindowTitle(newStyle.name); - } - - map.setStyleURL(style); - - view->run(); - - // Save settings - mbgl::LatLng latLng = map.getLatLng(); - settings.latitude = latLng.latitude; - settings.longitude = latLng.longitude; - settings.zoom = map.getZoom(); - settings.bearing = map.getBearing(); - settings.pitch = map.getPitch(); - settings.debug = mbgl::EnumType(map.getDebug()); - if (!skipConfig) { - settings.save(); - } - mbgl::Log::Info(mbgl::Event::General, - "Exit location: --lat=\"%f\" --lon=\"%f\" --zoom=\"%f\" --bearing \"%f\"", - settings.latitude, settings.longitude, settings.zoom, settings.bearing); - - return 0; -} diff --git a/platform/linux/mapboxgl-app.gypi b/platform/linux/mapboxgl-app.gypi deleted file mode 100644 index 533f0b85d2..0000000000 --- a/platform/linux/mapboxgl-app.gypi +++ /dev/null @@ -1,66 +0,0 @@ -{ - 'includes': [ - '../../gyp/common.gypi', - ], - 'targets': [ - { 'target_name': 'linuxapp', - 'product_name': 'mapbox-gl', - 'type': 'executable', - - 'dependencies': [ - 'mbgl.gyp:core', - 'mbgl.gyp:platform-<(platform_lib)', - 'mbgl.gyp:http-<(http_lib)', - 'mbgl.gyp:asset-<(asset_lib)', - 'mbgl.gyp:copy_certificate_bundle', - ], - - 'sources': [ - 'main.cpp', - '../default/settings_json.cpp', - '../default/glfw_view.hpp', - '../default/glfw_view.cpp', - '../default/log_stderr.cpp', - ], - - 'variables' : { - 'cflags_cc': [ - '<@(opengl_cflags)', - '<@(boost_cflags)', - '<@(glfw_cflags)', - '<@(variant_cflags)', - ], - 'ldflags': [ - '<@(glfw_ldflags)', - ], - 'libraries': [ - '<@(glfw_static_libs)', - ], - }, - - 'conditions': [ - ['OS == "mac"', { - 'xcode_settings': { - 'SDKROOT': 'macosx', - 'SUPPORTED_PLATFORMS':'macosx', - 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ], - 'MACOSX_DEPLOYMENT_TARGET': '10.10', - }, - }, { - 'cflags_cc': [ '<@(cflags_cc)' ], - }] - ], - - 'link_settings': { - 'conditions': [ - ['OS == "mac"', { - 'libraries': [ '<@(libraries)' ], - 'xcode_settings': { 'OTHER_LDFLAGS': [ '<@(ldflags)' ] } - }, { - 'libraries': [ '<@(libraries)', '<@(ldflags)' ], - }] - ], - }, - }, - ], -} diff --git a/platform/linux/platform.gyp b/platform/linux/platform.gyp new file mode 100644 index 0000000000..0adbd2a2e6 --- /dev/null +++ b/platform/linux/platform.gyp @@ -0,0 +1,97 @@ +{ + 'variables': { + 'loop_lib': 'uv', + 'headless_lib': 'glx', + }, + 'conditions': [ + ['OS == "mac"', { + 'variables': { + 'headless_lib': 'cgl', + } + }], + ], + 'includes': [ + '../../mbgl.gypi', + '../../test/test.gypi', + '../../bin/glfw.gypi', + '../../bin/render.gypi', + '../../bin/offline.gypi', + ], + 'targets': [ + { + 'target_name': 'platform-lib', + 'product_name': 'mbgl-platform-linux', + 'type': 'static_library', + 'standalone_static_library': 1, + 'hard_dependency': 1, + 'dependencies': [ + 'core', + ], + + 'include_dirs': [ + '../default', + '../../include', + '../../src', # TODO: eliminate + ], + + 'sources': [ + '../default/log_stderr.cpp', + '../default/string_stdlib.cpp', + '../default/thread.cpp', + '../default/image.cpp', + '../default/webp_reader.cpp', + '../default/png_reader.cpp', + '../default/jpeg_reader.cpp', + '../default/asset_file_source.cpp', + '../default/http_request_curl.cpp', + '../default/default_file_source.cpp', + '../default/online_file_source.cpp', + '../default/mbgl/storage/offline.hpp', + '../default/mbgl/storage/offline.cpp', + '../default/mbgl/storage/offline_database.hpp', + '../default/mbgl/storage/offline_database.cpp', + '../default/mbgl/storage/offline_download.hpp', + '../default/mbgl/storage/offline_download.cpp', + '../default/sqlite3.hpp', + '../default/sqlite3.cpp', + ], + + 'cflags_cc': [ + '<@(boost_cflags)', + '<@(nunicode_cflags)', + '<@(sqlite_cflags)', + '<@(rapidjson_cflags)', + '<@(variant_cflags)', + '<@(libcurl_cflags)', + '<@(libpng_cflags)', + '<@(libjpeg-turbo_cflags)', + '<@(webp_cflags)', + ], + + 'link_settings': { + 'libraries': [ + '<@(nunicode_ldflags)', + '<@(nunicode_static_libs)', + '<@(sqlite_ldflags)', + '<@(sqlite_static_libs)', + '<@(zlib_ldflags)', + '<@(zlib_static_libs)', + '<@(libcurl_ldflags)', + '<@(libcurl_static_libs)', + '<@(libpng_ldflags)', + '<@(libpng_static_libs)', + '<@(libjpeg-turbo_ldflags)', + '<@(libjpeg-turbo_static_libs)', + '<@(webp_ldflags)', + '<@(webp_static_libs)', + ], + }, + + 'direct_dependent_settings': { + 'include_dirs': [ + '../include', + ], + }, + }, + ], +} diff --git a/platform/linux/scripts/after_script.sh b/platform/linux/scripts/after_script.sh index b5397f1df2..4989f0c444 100755 --- a/platform/linux/scripts/after_script.sh +++ b/platform/linux/scripts/after_script.sh @@ -3,13 +3,9 @@ set -e set -o pipefail -if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then - # Install and add awscli to PATH for uploading the results - pip install --user awscli - export PATH="`python -m site --user-base`/bin:${PATH}" - - REPO_NAME=$(basename $TRAVIS_REPO_SLUG) +JOB=$1 +if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then aws s3 cp --recursive --acl public-read --exclude "*" --include "*/actual.png" test/fixtures \ - s3://mapbox/$REPO_NAME/render-tests/$TRAVIS_JOB_NUMBER + s3://mapbox/mapbox-gl-native/render-tests/$JOB fi diff --git a/platform/linux/scripts/coveralls.sh b/platform/linux/scripts/coveralls.sh index 468fa4774b..1d8d9f060a 100755 --- a/platform/linux/scripts/coveralls.sh +++ b/platform/linux/scripts/coveralls.sh @@ -3,11 +3,22 @@ set -e set -o pipefail -source ./platform/linux/scripts/setup.sh +mapbox_time "install_lcov" \ +mason install lcov 1.12 -################################################################################ -# Coveralls -################################################################################ +# Collect coverage data and save it into coverage.info +mapbox_time "lcov_capture" \ +`mason prefix lcov 1.12`/usr/bin/lcov \ + --quiet \ + --capture \ + --no-external \ + --gcov-tool "gcov-4.9" \ + --directory "src/mbgl" \ + --directory "platform" \ + --directory "include/mbgl" \ + --directory "build/linux-x86_64/${BUILDTYPE}" \ + --base-directory "build/linux-x86_64/${BUILDTYPE}" \ + --output-file "build/linux-x86_64/${BUILDTYPE}/coverage.info" -mapbox_time "make_coveralls" \ -make coveralls -j${JOBS} +mapbox_time "coveralls_upload" \ +coveralls-lcov "build/linux-x86_64/${BUILDTYPE}/coverage.info" diff --git a/platform/linux/scripts/defaults.mk b/platform/linux/scripts/defaults.mk deleted file mode 100644 index 80f1346533..0000000000 --- a/platform/linux/scripts/defaults.mk +++ /dev/null @@ -1,5 +0,0 @@ -HEADLESS ?= glx -PLATFORM ?= linux -ASSET ?= fs -HTTP ?= curl -LOOP ?= uv diff --git a/platform/linux/scripts/install.sh b/platform/linux/scripts/install.sh deleted file mode 100755 index a254d312ec..0000000000 --- a/platform/linux/scripts/install.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -mapbox_time "checkout_mason" \ -git submodule update --init .mason - -PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" \ -mapbox_time "install_mesa" \ -mason install mesa 10.4.3 diff --git a/platform/linux/scripts/run.sh b/platform/linux/scripts/run.sh deleted file mode 100755 index 1c0c13968a..0000000000 --- a/platform/linux/scripts/run.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -source ./platform/linux/scripts/setup.sh - -BUILDTYPE=${BUILDTYPE:-Release} - -################################################################################ -# Build -################################################################################ - -mapbox_time "compile_program" \ -make linux -j${JOBS} BUILDTYPE=${BUILDTYPE} - -mapbox_time "compile_render_binary" \ -make render -j${JOBS} BUILDTYPE=${BUILDTYPE} - -mapbox_time "compile_offline_binary" \ -make offline -j${JOBS} BUILDTYPE=${BUILDTYPE} - -mapbox_time "compile_tests" \ -make test -j${JOBS} BUILDTYPE=${BUILDTYPE} - -################################################################################ -# Test -################################################################################ - -mapbox_time "run_tests" \ -make test-* BUILDTYPE=${BUILDTYPE} diff --git a/platform/linux/scripts/setup.sh b/platform/linux/scripts/setup.sh deleted file mode 100755 index af0eafb5cf..0000000000 --- a/platform/linux/scripts/setup.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -# This script is sourced; do not set -e or -o pipefail here. - -# Ensure mason is on the PATH -export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" - -# Set the core file limit to unlimited so a core file is generated upon crash -ulimit -c unlimited -S - -################################################################################ -# X Server setup -################################################################################ - -# Start the mock X server -if [ -f /etc/init.d/xvfb ] ; then - mapbox_time "start_xvfb" \ - sh -e /etc/init.d/xvfb start - sleep 2 # sometimes, xvfb takes some time to start up -fi - -# Make sure we're connecting to xvfb -export DISPLAY=:99.0 - -# Make sure we're loading the 10.4.3 libs we installed manually -export LD_LIBRARY_PATH="`mason prefix mesa 10.4.3`/lib:${LD_LIBRARY_PATH:-}" - -mapbox_time "glxinfo" \ -glxinfo diff --git a/platform/linux/scripts/tidy.sh b/platform/linux/scripts/tidy.sh deleted file mode 100755 index 424c82c3cd..0000000000 --- a/platform/linux/scripts/tidy.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -# Ensure mason is on the PATH -export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" - -BUILDTYPE=${BUILDTYPE:-Release} - -export CLANG_TIDY=clang-tidy-3.8 - -mapbox_time "config" \ -make config - -mapbox_time "tidy" \ -make tidy diff --git a/platform/node/bitrise.yml b/platform/node/bitrise.yml index 9b9b4ca064..0b09192ee3 100644 --- a/platform/node/bitrise.yml +++ b/platform/node/bitrise.yml @@ -22,25 +22,20 @@ workflows: else envman add --key SKIPCI --value false fi - - select-xcode-version: - title: Select Xcode version - run_if: '{{enveq "SKIPCI" "false"}}' - script: title: Run build script run_if: '{{enveq "SKIPCI" "false"}}' inputs: - content: |- #!/bin/bash - export TRAVIS_OS_NAME=osx - export TRAVIS_TAG=$BITRISE_GIT_TAG - export TRAVIS_JOB_NUMBER=$BITRISE_BUILD_NUMBER - export NODE_VERSION=4 - export CXX=clang++ - export CC=clang - source ./scripts/set_compiler.sh - ./platform/node/scripts/install.sh - ./platform/node/scripts/run.sh - ./platform/node/scripts/after_script.sh + set -eu -o pipefail + brew unlink node + brew install awscli homebrew/versions/node4-lts + brew link homebrew/versions/node4-lts + make node + make test-node || result=$? + ./platform/node/scripts/after_script.sh ${BITRISE_BUILD_NUMBER} ${BITRISE_GIT_TAG:-} + exit ${result:-0} - slack: title: Post to Slack run_if: '{{enveq "SKIPCI" "false"}}' diff --git a/platform/node/scripts/after_script.sh b/platform/node/scripts/after_script.sh index ae8480e02a..905055ad11 100755 --- a/platform/node/scripts/after_script.sh +++ b/platform/node/scripts/after_script.sh @@ -3,50 +3,20 @@ set -e set -o pipefail -# Inspect binary. -if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then - ldd ./lib/mapbox-gl-native.node -else - otool -L ./lib/mapbox-gl-native.node -fi +JOB=$1 +TAG=$2 -PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") +if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then + gzip --stdout node_modules/mapbox-gl-test-suite/render-tests/index.html | \ + aws s3 cp --acl public-read --content-encoding gzip --content-type text/html \ + - s3://mapbox/mapbox-gl-native/render-tests/$JOB/index.html -if [[ ${TRAVIS_TAG} == node-v${PACKAGE_JSON_VERSION} ]]; then - source ~/.nvm/nvm.sh - nvm use $NODE_VERSION + echo http://mapbox.s3.amazonaws.com/mapbox-gl-native/render-tests/$JOB/index.html +fi - npm install aws-sdk +PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") +if [[ $TAG == node-v${PACKAGE_JSON_VERSION} ]]; then ./node_modules/.bin/node-pre-gyp package - - if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then - ./node_modules/.bin/node-pre-gyp testpackage - fi - ./node_modules/.bin/node-pre-gyp publish info - - if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then - source ./platform/linux/scripts/setup.sh - - rm -rf build - rm -rf lib - npm install --fallback-to-build=false - npm test - fi -fi - -if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then - if [[ ${TRAVIS_OS_NAME} == "linux" ]] ; then - pip install --user awscli - export PATH="`python -m site --user-base`/bin:${PATH}" - else - brew install awscli - fi - - gzip --stdout node_modules/mapbox-gl-test-suite/render-tests/index.html | \ - aws s3 cp --acl public-read --content-encoding gzip --content-type text/html \ - - s3://mapbox/mapbox-gl-native/render-tests/$TRAVIS_JOB_NUMBER/index.html - - echo http://mapbox.s3.amazonaws.com/mapbox-gl-native/render-tests/$TRAVIS_JOB_NUMBER/index.html fi diff --git a/platform/node/scripts/install.sh b/platform/node/scripts/install.sh deleted file mode 100755 index b550933cd9..0000000000 --- a/platform/node/scripts/install.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -git submodule update --init .mason - -export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" - -if [ ${TRAVIS_OS_NAME} == "linux" ]; then - mason install mesa 10.4.3 -fi - -if [ ! -d ~/.nvm ]; then - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.28.0/install.sh | bash -fi - -source ~/.nvm/nvm.sh - -nvm install $NODE_VERSION -nvm alias default $NODE_VERSION - -node --version -npm --version diff --git a/platform/node/scripts/run.sh b/platform/node/scripts/run.sh deleted file mode 100755 index 73578b110a..0000000000 --- a/platform/node/scripts/run.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -source ./platform/${TRAVIS_OS_NAME}/scripts/setup.sh - -BUILDTYPE=${BUILDTYPE:-Release} - -source ~/.nvm/nvm.sh -nvm use $NODE_VERSION -npm install --build-from-source - -npm test -npm run test-suite diff --git a/platform/osx/app/mapboxgl-app.gypi b/platform/osx/app/mapboxgl-app.gypi deleted file mode 100644 index 8b8cc17276..0000000000 --- a/platform/osx/app/mapboxgl-app.gypi +++ /dev/null @@ -1,77 +0,0 @@ -{ - 'includes': [ - '../../../gyp/common.gypi', - ], - 'targets': [ - { - 'target_name': 'osxapp', - 'product_name': 'Mapbox GL', - 'type': 'executable', - 'product_extension': 'app', - 'mac_bundle': 1, - 'mac_bundle_resources': [ - 'Credits.rtf', - 'Icon.icns', - 'MainMenu.xib', - 'MapDocument.xib', - ], - - 'dependencies': [ - 'osxsdk', - ], - - 'sources': [ - './AppDelegate.h', - './AppDelegate.m', - './DroppedPinAnnotation.h', - './DroppedPinAnnotation.m', - './LocationCoordinate2DTransformer.h', - './LocationCoordinate2DTransformer.m', - './MapDocument.h', - './MapDocument.m', - './OfflinePackNameValueTransformer.h', - './OfflinePackNameValueTransformer.m', - './TimeIntervalTransformer.h', - './TimeIntervalTransformer.m', - './NSValue+Additions.h', - './NSValue+Additions.m', - './main.m', - ], - - 'xcode_settings': { - 'CLANG_ENABLE_OBJC_ARC': 'YES', - 'INFOPLIST_FILE': '../platform/osx/app/Info.plist', - 'LD_RUNPATH_SEARCH_PATHS': [ - '\${inherited}', - '@executable_path/../Frameworks', - ], - 'PRODUCT_BUNDLE_IDENTIFIER': 'com.mapbox.MapboxGL', - 'SDKROOT': 'macosx', - 'SUPPORTED_PLATFORMS': 'macosx', - }, - - 'configurations': { - 'Debug': { - 'xcode_settings': { - 'COPY_PHASE_STRIP': 'NO', - }, - }, - 'Release': { - 'xcode_settings': { - 'COPY_PHASE_STRIP': 'YES', - }, - }, - }, - - 'copies': [ - { - 'destination': '<(PRODUCT_DIR)/${FRAMEWORKS_FOLDER_PATH}', - 'files': [ - '<(PRODUCT_DIR)/Mapbox.framework', - ], - 'xcode_code_sign': 1, - } - ], - }, - ] -} diff --git a/platform/osx/bitrise.yml b/platform/osx/bitrise.yml index 70fe9041bf..7170fa3f66 100644 --- a/platform/osx/bitrise.yml +++ b/platform/osx/bitrise.yml @@ -1,11 +1,6 @@ format_version: 1.1.0 default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git -app: - envs: - - BITRISE_APP_TITLE: "Mapbox GL – OS X" - - BITRISE_DEV_BRANCH: "master" - trigger_map: - pattern: "*" is_pull_request_allowed: true @@ -28,12 +23,15 @@ workflows: envman add --key SKIPCI --value false fi - script: - title: Run SDK unit tests + title: Run build script run_if: '{{enveq "SKIPCI" "false"}}' inputs: - content: |- #!/bin/bash - make xctest BUILDTYPE=Debug + set -eu -o pipefail + export BUILDTYPE=Debug + make osx + make test-osx - is_debug: 'yes' - slack: title: Post to Slack diff --git a/platform/osx/platform.gyp b/platform/osx/platform.gyp new file mode 100644 index 0000000000..120e5c592d --- /dev/null +++ b/platform/osx/platform.gyp @@ -0,0 +1,328 @@ +{ + 'variables': { + 'loop_lib': 'darwin', + 'headless_lib': 'cgl', + }, + 'xcode_settings': { + # Force all build output to the build directory. Must + # be an absolute path or xcodebuild will ignore it. + 'SYMROOT': '<!(cd ../../build/osx-x86_64 && pwd)', + }, + 'includes': [ + '../../mbgl.gypi', + '../../test/test.gypi', + '../../bin/glfw.gypi', + '../../bin/render.gypi', + '../../bin/offline.gypi', + ], + 'targets': [ + { + 'target_name': 'platform-lib', + 'product_name': 'mbgl-platform-osx', + 'type': 'static_library', + 'standalone_static_library': 1, + 'hard_dependency': 1, + 'dependencies': [ + 'core', + ], + + 'include_dirs': [ + 'include', + '../darwin/include', + '../default', + '../../include', + '../../src', # TODO: eliminate + ], + + 'sources': [ + '../default/asset_file_source.cpp', + '../default/default_file_source.cpp', + '../default/online_file_source.cpp', + '../default/mbgl/storage/offline.hpp', + '../default/mbgl/storage/offline.cpp', + '../default/mbgl/storage/offline_database.hpp', + '../default/mbgl/storage/offline_database.cpp', + '../default/mbgl/storage/offline_download.hpp', + '../default/mbgl/storage/offline_download.cpp', + '../default/sqlite3.hpp', + '../default/sqlite3.cpp', + '../darwin/src/http_request_nsurl.mm', + '../darwin/src/log_nslog.mm', + '../darwin/src/string_nsstring.mm', + '../darwin/src/image.mm', + '../darwin/src/nsthread.mm', + '../darwin/src/reachability.m', + ], + + 'xcode_settings': { + 'OTHER_CPLUSPLUSFLAGS': [ + '<@(boost_cflags)', + '<@(sqlite_cflags)', + '<@(zlib_cflags)', + '<@(rapidjson_cflags)', + '<@(variant_cflags)', + ], + 'CLANG_ENABLE_OBJC_ARC': 'YES', + 'CLANG_ENABLE_MODULES': 'YES', + }, + + 'link_settings': { + 'libraries': [ + '<@(sqlite_static_libs)', + '<@(zlib_static_libs)', + '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework', + '$(SDKROOT)/System/Library/Frameworks/CoreLocation.framework', + '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework', + '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework', + '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework', + ], + 'xcode_settings': { + 'OTHER_LDFLAGS': [ '<@(zlib_ldflags)' ], + }, + }, + }, + { + 'target_name': 'osxsdk', + 'product_name': 'Mapbox', + 'type': 'shared_library', + 'mac_bundle': 1, + + 'dependencies': [ + 'platform-lib', + ], + + 'xcode_settings': { + 'CLANG_ENABLE_OBJC_ARC': 'YES', + 'CURRENT_PROJECT_VERSION': '0', + 'DEFINES_MODULE': 'YES', + 'DYLIB_INSTALL_NAME_BASE': '@rpath', + 'INFOPLIST_FILE': 'sdk/Info.plist', + 'LD_RUNPATH_SEARCH_PATHS': [ + '${inherited}', + '@executable_path/../Frameworks', + '@loader_path/Frameworks', + ], + 'PRODUCT_BUNDLE_IDENTIFIER': 'com.mapbox.MapboxGL', + 'OTHER_CPLUSPLUSFLAGS': [ + '<@(boost_cflags)', + '<@(variant_cflags)', + ], + 'OTHER_LDFLAGS': [ '-stdlib=libc++', '-lstdc++' ], + 'SDKROOT': 'macosx', + 'SKIP_INSTALL': 'YES', + 'SUPPORTED_PLATFORMS':'macosx', + 'VERSIONING_SYSTEM': 'apple-generic', + }, + + 'mac_framework_headers': [ + 'sdk/Mapbox.h', + '<!@(find ../{darwin,osx}/include -type f \! -name \'.*\')', + ], + + 'mac_bundle_resources': [ + '<!@(find src/resources -type f \! -name \'.*\')', + ], + + 'include_dirs': [ + 'include', + '../darwin/include', + '../../include', + ], + + 'sources': [ + 'sdk/Mapbox.m', + '../darwin/src/NSException+MGLAdditions.h', + '../darwin/src/NSString+MGLAdditions.h', + '../darwin/src/NSString+MGLAdditions.m', + '../darwin/src/MGLTypes.m', + '../darwin/src/MGLStyle.mm', + '../darwin/src/MGLGeometry_Private.h', + '../darwin/src/MGLGeometry.mm', + '../darwin/src/MGLShape.m', + '../darwin/src/MGLMultiPoint_Private.h', + '../darwin/src/MGLMultiPoint.mm', + '../darwin/src/MGLPointAnnotation.m', + '../darwin/src/MGLPolyline.mm', + '../darwin/src/MGLPolygon.mm', + '../darwin/src/MGLMapCamera.mm', + '../darwin/src/MGLOfflinePack.mm', + '../darwin/src/MGLOfflinePack_Private.h', + '../darwin/src/MGLOfflineStorage.mm', + '../darwin/src/MGLOfflineStorage_Private.h', + '../darwin/src/MGLOfflineRegion_Private.h', + '../darwin/src/MGLTilePyramidOfflineRegion.mm', + '../darwin/src/MGLAccountManager_Private.h', + '../darwin/src/MGLAccountManager.m', + '../darwin/src/NSBundle+MGLAdditions.h', + '../darwin/src/NSBundle+MGLAdditions.m', + '../darwin/src/NSProcessInfo+MGLAdditions.h', + '../darwin/src/NSProcessInfo+MGLAdditions.m', + 'src/MGLMapView_Private.h', + 'src/MGLMapView.mm', + 'src/MGLMapView+IBAdditions.m', + 'src/MGLOpenGLLayer.h', + 'src/MGLOpenGLLayer.mm', + 'src/MGLCompassCell.h', + 'src/MGLCompassCell.m', + 'src/MGLAttributionButton.h', + 'src/MGLAttributionButton.m', + 'src/MGLAnnotationImage.m', + ], + + 'configurations': { + 'Debug': { + 'xcode_settings': { + 'GCC_OPTIMIZATION_LEVEL': '0', + }, + }, + 'Release': { + 'xcode_settings': { + 'GCC_OPTIMIZATION_LEVEL': 's', + }, + }, + }, + + 'direct_dependent_settings': { + 'libraries': [ + '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework', + '$(SDKROOT)/System/Library/Frameworks/CoreLocation.framework', + ], + }, + }, + { + 'target_name': 'osxtest', + 'product_name': 'osxtest', + 'type': 'loadable_module', + 'mac_xctest_bundle': 1, + + 'dependencies': [ + 'osxsdk', + ], + + 'xcode_settings': { + 'CLANG_ENABLE_MODULES': 'YES', + 'CLANG_ENABLE_OBJC_ARC': 'YES', + 'ENABLE_STRICT_OBJC_MSGSEND': 'YES', + 'GCC_DYNAMIC_NO_PIC': 'NO', + 'GCC_NO_COMMON_BLOCKS': 'YES', + 'INFOPLIST_FILE': 'test/Info.plist', + 'LD_RUNPATH_SEARCH_PATHS': [ + '${inherited}', + '@executable_path/../Frameworks', + '@loader_path/../Frameworks', + ], + 'PRODUCT_BUNDLE_IDENTIFIER': 'com.mapbox.osxtest', + 'SDKROOT': 'macosx', + 'SKIP_INSTALL': 'YES', + 'SUPPORTED_PLATFORMS':'macosx', + }, + + 'sources': [ + 'test/MGLGeometryTests.mm', + 'test/MGLOfflinePackTests.m', + 'test/MGLOfflineRegionTests.m', + 'test/MGLOfflineStorageTests.m', + 'test/MGLStyleTests.mm', + ], + + 'include_dirs': [ + 'include', + '../darwin/include', + '../../include', + ], + + 'configurations': { + 'Debug': { + 'xcode_settings': { + 'COPY_PHASE_STRIP': 'NO', + 'DEBUG_INFORMATION_FORMAT': 'dwarf', + 'ENABLE_TESTABILITY': 'YES', + 'GCC_OPTIMIZATION_LEVEL': '0', + 'GCC_PREPROCESSOR_DEFINITIONS': [ + 'DEBUG=1', + '${inherited}', + ], + 'ONLY_ACTIVE_ARCH': 'YES', + }, + }, + 'Release': { + 'xcode_settings': { + 'COPY_PHASE_STRIP': 'YES', + 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym', + 'ENABLE_NS_ASSERTIONS': 'NO', + }, + }, + }, + }, + { + 'target_name': 'osxapp', + 'product_name': 'Mapbox GL', + 'type': 'executable', + 'product_extension': 'app', + 'mac_bundle': 1, + 'mac_bundle_resources': [ + 'app/Credits.rtf', + 'app/Icon.icns', + 'app/MainMenu.xib', + 'app/MapDocument.xib', + ], + + 'dependencies': [ + 'osxsdk', + ], + + 'sources': [ + 'app/AppDelegate.h', + 'app/AppDelegate.m', + 'app/DroppedPinAnnotation.h', + 'app/DroppedPinAnnotation.m', + 'app/LocationCoordinate2DTransformer.h', + 'app/LocationCoordinate2DTransformer.m', + 'app/MapDocument.h', + 'app/MapDocument.m', + 'app/OfflinePackNameValueTransformer.h', + 'app/OfflinePackNameValueTransformer.m', + 'app/TimeIntervalTransformer.h', + 'app/TimeIntervalTransformer.m', + 'app/NSValue+Additions.h', + 'app/NSValue+Additions.m', + 'app/main.m', + ], + + 'xcode_settings': { + 'CLANG_ENABLE_OBJC_ARC': 'YES', + 'INFOPLIST_FILE': 'app/Info.plist', + 'LD_RUNPATH_SEARCH_PATHS': [ + '\${inherited}', + '@executable_path/../Frameworks', + ], + 'PRODUCT_BUNDLE_IDENTIFIER': 'com.mapbox.MapboxGL', + 'SDKROOT': 'macosx', + 'SUPPORTED_PLATFORMS': 'macosx', + }, + + 'configurations': { + 'Debug': { + 'xcode_settings': { + 'COPY_PHASE_STRIP': 'NO', + }, + }, + 'Release': { + 'xcode_settings': { + 'COPY_PHASE_STRIP': 'YES', + }, + }, + }, + + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)/${FRAMEWORKS_FOLDER_PATH}', + 'files': [ + '<(PRODUCT_DIR)/Mapbox.framework', + ], + 'xcode_code_sign': 1, + } + ], + }, + ], +} diff --git a/platform/osx/scripts/configure.sh b/platform/osx/scripts/configure.sh index ece6bba102..e2fa095df9 100644 --- a/platform/osx/scripts/configure.sh +++ b/platform/osx/scripts/configure.sh @@ -2,10 +2,8 @@ BOOST_VERSION=1.59.0 BOOST_LIBPROGRAM_OPTIONS_VERSION=1.59.0 -LIBCURL_VERSION=system GLFW_VERSION=3.1.2 SQLITE_VERSION=3.9.1 -LIBUV_VERSION=1.7.5 ZLIB_VERSION=system NUNICODE_VERSION=1.6 GEOJSONVT_VERSION=4.1.0 diff --git a/platform/osx/scripts/defaults.mk b/platform/osx/scripts/defaults.mk deleted file mode 100644 index be290891d6..0000000000 --- a/platform/osx/scripts/defaults.mk +++ /dev/null @@ -1,5 +0,0 @@ -HEADLESS ?= cgl -PLATFORM ?= osx -ASSET ?= fs -HTTP ?= nsurl -LOOP ?= darwin diff --git a/platform/osx/scripts/install.sh b/platform/osx/scripts/install.sh deleted file mode 100755 index 0f9b5a2752..0000000000 --- a/platform/osx/scripts/install.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -mapbox_time "checkout_mason" \ -git submodule update --init .mason diff --git a/platform/osx/scripts/osxsdk.xcscheme b/platform/osx/scripts/osxsdk.xcscheme deleted file mode 100644 index e8a7f2ff58..0000000000 --- a/platform/osx/scripts/osxsdk.xcscheme +++ /dev/null @@ -1,99 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<Scheme - LastUpgradeVersion = "0720" - version = "1.3"> - <BuildAction - parallelizeBuildables = "YES" - buildImplicitDependencies = "YES"> - <BuildActionEntries> - <BuildActionEntry - buildForTesting = "YES" - buildForRunning = "YES" - buildForProfiling = "YES" - buildForArchiving = "YES" - buildForAnalyzing = "YES"> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "8E4ECCDD911E8B357970AAED" - BuildableName = "Mapbox.framework" - BlueprintName = "osxsdk" - ReferencedContainer = "container:../build/osx-x86_64/gyp/osx.xcodeproj"> - </BuildableReference> - </BuildActionEntry> - </BuildActionEntries> - </BuildAction> - <TestAction - buildConfiguration = "Debug" - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES"> - <Testables> - <TestableReference - skipped = "NO"> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "968E0619FB16F6A55E27CDF3" - BuildableName = "osxtest.xctest" - BlueprintName = "osxtest" - ReferencedContainer = "container:../build/osx-x86_64/gyp/osx.xcodeproj"> - </BuildableReference> - </TestableReference> - </Testables> - <MacroExpansion> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "8E4ECCDD911E8B357970AAED" - BuildableName = "Mapbox.framework" - BlueprintName = "osxsdk" - ReferencedContainer = "container:../build/osx-x86_64/gyp/osx.xcodeproj"> - </BuildableReference> - </MacroExpansion> - <AdditionalOptions> - </AdditionalOptions> - </TestAction> - <LaunchAction - buildConfiguration = "Debug" - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - launchStyle = "0" - useCustomWorkingDirectory = "NO" - ignoresPersistentStateOnLaunch = "NO" - debugDocumentVersioning = "YES" - debugServiceExtension = "internal" - allowLocationSimulation = "YES"> - <MacroExpansion> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "8E4ECCDD911E8B357970AAED" - BuildableName = "Mapbox.framework" - BlueprintName = "osxsdk" - ReferencedContainer = "container:../build/osx-x86_64/gyp/osx.xcodeproj"> - </BuildableReference> - </MacroExpansion> - <AdditionalOptions> - </AdditionalOptions> - </LaunchAction> - <ProfileAction - buildConfiguration = "Release" - shouldUseLaunchSchemeArgsEnv = "YES" - savedToolIdentifier = "" - useCustomWorkingDirectory = "NO" - debugDocumentVersioning = "YES"> - <MacroExpansion> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "8E4ECCDD911E8B357970AAED" - BuildableName = "Mapbox.framework" - BlueprintName = "osxsdk" - ReferencedContainer = "container:../build/osx-x86_64/gyp/osx.xcodeproj"> - </BuildableReference> - </MacroExpansion> - </ProfileAction> - <AnalyzeAction - buildConfiguration = "Debug"> - </AnalyzeAction> - <ArchiveAction - buildConfiguration = "Release" - revealArchiveInOrganizer = "YES"> - </ArchiveAction> -</Scheme> diff --git a/platform/osx/scripts/osxtest.xcscheme b/platform/osx/scripts/osxtest.xcscheme new file mode 100644 index 0000000000..dbc0577df8 --- /dev/null +++ b/platform/osx/scripts/osxtest.xcscheme @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "0720" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + </BuildAction> + <TestAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES"> + <Testables> + <TestableReference + skipped = "NO"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "6EE19CDFBCE7BD04FE561812" + BuildableName = "osxtest.xctest" + BlueprintName = "osxtest" + ReferencedContainer = "container:../../build/osx-x86_64/platform/osx/platform.xcodeproj"> + </BuildableReference> + </TestableReference> + </Testables> + <AdditionalOptions> + </AdditionalOptions> + </TestAction> + <LaunchAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + debugServiceExtension = "internal" + allowLocationSimulation = "YES"> + <AdditionalOptions> + </AdditionalOptions> + </LaunchAction> + <ProfileAction + buildConfiguration = "Release" + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + debugDocumentVersioning = "YES"> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> diff --git a/platform/osx/scripts/package.sh b/platform/osx/scripts/package.sh deleted file mode 100755 index f4b2d0c899..0000000000 --- a/platform/osx/scripts/package.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail -set -u - -NAME=Mapbox -OUTPUT=build/osx/pkg -OSX_SDK_VERSION=`xcrun --sdk macosx --show-sdk-version` - -if [[ ${#} -eq 0 ]]; then # e.g. "make xpackage" - BUILDTYPE="Release" - GCC_GENERATE_DEBUGGING_SYMBOLS="YES" -else # e.g. "make xpackage-strip" - BUILDTYPE="Release" - GCC_GENERATE_DEBUGGING_SYMBOLS="NO" -fi - -function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; } -function finish { >&2 echo -en "\033[0m"; } -trap finish EXIT - -step "Creating build files..." -export MASON_PLATFORM=osx -export BUILDTYPE=${BUILDTYPE:-Release} -export HOST=osx -make Xcode/osx - -VERSION=${TRAVIS_JOB_NUMBER:-${BITRISE_BUILD_NUMBER:-0}} - -step "Building OS X framework (build ${VERSION})..." -xcodebuild -sdk macosx${OSX_SDK_VERSION} \ - ARCHS="x86_64" \ - ONLY_ACTIVE_ARCH=NO \ - GCC_GENERATE_DEBUGGING_SYMBOLS=${GCC_GENERATE_DEBUGGING_SYMBOLS} \ - CURRENT_PROJECT_VERSION=${VERSION} \ - -project ./build/osx-x86_64/gyp/osx.xcodeproj \ - -configuration ${BUILDTYPE} \ - -target osxsdk \ - -jobs ${JOBS} - -TARGET_BUILD_DIR=gyp/build/${BUILDTYPE} -INFOPLIST_PATH=Mapbox.framework/Versions/Current/Resources/Info.plist - -# Uncomment when we're ready to release an official version. -#VERSION=$( git tag | grep ^osx | sed 's/^osx-//' | sort -r | grep -v '\-rc.' | grep -v '\-pre.' | sed -n '1p' | sed 's/^v//' ) -#if [ "$VERSION" ]; then -# plutil \ -# -replace CFBundleShortVersionString -string ${VERSION} \ -# $TARGET_BUILD_DIR/$INFOPLIST_PATH -# plutil \ -# -replace CFBundleVersion -string ${VERSION} \ -# $TARGET_BUILD_DIR/$INFOPLIST_PATH -#fi - -echo $TARGET_BUILD_DIR/Mapbox.framework diff --git a/platform/osx/scripts/run.sh b/platform/osx/scripts/run.sh deleted file mode 100755 index 6d00d1b977..0000000000 --- a/platform/osx/scripts/run.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -source ./platform/osx/scripts/setup.sh - -BUILDTYPE=${BUILDTYPE:-Release} - -################################################################################ -# Build -################################################################################ - -mapbox_time "compile_render_binary" \ -make render -j${JOBS} BUILDTYPE=${BUILDTYPE} - -mapbox_time "compile_offline_binary" \ -make offline -j${JOBS} BUILDTYPE=${BUILDTYPE} - -mapbox_time "compile_tests" \ -make xtest -j${JOBS} BUILDTYPE=${BUILDTYPE} diff --git a/platform/osx/scripts/setup.sh b/platform/osx/scripts/setup.sh deleted file mode 100755 index 502d61d44d..0000000000 --- a/platform/osx/scripts/setup.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -# This script is sourced; do not set -e or -o pipefail here. - -# Ensure mason is on the PATH -export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" - -# Set the core file limit to unlimited so a core file is generated upon crash -ulimit -c unlimited -S diff --git a/platform/osx/scripts/test.sh b/platform/osx/scripts/test.sh deleted file mode 100755 index f72895d850..0000000000 --- a/platform/osx/scripts/test.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail -set -u - -OSX_SDK_VERSION=`xcrun --sdk macosx --show-sdk-version` -OSX_PROJ_PATH=./build/osx-x86_64/gyp/osx.xcodeproj - -export BUILDTYPE=${BUILDTYPE:-Release} - -mkdir -p "${OSX_PROJ_PATH}/xcshareddata/xcschemes" -cp platform/osx/scripts/osxsdk.xcscheme "${OSX_PROJ_PATH}/xcshareddata/xcschemes/osxsdk.xcscheme" - -xcodebuild -verbose \ - -sdk macosx${OSX_SDK_VERSION} \ - -project "${OSX_PROJ_PATH}" \ - -scheme osxsdk \ - test diff --git a/platform/osx/sdk/framework-osx.gypi b/platform/osx/sdk/framework-osx.gypi deleted file mode 100644 index 259066f702..0000000000 --- a/platform/osx/sdk/framework-osx.gypi +++ /dev/null @@ -1,68 +0,0 @@ -{ - 'includes': [ - '../../../gyp/common.gypi', - ], - 'targets': [ - { - 'target_name': 'osxsdk', - 'product_name': 'Mapbox', - 'type': 'shared_library', - 'mac_bundle': 1, - - 'dependencies': [ - 'mbgl.gyp:core', - 'mbgl.gyp:platform-<(platform_lib)', - 'mbgl.gyp:http-<(http_lib)', - 'mbgl.gyp:asset-<(asset_lib)', - ], - - 'xcode_settings': { - 'CLANG_ENABLE_OBJC_ARC': 'YES', - 'CURRENT_PROJECT_VERSION': '0', - 'DEFINES_MODULE': 'YES', - 'DYLIB_INSTALL_NAME_BASE': '@rpath', - 'INFOPLIST_FILE': '../platform/osx/sdk/Info.plist', - 'LD_RUNPATH_SEARCH_PATHS': [ - '${inherited}', - '@executable_path/../Frameworks', - '@loader_path/Frameworks', - ], - 'PRODUCT_BUNDLE_IDENTIFIER': 'com.mapbox.MapboxGL', - 'OTHER_LDFLAGS': [ '-stdlib=libc++', '-lstdc++' ], - 'SDKROOT': 'macosx', - 'SKIP_INSTALL': 'YES', - 'SUPPORTED_PLATFORMS':'macosx', - 'VERSIONING_SYSTEM': 'apple-generic', - }, - - 'mac_framework_headers': [ - './Mapbox.h', - '<!@(find ../platform/{darwin,osx}/include -type f \! -name \'.*\')', - ], - - 'sources': [ - './Mapbox.m', - ], - - 'configurations': { - 'Debug': { - 'xcode_settings': { - 'GCC_OPTIMIZATION_LEVEL': '0', - }, - }, - 'Release': { - 'xcode_settings': { - 'GCC_OPTIMIZATION_LEVEL': 's', - }, - }, - }, - - 'direct_dependent_settings': { - 'libraries': [ - '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework', - '$(SDKROOT)/System/Library/Frameworks/CoreLocation.framework', - ], - }, - }, - ] -} diff --git a/platform/osx/test/osxtest.gypi b/platform/osx/test/osxtest.gypi deleted file mode 100644 index 6165b6fa88..0000000000 --- a/platform/osx/test/osxtest.gypi +++ /dev/null @@ -1,84 +0,0 @@ -{ - 'includes': [ - '../../../gyp/common.gypi', - ], - 'targets': [ - { - 'target_name': 'osxtest', - 'product_name': 'osxtest', - 'type': 'loadable_module', - 'mac_xctest_bundle': 1, - - 'dependencies': [ - 'osxsdk', - ], - - 'variables': { - 'cflags_cc': [ - ], - 'ldflags': [ - '-stdlib=libc++', - '-lstdc++', - ], - }, - - 'xcode_settings': { - 'CLANG_ENABLE_MODULES': 'YES', - 'CLANG_ENABLE_OBJC_ARC': 'YES', - 'ENABLE_STRICT_OBJC_MSGSEND': 'YES', - 'GCC_DYNAMIC_NO_PIC': 'NO', - 'GCC_NO_COMMON_BLOCKS': 'YES', - 'INFOPLIST_FILE': '../platform/osx/test/Info.plist', - 'LD_RUNPATH_SEARCH_PATHS': [ - '${inherited}', - '@executable_path/../Frameworks', - '@loader_path/../Frameworks', - ], - 'PRODUCT_BUNDLE_IDENTIFIER': 'com.mapbox.osxtest', - 'OTHER_CPLUSPLUSFLAGS': [ '<@(cflags_cc)' ], - 'OTHER_LDFLAGS': [ '<@(ldflags)' ], - 'SDKROOT': 'macosx', - 'SKIP_INSTALL': 'YES', - 'SUPPORTED_PLATFORMS':'macosx', - }, - - 'sources': [ - './MGLGeometryTests.mm', - './MGLOfflinePackTests.m', - './MGLOfflineRegionTests.m', - './MGLOfflineStorageTests.m', - './MGLStyleTests.mm', - ], - - 'include_dirs': [ - '../../../platform/osx/include', - '../../../platform/darwin/include', - '../../../include', - '../../../src', - ], - - 'configurations': { - 'Debug': { - 'xcode_settings': { - 'COPY_PHASE_STRIP': 'NO', - 'DEBUG_INFORMATION_FORMAT': 'dwarf', - 'ENABLE_TESTABILITY': 'YES', - 'GCC_OPTIMIZATION_LEVEL': '0', - 'GCC_PREPROCESSOR_DEFINITIONS': [ - 'DEBUG=1', - '${inherited}', - ], - 'ONLY_ACTIVE_ARCH': 'YES', - }, - }, - 'Release': { - 'xcode_settings': { - 'COPY_PHASE_STRIP': 'YES', - 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym', - 'ENABLE_NS_ASSERTIONS': 'NO', - }, - }, - }, - }, - ] -} |