forked from OpenLiveWriter/OpenLiveWriter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
writer.build.targets
35 lines (29 loc) · 2.12 KB
/
writer.build.targets
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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionTxt>$(RepoRoot)\version.txt</VersionTxt>
<GlobalAssemblyVersionInfoPath>$(SrcManagedRoot)\GlobalAssemblyVersionInfo.cs</GlobalAssemblyVersionInfoPath>
<UnmanagedVersionPath>$(RepoRoot)\src\unmanaged\version.h</UnmanagedVersionPath>
</PropertyGroup>
<Target Name="GenerateVersionFiles" BeforeTargets="CoreCompile" Inputs="$(VersionTxt)" Outputs="$(GlobalAssemblyVersionInfoPath);$(UnmanagedVersionPath)">
<ReadLinesFromFile File="$(VersionTxt)">
<Output TaskParameter="Lines" ItemName="VersionTextLines"/>
</ReadLinesFromFile>
<PropertyGroup>
<BuildVersion>@(VersionTextLines)</BuildVersion>
</PropertyGroup>
<WriteLinesToFile File="$(GlobalAssemblyVersionInfoPath)" Lines="[assembly: System.Reflection.AssemblyVersion("$(BuildVersion)")];[assembly: System.Reflection.AssemblyFileVersion("$(BuildVersion)")]" Overwrite="true" />
<WriteLinesToFile File="$(UnmanagedVersionPath)" Lines="#define FILE_VERSION $(BuildVersion.Replace(".",","));#define PRODUCT_VERSION $(BuildVersion)" Overwrite="true" />
<ItemGroup>
<Compile Condition="Exists('$(GlobalAssemblyVersionInfoPath)')" Include="$(GlobalAssemblyVersionInfoPath)" />
</ItemGroup>
</Target>
<!-- Google Blogger -->
<PropertyGroup>
<BloggerClientSecretsJson>$(RepoRoot)\src\managed\OpenLiveWriter.BlogClient\Clients\GoogleBloggerv3Secrets.json</BloggerClientSecretsJson>
<OlwBloggerClientId Condition="'$(OlwBloggerClientId)'==''">PASTE_YOUR_CLIENT_ID_HERE</OlwBloggerClientId>
<OlwBloggerClientSecret Condition="'$(OlwBloggerClientSecret)'==''">PASTE_YOUR_CLIENT_SECRET_HERE</OlwBloggerClientSecret>
</PropertyGroup>
<Target Name="GenerateBloggerClientSecrets" BeforeTargets="CoreCompile" Outputs="$(BloggerClientSecretsJson)">
<WriteLinesToFile File="$(BloggerClientSecretsJson)" Lines="{ "installed": { "client_id": "$(OlwBloggerClientId)", "client_secret": "$(OlwBloggerClientSecret)" } }" Overwrite="true" />
</Target>
</Project>