Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 09802d4

Browse files
committed
Redo timestamp file change to allow partial rebuilds. (#2311)
* Revert "Revert "Support partial rebuilds (right click build project in VS) for nuprojs. (#2300)"" This reverts commit 0added7. * Fix previous implementation of creating the timestamp file at the beginning by being more careful with project references between nuproj files and projects pretending to be .nuprojs. The new implementation ensures that a .nuproj<->.nuproj project reference is only evaluated in one configuration so that the timestamp file creation doesn't happen more than once (happens once per conifg of .nuproj being built). The full explanation of what was occuring is as follows: A.nuproj -> B.nuproj -> NuprojInit.msbuildproj |--------------^ In the Any CPU config the build order was as follows: A.nuproj (Any CPU) -> B.nuproj (Any CPU) -> NuprojInit.msbuildproj (Any CPU) | | | |-> B.nuproj (x86) | |-> B.nuproj (ARM) | |--> A.nuproj (x86)--> B.nuproj (x86) -> NuprojInit.msbuildproj (x86) |--> A.nuproj (ARM)--> B.nuproj (ARM) -> NuprojInit.msbuildproj (ARM) The new build order is: A.nuproj (Any CPU) -> B.nuproj (Any CPU) -> NuprojInit.msbuildproj (Any CPU) | | | |-> B.nuproj (x86) | |-> B.nuproj (ARM) | |--> A.nuproj (x86) |--> A.nuproj (ARM) The key difference being NuprojInit.msbuildproj only being built in the original configuration. An additional benefit of this change is that B.nuproj will be rebuilt less.
1 parent ef4940b commit 09802d4

File tree

16 files changed

+77
-171
lines changed

16 files changed

+77
-171
lines changed

build/WinObjC.Frameworks.Core/WinObjC.Frameworks.Core.nuproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,13 @@
6161
<ProjectReference Include="$(MSBuildThisFileDirectory)..\Foundation\dll\Foundation.vcxproj" />
6262
<ProjectReference Include="$(MSBuildThisFileDirectory)..\MobileCoreServices\dll\MobileCoreServices.vcxproj" />
6363
<ProjectReference Include="$(MSBuildThisFileDirectory)..\Starboard\dll\Starboard.vcxproj" />
64+
</ItemGroup>
65+
66+
<!-- NuProj Project References. Ensure that these only get evaluated once by checking that this isn't the second time through this project -->
67+
<ItemGroup Condition="'$(SkipGetPackageContentsForOtherPlatforms)' != 'true'">
6468
<ProjectReference Include="$(MSBuildThisFileDirectory)..\WinObjC.Frameworks.ThirdParty\WinObjC.Frameworks.ThirdParty.nuproj" />
6569
</ItemGroup>
70+
6671
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
6772
<Import Project="$(NuGetAuthoringPath)\NuGet.Packaging.Authoring.targets" Condition="Exists('$(NuGetAuthoringPath)\NuGet.Packaging.Authoring.targets')" />
6873
<Import Project="WinObjC.Frameworks.Core.Packaging.targets" />

build/WinObjC.Frameworks.UWP/WinObjC.Frameworks.UWP.nuproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
5656
</None>
5757
</ItemGroup>
58-
<ItemGroup>
58+
<!-- NuProj Project References. Ensure that these only get evaluated once by checking that this isn't the second time through this project -->
59+
<ItemGroup Condition="'$(SkipGetPackageContentsForOtherPlatforms)' != 'true'">
5960
<ProjectReference Include="$(MSBuildThisFileDirectory)..\WinObjC.Frameworks.Core\WinObjC.Frameworks.Core.nuproj"/>
6061
</ItemGroup>
6162
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />

build/WinObjC.Frameworks/WinObjC.Frameworks.nuproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@
110110
<ProjectReference Include="$(MSBuildThisFileDirectory)..\UIKit.Xaml\dll\UIKit.Xaml.vcxproj" />
111111
<ProjectReference Include="$(MSBuildThisFileDirectory)..\UIKit\dll\UIKit.vcxproj" />
112112
<ProjectReference Include="$(MSBuildThisFileDirectory)..\WebKit\dll\WebKit.vcxproj" />
113+
</ItemGroup>
114+
115+
<!-- NuProj Project References. Ensure that these only get evaluated once by checking that this isn't the second time through this project -->
116+
<ItemGroup Condition="'$(SkipGetPackageContentsForOtherPlatforms)' != 'true'">
113117
<ProjectReference Include="$(MSBuildThisFileDirectory)..\WinObjC.Frameworks.UWP\WinObjC.Frameworks.UWP.nuproj" />
114118
</ItemGroup>
115119
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />

build/build.sln

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 15
3-
VisualStudioVersion = 15.0.26206.0
3+
VisualStudioVersion = 15.0.26228.4
44
MinimumVisualStudioVersion = 15.0.0.0
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Starboard", "Starboard", "{ADFDC5D9-3048-4E53-A9B7-41731D7AD8CF}"
66
EndProject
@@ -780,8 +780,6 @@ Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "TestPlatformMultiplexer", "
780780
EndProject
781781
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BuildSupport", "BuildSupport", "{7B338049-F463-44B0-B7BD-F8EA16750085}"
782782
EndProject
783-
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "BuildFinalizer", "BuildSupport\BuildFinalizer.msbuildproj", "{2967D06B-1CE1-45D9-B4CC-1E07D2851B6F}"
784-
EndProject
785783
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{CC27F0AE-184D-42F9-9633-B526C2887BE6}"
786784
ProjectSection(SolutionItems) = preProject
787785
nuget.config = nuget.config
@@ -791,6 +789,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WinObjC Frameworks Third Pa
791789
EndProject
792790
Project("{5DD5E4FA-CB73-4610-85AB-557B54E96AA9}") = "WinObjC.Frameworks.ThirdParty", "WinObjC.Frameworks.ThirdParty\WinObjC.Frameworks.ThirdParty.nuproj", "{DFDF94D9-2A0A-4F9B-953B-6BF383858AD3}"
793791
EndProject
792+
Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "NuprojInitializer", "..\common\NuprojInitializer.msbuildproj", "{417B0D00-F90E-47BB-9085-BE7E412C9DA8}"
793+
EndProject
794794
Global
795795
GlobalSection(SolutionConfigurationPlatforms) = preSolution
796796
Debug|Any CPU = Debug|Any CPU
@@ -2287,18 +2287,7 @@ Global
22872287
{60A07842-5D75-45E8-9FCF-C126E608B654}.Release|ARM.Build.0 = Release|ARM
22882288
{60A07842-5D75-45E8-9FCF-C126E608B654}.Release|x86.ActiveCfg = Release|x86
22892289
{60A07842-5D75-45E8-9FCF-C126E608B654}.Release|x86.Build.0 = Release|x86
2290-
{2967D06B-1CE1-45D9-B4CC-1E07D2851B6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2291-
{2967D06B-1CE1-45D9-B4CC-1E07D2851B6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
2292-
{2967D06B-1CE1-45D9-B4CC-1E07D2851B6F}.Debug|ARM.ActiveCfg = Debug|ARM
2293-
{2967D06B-1CE1-45D9-B4CC-1E07D2851B6F}.Debug|ARM.Build.0 = Debug|ARM
2294-
{2967D06B-1CE1-45D9-B4CC-1E07D2851B6F}.Debug|x86.ActiveCfg = Debug|x86
2295-
{2967D06B-1CE1-45D9-B4CC-1E07D2851B6F}.Debug|x86.Build.0 = Debug|x86
2296-
{2967D06B-1CE1-45D9-B4CC-1E07D2851B6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
2297-
{2967D06B-1CE1-45D9-B4CC-1E07D2851B6F}.Release|Any CPU.Build.0 = Release|Any CPU
2298-
{2967D06B-1CE1-45D9-B4CC-1E07D2851B6F}.Release|ARM.ActiveCfg = Release|ARM
2299-
{2967D06B-1CE1-45D9-B4CC-1E07D2851B6F}.Release|ARM.Build.0 = Release|ARM
2300-
{2967D06B-1CE1-45D9-B4CC-1E07D2851B6F}.Release|x86.ActiveCfg = Release|x86
2301-
{2967D06B-1CE1-45D9-B4CC-1E07D2851B6F}.Release|x86.Build.0 = Release|x86
2290+
{DFDF94D9-2A0A-4F9B-953B-6BF383858AD3}.Debug|Any CPU.ActiveCfg = Debug|x86
23022291
{DFDF94D9-2A0A-4F9B-953B-6BF383858AD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23032292
{DFDF94D9-2A0A-4F9B-953B-6BF383858AD3}.Debug|Any CPU.Build.0 = Debug|Any CPU
23042293
{DFDF94D9-2A0A-4F9B-953B-6BF383858AD3}.Debug|ARM.ActiveCfg = Debug|ARM
@@ -2311,6 +2300,18 @@ Global
23112300
{DFDF94D9-2A0A-4F9B-953B-6BF383858AD3}.Release|ARM.Build.0 = Release|ARM
23122301
{DFDF94D9-2A0A-4F9B-953B-6BF383858AD3}.Release|x86.ActiveCfg = Release|x86
23132302
{DFDF94D9-2A0A-4F9B-953B-6BF383858AD3}.Release|x86.Build.0 = Release|x86
2303+
{417B0D00-F90E-47BB-9085-BE7E412C9DA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2304+
{417B0D00-F90E-47BB-9085-BE7E412C9DA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
2305+
{417B0D00-F90E-47BB-9085-BE7E412C9DA8}.Debug|ARM.ActiveCfg = Debug|Any CPU
2306+
{417B0D00-F90E-47BB-9085-BE7E412C9DA8}.Debug|ARM.Build.0 = Debug|Any CPU
2307+
{417B0D00-F90E-47BB-9085-BE7E412C9DA8}.Debug|x86.ActiveCfg = Debug|Any CPU
2308+
{417B0D00-F90E-47BB-9085-BE7E412C9DA8}.Debug|x86.Build.0 = Debug|Any CPU
2309+
{417B0D00-F90E-47BB-9085-BE7E412C9DA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
2310+
{417B0D00-F90E-47BB-9085-BE7E412C9DA8}.Release|Any CPU.Build.0 = Release|Any CPU
2311+
{417B0D00-F90E-47BB-9085-BE7E412C9DA8}.Release|ARM.ActiveCfg = Release|Any CPU
2312+
{417B0D00-F90E-47BB-9085-BE7E412C9DA8}.Release|ARM.Build.0 = Release|Any CPU
2313+
{417B0D00-F90E-47BB-9085-BE7E412C9DA8}.Release|x86.ActiveCfg = Release|Any CPU
2314+
{417B0D00-F90E-47BB-9085-BE7E412C9DA8}.Release|x86.Build.0 = Release|Any CPU
23142315
EndGlobalSection
23152316
GlobalSection(SolutionProperties) = preSolution
23162317
HideSolutionNode = FALSE
@@ -2671,7 +2672,7 @@ Global
26712672
{B0F24416-5500-4A60-815B-8E08E9F3717A} = {312A2B08-9A28-468E-B74C-E194ACD154A6}
26722673
{BEF15618-E03F-4A44-A797-9150C979B09F} = {F0F1B2A3-6924-4A09-99CE-D08CD8BCF392}
26732674
{60A07842-5D75-45E8-9FCF-C126E608B654} = {7B338049-F463-44B0-B7BD-F8EA16750085}
2674-
{2967D06B-1CE1-45D9-B4CC-1E07D2851B6F} = {7B338049-F463-44B0-B7BD-F8EA16750085}
26752675
{DFDF94D9-2A0A-4F9B-953B-6BF383858AD3} = {4BC1549F-F4C2-42D0-9F77-C323F751EA04}
2676+
{417B0D00-F90E-47BB-9085-BE7E412C9DA8} = {7B338049-F463-44B0-B7BD-F8EA16750085}
26762677
EndGlobalSection
26772678
EndGlobal

build/BuildSupport/BuildFinalizer.msbuildproj renamed to common/NuprojInitializer.msbuildproj

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,26 @@
1010
<Configuration>Release</Configuration>
1111
<Platform>AnyCPU</Platform>
1212
</ProjectConfiguration>
13-
<ProjectConfiguration Include="Debug|x86">
14-
<Configuration>Debug</Configuration>
15-
<Platform>x86</Platform>
16-
</ProjectConfiguration>
17-
<ProjectConfiguration Include="Release|x86">
18-
<Configuration>Release</Configuration>
19-
<Platform>x86</Platform>
20-
</ProjectConfiguration>
21-
<ProjectConfiguration Include="Debug|ARM">
22-
<Configuration>Debug</Configuration>
23-
<Platform>ARM</Platform>
24-
</ProjectConfiguration>
25-
<ProjectConfiguration Include="Release|ARM">
26-
<Configuration>Release</Configuration>
27-
<Platform>ARM</Platform>
28-
</ProjectConfiguration>
2913
</ItemGroup>
3014
<PropertyGroup Label="Globals">
3115
<OutputPath>$(SolutionDir)</OutputPath>
32-
<ProjectGuid>2967D06B-1CE1-45D9-B4CC-1E07D2851B6F</ProjectGuid>
16+
<ProjectGuid>417B0D00-F90E-47BB-9085-BE7E412C9DA8</ProjectGuid>
3317
</PropertyGroup>
34-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'" />
35-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'" />
36-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" />
37-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
3818
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'" />
3919
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" />
4020
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
41-
<Target Name="CoreCompile" />
4221
<Target Name="CreateManifestResourceNames" />
22+
<Target Name="CoreCompile" />
4323
<Target Name="GetReferenceAssemblyPaths" />
4424
<Target Name="CopyFilesToOutputDirectory" />
4525
<Target Name="_GenerateCompileDependencyCache" />
4626

4727
<!-- This is where the fun starts. Any custom generic msbuild project goop goes here. -->
48-
<ItemGroup>
49-
<ProjectReference Include="$(SolutionDir)\**\WinObjC.*.nuproj" />
50-
</ItemGroup>
51-
<Target Name="DeleteTimestampFile" AfterTargets="AfterBuild">
52-
<Delete Files="$(SolutionDir)$(SolutionName).timestamp" TreatErrorsAsWarnings="true" />
28+
29+
<!-- Inline task to check for timestamp file existence and creation-->
30+
<Target Name="CreateTimestampFile" AfterTargets="Build">
31+
<Touch Condition="'$(SolutionDir)' != ''" AlwaysCreate="true" Files="$(SolutionDir)$(SolutionName).timestamp" />
32+
<Message Condition="'$(SolutionDir)' != ''" Text="NuprojInitializer touched $(SolutionDir)$(SolutionName).timestamp" />
5333
</Target>
34+
5435
</Project>

common/winobjc.nuproj.common.targets

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -36,41 +36,6 @@
3636

3737
</Target>
3838

39-
<!-- Inline task to check for timestamp file existence and creation-->
40-
<UsingTask
41-
TaskName="CreateTimestampFileIfNeeded"
42-
TaskFactory="CodeTaskFactory"
43-
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll" >
44-
<ParameterGroup>
45-
<TimestampFile ParameterType="System.String" Required="true" />
46-
<Timestamp ParameterType="System.String" Output="true" />
47-
</ParameterGroup>
48-
<Task>
49-
<Reference Include="System" />
50-
<Reference Include="System.IO" />
51-
<Reference Include="System.Threading" />
52-
<Using Namespace="System" />
53-
<Using Namespace="System.IO" />
54-
<Using Namespace="System.Threading" />
55-
<Code Type="Fragment" Language="cs">
56-
<![CDATA[
57-
var mutex = new Mutex(false, TimestampFile.Replace("\\", "."));
58-
try
59-
{
60-
mutex.WaitOne();
61-
} catch (AbandonedMutexException e)
62-
{
63-
}
64-
if (!File.Exists(TimestampFile)) {
65-
File.Create(TimestampFile);
66-
}
67-
68-
Timestamp = File.GetCreationTimeUtc(TimestampFile).ToString("yyyyMMddHHmmss");
69-
mutex.ReleaseMutex();
70-
]]>
71-
</Code>
72-
</Task>
73-
</UsingTask>
7439

7540
<!--
7641
In the above AddSingleConfigBuildOutput target, several properties are injected into this project so that this project knows
@@ -88,12 +53,11 @@
8853
</ProjectReference>
8954
</ItemGroup>
9055
</Target>
91-
9256
<PropertyGroup>
9357
<GetPackageVersionDependsOn>SetPackageVersion;$(GetPackageVersionDependsOn);</GetPackageVersionDependsOn>
9458
</PropertyGroup>
9559

96-
<Target Name="SetPackageVersion" DependsOnTargets="GetVersion" >
60+
<Target Name="SetPackageVersion" DependsOnTargets="GetVersion;ResolveReferences" >
9761
<PropertyGroup>
9862
<PackageVersion></PackageVersion>
9963
</PropertyGroup>
@@ -104,14 +68,8 @@
10468
<Warning Condition="'$(SolutionPath)' == ''"
10569
Text="Cannot determine solution build time. Package version dependencies may be inconsistent as a result. Please make sure to build using .sln file." />
10670

107-
<CreateTimestampFileIfNeeded Condition="'$(SolutionDir)' != ''"
108-
TimestampFile="$(SolutionDir)$(SolutionName).timestamp">
109-
<Output PropertyName="PackageTimestamp" TaskParameter="Timestamp" />
110-
</CreateTimestampFileIfNeeded>
111-
112-
113-
11471
<PropertyGroup>
72+
<PackageTimestamp Condition="'$(PackageTimestamp)' == '' And Exists('$(SolutionDir)$(SolutionName).timestamp')">$([System.IO.File]::GetLastWriteTime($(SolutionDir)$(SolutionName).timestamp).ToUniversalTime().ToString(yyyyMMddHHmmss))</PackageTimestamp>
11573
<PackageTimestamp Condition="'$(PackageTimestamp)' == ''">$([System.DateTime]::Now.ToString(yyyyMMddHHmmss))</PackageTimestamp>
11674

11775
<PackageVersion_Major>$(GitVersion_Major)</PackageVersion_Major>
@@ -136,4 +94,12 @@
13694
<PackageVersion Condition="'$(PackageVersionOverride)' != ''">$(PackageVersionOverride)</PackageVersion>
13795
</PropertyGroup>
13896
</Target>
97+
98+
<ItemGroup>
99+
<ProjectReference Include="$(MsBuildThisFileDirectory)\NuprojInitializer.msbuildproj" Condition="'$(SkipGetPackageContentsForOtherPlatforms)' != 'true'">
100+
<IncludeInPackage>false</IncludeInPackage>
101+
<Private>false</Private>
102+
</ProjectReference>
103+
</ItemGroup>
104+
139105
</Project>

tools/BuildMonitor/BuildMonitor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
4242
<IncludeOutputsInPackage>false</IncludeOutputsInPackage>
4343
<IncludeContentInPackage>false</IncludeContentInPackage>
44+
<DeployExtension>False</DeployExtension>
4445
</PropertyGroup>
4546
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
4647
<DebugSymbols>true</DebugSymbols>
@@ -50,7 +51,6 @@
5051
<DefineConstants>DEBUG;TRACE</DefineConstants>
5152
<ErrorReport>prompt</ErrorReport>
5253
<WarningLevel>4</WarningLevel>
53-
<DeployExtension>False</DeployExtension>
5454
</PropertyGroup>
5555
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
5656
<DebugType>pdbonly</DebugType>

tools/BuildSupport/BuildFinalizer.msbuildproj

Lines changed: 0 additions & 57 deletions
This file was deleted.

tools/Logging/dll/Logging.vcxproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@
4343
<ImportGroup Label="ExtensionSettings">
4444
<Import Project="$(MSBuildThisFileDirectory)..\..\common\common-build.props" />
4545
</ImportGroup>
46-
<!-- IMPORTANT: This is a hack to get both an "in the build project reference" and a nuget reference to
47-
work together. When a depending project depends on this project via project reference, the project imports
48-
the packaging props to impersonate its parent packaging project. In this way, a nuget dependency is created.
49-
In the normal Package project reference where we actually want the contents to be packaged, it has the same package
50-
info as the parent project so it gets rolled together nicely. Hooray. :-( -->
51-
<Import Project="$(MSBuildThisFileDirectory)..\..\WinObjC.Logging\WinObjC.Logging.Packaging.props" />
5246
<ItemDefinitionGroup>
5347
<ClCompile>
5448
<AdditionalOptions>"/DLOGGING_IMPEXP= " %(AdditionalOptions)</AdditionalOptions>

tools/VSIX/ObjectiveCVSIX.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<AssemblyName>VSIX</AssemblyName>
4545
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
4646
<GeneratePkgDefFile>false</GeneratePkgDefFile>
47+
<DeployExtension>False</DeployExtension>
4748
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
4849
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
4950
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>

0 commit comments

Comments
 (0)