diff options
-rw-r--r-- | cmake/benchmark.cmake | 1 | ||||
-rw-r--r-- | cmake/core.cmake | 1 | ||||
-rw-r--r-- | cmake/filesource.cmake | 1 | ||||
-rw-r--r-- | cmake/loop-darwin.cmake | 10 | ||||
-rw-r--r-- | cmake/test.cmake | 1 | ||||
-rw-r--r-- | package.json | 3 | ||||
-rw-r--r-- | platform/android/config.cmake | 2 | ||||
-rw-r--r-- | platform/darwin/filesource-files.txt | 5 | ||||
-rw-r--r-- | platform/darwin/loop-files.txt | 4 | ||||
-rw-r--r-- | platform/ios/DEVELOPING.md | 1 | ||||
-rw-r--r-- | platform/ios/config.cmake | 9 | ||||
-rw-r--r-- | platform/ios/core-files.txt | 302 | ||||
-rw-r--r-- | platform/macos/DEVELOPING.md | 1 | ||||
-rw-r--r-- | platform/macos/config.cmake | 9 | ||||
-rw-r--r-- | platform/macos/core-files.txt | 206 | ||||
-rw-r--r-- | platform/macos/macos.xcodeproj/project.pbxproj | 8 | ||||
-rwxr-xr-x | scripts/generate-cmake-files.js | 73 |
17 files changed, 609 insertions, 28 deletions
diff --git a/cmake/benchmark.cmake b/cmake/benchmark.cmake index 5cac8cc8b6..7e0fd76917 100644 --- a/cmake/benchmark.cmake +++ b/cmake/benchmark.cmake @@ -1,3 +1,4 @@ +# Modify cmake/benchmark-files.txt to change the source files for this target. load_sources_list(MBGL_BENCHMARK_FILES cmake/benchmark-files.txt) add_executable(mbgl-benchmark ${MBGL_BENCHMARK_FILES}) diff --git a/cmake/core.cmake b/cmake/core.cmake index d52f7ba32f..32e77f5d55 100644 --- a/cmake/core.cmake +++ b/cmake/core.cmake @@ -1,3 +1,4 @@ +# Modify cmake/core-files.txt to change the source files for this target. load_sources_list(MBGL_CORE_FILES cmake/core-files.txt) add_library(mbgl-core STATIC ${MBGL_CORE_FILES}) diff --git a/cmake/filesource.cmake b/cmake/filesource.cmake index 6486a4af32..cfb04a5ce9 100644 --- a/cmake/filesource.cmake +++ b/cmake/filesource.cmake @@ -1,5 +1,6 @@ add_vendor_target(expected INTERFACE) +# Modify cmake/filesource-files.txt to change the source files for this target. load_sources_list(MBGL_FILESOURCE_FILES cmake/filesource-files.txt) add_library(mbgl-filesource STATIC ${MBGL_FILESOURCE_FILES}) diff --git a/cmake/loop-darwin.cmake b/cmake/loop-darwin.cmake index f60972902f..ef79eef01b 100644 --- a/cmake/loop-darwin.cmake +++ b/cmake/loop-darwin.cmake @@ -1,8 +1,6 @@ -add_library(mbgl-loop-darwin STATIC - platform/darwin/src/async_task.cpp - platform/darwin/src/run_loop.cpp - platform/darwin/src/timer.cpp -) +# Modify platform/darwin/loop-files.txt to change the source files for this target. +load_sources_list(MBGL_LOOP_DARWIN_FILES platform/darwin/loop-files.txt) +add_library(mbgl-loop-darwin STATIC ${MBGL_LOOP_DARWIN_FILES}) target_include_directories(mbgl-loop-darwin PRIVATE include @@ -15,4 +13,4 @@ set_target_properties(mbgl-loop-darwin PROPERTIES FOLDER "Core") initialize_xcode_cxx_build_settings(mbgl-loop-darwin) -xcode_create_scheme(TARGET mbgl-loop-darwin)
\ No newline at end of file +xcode_create_scheme(TARGET mbgl-loop-darwin) diff --git a/cmake/test.cmake b/cmake/test.cmake index 755edad892..7d86dfdde8 100644 --- a/cmake/test.cmake +++ b/cmake/test.cmake @@ -1,5 +1,6 @@ add_vendor_target(gtest STATIC) +# Modify cmake/test-files.txt to change the source files for this target. load_sources_list(MBGL_TEST_FILES cmake/test-files.txt) if (MBGL_TEST_TARGET_TYPE STREQUAL "library") add_library(mbgl-test SHARED ${MBGL_TEST_FILES}) diff --git a/package.json b/package.json index 799d3ab85f..9fd8217dc8 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,8 @@ "pretty-bytes": "^5.1.0", "request": "^2.72.0", "semver": "^5.5.0", - "tape": "^4.5.1" + "tape": "^4.5.1", + "xcode": "^1.0.0" }, "engines": { "node": ">=6" diff --git a/platform/android/config.cmake b/platform/android/config.cmake index 84c508dd73..a0143aee9d 100644 --- a/platform/android/config.cmake +++ b/platform/android/config.cmake @@ -33,6 +33,7 @@ set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWIT ## mbgl core ## macro(mbgl_platform_core) + # Modify platform/android/core-files.txt to change the source files for this target. target_sources_from_file(mbgl-core PRIVATE platform/android/core-files.txt) target_include_directories(mbgl-core @@ -61,6 +62,7 @@ endmacro() macro(mbgl_filesource) + # Modify platform/android/filesource-files.txt to change the source files for this target. target_sources_from_file(mbgl-filesource PRIVATE platform/android/filesource-files.txt) target_add_mason_package(mbgl-filesource PUBLIC sqlite) diff --git a/platform/darwin/filesource-files.txt b/platform/darwin/filesource-files.txt new file mode 100644 index 0000000000..dc47142c40 --- /dev/null +++ b/platform/darwin/filesource-files.txt @@ -0,0 +1,5 @@ +# File source +platform/darwin/src/http_file_source.mm + +# Database +platform/default/sqlite3.cpp diff --git a/platform/darwin/loop-files.txt b/platform/darwin/loop-files.txt new file mode 100644 index 0000000000..f6e799550d --- /dev/null +++ b/platform/darwin/loop-files.txt @@ -0,0 +1,4 @@ +# Loop +platform/darwin/src/async_task.cpp +platform/darwin/src/run_loop.cpp +platform/darwin/src/timer.cpp diff --git a/platform/ios/DEVELOPING.md b/platform/ios/DEVELOPING.md index 34388c2589..93f1061b05 100644 --- a/platform/ios/DEVELOPING.md +++ b/platform/ios/DEVELOPING.md @@ -84,6 +84,7 @@ To add an Objective-C header or implementation file to the iOS maps SDK: 1. Audit new headers for nullability. Typically, you will wrap a header with `NS_ASSUME_NONNULL_BEGIN` and `NS_ASSUME_NONNULL_END`. 1. _(Optional.)_ If it’s a public header, change its visibility from Project to Public and import it in [the iOS SDK’s umbrella header](./src/Mapbox.h). 1. _(Optional.)_ If the file would also be used by the macOS maps SDK, make sure it’s in [platform/darwin/src/](../darwin/src/), then consult [the companion macOS document](../macos/DEVELOPING.md#adding-a-source-code-file) for further instructions. +1. Run `scripts/generate-cmake-files.js` to update the generated source file list for third party build systems. ### Adding a resource diff --git a/platform/ios/config.cmake b/platform/ios/config.cmake index 6dd3f23a69..48bb27a696 100644 --- a/platform/ios/config.cmake +++ b/platform/ios/config.cmake @@ -84,13 +84,8 @@ endmacro() macro(mbgl_filesource) initialize_ios_target(mbgl-filesource) - target_sources(mbgl-filesource - # File source - PRIVATE platform/darwin/src/http_file_source.mm - - # Database - PRIVATE platform/default/sqlite3.cpp - ) + # Modify platform/darwin/filesource-files.txt to change the source files for this target. + target_sources_from_file(mbgl-filesource PRIVATE platform/darwin/filesource-files.txt) target_link_libraries(mbgl-filesource PUBLIC "-lsqlite3" diff --git a/platform/ios/core-files.txt b/platform/ios/core-files.txt new file mode 100644 index 0000000000..04e7aa5065 --- /dev/null +++ b/platform/ios/core-files.txt @@ -0,0 +1,302 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# SDK +platform/ios/src/Mapbox.h + +# SDK/Foundation +platform/darwin/src/MGLAccountManager.h +platform/darwin/src/MGLAccountManager.m +platform/darwin/src/MGLAccountManager_Private.h +platform/darwin/src/MGLAttributionInfo.h +platform/darwin/src/MGLAttributionInfo.mm +platform/darwin/src/MGLAttributionInfo_Private.h +platform/darwin/src/MGLFoundation.h +platform/darwin/src/MGLFoundation.mm +platform/darwin/src/MGLFoundation_Private.h +platform/darwin/src/MGLLocationManager.h +platform/darwin/src/MGLLocationManager.m +platform/darwin/src/MGLLocationManager_Private.h +platform/darwin/src/MGLMapCamera.h +platform/darwin/src/MGLMapCamera.mm +platform/darwin/src/MGLMapSnapshotter.h +platform/darwin/src/MGLMapSnapshotter.mm +platform/darwin/src/MGLNetworkConfiguration.h +platform/darwin/src/MGLNetworkConfiguration.m +platform/darwin/src/MGLRendererConfiguration.h +platform/darwin/src/MGLRendererConfiguration.mm +platform/darwin/src/MGLRendererFrontend.h +platform/darwin/src/MGLStyle.h +platform/darwin/src/MGLStyle.mm +platform/darwin/src/MGLStyle_Private.h +platform/darwin/src/MGLTypes.h +platform/darwin/src/MGLTypes.m +platform/darwin/src/MGLValueEvaluator.h + +# SDK/Foundation/Categories +platform/darwin/src/NSArray+MGLAdditions.h +platform/darwin/src/NSArray+MGLAdditions.mm +platform/darwin/src/NSBundle+MGLAdditions.h +platform/darwin/src/NSBundle+MGLAdditions.m +platform/darwin/src/NSComparisonPredicate+MGLAdditions.h +platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm +platform/darwin/src/NSCompoundPredicate+MGLAdditions.h +platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm +platform/darwin/src/NSData+MGLAdditions.h +platform/darwin/src/NSData+MGLAdditions.mm +platform/darwin/src/NSDate+MGLAdditions.h +platform/darwin/src/NSDate+MGLAdditions.mm +platform/darwin/src/NSDictionary+MGLAdditions.h +platform/darwin/src/NSDictionary+MGLAdditions.mm +platform/darwin/src/NSException+MGLAdditions.h +platform/darwin/src/NSExpression+MGLAdditions.h +platform/darwin/src/NSExpression+MGLAdditions.mm +platform/darwin/src/NSExpression+MGLPrivateAdditions.h +platform/darwin/src/NSPredicate+MGLAdditions.h +platform/darwin/src/NSPredicate+MGLAdditions.mm +platform/darwin/src/NSPredicate+MGLPrivateAdditions.h +platform/darwin/src/NSProcessInfo+MGLAdditions.h +platform/darwin/src/NSProcessInfo+MGLAdditions.m +platform/darwin/src/NSString+MGLAdditions.h +platform/darwin/src/NSString+MGLAdditions.m +platform/darwin/src/NSURL+MGLAdditions.h +platform/darwin/src/NSURL+MGLAdditions.m +platform/darwin/src/NSValue+MGLAdditions.h +platform/darwin/src/NSValue+MGLAdditions.m + +# SDK/Foundation/Formatters +platform/darwin/src/MGLClockDirectionFormatter.h +platform/darwin/src/MGLClockDirectionFormatter.m +platform/darwin/src/MGLCompassDirectionFormatter.h +platform/darwin/src/MGLCompassDirectionFormatter.m +platform/darwin/src/MGLCoordinateFormatter.h +platform/darwin/src/MGLCoordinateFormatter.m +platform/darwin/src/MGLDistanceFormatter.h +platform/darwin/src/MGLDistanceFormatter.m + +# SDK/Foundation/Geometry +platform/darwin/src/MGLAnnotation.h +platform/darwin/src/MGLFeature.h +platform/darwin/src/MGLFeature.mm +platform/darwin/src/MGLFeature_Private.h +platform/darwin/src/MGLGeometry.h +platform/darwin/src/MGLGeometry.mm +platform/darwin/src/MGLGeometry_Private.h +platform/darwin/src/MGLMultiPoint.h +platform/darwin/src/MGLMultiPoint.mm +platform/darwin/src/MGLMultiPoint_Private.h +platform/darwin/src/MGLOverlay.h +platform/darwin/src/MGLPointAnnotation.h +platform/darwin/src/MGLPointAnnotation.mm +platform/darwin/src/MGLPointCollection.h +platform/darwin/src/MGLPointCollection.mm +platform/darwin/src/MGLPointCollection_Private.h +platform/darwin/src/MGLPolygon.h +platform/darwin/src/MGLPolygon.mm +platform/darwin/src/MGLPolygon_Private.h +platform/darwin/src/MGLPolyline.h +platform/darwin/src/MGLPolyline.mm +platform/darwin/src/MGLPolyline_Private.h +platform/darwin/src/MGLShape.h +platform/darwin/src/MGLShape.mm +platform/darwin/src/MGLShapeCollection.h +platform/darwin/src/MGLShapeCollection.mm +platform/darwin/src/MGLShape_Private.h + +# SDK/Foundation/Offline Maps +platform/darwin/src/MGLOfflinePack.h +platform/darwin/src/MGLOfflinePack.mm +platform/darwin/src/MGLOfflinePack_Private.h +platform/darwin/src/MGLOfflineRegion.h +platform/darwin/src/MGLOfflineRegion_Private.h +platform/darwin/src/MGLOfflineStorage.h +platform/darwin/src/MGLOfflineStorage.mm +platform/darwin/src/MGLOfflineStorage_Private.h +platform/darwin/src/MGLShapeOfflineRegion.h +platform/darwin/src/MGLShapeOfflineRegion.mm +platform/darwin/src/MGLShapeOfflineRegion_Private.h +platform/darwin/src/MGLTilePyramidOfflineRegion.h +platform/darwin/src/MGLTilePyramidOfflineRegion.mm +platform/darwin/src/MGLTilePyramidOfflineRegion_Private.h + +# SDK/Foundation/Styling +platform/darwin/src/MGLConversion.h +platform/darwin/src/MGLLight.h +platform/darwin/src/MGLLight.mm +platform/darwin/src/MGLLight_Private.h +platform/darwin/src/MGLStyleValue.h +platform/darwin/src/MGLStyleValue.mm +platform/darwin/src/MGLStyleValue_Private.h + +# SDK/Foundation/Styling/Categories +platform/darwin/src/NSValue+MGLStyleAttributeAdditions.h +platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm + +# SDK/Foundation/Styling/Layers +platform/darwin/src/MGLBackgroundStyleLayer.h +platform/darwin/src/MGLBackgroundStyleLayer.mm +platform/darwin/src/MGLCircleStyleLayer.h +platform/darwin/src/MGLCircleStyleLayer.mm +platform/darwin/src/MGLFillExtrusionStyleLayer.h +platform/darwin/src/MGLFillExtrusionStyleLayer.mm +platform/darwin/src/MGLFillStyleLayer.h +platform/darwin/src/MGLFillStyleLayer.mm +platform/darwin/src/MGLForegroundStyleLayer.h +platform/darwin/src/MGLForegroundStyleLayer.mm +platform/darwin/src/MGLHeatmapStyleLayer.h +platform/darwin/src/MGLHeatmapStyleLayer.mm +platform/darwin/src/MGLHillshadeStyleLayer.h +platform/darwin/src/MGLHillshadeStyleLayer.mm +platform/darwin/src/MGLLineStyleLayer.h +platform/darwin/src/MGLLineStyleLayer.mm +platform/darwin/src/MGLOpenGLStyleLayer.h +platform/darwin/src/MGLOpenGLStyleLayer.mm +platform/darwin/src/MGLRasterStyleLayer.h +platform/darwin/src/MGLRasterStyleLayer.mm +platform/darwin/src/MGLStyleLayer.h +platform/darwin/src/MGLStyleLayer.mm +platform/darwin/src/MGLStyleLayer_Private.h +platform/darwin/src/MGLSymbolStyleLayer.h +platform/darwin/src/MGLSymbolStyleLayer.mm +platform/darwin/src/MGLVectorStyleLayer.h +platform/darwin/src/MGLVectorStyleLayer.m + +# SDK/Foundation/Styling/Sources +platform/darwin/src/MGLComputedShapeSource.h +platform/darwin/src/MGLComputedShapeSource.mm +platform/darwin/src/MGLComputedShapeSource_Private.h +platform/darwin/src/MGLImageSource.h +platform/darwin/src/MGLImageSource.mm +platform/darwin/src/MGLRasterDEMSource.h +platform/darwin/src/MGLRasterDEMSource.mm +platform/darwin/src/MGLRasterTileSource.h +platform/darwin/src/MGLRasterTileSource.mm +platform/darwin/src/MGLRasterTileSource_Private.h +platform/darwin/src/MGLShapeSource.h +platform/darwin/src/MGLShapeSource.mm +platform/darwin/src/MGLShapeSource_Private.h +platform/darwin/src/MGLSource.h +platform/darwin/src/MGLSource.mm +platform/darwin/src/MGLSource_Private.h +platform/darwin/src/MGLTileSource.h +platform/darwin/src/MGLTileSource.mm +platform/darwin/src/MGLTileSource_Private.h +platform/darwin/src/MGLVectorTileSource.h +platform/darwin/src/MGLVectorTileSource.mm +platform/darwin/src/MGLVectorTileSource_Private.h + +# SDK/Kit +platform/ios/src/MGLCameraChangeReason.h +platform/ios/src/MGLMapAccessibilityElement.h +platform/ios/src/MGLMapAccessibilityElement.mm +platform/ios/src/MGLMapView+IBAdditions.h +platform/ios/src/MGLMapView.h +platform/ios/src/MGLMapView.mm +platform/ios/src/MGLMapViewDelegate.h +platform/ios/src/MGLMapView_Private.h + +# SDK/Kit/Annotations +platform/ios/src/MGLAnnotationContainerView.h +platform/ios/src/MGLAnnotationContainerView.m +platform/ios/src/MGLAnnotationContainerView_Private.h +platform/ios/src/MGLAnnotationImage.h +platform/ios/src/MGLAnnotationImage.m +platform/ios/src/MGLAnnotationImage_Private.h +platform/ios/src/MGLAnnotationView.h +platform/ios/src/MGLAnnotationView.mm +platform/ios/src/MGLAnnotationView_Private.h +platform/ios/src/MGLCalloutView.h +platform/ios/src/MGLCompactCalloutView.h +platform/ios/src/MGLCompactCalloutView.m +platform/ios/src/MGLFaux3DUserLocationAnnotationView.h +platform/ios/src/MGLFaux3DUserLocationAnnotationView.m +platform/ios/src/MGLUserLocation.h +platform/ios/src/MGLUserLocation.m +platform/ios/src/MGLUserLocationAnnotationView.h +platform/ios/src/MGLUserLocationAnnotationView.m +platform/ios/src/MGLUserLocationAnnotationView_Private.h +platform/ios/src/MGLUserLocationHeadingArrowLayer.h +platform/ios/src/MGLUserLocationHeadingArrowLayer.m +platform/ios/src/MGLUserLocationHeadingBeamLayer.h +platform/ios/src/MGLUserLocationHeadingBeamLayer.m +platform/ios/src/MGLUserLocationHeadingIndicator.h +platform/ios/src/MGLUserLocation_Private.h + +# SDK/Kit/Categories +platform/darwin/src/NSCoder+MGLAdditions.h +platform/darwin/src/NSCoder+MGLAdditions.mm +platform/ios/src/NSOrthography+MGLAdditions.h +platform/ios/src/NSOrthography+MGLAdditions.m +platform/ios/src/UIColor+MGLAdditions.h +platform/ios/src/UIColor+MGLAdditions.mm +platform/ios/src/UIDevice+MGLAdditions.h +platform/ios/src/UIDevice+MGLAdditions.m +platform/ios/src/UIImage+MGLAdditions.h +platform/ios/src/UIImage+MGLAdditions.mm +platform/ios/src/UIViewController+MGLAdditions.h +platform/ios/src/UIViewController+MGLAdditions.m + +# SDK/Kit/SMCalloutView +platform/ios/vendor/SMCalloutView/SMCalloutView.h +platform/ios/vendor/SMCalloutView/SMCalloutView.m + +# SDK/Kit/Telemetry +platform/ios/src/MGLTelemetryConfig.h +platform/ios/src/MGLTelemetryConfig.m + +# SDK/Kit/Telemetry/Development +platform/ios/src/MGLSDKUpdateChecker.h +platform/ios/src/MGLSDKUpdateChecker.mm + +# SDK/Kit/Telemetry/Runtime +platform/ios/src/MGLMapboxEvents.h +platform/ios/src/MGLMapboxEvents.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/CLLocation+MMEMobileEvents.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEAPIClient.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMECategoryLoader.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMECommonEventData.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEConstants.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEDependencyManager.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEvent.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventLogReportViewController.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventLogger.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventsConfiguration.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventsManager.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventsService.h +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEEventsService.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMELocationManager.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMENSDateWrapper.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMENSURLSessionWrapper.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMETimerManager.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMETrustKitWrapper.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMETypes.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEUIApplicationWrapper.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEUINavigation.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/MMEUniqueIdentifier.m +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/NSData+MMEGZIP.m + +# SDK/Kit/Telemetry/Runtime/Reachability +platform/ios/vendor/mapbox-events-ios/MapboxMobileEvents/Reachability/MMEReachability.m + +# SDK/Kit/Telemetry/Runtime/TrustKit +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TSKPinningValidator.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TSKPinningValidatorResult.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TSKTrustKitConfig.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/TrustKit.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/configuration_utils.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/parse_configuration.m + +# SDK/Kit/Telemetry/Runtime/TrustKit/Pinning +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Pinning/TSKSPKIHashCache.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Pinning/ssl_pin_verifier.m + +# SDK/Kit/Telemetry/Runtime/TrustKit/Reporting +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/TSKBackgroundReporter.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/TSKPinFailureReport.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/TSKReportsRateLimiter.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/reporting_utils.m +platform/ios/vendor/mapbox-events-ios/vendor/TrustKit/Reporting/vendor_identifier.m + +# SDK/Kit/Views +platform/ios/src/MGLScaleBar.h +platform/ios/src/MGLScaleBar.mm + diff --git a/platform/macos/DEVELOPING.md b/platform/macos/DEVELOPING.md index f4d946c527..8b7857cd62 100644 --- a/platform/macos/DEVELOPING.md +++ b/platform/macos/DEVELOPING.md @@ -52,6 +52,7 @@ To add an Objective-C header or implementation file to the macOS maps SDK: 1. Audit new headers for nullability. Typically, you will wrap a header with `NS_ASSUME_NONNULL_BEGIN` and `NS_ASSUME_NONNULL_END`. 1. _(Optional.)_ If it’s a public header, change its visibility from Project to Public and import it in [the macOS SDK’s umbrella header](./src/Mapbox.h). 1. _(Optional.)_ If the file would also be used by the iOS maps SDK, make sure it’s in [platform/darwin/src/](../darwin/src/), then consult [the companion iOS document](../ios/DEVELOPING.md#adding-a-source-code-file) for further instructions. +1. Run `scripts/generate-cmake-files.js` to update the generated source file list for third party build systems. ### Adding a resource diff --git a/platform/macos/config.cmake b/platform/macos/config.cmake index 6333beaeb5..d53f61f3b3 100644 --- a/platform/macos/config.cmake +++ b/platform/macos/config.cmake @@ -67,13 +67,8 @@ endmacro() macro(mbgl_filesource) - target_sources(mbgl-filesource - # File source - PRIVATE platform/darwin/src/http_file_source.mm - - # Database - PRIVATE platform/default/sqlite3.cpp - ) + # Modify platform/darwin/filesource-files.txt to change the source files for this target. + target_sources_from_file(mbgl-filesource PRIVATE platform/darwin/filesource-files.txt) target_compile_options(mbgl-filesource PRIVATE -fobjc-arc diff --git a/platform/macos/core-files.txt b/platform/macos/core-files.txt new file mode 100644 index 0000000000..3c1d1aa2d0 --- /dev/null +++ b/platform/macos/core-files.txt @@ -0,0 +1,206 @@ +# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js + +# SDK +platform/macos/src/Mapbox.h + +# SDK/Foundation +platform/darwin/src/MGLAccountManager.h +platform/darwin/src/MGLAccountManager.m +platform/darwin/src/MGLAccountManager_Private.h +platform/darwin/src/MGLAttributionInfo.h +platform/darwin/src/MGLAttributionInfo.mm +platform/darwin/src/MGLAttributionInfo_Private.h +platform/darwin/src/MGLFoundation.h +platform/darwin/src/MGLFoundation.mm +platform/darwin/src/MGLFoundation_Private.h +platform/darwin/src/MGLMapCamera.h +platform/darwin/src/MGLMapCamera.mm +platform/darwin/src/MGLMapSnapshotter.h +platform/darwin/src/MGLMapSnapshotter.mm +platform/darwin/src/MGLNetworkConfiguration.h +platform/darwin/src/MGLNetworkConfiguration.m +platform/darwin/src/MGLRendererConfiguration.h +platform/darwin/src/MGLRendererConfiguration.mm +platform/darwin/src/MGLRendererFrontend.h +platform/darwin/src/MGLStyle.h +platform/darwin/src/MGLStyle.mm +platform/darwin/src/MGLStyle_Private.h +platform/darwin/src/MGLTypes.h +platform/darwin/src/MGLTypes.m +platform/darwin/src/MGLValueEvaluator.h + +# SDK/Foundation/Categories +platform/darwin/src/NSArray+MGLAdditions.h +platform/darwin/src/NSArray+MGLAdditions.mm +platform/darwin/src/NSBundle+MGLAdditions.h +platform/darwin/src/NSBundle+MGLAdditions.m +platform/darwin/src/NSCoder+MGLAdditions.h +platform/darwin/src/NSCoder+MGLAdditions.mm +platform/darwin/src/NSComparisonPredicate+MGLAdditions.h +platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm +platform/darwin/src/NSCompoundPredicate+MGLAdditions.h +platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm +platform/darwin/src/NSDate+MGLAdditions.h +platform/darwin/src/NSDate+MGLAdditions.mm +platform/darwin/src/NSDictionary+MGLAdditions.h +platform/darwin/src/NSDictionary+MGLAdditions.mm +platform/darwin/src/NSException+MGLAdditions.h +platform/darwin/src/NSExpression+MGLAdditions.h +platform/darwin/src/NSExpression+MGLAdditions.mm +platform/darwin/src/NSExpression+MGLPrivateAdditions.h +platform/darwin/src/NSPredicate+MGLAdditions.h +platform/darwin/src/NSPredicate+MGLAdditions.mm +platform/darwin/src/NSPredicate+MGLPrivateAdditions.h +platform/darwin/src/NSProcessInfo+MGLAdditions.h +platform/darwin/src/NSProcessInfo+MGLAdditions.m +platform/darwin/src/NSString+MGLAdditions.h +platform/darwin/src/NSString+MGLAdditions.m +platform/darwin/src/NSURL+MGLAdditions.h +platform/darwin/src/NSURL+MGLAdditions.m +platform/darwin/src/NSValue+MGLAdditions.h +platform/darwin/src/NSValue+MGLAdditions.m + +# SDK/Foundation/Formatters +platform/darwin/src/MGLClockDirectionFormatter.h +platform/darwin/src/MGLClockDirectionFormatter.m +platform/darwin/src/MGLCompassDirectionFormatter.h +platform/darwin/src/MGLCompassDirectionFormatter.m +platform/darwin/src/MGLCoordinateFormatter.h +platform/darwin/src/MGLCoordinateFormatter.m +platform/darwin/src/MGLDistanceFormatter.h +platform/darwin/src/MGLDistanceFormatter.m + +# SDK/Foundation/Geometry +platform/darwin/src/MGLAnnotation.h +platform/darwin/src/MGLFeature.h +platform/darwin/src/MGLFeature.mm +platform/darwin/src/MGLFeature_Private.h +platform/darwin/src/MGLGeometry.h +platform/darwin/src/MGLGeometry.mm +platform/darwin/src/MGLGeometry_Private.h +platform/darwin/src/MGLMultiPoint.h +platform/darwin/src/MGLMultiPoint.mm +platform/darwin/src/MGLMultiPoint_Private.h +platform/darwin/src/MGLOverlay.h +platform/darwin/src/MGLPointAnnotation.h +platform/darwin/src/MGLPointAnnotation.mm +platform/darwin/src/MGLPointCollection.h +platform/darwin/src/MGLPointCollection.mm +platform/darwin/src/MGLPointCollection_Private.h +platform/darwin/src/MGLPolygon.h +platform/darwin/src/MGLPolygon.mm +platform/darwin/src/MGLPolygon_Private.h +platform/darwin/src/MGLPolyline.h +platform/darwin/src/MGLPolyline.mm +platform/darwin/src/MGLPolyline_Private.h +platform/darwin/src/MGLShape.h +platform/darwin/src/MGLShape.mm +platform/darwin/src/MGLShapeCollection.h +platform/darwin/src/MGLShapeCollection.mm +platform/darwin/src/MGLShape_Private.h + +# SDK/Foundation/Offline Maps +platform/darwin/src/MGLOfflinePack.h +platform/darwin/src/MGLOfflinePack.mm +platform/darwin/src/MGLOfflinePack_Private.h +platform/darwin/src/MGLOfflineRegion.h +platform/darwin/src/MGLOfflineRegion_Private.h +platform/darwin/src/MGLOfflineStorage.h +platform/darwin/src/MGLOfflineStorage.mm +platform/darwin/src/MGLOfflineStorage_Private.h +platform/darwin/src/MGLShapeOfflineRegion.h +platform/darwin/src/MGLShapeOfflineRegion.mm +platform/darwin/src/MGLShapeOfflineRegion_Private.h +platform/darwin/src/MGLTilePyramidOfflineRegion.h +platform/darwin/src/MGLTilePyramidOfflineRegion.mm +platform/darwin/src/MGLTilePyramidOfflineRegion_Private.h + +# SDK/Foundation/Styling +platform/darwin/src/MGLConversion.h +platform/darwin/src/MGLLight.h +platform/darwin/src/MGLLight.mm +platform/darwin/src/MGLLight_Private.h +platform/darwin/src/MGLStyleValue.h +platform/darwin/src/MGLStyleValue.mm +platform/darwin/src/MGLStyleValue_Private.h + +# SDK/Foundation/Styling/Categories +platform/darwin/src/NSValue+MGLStyleAttributeAdditions.h +platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm + +# SDK/Foundation/Styling/Layers +platform/darwin/src/MGLBackgroundStyleLayer.h +platform/darwin/src/MGLBackgroundStyleLayer.mm +platform/darwin/src/MGLCircleStyleLayer.h +platform/darwin/src/MGLCircleStyleLayer.mm +platform/darwin/src/MGLFillExtrusionStyleLayer.h +platform/darwin/src/MGLFillExtrusionStyleLayer.mm +platform/darwin/src/MGLFillStyleLayer.h +platform/darwin/src/MGLFillStyleLayer.mm +platform/darwin/src/MGLForegroundStyleLayer.h +platform/darwin/src/MGLForegroundStyleLayer.mm +platform/darwin/src/MGLHeatmapStyleLayer.h +platform/darwin/src/MGLHeatmapStyleLayer.mm +platform/darwin/src/MGLHillshadeStyleLayer.h +platform/darwin/src/MGLHillshadeStyleLayer.mm +platform/darwin/src/MGLLineStyleLayer.h +platform/darwin/src/MGLLineStyleLayer.mm +platform/darwin/src/MGLOpenGLStyleLayer.h +platform/darwin/src/MGLOpenGLStyleLayer.mm +platform/darwin/src/MGLRasterStyleLayer.h +platform/darwin/src/MGLRasterStyleLayer.mm +platform/darwin/src/MGLStyleLayer.h +platform/darwin/src/MGLStyleLayer.mm +platform/darwin/src/MGLStyleLayer_Private.h +platform/darwin/src/MGLSymbolStyleLayer.h +platform/darwin/src/MGLSymbolStyleLayer.mm +platform/darwin/src/MGLVectorStyleLayer.h +platform/darwin/src/MGLVectorStyleLayer.m + +# SDK/Foundation/Styling/Sources +platform/darwin/src/MGLComputedShapeSource.h +platform/darwin/src/MGLComputedShapeSource.mm +platform/darwin/src/MGLComputedShapeSource_Private.h +platform/darwin/src/MGLImageSource.h +platform/darwin/src/MGLImageSource.mm +platform/darwin/src/MGLRasterDEMSource.h +platform/darwin/src/MGLRasterDEMSource.mm +platform/darwin/src/MGLRasterTileSource.h +platform/darwin/src/MGLRasterTileSource.mm +platform/darwin/src/MGLRasterTileSource_Private.h +platform/darwin/src/MGLShapeSource.h +platform/darwin/src/MGLShapeSource.mm +platform/darwin/src/MGLShapeSource_Private.h +platform/darwin/src/MGLSource.h +platform/darwin/src/MGLSource.mm +platform/darwin/src/MGLSource_Private.h +platform/darwin/src/MGLTileSource.h +platform/darwin/src/MGLTileSource.mm +platform/darwin/src/MGLTileSource_Private.h +platform/darwin/src/MGLVectorTileSource.h +platform/darwin/src/MGLVectorTileSource.mm +platform/darwin/src/MGLVectorTileSource_Private.h + +# SDK/Kit +platform/macos/src/MGLAnnotationImage.h +platform/macos/src/MGLAnnotationImage.m +platform/macos/src/MGLAnnotationImage_Private.h +platform/macos/src/MGLAttributionButton.h +platform/macos/src/MGLAttributionButton.mm +platform/macos/src/MGLCompassCell.h +platform/macos/src/MGLCompassCell.m +platform/macos/src/MGLMapView+IBAdditions.h +platform/macos/src/MGLMapView+IBAdditions.mm +platform/macos/src/MGLMapView.h +platform/macos/src/MGLMapView.mm +platform/macos/src/MGLMapViewDelegate.h +platform/macos/src/MGLMapView_Private.h +platform/macos/src/MGLOpenGLLayer.h +platform/macos/src/MGLOpenGLLayer.mm + +# SDK/Kit/Categories +platform/macos/src/NSColor+MGLAdditions.h +platform/macos/src/NSColor+MGLAdditions.mm +platform/macos/src/NSImage+MGLAdditions.h +platform/macos/src/NSImage+MGLAdditions.mm + diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj index 1785caddb9..656121030c 100644 --- a/platform/macos/macos.xcodeproj/project.pbxproj +++ b/platform/macos/macos.xcodeproj/project.pbxproj @@ -24,7 +24,6 @@ 1F95931B1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F95931A1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm */; }; 1F9EF4061FBA1B0E0063FBB0 /* mapbox_helmet.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 1F9EF4051FBA1B0D0063FBB0 /* mapbox_helmet.pdf */; }; 1FC481852098F323000D09B4 /* NSPredicate+MGLPrivateAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FC481842098F323000D09B4 /* NSPredicate+MGLPrivateAdditions.h */; }; - 30E5781B1DAA857E0050F07E /* NSImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E578141DAA7D920050F07E /* NSImage+MGLAdditions.h */; }; 3508EC641D749D39009B0EE4 /* NSExpression+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3508EC621D749D39009B0EE4 /* NSExpression+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3508EC651D749D39009B0EE4 /* NSExpression+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3508EC631D749D39009B0EE4 /* NSExpression+MGLAdditions.mm */; }; 3526EABD1DF9B19800006B43 /* MGLCodingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3526EABC1DF9B19800006B43 /* MGLCodingTests.m */; }; @@ -79,6 +78,7 @@ 40E1601D1DF217D6005EA6D9 /* MGLStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 40E1601B1DF216E6005EA6D9 /* MGLStyleLayerTests.m */; }; 52B5D17F1E5E26DF00BBCB48 /* libmbgl-loop-darwin.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5548BE7B1D0ACBBD005DDE81 /* libmbgl-loop-darwin.a */; }; 52B5D1801E5E26DF00BBCB48 /* libmbgl-loop-darwin.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5548BE7B1D0ACBBD005DDE81 /* libmbgl-loop-darwin.a */; }; + 55335DF9212EC542000CE5F8 /* NSImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 405C03961DB0004E001AC280 /* NSImage+MGLAdditions.h */; }; 5548BE781D09E718005DDE81 /* libmbgl-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DAE6C3451CC31D1200DB3429 /* libmbgl-core.a */; }; 556660C61E1BEA0100E2C41B /* MGLFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 556660C51E1BEA0100E2C41B /* MGLFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; }; 556660D61E1D07E400E2C41B /* MGLVersionNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 556660D51E1D07E400E2C41B /* MGLVersionNumber.m */; }; @@ -315,7 +315,6 @@ 1F95931A1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLNSDateAdditionsTests.mm; path = ../../darwin/test/MGLNSDateAdditionsTests.mm; sourceTree = "<group>"; }; 1F9EF4051FBA1B0D0063FBB0 /* mapbox_helmet.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = mapbox_helmet.pdf; sourceTree = "<group>"; }; 1FC481842098F323000D09B4 /* NSPredicate+MGLPrivateAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSPredicate+MGLPrivateAdditions.h"; sourceTree = "<group>"; }; - 30E578141DAA7D920050F07E /* NSImage+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSImage+MGLAdditions.h"; path = "src/NSImage+MGLAdditions.h"; sourceTree = SOURCE_ROOT; }; 3508EC621D749D39009B0EE4 /* NSExpression+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSExpression+MGLAdditions.h"; sourceTree = "<group>"; }; 3508EC631D749D39009B0EE4 /* NSExpression+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSExpression+MGLAdditions.mm"; sourceTree = "<group>"; }; 3526EABC1DF9B19800006B43 /* MGLCodingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLCodingTests.m; path = ../../darwin/test/MGLCodingTests.m; sourceTree = "<group>"; }; @@ -796,7 +795,6 @@ DA33895E1FA3E997001EA329 /* Recovered References */ = { isa = PBXGroup; children = ( - 30E578141DAA7D920050F07E /* NSImage+MGLAdditions.h */, ); name = "Recovered References"; sourceTree = "<group>"; @@ -1221,7 +1219,6 @@ 35C5D8471D6DD66D00E95907 /* NSComparisonPredicate+MGLAdditions.h in Headers */, DAE6C3A31CC31E9400DB3429 /* MGLAnnotationImage.h in Headers */, DAE6C3A41CC31E9400DB3429 /* MGLMapView.h in Headers */, - 355BA4ED1D41633E00CCC6D5 /* NSColor+MGLAdditions.h in Headers */, DAE6C3611CC31E0400DB3429 /* MGLOfflineStorage.h in Headers */, 352742781D4C220900A1ECE6 /* MGLStyleValue.h in Headers */, DAE6C35E1CC31E0400DB3429 /* MGLMultiPoint.h in Headers */, @@ -1247,7 +1244,6 @@ DAE6C3991CC31E2A00DB3429 /* NSException+MGLAdditions.h in Headers */, DA8F25871D51C9E10010E6B5 /* MGLBackgroundStyleLayer.h in Headers */, 4049C2A51DB6CE7F00B3F799 /* MGLPointCollection.h in Headers */, - 30E5781B1DAA857E0050F07E /* NSImage+MGLAdditions.h in Headers */, DAE6C3661CC31E0400DB3429 /* MGLShape.h in Headers */, DA551B831DB496AC0009AFAF /* MGLTileSource_Private.h in Headers */, DAC25FCA200FD5E2009BE98E /* NSExpression+MGLPrivateAdditions.h in Headers */, @@ -1268,6 +1264,7 @@ DA8F258B1D51CA540010E6B5 /* MGLLineStyleLayer.h in Headers */, 35C6DF841E214C0400ACA483 /* MGLDistanceFormatter.h in Headers */, DA8F25B21D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h in Headers */, + 55335DF9212EC542000CE5F8 /* NSImage+MGLAdditions.h in Headers */, 1F7454A31ECFB00300021D39 /* MGLLight_Private.h in Headers */, 359819591E02F611008FC139 /* NSCoder+MGLAdditions.h in Headers */, DAE6C38E1CC31E2A00DB3429 /* MGLOfflineStorage_Private.h in Headers */, @@ -1295,6 +1292,7 @@ DAE6C3B91CC31EF300DB3429 /* MGLOpenGLLayer.h in Headers */, DAF0D80E1DFE0E5D00B28378 /* MGLPointCollection_Private.h in Headers */, 35D65C5A1D65AD5500722C23 /* NSDate+MGLAdditions.h in Headers */, + 355BA4ED1D41633E00CCC6D5 /* NSColor+MGLAdditions.h in Headers */, DAE6C3891CC31E2A00DB3429 /* MGLMultiPoint_Private.h in Headers */, DAE6C3A51CC31E9400DB3429 /* MGLMapView+IBAdditions.h in Headers */, DA35A2AD1CCA091800E826B2 /* MGLCompassDirectionFormatter.h in Headers */, diff --git a/scripts/generate-cmake-files.js b/scripts/generate-cmake-files.js index bbbb9accec..9413ff19b6 100755 --- a/scripts/generate-cmake-files.js +++ b/scripts/generate-cmake-files.js @@ -3,9 +3,13 @@ const child_process = require('child_process'); const fs = require('fs'); const ejs = require('ejs'); +const path = require('path'); +const xcode = require('xcode'); require('./style-code'); +const fileListTxt = ejs.compile(fs.readFileSync('cmake/files.txt.ejs', 'utf8'), {strict: true}); + function generateFileList(name, regex, patterns) { const files = child_process.execSync(`git ls-files ${patterns.map((p) => '"' + p + '"').join(' ')}`).toString().trim().split('\n'); var groups = {}; @@ -18,8 +22,69 @@ function generateFileList(name, regex, patterns) { groups[group].push(file); } - const fileListCmake = ejs.compile(fs.readFileSync('cmake/files.txt.ejs', 'utf8'), {strict: true}); - writeIfModified(`cmake/${name}-files.txt`, fileListCmake({ groups: groups })); + writeIfModified(`cmake/${name}-files.txt`, fileListTxt({ groups: groups })); +} + +function generateXcodeSourceList(project, target, name) { + const projectPath = path.dirname(project); + let objects = xcode.project(path.join(project, 'project.pbxproj')).parseSync().hash.project.objects; + + // Build reverse lookup table for file => group + let objToGroup = {}; + Object.keys(objects.PBXGroup) + .filter(name => !/_comment$/.test(name)) + .forEach(name => objects.PBXGroup[name].children + .forEach(child => objToGroup[child.value] = name)); + + // Retrieve the target + const targetObj = Object.keys(objects.PBXNativeTarget) + .filter(name => !/_comment$/.test(name)) + .map(name => objects.PBXNativeTarget[name]) + .filter(project => project.name == target)[0]; + + // Retrieve the sources associated with the target. + const sourcesObjs = targetObj.buildPhases + .map(phase => objects.PBXSourcesBuildPhase[phase.value] || objects.PBXHeadersBuildPhase[phase.value]) + .filter(phase => phase); + + let groups = {}; + sourcesObjs + .forEach(sourcesObj => sourcesObj.files + .map(file => objects.PBXBuildFile[file.value].fileRef) + .forEach(fileRef => { + // Look up the full path, and fully qualified group name for every source reference + let fileObj = objects.PBXFileReference[fileRef]; + + // Ascend the group tree to find the full path. + let fullPath = [ fileObj.path.replace(/^"(.+)"$/, '$1') ]; + for (let ref = fileRef, obj = fileObj; obj.sourceTree != 'SOURCE_ROOT' && ref in objToGroup;) { + ref = objToGroup[ref]; + obj = objects.PBXGroup[ref]; + if (obj.path) { + fullPath.unshift(obj.path.replace(/^"(.+)"$/, '$1')); + } + } + + // Generate a group name from the Xcode source groups + let groupName = []; + for (let ref = fileRef, obj = fileObj; ref in objToGroup;) { + ref = objToGroup[ref]; + obj = objects.PBXGroup[ref]; + if (obj.name) { + groupName.unshift(obj.name.replace(/^"(.+)"$/, '$1')); + } + } + + groupName = groupName.join('/'); + if (!groups[groupName]) { + groups[groupName] = []; + } + fullPath.unshift(projectPath); + groups[groupName].push(path.join.apply(path, fullPath)); + }) + ); + + writeIfModified(`${projectPath}/${name || target}-files.txt`, fileListTxt({ groups: groups })); } generateFileList('core', /^(?:src|include)\/(?:mbgl\/)?(.+)\/[^\/]+$/, @@ -30,3 +95,7 @@ generateFileList('benchmark', /^benchmark\/(?:(?:src|include)\/)?(?:mbgl\/)?(?:( generateFileList('test', /^test\/(?:(?:src|include)\/)?(?:mbgl\/)?(?:(.+)\/)?[^\/]+$/, [ 'test/*.hpp', 'test/*.cpp', 'test/*.h', 'test/*.c' ]); + +generateXcodeSourceList('platform/macos/macos.xcodeproj', 'dynamic', 'core'); + +generateXcodeSourceList('platform/ios/ios.xcodeproj', 'dynamic', 'core'); |