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
5 changes: 3 additions & 2 deletions internal/documentation/docs/pages/Builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ All available standard tasks are documented [in the API reference](https://ui5.g
| 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> | | | |
| generateVersionInfo | enabled <sup>6</sup> | | | |
| generateCachebusterInfo | *disabled* | *disabled* | | |
| generateApiIndex | *disabled* <sup>1</sup> | | | |
| generateResourcesJson | *disabled* | *disabled* | *disabled* | *disabled* |
Expand All @@ -57,7 +57,8 @@ All available standard tasks are documented [in the API reference](https://ui5.g
<sup>2</sup> Enabled for projects defining a [component preload configuration](./Configuration.md#component-preload-generation)
<sup>3</sup> Enabled in `self-contained` build, which disables `generateComponentPreload` and `generateLibraryPreload`
<sup>4</sup> Enabled for projects defining a [bundle configuration](./Configuration.md#custom-bundling)
<sup>5</sup> Can be enabled for framework projects via the `includeTask` option. For other projects, this task is skipped
<sup>5</sup> Can be enabled for framework projects via the `includeTask` option. For other projects, this task is skipped
<sup>6</sup> Disabled for the server due to a corresponding middleware producing the same output

### minify

Expand Down
4 changes: 4 additions & 0 deletions internal/documentation/docs/pages/Server.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ In case a directory has been requested, this middleware renders an HTML with a l
## Standard Tasks
As with the UI5 Builder, a set of standard tasks is being executed during a server build. Individual tasks can be included or excluded using the respective CLI options `--include-task` and `--exclude-task`.

::: info Exception
For the server, task [`generateVersionInfo`](../api/module-@ui5_builder_tasks_generateVersionInfo.md) is not executed because the corresponding middleware [`versionInfo`](#versioninfo) creates the same output file `sap-ui-version.json`.
:::

::: info
See [Builder Standard Tasks](./Builder.md#standard-tasks) for more explanation about each task.
:::
Expand Down
10 changes: 10 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,16 @@ 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`, 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 type `application`. For projects of other types (e.g. `library`), the behavior remains the same and [`generateVersionInfo`](../api/module-@ui5_builder_tasks_generateVersionInfo) is not executed.

::: info Tip
To see which standard tasks are executed for each project type, check out the [Standard Tasks](../pages/Builder#standard-tasks) table in the UI5 Builder page.
:::

When running `ui5 serve`, [`generateVersionInfo`](../api/module-@ui5_builder_tasks_generateVersionInfo) continues to **not be executed by default** because a corresponding middleware [`versionInfo`](../pages/Server.md#versioninfo) produces the same `sap-ui-version.json` output file.

## 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
Loading
Loading