Skip to content
Merged
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 @@ -145,6 +145,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, the [`generateVersionInfo`](../api/module-@ui5_builder_tasks_generateVersionInfo.md) task is not executed, because the corresponding [`versionInfo`](#versioninfo) middleware creates an identical `sap-ui-version.json` output file.
:::

::: 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 @@ -328,6 +328,16 @@ The SAP Theme Designer can create custom themes based on CSS variables instead o

With UI5 CLI v5, the `--experimental-css-variables` option has therefore been removed for the `ui5 build` command. For custom theme creation with CSS variables, please check out the **SAP Theme Designer**.

## `sap-ui-version.json`

When you run `ui5 build`, the standard task [`generateVersionInfo`](../api/module-@ui5_builder_tasks_generateVersionInfo) now runs by default. This task generates an `sap-ui-version.json` file in the `resources/` directory. The task runs for all build types (default, jsdoc, and self-contained) in projects of type `application`. For other project types (such as `library`), the behavior remains unchanged: [`generateVersionInfo`](../api/module-@ui5_builder_tasks_generateVersionInfo) does not run.

::: 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 run by default. The [`versionInfo`](../pages/Server.md#versioninfo) middleware creates an identical `sap-ui-version.json` output file.

## Learn More

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": []
}
26 changes: 16 additions & 10 deletions packages/builder/test/lib/builder/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,24 @@ async function checkFileContentsIgnoreLineFeeds(t, expectedFiles, expectedPath,
const currentFileContentPromise = readFile(destFile, "utf8");
const expectedFileContentPromise = readFile(expectedFile, "utf8");
const assertContents = ([currentContent, expectedContent]) => {
if (expectedFile.endsWith("sap-ui-cachebuster-info.json")) {
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);
if (expectedFile.endsWith(".json")) {
let currentJson;
let expectedJson;
try {
currentJson = JSON.parse(currentContent);
expectedJson = JSON.parse(expectedContent);
} catch (e) {
t.falsy(e, expectedFile);
}
if (relativeFile === path.join("resources", "sap-ui-version.json")) {
// Ignore the buildTimestamp property for comparison:
if (currentJson.buildTimestamp && expectedJson.buildTimestamp) {
delete currentJson.buildTimestamp;
delete expectedJson.buildTimestamp;
}
}
t.deepEqual(currentJson, expectedJson, 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