Ensure that you've setup your developer environment
# clone the repository
git clone https://github.com/azure/autorest
# install node modules
cd autorest
npm install
The AutoRest build system has standardized on gulp
for the following reasons:
- it works very well cross-platform
- excellent support for parallelism
- using
IcedCoffeeScript
+ShellJS
keeps the scripts very readable.
The main gulpfile
is the file in the root of the folder called gulpfile.iced
. You'll also find support modules for that in the ./src/gulp_modules
folder (see the .iced
files there)
You can get a quick list of the available gulp commands by running gulp
without arguments:
# list what gulp commands are available
gulp
If you pull new code, and the package.json
file has been updated, you will see a warning when you call gulp
:
[13:50:53] Requiring external module iced-coffee-script/register
WARNING: package.json is newer than 'node_modules' - you might want to do an 'npm install'
[13:50:54] Using gulpfile C:\work\github\autorest\gulpfile.iced
gulp
is smart enough to find it's gulpfile.iced
regardless where you are in the project hierarchy:
cd ./src/core/autorest
gulp clean
[13:55:16] Requiring external module iced-coffee-script/register
[13:55:16] Working directory changed to C:\work\github\autorest
[13:55:17] Using gulpfile C:\work\github\autorest\gulpfile.iced
[13:55:17] Starting 'clean/typescript'...
[13:55:18] Finished 'clean/typescript' after 813 ms
[13:55:21] Starting 'clean'...
[13:55:21] Finished 'clean' after 19 μs
gulp build
- compiles the typescript projects.
gulp clean
- cleans the build artifacts
gulp code
- launches vscode
gulp fix-line-endings
- ensures that .ts files are LF not CRLF. Will be expanded in the future.
gulp npm-install
- restores packages for the typescript projects
Build autorest and install it in the user's home folder (~/.autorest/plugins/autorest/<VERSION>-<DATE>-<TIME>-private
) as a private build so you can run it with the autorest
command anywhere.
gulp install
- build and install the dev version of autorest
gulp autorest
- runs AutoRest binary directly. You can pass regular command line parameters to it. Note: gulp
may interpret arguments coming after autorest
as further gulp
tasks. To prevent this, pass --foo
or similar as a first argument to gulp autorest
.
gulp regenerate
- regenerate all expected code for tests
gulp test
- runs all tests
--force
specify when you want to force an action (update dependencies, etc)
--verbose
enable verbose output
--threshold=nn
set parallelism threshold - default = (# of cpus in system-1)