microsoft / rushstack

Monorepo for tools developed by the Rush Stack community
https://rushstack.io/
Other
5.85k stars 594 forks source link

[rush] Feature request for rush build's output folder to be based on an environment variable #4938

Open timmydo opened 1 week ago

timmydo commented 1 week ago

Summary

Our git repository currently uses a msbuild-based build system. We invoke rush build to build ~80 packages from our rush.json. Currently these packages drop files into the dist directory in each projectFolder. (Later we copy them out to another location). We are migrating our normal build process to use an artifacts output layout (https://learn.microsoft.com/en-us/dotnet/core/sdk/artifacts-output) which puts all the build artifacts in a separate root folder instead of in the source code folders. We would like to migrate our rush build to also put build artifacts in $RUSH_BASE_OUTPUT_DIRECTORY/$RUSH_PROJECT_NAME/dist or similar.

Repro steps

projectOutputFolderNames from https://rushjs.io/pages/maintainer/build_cache/ to support environment variables. Basically, I think we can pass environment variables today and edit package.json to put files in the right place, but we need the cache to support such a feature or rebuilds will be painful.

iclanton commented 2 days ago

This is an interesting proposal, that may be able to be supported with injected dependencies for downstream projects.