summaryrefslogtreecommitdiff
path: root/scripts/generate-file-lists.js
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2019-07-26 09:42:38 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2019-07-26 17:43:18 +0300
commitb5980bda75b6f671718952054845c71f7c6a3356 (patch)
tree2b45b7f45dafae7d58c45e383ddb6f93e3c753a3 /scripts/generate-file-lists.js
parentf5293801b9a2bb2891be74fd81c9fc3dbe8d5372 (diff)
downloadqtlocation-mapboxgl-b5980bda75b6f671718952054845c71f7c6a3356.tar.gz
[build] Replace geometry.hpp/variant with mapbox-base
Diffstat (limited to 'scripts/generate-file-lists.js')
-rwxr-xr-xscripts/generate-file-lists.js67
1 files changed, 34 insertions, 33 deletions
diff --git a/scripts/generate-file-lists.js b/scripts/generate-file-lists.js
index c4cf11a4c5..2138d876be 100755
--- a/scripts/generate-file-lists.js
+++ b/scripts/generate-file-lists.js
@@ -7,17 +7,19 @@ const xcode = require('xcode');
require('./style-code');
-const classifier = /^(?:(?:(?:platform|vendor)\/(?:[^/]+)\/|(?:test|benchmark)\/)?(?:(include|src)\/)?)?(.+\.h(?:pp|xx)?)$/;
+const classifier = /^(?:(?:(?:platform|vendor)\/(?:(?!include|src).)*\/|(?:test|benchmark)\/)?(?:(include|src)\/)?)?(.+\.h(?:pp|xx)?)$/;
-function generateFileList(filename, root, regex, patterns) {
+function generateFileList(filename, roots, regex, patterns) {
writeFileList(
filename,
- child_process
+ [].concat.apply([], roots.map(function(root) {
+ return child_process
.execSync(`git -C ${root} ls-files ${patterns.map((p) => '"' + p + '"').join(' ')}`)
.toString()
.trim()
.split('\n')
- .map(file => path.join(root, file)));
+ .map(file => path.join(root, file))
+ })))
}
function writeFileList(filename, files) {
@@ -110,13 +112,13 @@ function generateXcodeSourceList(project, target, name) {
writeIfModified(`${projectPath}/${name || target}-files.json`, JSON.stringify(json, null, 4) + '\n');
}
-generateFileList('src/core-files.json', '.', /^(?:src|include)\/(?:mbgl\/)?(.+)\/[^\/]+$/,
+generateFileList('src/core-files.json', [ '.' ], /^(?:src|include)\/(?:mbgl\/)?(.+)\/[^\/]+$/,
[ 'include/*.hpp', 'include/*.h', 'src/*.hpp', 'src/*.cpp', 'src/*.h', 'src/*.c' ]);
-generateFileList('benchmark/benchmark-files.json', '.', /^benchmark\/(?:(?:src|include)\/)?(?:mbgl\/)?(?:(.+)\/)?[^\/]+$/,
- [ 'benchmark/*.hpp', 'benchmark/*.cpp', 'benchmark/*.h', 'benchmark/*.c' ]);
+generateFileList('benchmark/benchmark-files.json', [ '.' ], /^benchmark\/(?:(?:src|include)\/)?(?:mbgl\/)?(?:(.+)\/)?[^\/]+$/,
+ [ 'benchmark/*.hpp', 'benchmark/*.cpp', 'benchmark/*.host', 'benchmark/*.c' ]);
-generateFileList('test/test-files.json', '.', /^test\/(?:(?:src|include)\/)?(?:mbgl\/)?(?:(.+)\/)?[^\/]+$/,
+generateFileList('test/test-files.json', [ '.' ], /^test\/(?:(?:src|include)\/)?(?:mbgl\/)?(?:(.+)\/)?[^\/]+$/,
[ 'test/*.hpp', 'test/*.cpp', 'test/*.h', 'test/*.c' ]);
generateXcodeSourceList('platform/macos/macos.xcodeproj', 'dynamic', 'sdk');
@@ -124,28 +126,27 @@ generateXcodeSourceList('platform/macos/macos.xcodeproj', 'dynamic', 'sdk');
generateXcodeSourceList('platform/ios/ios.xcodeproj', 'dynamic', 'sdk');
const vendorRegex = /^(?:(?:src|include)\/)?(?:(.+)\/)?[^\/]+$/
-generateFileList('vendor/args-files.json', 'vendor/args', vendorRegex, [ "args.hxx" ]);
-generateFileList('vendor/boost-files.json', 'vendor/boost', vendorRegex, [ "include/**/*.hpp", "include/**/*.h" ]);
-generateFileList('vendor/cheap-ruler-cpp-files.json', 'vendor/cheap-ruler-cpp', vendorRegex, [ "include/**/*.hpp" ]);
-generateFileList('vendor/earcut.hpp-files.json', 'vendor/earcut.hpp', vendorRegex, [ "include/**/*.hpp" ]);
-generateFileList('vendor/eternal-files.json', 'vendor/eternal', vendorRegex, [ "include/**/*.hpp" ]);
-generateFileList('vendor/expected-files.json', 'vendor/expected', vendorRegex, [ "include/expected.hpp" ]);
-generateFileList('vendor/filesystem-files.json', 'vendor/filesystem', vendorRegex, [ "include/**/*.hpp" ]);
-generateFileList('vendor/geojson-vt-cpp-files.json', 'vendor/geojson-vt-cpp', vendorRegex, [ "include/**/*.hpp" ]);
-generateFileList('vendor/geojson.hpp-files.json', 'vendor/geojson.hpp', vendorRegex, [ "include/**/*.hpp" ]);
-generateFileList('vendor/geometry.hpp-files.json', 'vendor/geometry.hpp', vendorRegex, [ "include/**/*.hpp" ]);
-generateFileList('vendor/icu-files.json', 'vendor/icu', vendorRegex, [ "include/**/*.h", "src/*.h", "src/*.cpp" ]);
-generateFileList('vendor/jni.hpp-files.json', 'vendor/jni.hpp', vendorRegex, [ "include/**/*.hpp", ":!:include/jni/string_conversion.hpp" ]);
-generateFileList('vendor/kdbush.hpp-files.json', 'vendor/kdbush.hpp', vendorRegex, [ "include/*.hpp" ]);
-generateFileList('vendor/optional-files.json', 'vendor/optional', vendorRegex, [ "optional.hpp" ]);
-generateFileList('vendor/pixelmatch-cpp-files.json', 'vendor/pixelmatch-cpp', vendorRegex, [ "include/**/*.hpp" ]);
-generateFileList('vendor/polylabel-files.json', 'vendor/polylabel', vendorRegex, [ "include/**/*.hpp" ]);
-generateFileList('vendor/protozero-files.json', 'vendor/protozero', vendorRegex, [ "include/**/*.hpp" ]);
-generateFileList('vendor/rapidjson-files.json', 'vendor/rapidjson', vendorRegex, [ "include/**/*.h" ]);
-generateFileList('vendor/shelf-pack-cpp-files.json', 'vendor/shelf-pack-cpp', vendorRegex, [ "include/**/*.hpp" ]);
-generateFileList('vendor/sqlite-files.json', 'vendor/sqlite', vendorRegex, [ "include/*.h", "src/*.c" ]);
-generateFileList('vendor/supercluster.hpp-files.json', 'vendor/supercluster.hpp', vendorRegex, [ "include/*.hpp" ]);
-generateFileList('vendor/unique_resource-files.json', 'vendor/unique_resource', vendorRegex, [ "unique_resource.hpp" ]);
-generateFileList('vendor/variant-files.json', 'vendor/variant', vendorRegex, [ "include/**/*.hpp" ]);
-generateFileList('vendor/vector-tile-files.json', 'vendor/vector-tile', vendorRegex, [ "include/**/*.hpp" ]);
-generateFileList('vendor/wagyu-files.json', 'vendor/wagyu', vendorRegex, [ "include/**/*.hpp" ]);
+generateFileList('vendor/args-files.json', [ 'vendor/args' ], vendorRegex, [ "args.hxx" ]);
+generateFileList('vendor/boost-files.json', [ 'vendor/boost' ], vendorRegex, [ "include/**/*.hpp", "include/**/*.h" ]);
+generateFileList('vendor/cheap-ruler-cpp-files.json', [ 'vendor/cheap-ruler-cpp' ], vendorRegex, [ "include/**/*.hpp" ]);
+generateFileList('vendor/earcut.hpp-files.json', [ 'vendor/earcut.hpp' ], vendorRegex, [ "include/**/*.hpp" ]);
+generateFileList('vendor/eternal-files.json', [ 'vendor/eternal' ], vendorRegex, [ "include/**/*.hpp" ]);
+generateFileList('vendor/expected-files.json', [ 'vendor/expected' ], vendorRegex, [ "include/expected.hpp" ]);
+generateFileList('vendor/filesystem-files.json', [ 'vendor/filesystem' ], vendorRegex, [ "include/**/*.hpp" ]);
+generateFileList('vendor/geojson-vt-cpp-files.json', [ 'vendor/geojson-vt-cpp' ], vendorRegex, [ "include/**/*.hpp" ]);
+generateFileList('vendor/geojson.hpp-files.json', [ 'vendor/geojson.hpp' ], vendorRegex, [ "include/**/*.hpp" ]);
+generateFileList('vendor/icu-files.json', [ 'vendor/icu' ], vendorRegex, [ "include/**/*.h", "src/*.h", "src/*.cpp" ]);
+generateFileList('vendor/jni.hpp-files.json', [ 'vendor/jni.hpp' ], vendorRegex, [ "include/**/*.hpp", ":!:include/jni/string_conversion.hpp" ]);
+generateFileList('vendor/kdbush.hpp-files.json', [ 'vendor/kdbush.hpp' ], vendorRegex, [ "include/*.hpp" ]);
+generateFileList('vendor/mapbox-base-files.json', [ 'vendor/mapbox-base/libs/geometry.hpp', 'vendor/mapbox-base/libs/variant' ], vendorRegex, [ "include/*.hpp", "include/**/*.hpp" ]);
+generateFileList('vendor/optional-files.json', [ 'vendor/optional' ], vendorRegex, [ "optional.hpp" ]);
+generateFileList('vendor/pixelmatch-cpp-files.json', [ 'vendor/pixelmatch-cpp' ], vendorRegex, [ "include/**/*.hpp" ]);
+generateFileList('vendor/polylabel-files.json', [ 'vendor/polylabel' ], vendorRegex, [ "include/**/*.hpp" ]);
+generateFileList('vendor/protozero-files.json', [ 'vendor/protozero' ], vendorRegex, [ "include/**/*.hpp" ]);
+generateFileList('vendor/rapidjson-files.json', [ 'vendor/rapidjson' ], vendorRegex, [ "include/**/*.h" ]);
+generateFileList('vendor/shelf-pack-cpp-files.json', [ 'vendor/shelf-pack-cpp' ], vendorRegex, [ "include/**/*.hpp" ]);
+generateFileList('vendor/sqlite-files.json', [ 'vendor/sqlite' ], vendorRegex, [ "include/*.h", "src/*.c" ]);
+generateFileList('vendor/supercluster.hpp-files.json', [ 'vendor/supercluster.hpp' ], vendorRegex, [ "include/*.hpp" ]);
+generateFileList('vendor/unique_resource-files.json', [ 'vendor/unique_resource' ], vendorRegex, [ "unique_resource.hpp" ]);
+generateFileList('vendor/vector-tile-files.json', [ 'vendor/vector-tile' ], vendorRegex, [ "include/**/*.hpp" ]);
+generateFileList('vendor/wagyu-files.json', [ 'vendor/wagyu' ], vendorRegex, [ "include/**/*.hpp" ]);