lib/builder/builder.js
function composeTaskList({dev, selfContained, jsdoc, includedTasks, excludedTasks}) {
	let selectedTasks = Object.keys(definedTasks).reduce((list, key) => {
		list[key] = true;
		return list;
	}, {});

	// Exclude non default tasks
	selectedTasks.generateManifestBundle = false;
	selectedTasks.generateStandaloneAppBundle = false;
	selectedTasks.transformBootstrapHtml = false;
	selectedTasks.generateJsdoc = false;
	selectedTasks.executeJsdocSdkTransformation = false;
	selectedTasks.generateCachebusterInfo = false;
	selectedTasks.generateApiIndex = false;

	if (selfContained) {
		// No preloads, bundle only
		selectedTasks.generateComponentPreload = false;
		selectedTasks.generateStandaloneAppBundle = true;
		selectedTasks.transformBootstrapHtml = true;
		selectedTasks.generateLibraryPreload = false;
	}

	if (jsdoc) {
		// Include JSDoc tasks
		selectedTasks.generateJsdoc = true;
		selectedTasks.executeJsdocSdkTransformation = true;
		selectedTasks.generateApiIndex = true;

		// Include theme build as required for SDK
		selectedTasks.buildThemes = true;

		// Exclude all tasks not relevant to JSDoc generation
		selectedTasks.replaceCopyright = false;
		selectedTasks.replaceVersion = false;
		selectedTasks.generateComponentPreload = false;
		selectedTasks.generateLibraryPreload = false;
		selectedTasks.generateLibraryManifest = false;
		selectedTasks.createDebugFiles = false;
		selectedTasks.uglify = false;
		selectedTasks.generateFlexChangesBundle = false;
		selectedTasks.generateManifestBundle = false;
	}

	// Only run essential tasks in development mode, it is not desired to run time consuming tasks during development.
	if (dev) {
		// Overwrite all other tasks with noop promise
		Object.keys(selectedTasks).forEach((key) => {
			if (devTasks.indexOf(key) === -1) {
				selectedTasks[key] = false;
			}
		});
	}

	// Exclude tasks
	for (let i = 0; i < excludedTasks.length; i++) {
		const taskName = excludedTasks[i];
		if (taskName === "*") {
			Object.keys(selectedTasks).forEach((sKey) => {
				selectedTasks[sKey] = false;
			});
			break;
		}
		if (selectedTasks[taskName] !== false) {
			selectedTasks[taskName] = false;
		}
	}

	// Include tasks
	for (let i = 0; i < includedTasks.length; i++) {
		const taskName = includedTasks[i];
		if (taskName === "*") {
			Object.keys(selectedTasks).forEach((sKey) => {
				selectedTasks[sKey] = true;
			});
			break;
		}
		if (selectedTasks[taskName] === false) {
			selectedTasks[taskName] = true;
		}
	}

	// Filter only for tasks that will be executed
	selectedTasks = Object.keys(selectedTasks).filter((task) => selectedTasks[task]);

	return selectedTasks;
}
function composeTaskList({dev, selfContained, jsdoc, includedTasks, excludedTasks}) {
	let selectedTasks = Object.keys(definedTasks).reduce((list, key) => {
		list[key] = true;
		return list;
	}, {});

	// Exclude non default tasks
	selectedTasks.generateManifestBundle = false;
	selectedTasks.generateStandaloneAppBundle = false;
	selectedTasks.transformBootstrapHtml = false;
	selectedTasks.generateJsdoc = false;
	selectedTasks.executeJsdocSdkTransformation = false;
	selectedTasks.generateCachebusterInfo = false;
	selectedTasks.generateApiIndex = false;

	if (selfContained) {
		// No preloads, bundle only
		selectedTasks.generateComponentPreload = false;
		selectedTasks.generateStandaloneAppBundle = true;
		selectedTasks.transformBootstrapHtml = true;
		selectedTasks.generateLibraryPreload = false;
	}

	if (jsdoc) {
		// Include JSDoc tasks
		selectedTasks.generateJsdoc = true;
		selectedTasks.executeJsdocSdkTransformation = true;
		selectedTasks.generateApiIndex = true;

		// Include theme build as required for SDK
		selectedTasks.buildThemes = true;

		// Exclude all tasks not relevant to JSDoc generation
		selectedTasks.replaceCopyright = false;
		selectedTasks.replaceVersion = false;
		selectedTasks.generateComponentPreload = false;
		selectedTasks.generateLibraryPreload = false;
		selectedTasks.generateLibraryManifest = false;
		selectedTasks.createDebugFiles = false;
		selectedTasks.uglify = false;
		selectedTasks.generateFlexChangesBundle = false;
		selectedTasks.generateManifestBundle = false;
	}

	// Only run essential tasks in development mode, it is not desired to run time consuming tasks during development.
	if (dev) {
		// Overwrite all other tasks with noop promise
		Object.keys(selectedTasks).forEach((key) => {
			if (devTasks.indexOf(key) === -1) {
				selectedTasks[key] = false;
			}
		});
	}

	// Exclude tasks
	for (let i = 0; i < excludedTasks.length; i++) {
		const taskName = excludedTasks[i];
		if (taskName === "*") {
			Object.keys(selectedTasks).forEach((sKey) => {
				selectedTasks[sKey] = false;
			});
			break;
		}
		if (selectedTasks[taskName] !== false) {
			selectedTasks[taskName] = false;
		}
	}

	// Include tasks
	for (let i = 0; i < includedTasks.length; i++) {
		const taskName = includedTasks[i];
		if (taskName === "*") {
			Object.keys(selectedTasks).forEach((sKey) => {
				selectedTasks[sKey] = true;
			});
			break;
		}
		if (selectedTasks[taskName] === false) {
			selectedTasks[taskName] = true;
		}
	}

	// Filter only for tasks that will be executed
	selectedTasks = Object.keys(selectedTasks).filter((task) => selectedTasks[task]);

	return selectedTasks;
}
function composeTaskList ( { dev , selfContained , jsdoc , includedTasks , excludedTasks } ) { let selectedTasks = Object . keys ( definedTasks ) . reduce ( ( list , key ) => { list [ key ] = true ; return list ; } , { } ) ; // Exclude non default tasks selectedTasks . generateManifestBundle = false ; selectedTasks . generateStandaloneAppBundle = false ; selectedTasks . transformBootstrapHtml = false ; selectedTasks . generateJsdoc = false ; selectedTasks . executeJsdocSdkTransformation = false ; selectedTasks . generateCachebusterInfo = false ; selectedTasks . generateApiIndex = false ; if ( selfContained ) { // No preloads, bundle only selectedTasks . generateComponentPreload = false ; selectedTasks . generateStandaloneAppBundle = true ; selectedTasks . transformBootstrapHtml = true ; selectedTasks . generateLibraryPreload = false ; } if ( jsdoc ) { // Include JSDoc tasks selectedTasks . generateJsdoc = true ; selectedTasks . executeJsdocSdkTransformation = true ; selectedTasks . generateApiIndex = true ; // Include theme build as required for SDK selectedTasks . buildThemes = true ; // Exclude all tasks not relevant to JSDoc generation selectedTasks . replaceCopyright = false ; selectedTasks . replaceVersion = false ; selectedTasks . generateComponentPreload = false ; selectedTasks . generateLibraryPreload = false ; selectedTasks . generateLibraryManifest = false ; selectedTasks . createDebugFiles = false ; selectedTasks . uglify = false ; selectedTasks . generateFlexChangesBundle = false ; selectedTasks . generateManifestBundle = false ; } // Only run essential tasks in development mode, it is not desired to run time consuming tasks during development. if ( dev ) { // Overwrite all other tasks with noop promise Object . keys ( selectedTasks ) . forEach ( ( key ) => { if ( devTasks . indexOf ( key ) === - 1 ) { selectedTasks [ key ] = false ; } } ) ; } // Exclude tasks for ( let i = 0 ; i < excludedTasks . length ; i ++ ) { const taskName = excludedTasks [ i ] ; if ( taskName === "*" ) { Object . keys ( selectedTasks ) . forEach ( ( sKey ) => { selectedTasks [ sKey ] = false ; } ) ; break ; } if ( selectedTasks [ taskName ] !== false ) { selectedTasks [ taskName ] = false ; } } // Include tasks for ( let i = 0 ; i < includedTasks . length ; i ++ ) { const taskName = includedTasks [ i ] ; if ( taskName === "*" ) { Object . keys ( selectedTasks ) . forEach ( ( sKey ) => { selectedTasks [ sKey ] = true ; } ) ; break ; } if ( selectedTasks [ taskName ] === false ) { selectedTasks [ taskName ] = true ; } } // Filter only for tasks that will be executed selectedTasks = Object . keys ( selectedTasks ) . filter ( ( task ) => selectedTasks [ task ] ) ; return selectedTasks ; }
Creates the list of tasks to be executed by the build process

Sets specific tasks to be disabled by default, these tasks need to be included explicitly.
Based on the selected build mode (dev|selfContained|preload), different tasks are enabled.
Tasks can be enabled or disabled. The wildcard <code>*</code> is also supported and affects all tasks.

@private
@param {Object} parameters
@param {boolean} parameters.dev Sets development mode, which only runs essential tasks
@param {boolean} parameters.selfContained True if a the build should be self-contained or false for prelead build bundles
@param {boolean} parameters.jsdoc True if a JSDoc build should be executed
@param {Array} parameters.includedTasks Task list to be included from build
@param {Array} parameters.excludedTasks Task list to be excluded from build
@returns {Array} Return a task list for the builder
Creates the list of tasks to be executed by the build process