Add 'ui5 build for-server' command - #1563
Draft
RandomByte wants to merge 5 commits into
Draft
Conversation
Introduce a "server" flag on the BuildConfiguration. When set, composeTaskList disables tasks whose output the server generates on the fly (currently generateVersionInfo) by default, while still allowing includedTasks to re-enable them. graph.serve() now sets server:true, giving a single declarative source of truth for the server task set instead of callers hand-editing excludedTasks. Also add a cacheOnly option to graph.build(): it runs the build to populate the shared build cache via ProjectBuilder.build() + closeCacheManager() without writing the result to a target directory. ProjectBuilder.build() gains a dependencyIncludes parameter so the cache-only path has the same dependency selection as buildToTarget(). The server flag participates in the build-cache signature, so a server-aligned build (e.g. the upcoming "ui5 build for-server") and a running "ui5 serve" hash to the same cache entries and share results.
…ve() graph.serve() now runs a server-aligned build (server:true) that disables the generateVersionInfo task by default, since the versionInfo middleware generates the version info on the fly. Drop the imperative excludedTasks editing in stack.js and forward the caller's excludedTasks unchanged, keeping the default server task set in one place (@ui5/project composeTaskList).
Add a "ui5 build for-server" subcommand that warms the shared build cache the "ui5 serve" command reuses. It runs a server-aligned build (server:true, so the generateVersionInfo task is skipped) and only populates the cache (cacheOnly), without writing the build result to the destination directory. Because its BuildConfiguration matches what "ui5 serve" produces, the two share the same build-cache entries, so a subsequent serve can reuse the pre-built results.
Describe the new "ui5 build for-server" command in the Builder page: it warms the shared cache that "ui5 serve" reuses by running the server's task set (which skips generateVersionInfo) without writing a build result. Update the generateVersionInfo footnote to name both server entry points.
…fault graph.serve() now runs a server-aligned build (server:true), which disables generateVersionInfo by default. Because that task collected the version info of all libraries, it previously forced every library to build on the initial serve. Without it, serving an application resource builds only application.a; libraries build lazily when their resources (or a not-found lookup) first reach them. Update the integration expectations accordingly: drop generateVersionInfo from the skipped-task lists, expect only the requested projects to build, and rework the "test exclusion of generateVersionInfo" case to assert the new default (excluded) plus re-enabling it via includedTasks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This command can be used to warm the cache for a later
ui5 serverun. It's supposed to mimic the build that runs within the server (same set of tasks). This change also moves the server's task-exclude configuration topackages/project/lib/build/helpers/composeTaskList.js, where all the other default include and excludes are already placed.Note that running
ui5 build for-serverwill not write out files todistand only fill the central cache.JIRA: CPOUI5FOUNDATION-1354