Skip to content

Commit ddab06a

Browse files
authored
Add appmanifest config option (#2769)
1 parent 78b568e commit ddab06a

6 files changed

Lines changed: 55 additions & 0 deletions

File tree

‎modules/vstudio/_preload.lua‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@
158158
kind = "boolean",
159159
default = false
160160
}
161+
p.api.register {
162+
name = "appmanifest",
163+
scope = "config",
164+
kind = "string"
165+
}
161166

162167
p.api.register {
163168
name = "enableimplicitusings",

‎modules/vstudio/tests/cs2005/test_netcore.lua‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,23 @@ function suite.multiple_target_dotnet_frameworks()
187187
]]
188188
end
189189

190+
function suite.set_appmanifest()
191+
p.action.set("vs2022")
192+
dotnetframework { "net10.0" }
193+
appmanifest "app.manifest"
194+
prepareProjectProperties()
195+
test.capture [[
196+
<PropertyGroup>
197+
<OutputType>Exe</OutputType>
198+
<AppDesignerFolder>Properties</AppDesignerFolder>
199+
<TargetFramework>net10.0</TargetFramework>
200+
<Configurations>Debug;Release;Distribution</Configurations>
201+
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
202+
<ApplicationManifest>app.manifest</ApplicationManifest>
203+
</PropertyGroup>
204+
]]
205+
end
206+
190207
function suite.project_element_configurations()
191208
p.action.set("vs2022")
192209
dotnetframework "net8.0"

‎modules/vstudio/vs2005_csproj.lua‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
dotnetbase.projectConfigurations,
5656
dotnetbase.netcore.enableDefaultCompileItems,
5757
dotnetbase.netcore.enableImplicitUsings,
58+
dotnetbase.netcore.appManifest,
5859
dotnetbase.netcore.dotnetsdk
5960
}
6061
else

‎modules/vstudio/vs2005_dotnetbase.lua‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,12 @@
855855
end
856856
end
857857

858+
function dotnetbase.netcore.appManifest(cfg)
859+
if cfg.appmanifest and string.len(cfg.appmanifest) > 0 then
860+
_p(2,'<ApplicationManifest>%s</ApplicationManifest>', path.getrelative(cfg.project.location, cfg.appmanifest))
861+
end
862+
end
863+
858864
function dotnetbase.netcore.useWpf(cfg)
859865
if cfg.wpf == p.ON then
860866
_p(2,'<UseWpf>true</UseWpf>')

‎website/docs/appmanifest.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Adds the ApplicationManifest property to .NET projects
2+
3+
```lua
4+
appmanifest ("path")
5+
```
6+
7+
### Parameters ###
8+
9+
`path` should contain the path to the application manifest file.
10+
11+
## Applies To ###
12+
13+
.NET project configurations.
14+
15+
### Availability ###
16+
17+
Premake 5.0.0
18+
19+
### Examples ###
20+
21+
If the app manifest file is called `app.manifest` and is located in the folder alongside the project then the following usage will reference it within the project:
22+
23+
```lua
24+
appmanifest "app.manifest"
25+
```

‎website/sidebars.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ module.exports = {
6666
'allowcopylocal',
6767
'androidapilevel',
6868
'androidapplibname',
69+
'appmanifest',
6970
'architecture',
7071
'assemblydebug',
7172
'atl',

0 commit comments

Comments
 (0)