summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2018-08-22 12:51:08 +0200
committerKonstantin Käfer <mail@kkaefer.com>2018-08-22 12:52:38 +0200
commit5e6fb891f1b1919177099b3a68690d578df4b3c7 (patch)
tree355853bc2d7daa7cd8ce4bffe1a8300958f1f532
parent1662be7ea546ac78654396e700b9ed7107407904 (diff)
downloadqtlocation-mapboxgl-upstream/file-list-ios-macos.tar.gz
[build] add plain text file lists for iOS/macOSupstream/file-list-ios-macos
-rw-r--r--cmake/benchmark.cmake1
-rw-r--r--cmake/core.cmake1
-rw-r--r--cmake/filesource.cmake1
-rw-r--r--cmake/loop-darwin.cmake10
-rw-r--r--cmake/test.cmake1
-rw-r--r--package.json3
-rw-r--r--platform/android/config.cmake2
-rw-r--r--platform/darwin/filesource-files.txt5
-rw-r--r--platform/darwin/loop-files.txt4
-rw-r--r--platform/ios/config.cmake9
-rw-r--r--platform/ios/core-files.txt166
-rw-r--r--platform/macos/config.cmake9
-rw-r--r--platform/macos/core-files.txt95
-rwxr-xr-xscripts/generate-cmake-files.js71
14 files changed, 355 insertions, 23 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/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..3d3c55cac1
--- /dev/null
+++ b/platform/ios/core-files.txt
@@ -0,0 +1,166 @@
+# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js
+
+# SDK/Foundation
+platform/darwin/src/MGLAccountManager.m
+platform/darwin/src/MGLAttributionInfo.mm
+platform/darwin/src/MGLFoundation.mm
+platform/darwin/src/MGLLocationManager.m
+platform/darwin/src/MGLMapCamera.mm
+platform/darwin/src/MGLMapSnapshotter.mm
+platform/darwin/src/MGLNetworkConfiguration.m
+platform/darwin/src/MGLRendererConfiguration.mm
+platform/darwin/src/MGLStyle.mm
+platform/darwin/src/MGLTypes.m
+
+# SDK/Foundation/Categories
+platform/darwin/src/NSArray+MGLAdditions.mm
+platform/darwin/src/NSBundle+MGLAdditions.m
+platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm
+platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm
+platform/darwin/src/NSData+MGLAdditions.mm
+platform/darwin/src/NSDate+MGLAdditions.mm
+platform/darwin/src/NSDictionary+MGLAdditions.mm
+platform/darwin/src/NSExpression+MGLAdditions.mm
+platform/darwin/src/NSPredicate+MGLAdditions.mm
+platform/darwin/src/NSProcessInfo+MGLAdditions.m
+platform/darwin/src/NSString+MGLAdditions.m
+platform/darwin/src/NSURL+MGLAdditions.m
+platform/darwin/src/NSValue+MGLAdditions.m
+
+# SDK/Foundation/Formatters
+platform/darwin/src/MGLClockDirectionFormatter.m
+platform/darwin/src/MGLCompassDirectionFormatter.m
+platform/darwin/src/MGLCoordinateFormatter.m
+platform/darwin/src/MGLDistanceFormatter.m
+
+# SDK/Foundation/Geometry
+platform/darwin/src/MGLFeature.mm
+platform/darwin/src/MGLGeometry.mm
+platform/darwin/src/MGLMultiPoint.mm
+platform/darwin/src/MGLPointAnnotation.mm
+platform/darwin/src/MGLPointCollection.mm
+platform/darwin/src/MGLPolygon.mm
+platform/darwin/src/MGLPolyline.mm
+platform/darwin/src/MGLShape.mm
+platform/darwin/src/MGLShapeCollection.mm
+
+# SDK/Foundation/Offline Maps
+platform/darwin/src/MGLOfflinePack.mm
+platform/darwin/src/MGLOfflineStorage.mm
+platform/darwin/src/MGLShapeOfflineRegion.mm
+platform/darwin/src/MGLTilePyramidOfflineRegion.mm
+
+# SDK/Foundation/Styling
+platform/darwin/src/MGLLight.mm
+platform/darwin/src/MGLStyleValue.mm
+
+# SDK/Foundation/Styling/Categories
+platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm
+
+# SDK/Foundation/Styling/Layers
+platform/darwin/src/MGLBackgroundStyleLayer.mm
+platform/darwin/src/MGLCircleStyleLayer.mm
+platform/darwin/src/MGLFillExtrusionStyleLayer.mm
+platform/darwin/src/MGLFillStyleLayer.mm
+platform/darwin/src/MGLForegroundStyleLayer.mm
+platform/darwin/src/MGLHeatmapStyleLayer.mm
+platform/darwin/src/MGLHillshadeStyleLayer.mm
+platform/darwin/src/MGLLineStyleLayer.mm
+platform/darwin/src/MGLOpenGLStyleLayer.mm
+platform/darwin/src/MGLRasterStyleLayer.mm
+platform/darwin/src/MGLStyleLayer.mm
+platform/darwin/src/MGLSymbolStyleLayer.mm
+platform/darwin/src/MGLVectorStyleLayer.m
+
+# SDK/Foundation/Styling/Sources
+platform/darwin/src/MGLComputedShapeSource.mm
+platform/darwin/src/MGLImageSource.mm
+platform/darwin/src/MGLRasterDEMSource.mm
+platform/darwin/src/MGLRasterTileSource.mm
+platform/darwin/src/MGLShapeSource.mm
+platform/darwin/src/MGLSource.mm
+platform/darwin/src/MGLTileSource.mm
+platform/darwin/src/MGLVectorTileSource.mm
+
+# SDK/Kit
+platform/ios/src/MGLMapAccessibilityElement.mm
+platform/ios/src/MGLMapView.mm
+
+# SDK/Kit/Annotations
+platform/ios/src/MGLAnnotationContainerView.m
+platform/ios/src/MGLAnnotationImage.m
+platform/ios/src/MGLAnnotationView.mm
+platform/ios/src/MGLCompactCalloutView.m
+platform/ios/src/MGLFaux3DUserLocationAnnotationView.m
+platform/ios/src/MGLUserLocation.m
+platform/ios/src/MGLUserLocationAnnotationView.m
+platform/ios/src/MGLUserLocationHeadingArrowLayer.m
+platform/ios/src/MGLUserLocationHeadingBeamLayer.m
+
+# SDK/Kit/Categories
+platform/darwin/src/NSCoder+MGLAdditions.mm
+platform/ios/src/NSOrthography+MGLAdditions.m
+platform/ios/src/UIColor+MGLAdditions.mm
+platform/ios/src/UIDevice+MGLAdditions.m
+platform/ios/src/UIImage+MGLAdditions.mm
+platform/ios/src/UIViewController+MGLAdditions.m
+
+# SDK/Kit/SMCalloutView
+platform/ios/vendor/SMCalloutView/SMCalloutView.m
+
+# SDK/Kit/Telemetry
+platform/ios/src/MGLTelemetryConfig.m
+
+# SDK/Kit/Telemetry/Development
+platform/ios/src/MGLSDKUpdateChecker.mm
+
+# SDK/Kit/Telemetry/Runtime
+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.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.mm
+
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..ef9654fffd
--- /dev/null
+++ b/platform/macos/core-files.txt
@@ -0,0 +1,95 @@
+# This file is generated. Do not edit. Regenerate this with scripts/generate-cmake-files.js
+
+# SDK/Foundation
+platform/darwin/src/MGLAccountManager.m
+platform/darwin/src/MGLAttributionInfo.mm
+platform/darwin/src/MGLFoundation.mm
+platform/darwin/src/MGLMapCamera.mm
+platform/darwin/src/MGLMapSnapshotter.mm
+platform/darwin/src/MGLNetworkConfiguration.m
+platform/darwin/src/MGLRendererConfiguration.mm
+platform/darwin/src/MGLStyle.mm
+platform/darwin/src/MGLTypes.m
+
+# SDK/Foundation/Categories
+platform/darwin/src/NSArray+MGLAdditions.mm
+platform/darwin/src/NSBundle+MGLAdditions.m
+platform/darwin/src/NSCoder+MGLAdditions.mm
+platform/darwin/src/NSComparisonPredicate+MGLAdditions.mm
+platform/darwin/src/NSCompoundPredicate+MGLAdditions.mm
+platform/darwin/src/NSDate+MGLAdditions.mm
+platform/darwin/src/NSDictionary+MGLAdditions.mm
+platform/darwin/src/NSExpression+MGLAdditions.mm
+platform/darwin/src/NSPredicate+MGLAdditions.mm
+platform/darwin/src/NSProcessInfo+MGLAdditions.m
+platform/darwin/src/NSString+MGLAdditions.m
+platform/darwin/src/NSURL+MGLAdditions.m
+platform/darwin/src/NSValue+MGLAdditions.m
+
+# SDK/Foundation/Formatters
+platform/darwin/src/MGLClockDirectionFormatter.m
+platform/darwin/src/MGLCompassDirectionFormatter.m
+platform/darwin/src/MGLCoordinateFormatter.m
+platform/darwin/src/MGLDistanceFormatter.m
+
+# SDK/Foundation/Geometry
+platform/darwin/src/MGLFeature.mm
+platform/darwin/src/MGLGeometry.mm
+platform/darwin/src/MGLMultiPoint.mm
+platform/darwin/src/MGLPointAnnotation.mm
+platform/darwin/src/MGLPointCollection.mm
+platform/darwin/src/MGLPolygon.mm
+platform/darwin/src/MGLPolyline.mm
+platform/darwin/src/MGLShape.mm
+platform/darwin/src/MGLShapeCollection.mm
+
+# SDK/Foundation/Offline Maps
+platform/darwin/src/MGLOfflinePack.mm
+platform/darwin/src/MGLOfflineStorage.mm
+platform/darwin/src/MGLShapeOfflineRegion.mm
+platform/darwin/src/MGLTilePyramidOfflineRegion.mm
+
+# SDK/Foundation/Styling
+platform/darwin/src/MGLLight.mm
+platform/darwin/src/MGLStyleValue.mm
+
+# SDK/Foundation/Styling/Categories
+platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm
+
+# SDK/Foundation/Styling/Layers
+platform/darwin/src/MGLBackgroundStyleLayer.mm
+platform/darwin/src/MGLCircleStyleLayer.mm
+platform/darwin/src/MGLFillExtrusionStyleLayer.mm
+platform/darwin/src/MGLFillStyleLayer.mm
+platform/darwin/src/MGLForegroundStyleLayer.mm
+platform/darwin/src/MGLHeatmapStyleLayer.mm
+platform/darwin/src/MGLHillshadeStyleLayer.mm
+platform/darwin/src/MGLLineStyleLayer.mm
+platform/darwin/src/MGLOpenGLStyleLayer.mm
+platform/darwin/src/MGLRasterStyleLayer.mm
+platform/darwin/src/MGLStyleLayer.mm
+platform/darwin/src/MGLSymbolStyleLayer.mm
+platform/darwin/src/MGLVectorStyleLayer.m
+
+# SDK/Foundation/Styling/Sources
+platform/darwin/src/MGLComputedShapeSource.mm
+platform/darwin/src/MGLImageSource.mm
+platform/darwin/src/MGLRasterDEMSource.mm
+platform/darwin/src/MGLRasterTileSource.mm
+platform/darwin/src/MGLShapeSource.mm
+platform/darwin/src/MGLSource.mm
+platform/darwin/src/MGLTileSource.mm
+platform/darwin/src/MGLVectorTileSource.mm
+
+# SDK/Kit
+platform/macos/src/MGLAnnotationImage.m
+platform/macos/src/MGLAttributionButton.mm
+platform/macos/src/MGLCompassCell.m
+platform/macos/src/MGLMapView+IBAdditions.mm
+platform/macos/src/MGLMapView.mm
+platform/macos/src/MGLOpenGLLayer.mm
+
+# SDK/Kit/Categories
+platform/macos/src/NSColor+MGLAdditions.mm
+platform/macos/src/NSImage+MGLAdditions.mm
+
diff --git a/scripts/generate-cmake-files.js b/scripts/generate-cmake-files.js
index bbbb9accec..07b189b687 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,67 @@ 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 sourcesObj = targetObj.buildPhases
+ .map(phase => objects.PBXSourcesBuildPhase[phase.value])
+ .filter(phase => phase)[0];
+
+ let groups = {};
+ 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 +93,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');