Updates for building on Windows using Cygwin.
Tested on Windows 7.
This commit is contained in:
@@ -329,3 +329,33 @@ Occasionally other changes to `master` might mean that your pull request cannot
|
|||||||
be merged automatically. In this case you may need to rebase your branch on a
|
be merged automatically. In this case you may need to rebase your branch on a
|
||||||
more recent `master`, resolve any conflicts, and `git push --force` to update
|
more recent `master`, resolve any conflicts, and `git push --force` to update
|
||||||
your branch so that it can be merged automatically.
|
your branch so that it can be merged automatically.
|
||||||
|
|
||||||
|
## Building on Windows
|
||||||
|
|
||||||
|
Most developers build on Linux. Building on Windows is possible under Cygwin.
|
||||||
|
When installing Cygwin from https://www.cygwin.com/, include the developer
|
||||||
|
tools to get GNU make.
|
||||||
|
|
||||||
|
First (before npm install), to avoid file permission problems between Windows
|
||||||
|
and Cygwin, edit Cygwin's /etc/fstab file to disable ACLs like this
|
||||||
|
`none /cygdrive cygdrive binary,noacl,posix=0,user 0 0`
|
||||||
|
|
||||||
|
Python is normally installed with Cygwin so need not be installed separately.
|
||||||
|
By default Cygwin will use its own version of Python rather than Window's,
|
||||||
|
so the Python modules should be installed for Cygwin's Python.
|
||||||
|
|
||||||
|
The build targets `check-deps`, `serve`, `lint`, `build`, `test`, `check` and
|
||||||
|
`host-examples` described above should all work. `host-examples` takes quite a
|
||||||
|
while to run. If a target does not run properly first time, try it again.
|
||||||
|
|
||||||
|
Currently, Firefox fails to run http://localhost:3000/build/examples
|
||||||
|
from make serve, but Chrome and Internet Explorer will.
|
||||||
|
|
||||||
|
Microsoft Visual Studio's javascript debugger may be used to debug the
|
||||||
|
build/hosted/your-branch/examples. It will be convenient to set
|
||||||
|
build/hosted/your-branch/examples/index.html as the startup page.
|
||||||
|
|
||||||
|
Your ol3 source tree need not be under the Cygwin root.
|
||||||
|
if you checkout to c:/ol3 then you can build under Cygwin at /cygdrive/c/ol3 .
|
||||||
|
However, keep the path to the ol3 files short otherwise you may see
|
||||||
|
`ENAMETOOLONG` errors.
|
||||||
|
|||||||
6
Makefile
6
Makefile
@@ -23,7 +23,11 @@ CHECK_EXAMPLE_TIMESTAMPS = $(patsubst examples/%.html,build/timestamps/check-%-t
|
|||||||
|
|
||||||
TASKS_JS := $(shell find tasks -name '*.js')
|
TASKS_JS := $(shell find tasks -name '*.js')
|
||||||
|
|
||||||
CLOSURE_LIB = $(shell node -e 'process.stdout.write(require("closure-util").getLibraryPath())')
|
ifeq (CYGWIN,$(findstring CYGWIN,$(OS)))
|
||||||
|
CLOSURE_LIB = $(shell cygpath -u $(shell node -e 'process.stdout.write(require("closure-util").getLibraryPath())'))
|
||||||
|
else
|
||||||
|
CLOSURE_LIB = $(shell node -e 'process.stdout.write(require("closure-util").getLibraryPath())')
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(OS),Darwin)
|
ifeq ($(OS),Darwin)
|
||||||
STAT_COMPRESSED = stat -f ' compressed: %z bytes'
|
STAT_COMPRESSED = stat -f ' compressed: %z bytes'
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ var spawn = require('child_process').spawn;
|
|||||||
var async = require('async');
|
var async = require('async');
|
||||||
var fse = require('fs-extra');
|
var fse = require('fs-extra');
|
||||||
var walk = require('walk').walk;
|
var walk = require('walk').walk;
|
||||||
|
var isWindows = process.platform.indexOf('win') === 0;
|
||||||
|
|
||||||
var sourceDir = path.join(__dirname, '..', 'src');
|
var sourceDir = path.join(__dirname, '..', 'src');
|
||||||
var externsDir = path.join(__dirname, '..', 'externs');
|
var externsDir = path.join(__dirname, '..', 'externs');
|
||||||
@@ -14,6 +15,12 @@ var externsPaths = [
|
|||||||
];
|
];
|
||||||
var infoPath = path.join(__dirname, '..', 'build', 'info.json');
|
var infoPath = path.join(__dirname, '..', 'build', 'info.json');
|
||||||
var jsdoc = path.join(__dirname, '..', 'node_modules', '.bin', 'jsdoc');
|
var jsdoc = path.join(__dirname, '..', 'node_modules', '.bin', 'jsdoc');
|
||||||
|
|
||||||
|
// on Windows, use jsdoc.cmd
|
||||||
|
if (isWindows) {
|
||||||
|
jsdoc += '.cmd';
|
||||||
|
}
|
||||||
|
|
||||||
var jsdocConfig = path.join(
|
var jsdocConfig = path.join(
|
||||||
__dirname, '..', 'config', 'jsdoc', 'info', 'conf.json');
|
__dirname, '..', 'config', 'jsdoc', 'info', 'conf.json');
|
||||||
|
|
||||||
@@ -92,6 +99,17 @@ function getNewer(date, newer, callback) {
|
|||||||
callback(new Error('Trouble walking ' + sourceDir));
|
callback(new Error('Trouble walking ' + sourceDir));
|
||||||
});
|
});
|
||||||
walker.on('end', function() {
|
walker.on('end', function() {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Windows has restrictions on length of command line, so passing all the
|
||||||
|
* changed paths to a task will fail if this limit is exceeded.
|
||||||
|
* To get round this, if this is Windows and there are newer files, just
|
||||||
|
* pass the sourceDir to the task so it can do the walking.
|
||||||
|
*/
|
||||||
|
if (isWindows) {
|
||||||
|
paths = [sourceDir].concat(externsPaths);
|
||||||
|
}
|
||||||
|
|
||||||
callback(null, newer ? paths : []);
|
callback(null, newer ? paths : []);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user