Skip to content

Commit

Permalink
Merge pull request #10583 from CesiumGS/scripts
Browse files Browse the repository at this point in the history
Pare down build scripts; naming consistancy
  • Loading branch information
sanjeetsuhag authored Jul 22, 2022
2 parents e8d8b99 + 45531ec commit 47f82fc
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ script:

- npm --silent run coverage -- --browsers FirefoxHeadless --webgl-stub --failTaskOnError --suppressPassed

- travis_wait 20 npm --silent run makeZipFile -- --concurrency 1
- travis_wait 20 npm --silent run make-zip -- --concurrency 1
- npm pack &> /dev/null

- npm --silent run buildApps
- npm --silent run build-apps

- npm --silent run deploy-s3 -- -b cesium-dev -d cesium/$TRAVIS_BRANCH --confirm -c 'no-cache'
- npm --silent run deploy-status -- --status success --message Deployed
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/CesiumSandcastle.js
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ require({
if (docError) {
appendConsole(
"consoleError",
'Documentation not available. Please run the "generateDocumentation" build script to generate Cesium documentation.',
'Documentation not available. Please run the "build-docs" build script to generate Cesium documentation.',
true
);
showGallery();
Expand Down
9 changes: 3 additions & 6 deletions Documentation/Contributors/BuildGuide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,12 @@ Here's the full set of scripts and what they do.
- `--removePragmas` - Optimizes the output by removing debugging code that validates function input and throws `DeveloperError`s. The removed sections are marked with `//>>includeStart('debug', pragmas.debug);` blocks in the code.
- `--node` - Bundles an `index.cjs` module targeted for use in NodeJS
- `build-watch` - A never-ending task that watches your file system for changes to Cesium and builds the source code as needed. All `build` options are also available for this task.
- `minify` - Bundles the source modules and [minifies](<http://en.wikipedia.org/wiki/Minification_(programming)>) to produce an all-in-one files in the `Build/Cesium` directory.
- `combineRelease` - Bundles plus removes debugging code that validates function input and throws DeveloperErrors. The removed sections are marked with `//>>includeStart('debug', pragmas.debug);` blocks in the code.
- `minifyRelease` - Bundles, minifies, and removes debugging code.
- `buildApps` - Builds the example applications (such as Cesium Viewer) to produce self-contained, minified, deployable versions in the `Build` directory.
- `generateDocumentation` - Generates HTML documentation in `Build/Documentation` using [JSDoc 3](https://github.com/jsdoc3/jsdoc). See the [Documentation Guide](../DocumentationGuide/README.md) for more details.
- `build-apps` - Builds the example applications (such as Cesium Viewer) to produce self-contained, minified, deployable versions in the `Build` directory.
- `build-docs` - Generates HTML documentation in `Build/Documentation` using [JSDoc 3](https://github.com/jsdoc3/jsdoc). See the [Documentation Guide](../DocumentationGuide/README.md) for more details.
- `build-ts` - Generates a TypeScript definitions file for the Cesium library
- `build-third-party` - Generates `ThirdParty.json`, a file which lists the latest licensing information of installed third party modules
- `release` - A full release build that creates a shippable product, including generating documentation.
- `makeZipFile` - Builds a zip file containing all release files. This includes the source ESM modules, bundled ESM and IIFE format `Cesium.js`, plus the bundled minified versions of ESM and IIFE, the generated documentation, the test suite, and the example applications (in both built and source form).
- `make-zip` - Builds a zip file containing all release files. This includes the source ESM modules, bundled ESM and IIFE format `Cesium.js`, plus the bundled minified versions of ESM and IIFE, the generated documentation, the test suite, and the example applications (in both built and source form).
- **Utility scripts** -- code coverage, static code analysis, and other utilities
- `clean` - Removes all generated build artifacts
- `cloc` - Runs [CLOC](https://github.com/AlDanial/cloc) to count the lines of code on the Source and Specs directories. This requires [Perl](http://www.perl.org/) to execute.
Expand Down
6 changes: 3 additions & 3 deletions Documentation/Contributors/DocumentationGuide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ Generally, just follow the patterns that are already in comparable parts of the
The reference doc is written in JavaScript code comments using [JSDoc3](http://usejsdoc.org/index.html) tags. At the command line, build the doc from the root CesiumJS directory by running the following:

```bash
npm run generateDocumentation
npm run build-docs
```

This creates a `Build/Documentation` directory with the built HTML files.

> Alternatively, you can build documentation in watch mode `npm run generateDocumentation-watch` and have it generated automatically when source files change.
> Alternatively, you can build documentation in watch mode `npm run build-docs-watch` and have it generated automatically when source files change.
There is a link to the doc from CesiumJS's main `index.html` when running

Expand Down Expand Up @@ -445,7 +445,7 @@ function appendForwardSlash(url) {
Documentation for private elements can be generated by running the following:
```bash
npm run generateDocumentation -- --private
npm run build-docs -- --private
```
## Layout Reference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ When running the test, there are a few additional considerations:
npm run release

# build Sandcastle and other apps
npm run buildApps
npm run build-apps
```

2. (optional) Unless the Network tab is needed (e.g. for throttling), consider
Expand Down
21 changes: 10 additions & 11 deletions gulpfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ const travisDeployUrl =
//Gulp doesn't seem to have a way to get the currently running tasks for setting
//per-task variables. We use the command line argument here to detect which task is being run.
const taskName = process.argv[2];
const noDevelopmentGallery =
taskName === "release" || taskName === "makeZipFile";
const noDevelopmentGallery = taskName === "release" || taskName === "make-zip";
const verbose = yargs.argv.verbose;

let concurrency = yargs.argv.concurrency;
Expand Down Expand Up @@ -308,7 +307,7 @@ gulp.task("build-ts", function () {
return Promise.resolve();
});

gulp.task("buildApps", function () {
gulp.task("build-apps", function () {
return Promise.join(buildCesiumViewer(), buildSandcastle());
});

Expand Down Expand Up @@ -433,12 +432,12 @@ function generateDocumentation() {

return streamToPromise(stream);
}
gulp.task("generateDocumentation", generateDocumentation);
gulp.task("build-docs", generateDocumentation);

gulp.task("generateDocumentation-watch", function () {
gulp.task("build-docs-watch", function () {
return generateDocumentation().then(function () {
console.log("Listening for changes in documentation...");
return gulp.watch(sourceFiles, gulp.series("generateDocumentation"));
return gulp.watch(sourceFiles, gulp.series("build-docs"));
});
});

Expand All @@ -465,7 +464,7 @@ gulp.task(
);

gulp.task(
"makeZipFile",
"make-zip",
gulp.series("release", function () {
//For now we regenerate the JS glsl to force it to be unminified in the release zip
//See https://github.com/CesiumGS/cesium/pull/3106#discussion_r42793558 for discussion.
Expand All @@ -479,12 +478,12 @@ gulp.task(
delete packageJson.scripts["build-watch"];
delete packageJson.scripts["build-ts"];
delete packageJson.scripts["build-third-party"];
delete packageJson.scripts["buildApps"];
delete packageJson.scripts["build-apps"];
delete packageJson.scripts.clean;
delete packageJson.scripts.cloc;
delete packageJson.scripts["generateDocumentation"];
delete packageJson.scripts["generateDocumentation-watch"];
delete packageJson.scripts["makeZipFile"];
delete packageJson.scripts["build-docs"];
delete packageJson.scripts["build-docs-watch"];
delete packageJson.scripts["make-zip"];
delete packageJson.scripts.release;
delete packageJson.scripts.prettier;

Expand Down
13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,22 +123,19 @@
"scripts": {
"prepare": "gulp prepare && husky install",
"start": "node server.cjs",
"startPublic": "node server.cjs --public",
"start-public": "node server.cjs --public",
"build": "gulp build",
"minify": "gulp build --minify",
"minifyRelease": "gulp build --minify --removePragmas",
"combineRelease": "gulp build --removePragmas",
"build-watch": "gulp build-watch",
"build-ts": "gulp build-ts",
"build-third-party": "gulp build-third-party",
"buildApps": "gulp buildApps",
"build-apps": "gulp build-apps",
"clean": "gulp clean",
"cloc": "gulp cloc",
"coverage": "gulp coverage",
"generateDocumentation": "gulp generateDocumentation",
"generateDocumentation-watch": "gulp generateDocumentation-watch",
"build-docs": "gulp build-docs",
"build-docs-watch": "gulp build-docs-watch",
"eslint": "eslint \"./**/*.js\" \"./**/*.cjs\" \"./**/*.html\" --cache --quiet",
"makeZipFile": "gulp makeZipFile",
"make-zip": "gulp make-zip",
"markdownlint": "markdownlint \"*.md\" \"Documentation/**/*.md\" --ignore CHANGES.md --ignore README.md --ignore LICENSE.md",
"release": "gulp release",
"test": "gulp test",
Expand Down

0 comments on commit 47f82fc

Please sign in to comment.