Move creation of GoogleBloggerv3Secrets.json into writer.build.targets

There was an issue around the first time the project built, the JSON
file was not getting included into the project because it hadn't been
generated yet. Moving the creation of the JSON file into a centralized
writer.build.targets fixed this.
This commit is contained in:
Will Duff 2015-12-16 08:53:29 -08:00
parent 24c97bbb4a
commit 1a963eaf0a
2 changed files with 13 additions and 11 deletions

View File

@ -203,6 +203,7 @@
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Clients\PassportSettings.xml" />
<EmbeddedResource Include="Clients\GoogleBloggerv3Secrets.json" />
<EmbeddedResource Include="Images\WordPressFav.ico" />
<EmbeddedResource Include="Providers\BlogProvidersB5.xml" />
<Content Include="Detection\default.htm" />
@ -215,17 +216,6 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(RepoRoot)\writer.build.targets" />
<PropertyGroup>
<BloggerClientSecretsJson>Clients\GoogleBloggerv3Secrets.json</BloggerClientSecretsJson>
<OlwBloggerClientId Condition="'$(OlwBloggerClientId)'==''">ClientId</OlwBloggerClientId>
<OlwBloggerClientSecret Condition="'$(OlwBloggerClientSecret)'==''">ClientSecret</OlwBloggerClientSecret>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Condition="Exists('$(BloggerClientSecretsJson)')" Include="$(BloggerClientSecretsJson)" />
</ItemGroup>
<Target Name="GenerateBloggerClientSecrets" DependsOnTargets="ResolveProjectReferences" BeforeTargets="CoreCompile" Outputs="$(BloggerClientSecretsJson)">
<WriteLinesToFile File="$(BloggerClientSecretsJson)" Lines="{ &quot;installed&quot;: { &quot;client_id&quot;: &quot;$(OlwBloggerClientId)&quot;, &quot;client_secret&quot;: &quot;$(OlwBloggerClientSecret)&quot; } }" Overwrite="true" />
</Target>
<Target Name="BeforeBuild">
<Copy SourceFiles="$(ProjectDir)Detection\default.htm" DestinationFiles="$(OutputPath)\template\default.htm" />
<Copy SourceFiles="$(ProjectDir)Detection\defaultstyle.css" DestinationFiles="$(OutputPath)\template\defaultstyle.css" />

View File

@ -20,4 +20,16 @@
</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="{ &quot;installed&quot;: { &quot;client_id&quot;: &quot;$(OlwBloggerClientId)&quot;, &quot;client_secret&quot;: &quot;$(OlwBloggerClientSecret)&quot; } }" Overwrite="true" />
</Target>
</Project>