Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 23 additions & 22 deletions internal/documentation/docs/pages/Builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,32 @@ A project can add custom tasks to the build by using the [Custom Tasks Extensibi

### Standard Tasks

All available standard tasks are documented [in the API reference](https://ui5.github.io/cli/v5/api/index.html). Search for `@ui5/builder/tasks/` to filter the API reference for all available tasks. The list below offers the actual order of their execution:
All available standard tasks are documented in the **@ui5/builder API reference**. Use the sidebar menu to access the respective pages. The list below offers the actual order of their execution:

[TODO: Cleanup formatting]: #
| Task | Type `application` | Type `component` | Type `library` | Type `theme-library` |
|--------------------------------|:-----------------------:|:-----------------------:|:-----------------------:|:-----------------------:|
| escapeNonAsciiCharacters | enabled | enabled | enabled | |
| replaceCopyright | enabled | enabled | enabled | enabled |
| replaceVersion | enabled | enabled | enabled | enabled |
| replaceBuildtime | | | enabled | |
| generateJsdoc | | | *disabled* <sup>1</sup> | |
| executeJsdocSdkTransformation | | | *disabled* <sup>1</sup> | |
| minify | enabled | enabled | enabled | |
| generateFlexChangesBundle | enabled | enabled | enabled | |
| generateLibraryManifest | | | enabled | |
| enhanceManifest | enabled | enabled | enabled | |
| generateComponentPreload | enabled | enabled | *disabled* <sup>2</sup> | |
| generateLibraryPreload | | | enabled | |
| generateStandaloneAppBundle | *disabled* <sup>3</sup> | | | |
| transformBootstrapHtml | *disabled* <sup>3</sup> | | | |
| generateBundle | *disabled* <sup>4</sup> | *disabled* <sup>4</sup> | *disabled* <sup>4</sup> | |
| buildThemes | | | enabled | enabled |
| generateThemeDesignerResources | | | *disabled* <sup>5</sup> | *disabled* <sup>5</sup> |
| generateVersionInfo | *disabled* <sup>1</sup> | | | |
| generateCachebusterInfo | *disabled* | *disabled* | | |
| generateApiIndex | *disabled* <sup>1</sup> | | | |
| generateResourcesJson | *disabled* | *disabled* | *disabled* | *disabled* |
| [escapeNonAsciiCharacters](../api/module-@ui5_builder_tasks_escapeNonAsciiCharacters) | enabled | enabled | enabled | |
| [replaceCopyright](../api/module-@ui5_builder_tasks_replaceCopyright) | enabled | enabled | enabled | enabled |
| [replaceVersion](../api/module-@ui5_builder_tasks_replaceVersion) | enabled | enabled | enabled | enabled |
| [replaceBuildtime](../api/module-@ui5_builder_tasks_replaceBuildtime) | | | enabled | |
| [generateJsdoc](../api/module-@ui5_builder_tasks_jsdoc_generateJsdoc) | | | *disabled* <sup>1</sup> | |
| [executeJsdocSdkTransformation](../api/module-@ui5_builder_tasks_jsdoc_executeJsdocSdkTransformation) | | | *disabled* <sup>1</sup> | |
| [minify](../api/module-@ui5_builder_tasks_minify) | enabled | enabled | enabled | |
| [generateFlexChangesBundle](../api/module-@ui5_builder_tasks_bundlers_generateFlexChangesBundle) | enabled | enabled | enabled | |
| [generateLibraryManifest](../api/module-@ui5_builder_tasks_generateLibraryManifest) | | | enabled | |
| [enhanceManifest](../api/module-@ui5_builder_tasks_enhanceManifest) | enabled | enabled | enabled | |
| [generateComponentPreload](../api/module-@ui5_builder_tasks_bundlers_generateComponentPreload) | enabled | enabled | *disabled* <sup>2</sup> | |
| [generateLibraryPreload](../api/module-@ui5_builder_tasks_bundlers_generateLibraryPreload) | | | enabled | |
| [generateStandaloneAppBundle](../api/module-@ui5_builder_tasks_bundlers_generateStandaloneAppBundle) | *disabled* <sup>3</sup> | | | |
| transformBootstrapHtml TODO: Link missing??? | *disabled* <sup>3</sup> | | | |
| [generateBundle](../api/module-@ui5_builder_tasks_bundlers_generateBundle) | *disabled* <sup>4</sup> | *disabled* <sup>4</sup> | *disabled* <sup>4</sup> | |
| [buildThemes](../api/module-@ui5_builder_tasks_buildThemes) | | | enabled | enabled |
| [generateThemeDesignerResources](../api/module-@ui5_builder_tasks_generateThemeDesignerResources) | | | *disabled* <sup>5</sup> | *disabled* <sup>5</sup> |
| [generateVersionInfo](../api/module-@ui5_builder_tasks_generateVersionInfo) | enabled | *disabled* | *disabled* | *disabled* |
| [generateCachebusterInfo](../api/module-@ui5_builder_tasks_generateCachebusterInfo) | *disabled* | *disabled* | | |
| [generateApiIndex](../api/module-@ui5_builder_tasks_jsdoc_generateApiIndex) | *disabled* <sup>1</sup> | | | |
| [generateResourcesJson](../api/module-@ui5_builder_tasks_generateResourcesJson) | *disabled* | *disabled* | *disabled* | *disabled* |

*Disabled tasks can be activated by certain build modes, the project configuration, or by using the `--include-task` [CLI parameter](./CLI.md#ui5-build). See footnotes where given*

Expand Down
6 changes: 6 additions & 0 deletions internal/documentation/docs/updates/migrate-v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ Update your `ui5.yaml` configuration to reference an existing middleware instead
| `serveThemes` | CSS files pre-built by `buildThemes` task and served via `serveResources` | `serveResources` |
| `testRunner` | TestRunner resources served via `serveResources` from the UI5 framework | `serveResources` |

## `sap-ui-version.json`

When running `ui5 build` for projects of type `application`, the standard task [`generateVersionInfo`](../api/module-@ui5_builder_tasks_generateVersionInfo) (producing a `sap-ui-version.json` file under `resources/`) is now **executed by default**. This applies to every build type (default, jsdoc, and self-contained). For projects of other types (e.g. `library`), the behavior remains the same and [`generateVersionInfo`](../api/module-@ui5_builder_tasks_generateVersionInfo) is not executed.

To see which standard tasks are executed by default, check out the [Standard Tasks](../pages/Builder#standard-tasks) table in the UI5 Builder page.

## Learn More

- [Project: Type `component`](../pages/Project#component)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "application.m",
"version": "1.0.0",
"buildTimestamp": "WILL_BE_IGNORED_BY_TESTS",
"scmRevision": "",
"libraries": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "application.o",
"version": "1.0.0",
"buildTimestamp": "WILL_BE_IGNORED_BY_TESTS",
"scmRevision": "",
"libraries": []
}
18 changes: 12 additions & 6 deletions packages/builder/test/lib/builder/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,20 @@ async function checkFileContentsIgnoreLineFeeds(t, expectedFiles, expectedPath,
currentContent = JSON.parse(currentContent.replace(/(:\s+)(\d+)/g, ": 0"));
expectedContent = JSON.parse(expectedContent.replace(/(:\s+)(\d+)/g, ": 0"));
t.deepEqual(currentContent, expectedContent);
} else {
if (expectedFile.endsWith(".json")) {
try {
t.deepEqual(JSON.parse(currentContent), JSON.parse(expectedContent), expectedFile);
} catch (e) {
t.falsy(e, expectedFile);
} else if (expectedFile.endsWith(".json")) {
try {
const currentJson = JSON.parse(currentContent);
const expectedJson = JSON.parse(expectedContent);
// Check if file is "sap-ui-version.json" and ignore the buildTimestamp property for comparison:
if (expectedFile.endsWith("sap-ui-version.json")) {
delete currentJson.buildTimestamp;
delete expectedJson.buildTimestamp;
}
t.deepEqual(currentJson, expectedJson, expectedFile);
} catch (e) {
t.falsy(e, expectedFile);
}
} else {
t.is(currentContent.replace(newLineRegexp, "\n"),
expectedContent.replace(newLineRegexp, "\n"),
relativeFile);
Expand Down
2 changes: 0 additions & 2 deletions packages/project/lib/build/helpers/composeTaskList.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export default function composeTaskList(allTasks, {selfContained, jsdoc, include
selectedTasks.generateCachebusterInfo = false;
selectedTasks.generateApiIndex = false;
selectedTasks.generateThemeDesignerResources = false;
selectedTasks.generateVersionInfo = false;

// Disable generateResourcesJson due to performance.
// When executed it analyzes each module's AST and therefore
Expand All @@ -45,7 +44,6 @@ export default function composeTaskList(allTasks, {selfContained, jsdoc, include
selectedTasks.generateJsdoc = true;
selectedTasks.executeJsdocSdkTransformation = true;
selectedTasks.generateApiIndex = true;
selectedTasks.generateVersionInfo = true;

// Include theme build as required for SDK
selectedTasks.buildThemes = true;
Expand Down
80 changes: 58 additions & 22 deletions packages/project/test/lib/build/BuildServer.integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ test.serial("Serve application.a, request application resource", async (t) => {
resource: "/test.js",
assertions: {
projects: {
"application.a": {}
"library.d": {},
"library.a": {},
"library.b": {},
"library.c": {},
"application.a": {},
}
}
});
Expand Down Expand Up @@ -193,6 +197,7 @@ test.serial("Serve application.a, request application resource", async (t) => {
"replaceCopyright",
"enhanceManifest",
"generateFlexChangesBundle",
"generateVersionInfo",
]
}
}
Expand All @@ -219,7 +224,11 @@ test.serial("Serve application.a, create and delete a source file", async (t) =>
resource: "/created.js",
assertions: {
projects: {
"application.a": {}
"library.d": {},
"library.a": {},
"library.b": {},
"library.c": {},
"application.a": {},
}
}
});
Expand Down Expand Up @@ -251,6 +260,7 @@ test.serial("Serve application.a, create and delete a source file", async (t) =>
"replaceCopyright",
"enhanceManifest",
"generateFlexChangesBundle",
"generateVersionInfo",
]
}
}
Expand All @@ -272,22 +282,13 @@ test.serial("Serve application.a, create and delete a source file", async (t) =>
}
});

// #5 the second file is no longer served, but requesting it triggers a build of the dependencies
// because the file is not known anymore and might come from a different project.
// Note: This is special for applications, which are served at root level. For libraries, the server
// can determine whether a resources is inside a project namespace and only trigger a build for the affected
// project. The logic could be improved, especially like in this case where the requested resource is outside
// of /resources or /test-resources.
// #5 the second file is no longer served, thus requesting it shouldn't trigger a rebuild
// (all projects are still cached from the previous builds)
await fixtureTester.requestResource({
resource: "/another.js",
notFound: true,
assertions: {
projects: {
"library.d": {},
"library.a": {},
"library.b": {},
"library.c": {},
}
projects: {}
}
});

Expand All @@ -308,6 +309,7 @@ test.serial("Serve application.a, create and delete a source file", async (t) =>
"replaceCopyright",
"enhanceManifest",
"generateFlexChangesBundle",
"generateVersionInfo",
]
}
}
Expand Down Expand Up @@ -486,8 +488,11 @@ test.serial("Serve application.a, request application resource AND library resou
resources: ["/test.js", "/resources/library/a/.library"],
assertions: {
projects: {
"library.d": {},
"library.a": {},
"application.a": {}
"library.b": {},
"library.c": {},
"application.a": {},
}
}
});
Expand Down Expand Up @@ -558,7 +563,11 @@ test.serial("Serve application.a with --cache=Default", async (t) => {
resource: "/test.js",
assertions: {
projects: {
"application.a": {}
"library.d": {},
"library.a": {},
"library.b": {},
"library.c": {},
"application.a": {},
}
}
});
Expand Down Expand Up @@ -587,6 +596,7 @@ test.serial("Serve application.a with --cache=Default", async (t) => {
"replaceCopyright",
"enhanceManifest",
"generateFlexChangesBundle",
"generateVersionInfo",
]
}
}
Expand All @@ -609,7 +619,11 @@ test.serial("Serve application.a with --cache=Off", async (t) => {
resource: "/test.js",
assertions: {
projects: {
"application.a": {}
"library.d": {},
"library.a": {},
"library.b": {},
"library.c": {},
"application.a": {},
}
}
});
Expand All @@ -631,7 +645,11 @@ test.serial("Serve application.a with --cache=Off", async (t) => {
resource: "/test.js",
assertions: {
projects: {
"application.a": {}
"library.d": {},
"library.a": {},
"library.b": {},
"library.c": {},
"application.a": {},
}
}
});
Expand All @@ -651,7 +669,11 @@ test.serial("Serve application.a with --cache=Off", async (t) => {
resource: "/test.js",
assertions: {
projects: {
"application.a": {}
"library.d": {},
"library.a": {},
"library.b": {},
"library.c": {},
"application.a": {},
}
}
});
Expand All @@ -673,7 +695,11 @@ test.serial("Serve application.a with --cache=Off", async (t) => {
resource: "/test.js",
assertions: {
projects: {
"application.a": {}
"library.d": {},
"library.a": {},
"library.b": {},
"library.c": {},
"application.a": {},
}
}
});
Expand All @@ -688,7 +714,11 @@ test.serial("Serve application.a with --cache=ReadOnly", async (t) => {
resource: "/test.js",
assertions: {
projects: {
"application.a": {}
"library.d": {},
"library.a": {},
"library.b": {},
"library.c": {},
"application.a": {},
}
}
});
Expand Down Expand Up @@ -721,6 +751,7 @@ test.serial("Serve application.a with --cache=ReadOnly", async (t) => {
"replaceCopyright",
"enhanceManifest",
"generateFlexChangesBundle",
"generateVersionInfo",
]
}
}
Expand Down Expand Up @@ -749,6 +780,7 @@ test.serial("Serve application.a with --cache=ReadOnly", async (t) => {
"replaceCopyright",
"enhanceManifest",
"generateFlexChangesBundle",
"generateVersionInfo",
]
}
}
Expand All @@ -765,7 +797,11 @@ test.serial("Serve application.a with --cache=Force (1)", async (t) => {
resource: "/test.js",
assertions: {
projects: {
"application.a": {}
"library.d": {},
"library.a": {},
"library.b": {},
"library.c": {},
"application.a": {},
}
}
});
Expand Down
Loading
Loading