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

feat(typescript): adding typescript to protractor #2902

Merged
merged 1 commit into from
Feb 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Language: JavaScript
BasedOnStyle: Google
ColumnLimit: 80
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ built/
node_modules/
selenium/
testapp/inbrowsertest/
typings/
website/bower_components/
website/build/
website/docgen/build/
Expand Down
63 changes: 38 additions & 25 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,52 @@
'use strict';

var gulp = require('gulp');
var clangFormat = require('clang-format');
var gulpFormat = require('gulp-clang-format');
var runSequence = require('run-sequence');
var spawnSync = require('child_process').spawnSync;
var spawn = require('child_process').spawn;

var runSpawn = function(done, task, opt_arg) {
var child = spawn(task, opt_arg, {stdio: 'inherit'});
child.on('close', function() {
done();
});
};

gulp.task('built:copy', function() {
var srcFiles = ['lib/**/*'];
var dist = 'built/';
return gulp.src(srcFiles).pipe(gulp.dest(dist));
return gulp.src(['lib/**/*','!lib/**/*.ts'])
.pipe(gulp.dest('built/'));
});

gulp.task('webdriver:update', function(done) {
runSpawn(done, 'bin/webdriver-manager', ['update']);
});

gulp.task('jslint', function(done) {
runSpawn(done, './node_modules/.bin/jshint', ['lib','spec', 'scripts']);
});

gulp.task('clang', function() {
return gulp.src(['lib/**/*.ts'])
.pipe(gulpFormat.checkFormat('file', clangFormat))
.on('warning', function(e) {
console.log(e);
});
});

gulp.task('typings', function(done) {
runSpawn(done, 'node_modules/.bin/typings', ['install']);
});

gulp.task('webdriver:update', function() {
var child = spawnSync('bin/webdriver-manager', ['update']);
if (child.stdout != null) {
console.log(child.stdout.toString());
}
if (child.status !== 0) {
throw new Error('webdriver-manager update: child error');
}
gulp.task('tsc', function(done) {
runSpawn(done, 'node_modules/typescript/bin/tsc');
});

gulp.task('jslint', function() {
var child = spawnSync('./node_modules/.bin/jshint', ['lib','spec', 'scripts']);
if (child != null && child.stdout != null ) {
console.log(child.stdout.toString());
}
if (child.status !== 0) {
throw new Error('jslint: child error');
}
gulp.task('prepublish', function(done) {
runSequence(['typings', 'jslint', 'clang'],'tsc', 'built:copy', done);
});

gulp.task('pretest', function() {
gulp.task('pretest', function(done) {
runSequence(
['webdriver:update', 'jslint'],
'built:copy'
);
['webdriver:update', 'typings', 'jslint', 'clang'], 'tsc', 'built:copy', done);
});
gulp.task('prepublish', ['built:copy']);
232 changes: 0 additions & 232 deletions lib/configParser.js

This file was deleted.

Loading