move package.json and binding.gyp to root, drop tiles.tilejson
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -12,6 +12,7 @@
|
||||
/mason_packages
|
||||
/config/*.gypi
|
||||
/build
|
||||
/lib
|
||||
/macosx/build
|
||||
/linux/build
|
||||
/ios/build
|
||||
@@ -28,8 +29,6 @@
|
||||
/src/shader/shaders_gl.cpp
|
||||
/src/shader/shaders_gles2.cpp
|
||||
/bin/style.bin.js
|
||||
/platform/*.mk
|
||||
/platform/*.Makefile
|
||||
*~
|
||||
|
||||
/ios/benchmark/assets/tiles/mapbox.mapbox-streets-v6/
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
{
|
||||
'includes': [
|
||||
'../../gyp/common.gypi',
|
||||
'gyp/common.gypi',
|
||||
],
|
||||
'targets': [
|
||||
{ 'target_name': '<(module_name)',
|
||||
'dependencies': [
|
||||
'../../mbgl.gyp:core',
|
||||
'../../mbgl.gyp:platform-<(platform_lib)',
|
||||
'../../mbgl.gyp:headless-<(headless_lib)',
|
||||
'mbgl.gyp:core',
|
||||
'mbgl.gyp:platform-<(platform_lib)',
|
||||
'mbgl.gyp:headless-<(headless_lib)',
|
||||
],
|
||||
|
||||
'include_dirs': [ "<!(node -e \"require('nan')\")" ],
|
||||
|
||||
'sources': [
|
||||
'src/node_mapbox_gl_native.cpp',
|
||||
'src/node_log.hpp',
|
||||
'src/node_log.cpp',
|
||||
'src/node_file_source.hpp',
|
||||
'src/node_file_source.cpp',
|
||||
'src/node_map.hpp',
|
||||
'src/node_map.cpp',
|
||||
'src/node_request.hpp',
|
||||
'src/node_request.cpp',
|
||||
'src/util/async_queue.hpp',
|
||||
'platform/node/src/node_mapbox_gl_native.cpp',
|
||||
'platform/node/src/node_log.hpp',
|
||||
'platform/node/src/node_log.cpp',
|
||||
'platform/node/src/node_file_source.hpp',
|
||||
'platform/node/src/node_file_source.cpp',
|
||||
'platform/node/src/node_map.hpp',
|
||||
'platform/node/src/node_map.cpp',
|
||||
'platform/node/src/node_request.hpp',
|
||||
'platform/node/src/node_request.cpp',
|
||||
'platform/node/src/util/async_queue.hpp',
|
||||
],
|
||||
|
||||
'conditions': [
|
||||
@@ -33,9 +33,9 @@
|
||||
"tape": "^4.2.0"
|
||||
},
|
||||
"scripts": {
|
||||
"install": "node-pre-gyp install || make node -C ../../",
|
||||
"test": "tape test/js/**/*.test.js",
|
||||
"test-suite": "tape test/render.test.js"
|
||||
"install": "node-pre-gyp install --fallback-to-build=false || make node",
|
||||
"test": "tape platform/node/test/js/**/*.test.js",
|
||||
"test-suite": "tape platform/node/test/render.test.js"
|
||||
},
|
||||
"gypfile": true,
|
||||
"binary": {
|
||||
6
platform/node/test/fixtures/style.json
vendored
6
platform/node/test/fixtures/style.json
vendored
@@ -4,8 +4,10 @@
|
||||
"sources": {
|
||||
"mapbox": {
|
||||
"type": "vector",
|
||||
"url": "./fixtures/tiles.tilejson",
|
||||
"maxzoom": 15
|
||||
"maxzoom": 15,
|
||||
"tiles": [
|
||||
"./fixtures/tiles/{z}-{x}-{y}.vector.pbf"
|
||||
]
|
||||
}
|
||||
},
|
||||
"layers": [
|
||||
|
||||
13
platform/node/test/fixtures/tiles.tilejson
vendored
13
platform/node/test/fixtures/tiles.tilejson
vendored
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"bounds": [ -180, -85.0511, 180, 85.0511 ],
|
||||
"center": [ 0, 0, 0 ],
|
||||
"format": "pbf",
|
||||
"id": "mapbox.mapbox-streets-v6-dev",
|
||||
"maskLevel": 8,
|
||||
"maxzoom": 15,
|
||||
"minzoom": 0,
|
||||
"name": "Mapbox Streets V6",
|
||||
"scheme": "xyz",
|
||||
"tilejson": "2.0.0",
|
||||
"tiles": [ "./fixtures/tiles/{z}-{x}-{y}.vector.pbf" ]
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
/* jshint node:true */
|
||||
|
||||
var test = require('tape');
|
||||
var mbgl = require('../..');
|
||||
var mbgl = require('../../../..');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
|
||||
|
||||
@@ -3,24 +3,23 @@
|
||||
/* jshint node: true */
|
||||
|
||||
var test = require('tape').test;
|
||||
var mbgl = require('../..');
|
||||
var mbgl = require('../../../..');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var mkdirp = require('mkdirp');
|
||||
var http = require('http');
|
||||
var request = require('request');
|
||||
var st = require('st');
|
||||
var style = require('../../test/fixtures/style.json');
|
||||
var style = require('../fixtures/style.json');
|
||||
var PNG = require('pngjs').PNG;
|
||||
var compare = require('../compare.js');
|
||||
|
||||
var dirPath = path.join(path.dirname(require.resolve('../../package.json')), 'test');
|
||||
var server = http.createServer(st({ path: dirPath }));
|
||||
var server = http.createServer(st({ path: path.join(__dirname, '..') }));
|
||||
server.listen(0);
|
||||
|
||||
function filePath(name) {
|
||||
return ['expected', 'actual', 'diff'].reduce(function(prev, key) {
|
||||
var dir = path.join('test', key, 'gzip');
|
||||
var dir = path.join(__dirname, '..', key, 'gzip');
|
||||
mkdirp.sync(dir);
|
||||
prev[key] = path.join(dir, name);
|
||||
return prev;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/* jshint node: true */
|
||||
|
||||
var test = require('tape');
|
||||
var mbgl = require('../..');
|
||||
var mbgl = require('../../../..');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var mkdirp = require('mkdirp');
|
||||
@@ -13,7 +13,7 @@ var compare = require('../compare.js');
|
||||
|
||||
function filePath(name) {
|
||||
return ['expected', 'actual', 'diff'].reduce(function(prev, key) {
|
||||
var dir = path.join('test', key, 'map');
|
||||
var dir = path.join(__dirname, '..', key, 'map');
|
||||
mkdirp.sync(dir);
|
||||
prev[key] = path.join(dir, name);
|
||||
return prev;
|
||||
@@ -145,13 +145,7 @@ test('Map', function(t) {
|
||||
t.test('does not immediately trigger any tile loads', function(t) {
|
||||
var map = new mbgl.Map({
|
||||
request: function(req) {
|
||||
if (req.url === './fixtures/tiles.tilejson') {
|
||||
fs.readFile(path.join('test', req.url), function (err, data) {
|
||||
req.respond(err, {data: data});
|
||||
});
|
||||
} else {
|
||||
t.fail('unexpected request ' + req.url);
|
||||
}
|
||||
t.fail('unexpected request ' + req.url);
|
||||
},
|
||||
ratio: 1
|
||||
});
|
||||
@@ -168,7 +162,7 @@ test('Map', function(t) {
|
||||
t.test('.render', function(t) {
|
||||
var options = {
|
||||
request: function(req) {
|
||||
fs.readFile(path.join('test', req.url), function(err, data) {
|
||||
fs.readFile(path.join(__dirname, '..', req.url), function(err, data) {
|
||||
req.respond(err, { data: data });
|
||||
});
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/* jshint node:true */
|
||||
|
||||
var test = require('tape');
|
||||
var mbgl = require('..');
|
||||
var mbgl = require('../../..');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var mkdirp = require('mkdirp');
|
||||
|
||||
@@ -70,6 +70,7 @@ config/%.gypi: $(SUBMODULES) configure $(CONFIGURE_FILES)
|
||||
#### Build files ###############################################################
|
||||
|
||||
GYP_FLAGS += -Dhost=$(HOST)
|
||||
GYP_FLAGS += -Iconfig/$(HOST_SLUG).gypi
|
||||
GYP_FLAGS += -Dplatform_lib=$(PLATFORM)
|
||||
GYP_FLAGS += -Dhttp_lib=$(HTTP)
|
||||
GYP_FLAGS += -Dasset_lib=$(ASSET)
|
||||
@@ -85,26 +86,25 @@ GYP_FLAGS += --generator-output=./build/$(HOST_SLUG)
|
||||
Makefile/__project__: print-env $(SUBMODULES) config/$(HOST_SLUG).gypi
|
||||
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Recreating project...$(FORMAT_END)\n"
|
||||
$(QUIET)$(ENV) deps/run_gyp gyp/$(HOST).gyp $(GYP_FLAGS) \
|
||||
-Iconfig/$(HOST_SLUG).gypi -f make$(GYP_FLAVOR_SUFFIX)
|
||||
-f make$(GYP_FLAVOR_SUFFIX)
|
||||
|
||||
.PHONY: Xcode/__project__
|
||||
Xcode/__project__: print-env $(SUBMODULES) config/$(HOST_SLUG).gypi
|
||||
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Recreating project...$(FORMAT_END)\n"
|
||||
$(QUIET)$(ENV) deps/run_gyp gyp/$(HOST).gyp $(GYP_FLAGS) \
|
||||
-Iconfig/$(HOST_SLUG).gypi -f xcode$(GYP_FLAVOR_SUFFIX)
|
||||
-f xcode$(GYP_FLAVOR_SUFFIX)
|
||||
|
||||
#### Build individual targets ##################################################
|
||||
|
||||
NODE_PRE_GYP = $(shell cd platform/node > /dev/null && npm bin)/node-pre-gyp
|
||||
NODE_PRE_GYP = $(shell npm bin)/node-pre-gyp
|
||||
node/configure:
|
||||
cd platform/node && $(NODE_PRE_GYP) configure --clang -- \
|
||||
$(GYP_FLAGS) -I../../config/$(HOST_SLUG).gypi \
|
||||
-Dlibuv_ldflags= -Dlibuv_static_libs=
|
||||
$(QUIET)$(ENV) $(NODE_PRE_GYP) configure --clang -- \
|
||||
$(GYP_FLAGS) -Dlibuv_ldflags= -Dlibuv_static_libs=
|
||||
|
||||
Makefile/node: Makefile/__project__ node/configure
|
||||
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Building target node...$(FORMAT_END)\n"
|
||||
cd platform/node && $(NODE_PRE_GYP) build --clang -- \
|
||||
-j$(JOBS)
|
||||
$(QUIET)$(ENV) $(NODE_PRE_GYP) build --clang -- \
|
||||
-j$(JOBS)
|
||||
|
||||
Makefile/%: Makefile/__project__
|
||||
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Building target $*...$(FORMAT_END)\n"
|
||||
|
||||
Reference in New Issue
Block a user