-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCarbon.Common.csproj
67 lines (59 loc) · 3.45 KB
/
Carbon.Common.csproj
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
57
58
59
60
61
62
63
64
65
66
67
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Build">
<PropertyGroup>
<Product>Carbon.Common</Product>
<OutputType>Library</OutputType>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>
<Import Project="$(SolutionDir)\.msbuild\Common.props" />
<Import Project="$(SolutionDir)\.msbuild\ReferencesRust.props" />
<ItemGroup>
<PackageReference Include="Ben.Demystifier" Version="0.4.1" />
<PackageReference Include="MySql.Data" Version="8.0.32.1" />
<PackageReference Include="protobuf-net.Core" Version="3.2.30" />
<PackageReference Include="protobuf-net" Version="3.2.30" />
<PackageReference Include="QRCoder" Version="1.6.0" />
<PackageReference Include="System.Data.SQLite" Version="1.0.118" />
<PackageReference Include="System.IO.Compression" Version="4.3.0" />
<PackageReference Include="WebSocketSharp" Version="1.0.3-rc11" />
</ItemGroup>
<ItemGroup>
<Reference Include="$(SolutionDir)..\Rust\$(OperatingSystem)\RustDedicated_Data\Managed\UnityEngine.CoreModule.dll" Private="false" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Carbon.Test\Carbon.Test.csproj" />
</ItemGroup>
<Choose>
<When Condition="Exists('$(SolutionDir).tmp\.gitbranch')">
<PropertyGroup>
<GitCommitBranch>$([System.IO.File]::ReadAllText('$(SolutionDir).tmp\.gitbranch').Trim())</GitCommitBranch>
<GitCommitHashLong>$([System.IO.File]::ReadAllText('$(SolutionDir).tmp\.gitchl').Replace("--long", "").Trim())</GitCommitHashLong>
<GitCommitHashShort>$([System.IO.File]::ReadAllText('$(SolutionDir).tmp\.gitchs').Trim())</GitCommitHashShort>
<GitCommitUrl>$([System.IO.File]::ReadAllText('$(SolutionDir).tmp\.giturl').Trim().Replace('.git', ''))/commit/$(GitCommitHashLong.Trim())</GitCommitUrl>
<GitCommitAuthor>$([System.IO.File]::ReadAllText('$(SolutionDir).tmp\.gitauthor').Trim())</GitCommitAuthor>
<GitCommitComment>$([System.IO.File]::ReadAllText('$(SolutionDir).tmp\.gitcomment').Replace('"', '""').Trim())</GitCommitComment>
<GitCommitTag>$([System.IO.File]::ReadAllText('$(SolutionDir).tmp\.gittag').Trim())</GitCommitTag>
<GitCommitDate>$([System.IO.File]::ReadAllText('$(SolutionDir).tmp\.gitdate').Trim())</GitCommitDate>
<GitCommitChanges>$([System.IO.File]::ReadAllText('$(SolutionDir).tmp\.gitchanges').Replace(" ", " ").Trim())</GitCommitChanges>
<InformationalVersion>$(VersionPrefix)-$(VersionSuffix)-$(GitCommitBranch)-$(GitCommitHashShort)</InformationalVersion>
<BuildMetadataCode>
$([System.IO.File]::ReadAllText('$(MSBuildProjectDirectory)\src\Carbon\Build.cs.template')
.Replace('[GIT_BRANCH]', '$(GitCommitBranch)')
.Replace('[GIT_AUTHOR]', '$(GitCommitAuthor)')
.Replace('[GIT_COMMENT]', '$(GitCommitComment)')
.Replace('[GIT_DATE]', '$(GitCommitDate)')
.Replace('[GIT_URL]', '$(GitCommitUrl)')
.Replace('[GIT_TAG]', '$(GitCommitTag)')
.Replace('[GIT_ASSET_CHANGES]', '$(GitCommitChanges)')
.Replace('[GIT_HASH_SHORT]', '$(GitCommitHashShort)')
.Replace('[GIT_HASH_LONG]', '$(GitCommitHashLong)'))
</BuildMetadataCode>
</PropertyGroup>
</When>
</Choose>
<Target Name="GitMetadata" AfterTargets="_GenerateRestoreProjectSpec">
<WriteLinesToFile File="$(MSBuildProjectDirectory)\src\Carbon\Build.cs" Overwrite="true" Lines="$(BuildMetadataCode)" />
</Target>
<Target Name="CustomRelease" AfterTargets="Build" DependsOnTargets="PrepareRelease">
<Copy SourceFiles="$(OutputPath)$(Product).dll" DestinationFolder="$(c_managed)" />
</Target>
</Project>