Skip to content

[BUG] Output directory does not follow the Nx pattern #27

@bcallaghan-et

Description

@bcallaghan-et

Describe the bug
The output directory added to the csproj file after generating a new project does not follow the pattern used by official Nx plugins. The generator @nrwl/angular:application (for example) will specify an output path that is identical to the project root, other than a dist/ prefix.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Nx workspace
  2. Generate a new .NET application with npx nx generate @nx-dotnet/core:app my-app --template console --language C# --test-template none
  3. Open the generated file apps/my-app/MyApp.csproj
  4. The OutputPath element specifies a path of ../../dist/my-app, which is missing the apps part of the original file path.

Expected behavior
The OutputPath element should have been ../../dist/apps/my-app to match the pattern of other Nx generators.

Environment:

  • OS: Windows
  • Browser: N/A
  • Version: 0.2.0
  • Affected Packages: @nx-dotnet/core

Additional context
When the project directory contains additional folder nesting (such as when the --directory flag is specified), the OutputPath element contains the extra directories, but it still does not contain the apps portion of the file path. The output path given in workspace.json never includes extra directories and, as a result, is sometimes inconsistent with the csproj file.

If the output path follows the standard Nx pattern, then the outputs property of the workspace.json file becomes unnecessary, as the explicit and default values are the same. It is worth nothing though that @nrwl/angular will explicitly specify the output path, even when it matches the inferred default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingoutdated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions