Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit a79fd29

Browse files
committed
chore(gulp): changes to gulpfile to run on windows
1 parent 6f7140a commit a79fd29

File tree

7 files changed

+31
-18
lines changed

7 files changed

+31
-18
lines changed

Diff for: gulpfile.js

+19-8
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,19 @@ var spawn = require('child_process').spawn;
99
var runSpawn = function(done, task, opt_arg) {
1010
opt_arg = typeof opt_arg !== 'undefined' ? opt_arg : [];
1111
var child = spawn(task, opt_arg, {stdio: 'inherit'});
12+
var running = false;
1213
child.on('close', function() {
13-
done();
14+
if (!running) {
15+
running = true;
16+
done();
17+
}
18+
});
19+
child.on('error', function() {
20+
if (!running) {
21+
console.error('gulp encountered a child error');
22+
running = true;
23+
done();
24+
}
1425
});
1526
};
1627

@@ -20,11 +31,11 @@ gulp.task('built:copy', function() {
2031
});
2132

2233
gulp.task('webdriver:update', function(done) {
23-
runSpawn(done, 'bin/webdriver-manager', ['update']);
34+
runSpawn(done, 'node', ['bin/webdriver-manager', 'update']);
2435
});
2536

26-
gulp.task('jslint', function(done) {
27-
runSpawn(done, './node_modules/.bin/jshint', ['lib','spec', 'scripts']);
37+
gulp.task('jshint', function(done) {
38+
runSpawn(done, 'node', ['node_modules/jshint/bin/jshint', 'lib', 'spec', 'scripts']);
2839
});
2940

3041
gulp.task('clang', function() {
@@ -36,18 +47,18 @@ gulp.task('clang', function() {
3647
});
3748

3849
gulp.task('typings', function(done) {
39-
runSpawn(done, 'node_modules/.bin/typings', ['install']);
50+
runSpawn(done, 'node', ['node_modules/typings/dist/bin/typings.js', 'install']);
4051
});
4152

4253
gulp.task('tsc', function(done) {
43-
runSpawn(done, './node_modules/typescript/bin/tsc');
54+
runSpawn(done, 'node', ['node_modules/typescript/bin/tsc']);
4455
});
4556

4657
gulp.task('prepublish', function(done) {
47-
runSequence(['typings', 'jslint', 'clang'],'tsc', 'built:copy', done);
58+
runSequence(['typings', 'jshint', 'clang'],'tsc', 'built:copy', done);
4859
});
4960

5061
gulp.task('pretest', function(done) {
5162
runSequence(
52-
['webdriver:update', 'typings', 'jslint', 'clang'], 'tsc', 'built:copy', done);
63+
['webdriver:update', 'typings', 'jshint', 'clang'], 'tsc', 'built:copy', done);
5364
});

Diff for: scripts/attachSession.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ var checkSession = function() {
5050
});
5151
res.on('end', function() {
5252
if (state === 'success') {
53-
var runProtractor = spawn('bin/protractor',
54-
['spec/attachSession.js', '--seleniumSessionId=' + sessionId]);
53+
var runProtractor = spawn('node',
54+
['bin/protractor', 'spec/attachSession.js', '--seleniumSessionId=' + sessionId]);
5555
console.log(runProtractor.stdout.toString());
5656
if (runProtractor.status !== 0) {
5757
throw new Error('Protractor did not run properly.');

Diff for: scripts/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var passingTests = [
3636
'node scripts/interactive_tests/interactive_test.js',
3737
'node scripts/interactive_tests/with_base_url.js',
3838
// Unit tests
39-
'node node_modules/.bin/jasmine JASMINE_CONFIG_PATH=scripts/unit_test.json',
39+
'node node_modules/jasmine/bin/jasmine.js JASMINE_CONFIG_PATH=scripts/unit_test.json',
4040
];
4141

4242
var executor = new Executor();

Diff for: spec/angular2Conf.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var env = require('./environment.js');
1+
var env = require('./environment');
22

33
// This is the configuration for a smoke test for an Angular2 application.
44
//
@@ -21,7 +21,7 @@ exports.config = {
2121

2222
capabilities: env.capabilities,
2323

24-
baseUrl: 'http://localhost:8081',
24+
baseUrl: env.baseUrl,
2525

2626
// Special option for Angular2, to test against all Angular2 applications
2727
// on the page. This means that Protractor will wait for every app to be

Diff for: spec/attachSession.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var env = require('./environment.js');
1+
var env = require('./environment');
22

33
exports.config = {
44
seleniumAddress: env.seleniumAddress,
@@ -11,7 +11,7 @@ exports.config = {
1111

1212
capabilities: env.capabilities,
1313

14-
baseUrl: 'http://localhost:8081',
14+
baseUrl: env.baseUrl,
1515

1616
// Special option for Angular2, to test against all Angular2 applications
1717
// on the page. This means that Protractor will wait for every app to be

Diff for: spec/driverprovider_test.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
var argv = require('optimist').argv;
1515
var q = require('q');
16+
var env = require('./environment');
1617

1718
var testDriverProvider = function(driverProvider) {
1819
return driverProvider.setupEnv().then(function() {
@@ -64,7 +65,7 @@ testDriverProvider(require('../lib/driverProviders/direct')(firefoxConfig)).
6465
});
6566

6667
var hostedConfig = {
67-
seleniumAddress: 'http://localhost:4444/wd/hub',
68+
seleniumAddress: env.seleniumAddress,
6869
capabilities: {
6970
browserName: 'firefox'
7071
}
@@ -77,7 +78,7 @@ testDriverProvider(require('../lib/driverProviders/hosted')(hostedConfig)).
7778
});
7879

7980
var hostedPromisedConfig = {
80-
seleniumAddress: q.when('http://localhost:4444/wd/hub'),
81+
seleniumAddress: q.when(env.seleniumAddress),
8182
capabilities: {
8283
browserName: 'firefox'
8384
}

Diff for: tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"testapp",
1616
"typings/browser",
1717
"typings/browser.d.ts",
18-
"typings/main"
18+
"typings/main",
19+
"website"
1920
]
2021
}

0 commit comments

Comments
 (0)