Skip to content

Commit

Permalink
implemented feedback from Jarod42
Browse files Browse the repository at this point in the history
  • Loading branch information
Beernaert Robbe committed Oct 9, 2024
1 parent 3698bec commit 566a587
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 36 deletions.
19 changes: 17 additions & 2 deletions modules/vstudio/_preload.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"Hull",
"Domain",
"Compute",
"Library",
"Library",
"Mesh",
"Amplification",
"Texture",
Expand Down Expand Up @@ -255,7 +255,7 @@
scope = "config",
kind = "string",
}

-- Relative per-project directory. Set to empty for the entire project to be copied as is
-- Should default to empty really for the more seamless experience
p.api.register {
Expand Down Expand Up @@ -294,6 +294,21 @@
tokens = "true",
}

p.api.register {
name = "dotnetsdk",
scope = "project",
kind = "string",
allowed = {
"Default",
"Web",
"Razor",
"Worker",
"Blazor",
"WindowsDesktop",
"MSTest"
}
}

--
-- Decide when the full module should be loaded.
--
Expand Down
6 changes: 3 additions & 3 deletions modules/vstudio/vs2005_dotnetbase.lua
Original file line number Diff line number Diff line change
Expand Up @@ -835,9 +835,9 @@
end

function dotnetbase.netcore.dotnetsdk(cfg)
local globalpath = string.format("%s/global.json", cfg.workspace.location)
if cfg.dotnetsdk == "mstest" and not os.isfile(globalpath) then
io.writefile(globalpath, "{\"msbuild-sdks\": {\"MSTest.Sdk\": \"3.6.1\"}}")
local globalpath = path.join(cfg.workspace.location, "global.json")
if cfg.dotnetsdk == "MSTest" and not os.isfile(globalpath) then
io.writefile(globalpath, '{"msbuild-sdks": {"MSTest.Sdk": "3.6.1"}}')
end
end

Expand Down
15 changes: 0 additions & 15 deletions src/_premake_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -618,21 +618,6 @@
kind = "string",
}

api.register {
name = "dotnetsdk",
scope = "project",
kind = "string",
allowed = {
"Default",
"Web",
"Razor",
"Worker",
"Blazor",
"WindowsDesktop",
"MSTest"
}
}

api.register {
name = "enabledefaultcompileitems",
scope = "config",
Expand Down
17 changes: 1 addition & 16 deletions website/docs/dotnetsdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,7 @@ For more information see the MSDN documentation [here](https://learn.microsoft.c


## mstest ##
To make the MSTest SDK work you need to add the version to `global.json`:
```json
{
"msbuild-sdks": {
"MSTest.Sdk": "3.6.1"
}
}
```
:::note
`global.json` will be auto generated when it does not exist!
:::

:::warning
`global.json` needs to be located in the same folder as your solution.
:::

SDK used for MSTest is `"3.6.1"`, to use another version create or update global.json near the solution.
### Applies To ###

Project configurations.
Expand Down

0 comments on commit 566a587

Please sign in to comment.