Skip to content

Conversation

TheAngryByrd
Copy link
Member

@TheAngryByrd TheAngryByrd commented Apr 6, 2025

Closes #2078

| Error msg -> Promise.reject (exn msg))

let invokeMSBuildWithCancel project target (cancellationToken: CancellationToken) =
let invokeMSBuildWithCancel project target (cancellationToken: CancellationToken) args =
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're doing the classic calling msbuild t:Build here instead of dotnet build which can cause issues with needing to restore. This is currently in a hacky state so we can discuss options.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on thing to consider is that /t:Build calls the build target - and not all projects will have that target. Most managed projects will, but what dotnet build and msbuild do by default is call the default target so the most correct thing to do might be to allow specifying an optional target?

you can also do dotnet build with --no-restore if you want to skip the implicit restore.

module Project =
let testPathSubDir = ".ionide-test"
let getOutputPaths () =
let objOutputPath = node.path.join [| "obj" ; testPathSubDir ; node.path.sep|]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using relative paths means it can build each respective project in its own subfolder (Real lib and test project), otherwise, things like project.assets.json will collide. . Though I'm not entirely sure this is the correct approach.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using separate subfolders is the right move here IMO

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same discussion that's going on for the dotnet run foo.cs work, and separate intermediate/output paths is what that effort has landed on as well.

@TheAngryByrd TheAngryByrd requested a review from baronfel April 6, 2025 22:04
@TheAngryByrd TheAngryByrd self-assigned this Apr 6, 2025
@TheAngryByrd
Copy link
Member Author

cc @farlee2121

type TargetFramework = string

module Project =
let testPathSubDir = ".ionide-test"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idea: consider using ExtensionContext.storageUri from the activate call to provide our workspace-unique state path?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test Discovery can influence/break design time builds
2 participants