diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/content/misc/contribute.ngdoc | 40 | ||||
| -rwxr-xr-x | docs/src/gen-docs.js | 12 | ||||
| -rw-r--r-- | docs/src/ngdoc.js | 2 | ||||
| -rw-r--r-- | docs/src/reader.js | 5 | ||||
| -rw-r--r-- | docs/src/templates/.htaccess | 2 | ||||
| -rw-r--r-- | docs/src/writer.js | 9 |
6 files changed, 37 insertions, 33 deletions
diff --git a/docs/content/misc/contribute.ngdoc b/docs/content/misc/contribute.ngdoc index 9f9123b4..59c3acdf 100644 --- a/docs/content/misc/contribute.ngdoc +++ b/docs/content/misc/contribute.ngdoc @@ -81,15 +81,11 @@ Several steps are needed to check out and build AngularJS: Before you can build AngularJS, you must install or configure the following dependencies on your machine: -* {@link http://rake.rubyforge.org Rake}: We use Rake as our build system, which is pre-installed -on most Macintosh and Linux machines. If that is not true in your case, you can grab it from the -Rake website. - * Git: The {@link http://help.github.com/mac-git-installation Github Guide to Installing Git} is quite a good source for information on Git. -* {@link http://nodejs.org Node.js}: We use Node to generate the documentation and to run a -development web server. Depending on your system, you can install Node either from source or as a +* {@link http://nodejs.org Node.js}: We use Node to generate the documentation, run a +development web server, run tests, and generate a build. Depending on your system, you can install Node either from source or as a pre-packaged bundle. Once installed, you'll also need several npms (node packages), which you can install once you checked out a local copy @@ -98,6 +94,10 @@ pre-packaged bundle. * `cd angular.js` * `npm install` +* {@link http://gruntjs.com Grunt}: We use Grunt as our build system. Install the grunt command-line tool globally with: + + * `sudo npm install -g grunt-cli` + ## Creating a Github Account and Forking Angular @@ -108,7 +108,7 @@ https://github.com/angular/angular.js main angular repository}. ## Building AngularJS -To build AngularJS, you check out the source code and use Rake to generate the non-minified and +To build AngularJS, you check out the source code and use Grunt to generate the non-minified and minified AngularJS files: 1. To clone your Github repository, run: @@ -129,7 +129,7 @@ minified AngularJS files: 5. To build AngularJS, run: - rake package + grunt package The build output can be located under the `build` directory. It consists of the following files and directories: @@ -158,7 +158,7 @@ made available a local web server based on Node.js. 1. To start the web server, run: - rake webserver + grunt webserver 2. To access the local server, go to this website: @@ -173,18 +173,20 @@ made available a local web server based on Node.js. Our unit and integration tests are written with Jasmine and executed with Testacular. To run all of the tests once on Chrome run: - rake test:unit + grunt test:unit To run the tests on other browsers (Chrome, ChromeCanary, Firefox, Opera and Safari are pre-configured) use: - rake test:unit[Opera+Firefox] + grunt test:unit --browsers Opera,Firefox + +Note there should be _no spaces between browsers_. `Opera, Firefox` is INVALID. During development it's however more productive to continuously run unit tests every time the source or test files change. To execute tests in this mode run: 1. To start the Testacular server, capture Chrome browser and run unit tests, run: - rake autotest:jqlite + grunt autotest:jqlite 2. To capture more browsers, open this url in the desired browser (url might be different if you have multiple instance of Testacular running, read Testacular's console output for the correct url): @@ -194,9 +196,9 @@ change. To execute tests in this mode run: 3. To re-run tests just change any source or test file. -To learn more about all of the preconfigured Rake tasks run: +To learn more about all of the preconfigured Grunt tasks run: - rake -T + grunt --help ## Running the end-to-end Test Suite @@ -205,7 +207,7 @@ To run the E2E test suite: 1. Start the local web server if it's not running already. - rake webserver + grunt webserver 2. In a browser, go to: @@ -213,7 +215,13 @@ To run the E2E test suite: or in terminal run: - rake test:e2e + grunt test:end2end + +For convenience you can also simply run: + + grunt test:e2e + +This will start the webserver for you and run the tests. diff --git a/docs/src/gen-docs.js b/docs/src/gen-docs.js index 62d22b17..992c4527 100755 --- a/docs/src/gen-docs.js +++ b/docs/src/gen-docs.js @@ -5,10 +5,6 @@ var reader = require('./reader.js'), appCache = require('./appCache.js').appCache, Q = require('qq'); -process.on('uncaughtException', function(err) { - console.error(err.stack || err); -}); - var start = now(); var docs; @@ -42,10 +38,10 @@ writer.makeDir('build/docs/', true).then(function() { function writeTheRest(writesFuture) { var metadata = ngdoc.metadata(docs); - writesFuture.push(writer.symlinkTemplate('css')); - writesFuture.push(writer.symlinkTemplate('font')); - writesFuture.push(writer.symlink('../../docs/img', 'build/docs/img')); - writesFuture.push(writer.symlinkTemplate('js')); + writesFuture.push(writer.symlinkTemplate('css', 'dir')); + writesFuture.push(writer.symlinkTemplate('font', 'dir')); + writesFuture.push(writer.symlink('../../docs/img', 'build/docs/img', 'dir')); + writesFuture.push(writer.symlinkTemplate('js', 'dir')); var manifest = 'manifest="/build/docs/appcache.manifest"'; diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 253f5411..37e90a15 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -203,7 +203,7 @@ Doc.prototype = { flush(); this.shortName = this.name.split(/[\.:#]/).pop().trim(); this.id = this.id || // if we have an id just use it - (((this.file||'').match(/.*\/([^\/]*)\.ngdoc/)||{})[1]) || // try to extract it from file name + (((this.file||'').match(/.*(\/|\\)([^(\/|\\)]*)\.ngdoc/)||{})[2]) || // try to extract it from file name this.name; // default to name this.description = this.markdown(this.description); this.example = this.markdown(this.example); diff --git a/docs/src/reader.js b/docs/src/reader.js index ded573c1..a021c05f 100644 --- a/docs/src/reader.js +++ b/docs/src/reader.js @@ -7,7 +7,8 @@ exports.collect = collect; var ngdoc = require('./ngdoc.js'), Q = require('qq'), - qfs = require('q-fs'); + qfs = require('q-fs'), + PATH = require('path'); var NEW_LINE = /\n\r?/; @@ -43,7 +44,7 @@ function collect() { var work2; if (file.match(/\.ngdoc$/)) { work2 = Q.when(qfs.read(file, 'b'), function(content){ - var section = '@section ' + file.split('/')[2] + '\n'; + var section = '@section ' + file.split(PATH.sep)[2] + '\n'; allDocs.push(new ngdoc.Doc(section + content.toString(),file, 1).parse()); }); } diff --git a/docs/src/templates/.htaccess b/docs/src/templates/.htaccess index 98c7b795..e5a74cc4 100644 --- a/docs/src/templates/.htaccess +++ b/docs/src/templates/.htaccess @@ -4,7 +4,7 @@ # current angular version. If this rule matches the appcache-offline.manifest will be served for # requests to appcache.manifest # -# This file must be processed by Rake in order to replace %ANGULAR_VERSION% with the actual version. +# This file must be processed by Grunt in order to replace %ANGULAR_VERSION% with the actual version. Options -Indexes RewriteEngine on diff --git a/docs/src/writer.js b/docs/src/writer.js index 450f7cb5..b6403e34 100644 --- a/docs/src/writer.js +++ b/docs/src/writer.js @@ -61,22 +61,21 @@ exports.copy = function(from, to, transform) { exports.symlink = symlink; -function symlink(from, to) { +function symlink(from, to, type) { return qfs.exists(to).then(function(exists) { if (!exists) { - return qfs.symbolicLink(to, from); + return qfs.symbolicLink(to, from, type); } }); } exports.symlinkTemplate = symlinkTemplate; -function symlinkTemplate(filename) { +function symlinkTemplate(filename, type) { var dest = OUTPUT_DIR + filename, dirDepth = dest.split('/').length, src = Array(dirDepth).join('../') + 'docs/src/templates/' + filename; - - return symlink(src, dest); + return symlink(src, dest, type); } |
