-
-
Notifications
You must be signed in to change notification settings - Fork 618
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into show-error-context-for-broken-include
- Loading branch information
Showing
11 changed files
with
178 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
-- | ||
-- tests/actions/vstudio/cs2005/test_documentation_file.lua | ||
-- Test DocumentationFile feature Visual Studio 2005+ C# project. | ||
-- Copyright (c) 2012-2024 Jason Perkins and the Premake project | ||
-- | ||
local p = premake | ||
local suite = test.declare("vstudio_cs2005_documentation_file") | ||
local dn2005 = p.vstudio.dotnetbase | ||
-- | ||
-- Setup | ||
-- | ||
|
||
local wks, prj | ||
|
||
-- | ||
-- Setup and teardown | ||
-- | ||
function suite.setup() | ||
p.action.set("vs2010") | ||
wks = test.createWorkspace() | ||
configurations { "Debug", "Release" } | ||
language "C#" | ||
targetdir("test/targetDir") | ||
end | ||
|
||
local function setConfig() | ||
local cfg = test.getconfig(prj, "Debug") | ||
dn2005.documentationfile(cfg); | ||
end | ||
|
||
|
||
|
||
local function prepare() | ||
prj = test.getproject(wks, 1) | ||
end | ||
|
||
function suite.documentationFilePath() | ||
prepare() | ||
documentationfile("test") | ||
setConfig() | ||
test.capture [[ | ||
<DocumentationFile>test\MyProject.xml</DocumentationFile> | ||
]] | ||
end | ||
|
||
function suite.documentationFilePath_vs2017up() | ||
p.action.set("vs2017") | ||
|
||
prepare() | ||
documentationfile("test") | ||
setConfig() | ||
|
||
test.capture [[ | ||
<DocumentationFile>test\MyProject.xml</DocumentationFile> | ||
]] | ||
end | ||
|
||
function suite.documentationEmpty() | ||
prepare() | ||
documentationfile(true) | ||
setConfig() | ||
|
||
test.capture [[ | ||
<DocumentationFile>test\targetDir\MyProject.xml</DocumentationFile> | ||
]] | ||
end | ||
|
||
function suite.documentationEmpty_vs2017up() | ||
p.action.set("vs2017") | ||
|
||
prepare() | ||
documentationfile(true) | ||
setConfig() | ||
|
||
test.capture [[<GenerateDocumentationFile>true</GenerateDocumentationFile>]] | ||
end | ||
|
||
function suite.documentationNull() | ||
wks = test.createWorkspace() | ||
prepare() | ||
setConfig() | ||
test.isemptycapture() | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Enables C# xmlDocumentationFile | ||
|
||
The `xmlDocumentationFile` option is used to include [XML comments](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/) in a DLL that has been included in a .NET framework or another C# project. These XML comments can then be referenced by other projects when placed alongside the corresponding SharedLib. | ||
|
||
This feature sets the [documentationfile](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/output#documentationfile) option in a C# project's .csproj file for each respective [configuration](https://premake.github.io/docs/configurations/) | ||
|
||
## Usage ## | ||
To use xmlDocumentationFile, add the following line to your project configuration in your premake script: | ||
|
||
```lua | ||
documentationfile("targetdir") | ||
``` | ||
### Parameters ### | ||
`targetdir` is the directory where the documentation file should be placed after building the project using visual studio. | ||
|
||
### Examples ### | ||
|
||
When you set documentationFile to true, the following filepath will be generated: | ||
```%{targetdir}/%{prj.name}.xml``` | ||
```lua | ||
documentationfile(true) | ||
``` | ||
If you specify a custom target directory like this: | ||
```lua | ||
documentationfile("%{prj.location}/bin/test") | ||
``` | ||
the following filepath will be generated: | ||
```bin\test\%{prj.name}.xml``` | ||
### Applies To ### | ||
|
||
Project configurations. | ||
|
||
### Availability ### | ||
|
||
Premake 5.0 beta3 or later. | ||
|
||
Visual studio is the only toolset currently supported. | ||
|
||
### Warning ### | ||
It's recommended to use `documentationfile(true)` because Visual Studio's intellisense will not detect the XML file if its name is not the same as the SharedLib. | ||
|
||
### See Also ### | ||
For more information on XML documentation in C#, refer to: | ||
1) [xml comments](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/) | ||
2) [documentation file](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/output#documentationfile) | ||
3) [configuration](https://premake.github.io/docs/configurations/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters