Skip to content

Commit

Permalink
Only create Blogger json file if necessary
Browse files Browse the repository at this point in the history
Add dependency checking

Avoid unnecessary rebuilding of marketization files
  • Loading branch information
flcdrg committed Apr 14, 2016
1 parent 69ea434 commit 10a55d6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,27 @@
<PropertyGroup>
<MasterXmlPath>$(MSBuildProjectDirectory)\..\..\..\intl\markets\Master.xml</MasterXmlPath>
<MasterXmlOutput>$(MSBuildProjectDirectory)\Marketization\Master.xml</MasterXmlOutput>
<MarketsXmlPath>$(MSBuildProjectDirectory)\Marketization\Markets.xml</MarketsXmlPath>
<MarketsSourceDataFolder>$(MSBuildProjectDirectory)\..\..\..\intl\markets</MarketsSourceDataFolder>
</PropertyGroup>
<Target Name="GenerateMarketXml" DependsOnTargets="ResolveProjectReferences" BeforeTargets="CoreCompile">
<MakeDir Directories="$(MSBuildProjectDirectory)\Marketization" />
<Target Name="GenerateMarketXmlDeps">
<ItemGroup>
<MarketsSourceFiles Include="$(MarketsSourceDataFolder)\**\*.xml" />
</ItemGroup>
</Target>

<Target Name="GenerateMarketXml" DependsOnTargets="ResolveProjectReferences;GenerateMarketXmlDeps;GenerateMarketXmlCopyMaster;GenerateMarketXmlImpl" BeforeTargets="CoreCompile">
</Target>

<Target Name="GenerateMarketXmlImpl" Inputs="@(MarketsSourceFiles)" Outputs="$(MarketsXmlPath)">
<Exec Command="&quot;$(OutDir)MarketXmlGenerator.exe&quot; &quot;$(MarketsSourceDataFolder)&quot; &quot;$(MarketsXmlPath)&quot;" />
</Target>

<Target Name="GenerateMarketXmlCopyMaster" Inputs="$(MasterXmlPath)" Outputs="$(MasterXmlOutput)">
<MakeDir Directories="$(MSBuildProjectDirectory)\Marketization" Condition="!Exists('$(MSBuildProjectDirectory)\Marketization')" />
<Copy SourceFiles="$(MasterXmlPath)" DestinationFiles="$(MasterXmlOutput)" />
<Exec Command="&quot;$(OutDir)MarketXmlGenerator.exe&quot; &quot;$(MSBuildProjectDirectory)\..\..\..\intl\markets&quot; &quot;$(MSBuildProjectDirectory)\Marketization\Markets.xml&quot;" />
</Target>

<Target Name="_CopyFilesMarkedCopyLocal" />

</Project>
3 changes: 2 additions & 1 deletion src/managed/writer.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenLiveWriter.CoreServices", "OpenLiveWriter.CoreServices\OpenLiveWriter.CoreServices.csproj", "{9154B6B4-F2C3-4FB4-BE38-A26A6C9409EE}"
EndProject
Expand Down Expand Up @@ -59,6 +59,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
..\..\build.cmd = ..\..\build.cmd
..\..\version.txt = ..\..\version.txt
..\..\writer.build.targets = ..\..\writer.build.targets
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostBuild.CreateInstaller", "PostBuild.CreateInstaller\PostBuild.CreateInstaller.csproj", "{4E445FF3-7F7B-46D1-9424-682E146F1F09}"
Expand Down
3 changes: 2 additions & 1 deletion writer.build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
<OlwBloggerClientSecret Condition="'$(OlwBloggerClientSecret)'==''">PASTE_YOUR_CLIENT_SECRET_HERE</OlwBloggerClientSecret>
</PropertyGroup>

<Target Name="GenerateBloggerClientSecrets" BeforeTargets="CoreCompile" Outputs="$(BloggerClientSecretsJson)">
<Target Name="GenerateBloggerClientSecrets" BeforeTargets="CoreCompile" Inputs="$(MSBuildThisFileFullPath)" Outputs="$(BloggerClientSecretsJson)">
<Message Text="$(BloggerClientSecretsJson)" Importance="high" />
<WriteLinesToFile File="$(BloggerClientSecretsJson)" Lines="{ &quot;installed&quot;: { &quot;client_id&quot;: &quot;$(OlwBloggerClientId)&quot;, &quot;client_secret&quot;: &quot;$(OlwBloggerClientSecret)&quot; } }" Overwrite="true" />
</Target>

Expand Down

0 comments on commit 10a55d6

Please sign in to comment.