-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Generate Directory.Build.props during init
generator
#469
Comments
I am currently setting up dotnet projects in a monorepo to better understand this. For 'app' vs 'lib', the output path is different in nx convention, and this appears to be achievable with dotnet by checking the SDK. <PropertyGroup Condition="'$(UsingMicrosoftNETSdkWeb)' == 'false'">
<BaseOutputPath>$(RepoRoot)dist/libs/$(MSBuildProjectName)</BaseOutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true'">
<BaseOutputPath>$(RepoRoot)dist/apps/$(MSBuildProjectName)</BaseOutputPath>
</PropertyGroup> |
That's interesting too, but the workspace layout is determined by a property in During At the same time though, I'm not really a fan of checking for the .NET web SDK here... Console applications as an example would not be picked up. Nx traditionally classifies e2e as an app, which this would miss etc. Perhaps it would be better to not bother with libs/apps directory in the output path. Do something like: <PropertyGroup>
<BaseOutputPath>$(RepoRoot)dist/nx-dotnet/$(MSBuildProjectName)</BaseOutputPath>
</PropertyGroup> |
Agreed about using appsDir / libsDir from the workspace config during Is there currently a generator that results in a project with |
There is a different strategy to this that I've thought of that would match typical Nx dist output better. If we could represent There's not the concept of a publishable lib in nx-dotnet, the generators don't do a ton of extra stuff beyond
|
Great idea. This seems to work. <RepoRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)'))</RepoRoot>
<BaseOutputPath>$(RepoRoot)dist/$([System.IO.Path]::GetRelativePath($(RepoRoot), $(MSBuildProjectDirectory)))</BaseOutputPath> |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Current Behavior
Currently, we set the output path of C# projects in the monorepo individually. We do this by manually specifying them in each .csproj file. This has issues.
move
generator to @nx-dotnet/core #406, [Feature] nx conventions on shared dependencies, unit tests with code, dist #468)Desired Behavior
During
@nx-dotnet/core:init
, we should scaffold a minimalDirectory.Build.props
file that contains the setup for output paths.Additional context
We need to ensure that the creation of this file is idempotent.
init
is called automatically at the beginning of each project generator, and the file shouldn't be recreated each time in case dev's customize it.The text was updated successfully, but these errors were encountered: