Skip to content

Latest commit

 

History

History
77 lines (55 loc) · 3.98 KB

File metadata and controls

77 lines (55 loc) · 3.98 KB

Grunt tasks

The following Grunt tasks are available after setting up the legacy Grunt development environment.

Please consider using the new UI5 CLI based setup. See the developing OpenUI5 guide for details.

serve

Argument Description Default
mode src uses source files, target uses built files (see build task) src
port Network port to use 8080
hostname Network hostname to use (e.g. 127.0.0.1 for local access only) *

Runs an HTTP server.

Maps folders of all libraries

  • src -> /resources
  • test -> /test-resources
grunt serve[:<mode>] [--port=<port>] [--hostname=<hostname>]

# examples
#  grunt serve --port=3000                       # mode=src, port=3000, hostname=*
#  grunt serve --port=3000 --hostname=127.0.0.1  # mode=src, port=3000, hostname=127.0.0.1
#  grunt serve:src                               # mode=src, port=8080, hostname=*
#  grunt serve:target --port=80                  # mode=target, port=80, hostname=*

build

Argument Description Default
libs Library name(s) to build (comma-separated) All libraries
production boolean whether to do a production build (sets default values of minify-css and include-test-resources) false
minify-css boolean whether to minify css files true in production mode, false in non-production mode
include-test-resources boolean whether to include test-resources false in production mode, true in non-production mode

Minifies / compiles / optimizes source files and puts them into target/openui5.

Use serve:target to start a server with the built files (see serve task).

grunt build [--libs=<library-1>,<library-n>] [--production] [--minify-css] [--include-test-resources]

# examples
#  grunt build --production               # build all libraries in production mode (minfied css, no test-resources)
#  grunt build --minify-css               # build all libraries with minified css (but with test-resources)
#  grunt build --libs=sap.ui.core,sap.m   # only build sap.ui.core and sap.m in non-production mode (non-minified css, with test-resources)

docs

Argument Description Default
libs Library name(s) to build documentation for (comma-separated) All libraries
default-template boolean whether to use the JSDoc default template instead of the UI5 template false

Creates documentation from the source files that can be displayed in the SDK. If option default-template is set, HTML output will be generated instead of the api.json files.

grunt docs [--libs=<library-1>,<library-n>]

# examples
#  grunt docs                            # build documentation preview for all libraries
#  grunt docs --libs=sap.ui.core,sap.m   # only build documentation preview for sap.ui.core and sap.m
#  grunt docs --default-template         # produce HTML output using the default JSDoc template

grunt serve

open http://localhost:8080/testsuite/documentation.html#/api