-
Notifications
You must be signed in to change notification settings - Fork 2
/
Directory.Build.props
56 lines (50 loc) · 2.65 KB
/
Directory.Build.props
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup Label="Framework and language configuration">
<TargetFramework>netstandard2.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>
<PropertyGroup Label="Game folder configuration">
<!-- Set this to the path to your KSP 2 folder if you don't have the KSP2DIR environmental variable set -->
<KSP2DIR Condition="'$(KSP2DIR)' == ''">C:/Program Files (x86)/Steam/steamapps/common/Kerbal Space Program 2</KSP2DIR>
</PropertyGroup>
<PropertyGroup Label="Build and namespace configuration">
<SolutionDir Condition="'$(SolutionDir)'==''">$(MSBuildThisFileDirectory)</SolutionDir>
<BaseOutputPath>$(SolutionDir)build/bin/$(MSBuildProjectName)</BaseOutputPath>
<BaseIntermediateOutputPath>$(SolutionDir)build/obj/$(MSBuildProjectName)</BaseIntermediateOutputPath>
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
<RootNamespace>$(AssemblyName)</RootNamespace>
<Configurations>Debug;Release;Deploy;DeployAndRun</Configurations>
<Platforms>AnyCPU</Platforms>
<NoWarn>$(NoWarn);CS0436</NoWarn>
</PropertyGroup>
<PropertyGroup Label="Package source configuration">
<RestoreAdditionalProjectSources>
https://nuget.spacewarp.org/v3/index.json
</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup Label="Dependencies for build targets">
<PackageReference Include="JsonPeek" Version="1.2.0" PrivateAssets="all"/>
</ItemGroup>
<!-- Define the main target -->
<Target Label="Reading properties from swinfo.json" Name="ReadPropertiesFromJson" BeforeTargets="PreBuildEvent">
<JsonPeek ContentPath="$(SolutionDir)/plugin_template/swinfo.json" Query="$">
<Output TaskParameter="Result" ItemName="Swinfo"/>
</JsonPeek>
<JsonPeek ContentPath="$(SolutionDir)/plugin_template/swinfo.json" Query="$.dependencies">
<Output TaskParameter="Result" ItemName="Dependencies"/>
</JsonPeek>
<!-- Extract properties from the JSON -->
<PropertyGroup>
<ModId>@(Swinfo -> '%(mod_id)')</ModId>
<Version>@(Swinfo -> '%(version)')</Version>
<Product>@(Swinfo -> '%(name)')</Product>
<Authors>@(Swinfo -> '%(author)')</Authors>
<Description>@(Swinfo -> '%(description)')</Description>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>@(Swinfo -> '%(source)')</RepositoryUrl>
</PropertyGroup>
</Target>
</Project>