Skip to content

Commit

Permalink
Create Deps package (#2034)
Browse files Browse the repository at this point in the history
* Create Deps package
  • Loading branch information
bbowman authored Feb 23, 2017
1 parent 0c82a47 commit 52d468b
Show file tree
Hide file tree
Showing 19 changed files with 370 additions and 72 deletions.
10 changes: 3 additions & 7 deletions build/BuildSupport/BuildFinalizer.msbuildproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<ItemGroup Label="ProjectConfigurations">
Expand Down Expand Up @@ -37,20 +37,16 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" />

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

<Target Name="CoreCompile"/>
<Target Name="CoreCompile" />
<Target Name="CreateManifestResourceNames" />
<Target Name="GetReferenceAssemblyPaths" />
<Target Name="CopyFilesToOutputDirectory" />

<!-- This is where the fun starts. Any custom generic msbuild project goop goes here. -->
<ItemGroup>
<ProjectReference Include="$(SolutionDir)\**\WinObjC.*.nuproj" />
</ItemGroup>

<Target Name="DeleteTimestampFile" AfterTargets="AfterBuild">
<Delete Files="$(SolutionDir)$(SolutionName).timestamp" TreatErrorsAsWarnings="true"/>
<Delete Files="$(SolutionDir)$(SolutionName).timestamp" TreatErrorsAsWarnings="true" />
</Target>
</Project>
9 changes: 0 additions & 9 deletions build/CoreFoundation/dll/CoreFoundation.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,6 @@

<Target Name="AddExtraPackageItems" BeforeTargets="GetPackageContents">
<ItemGroup>

<!-- Include Extra Deps for this project -->
<_DepsFiles Include="$(StarboardBasePath)\deps\prebuilt\$(TargetOsAndVersion)\$(PlatformTarget)\libxml2.dll"/>
<_DepsFiles Include="$(StarboardBasePath)\deps\prebuilt\$(TargetOsAndVersion)\$(PlatformTarget)\icu*.dll"/>

<PackageFile Include="@(_DepsFiles)">
<PackagePath>build\deps\prebuilt\$(TargetOsAndVersion)\$(PlatformTarget)\%(Filename)%(Extension)</PackagePath>
</PackageFile>

<_CoreFoundationContent Include="$(StarboardBasePath)\Frameworks\CoreFoundation\CharacterSets\**\*.*"/>

<PackageFile Include="@(_CoreFoundationContent)">
Expand Down
15 changes: 0 additions & 15 deletions build/Foundation/dll/Foundation.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,4 @@
<ItemGroup>
<None Include="Project.json" />
</ItemGroup>

<Target Name="AddExtraPackageItems" BeforeTargets="GetPackageContents">
<ItemGroup>

<!-- Include Extra Deps for this project -->
<_DepsFiles Include="$(StarboardBasePath)\deps\prebuilt\$(TargetOsAndVersion)\$(PlatformTarget)\libxml2.dll"/>
<_DepsFiles Include="$(StarboardBasePath)\deps\prebuilt\$(TargetOsAndVersion)\$(PlatformTarget)\icu*.dll"/>

<PackageFile Include="@(_DepsFiles)">
<PackagePath>build\deps\prebuilt\$(TargetOsAndVersion)\$(PlatformTarget)\%(Filename)%(Extension)</PackagePath>
</PackageFile>
</ItemGroup>
</Target>


</Project>
8 changes: 2 additions & 6 deletions build/WinObjC.Frameworks.Core/Readme.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# WinObjC.Frameworks.Core Readme

Building this project will create a .nupkg containing just this Readme file.
WinObjC.Frameworks.Core package provides the build and runtime support for core objective C frameworks like Foundation.

It's always a good idea to provide a more useful package to your users,
alongside a nice descriptive Readme like this one that will open automatically
when the add your package to a project.

Happy nugetizing!
See https://github.com/Microsoft/WinObjC for more information
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<ProjectReference Include="$(MSBuildThisFileDirectory)..\Foundation\dll\Foundation.vcxproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)..\MobileCoreServices\dll\MobileCoreServices.vcxproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)..\Starboard\dll\Starboard.vcxproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)..\WinObjC.Frameworks.ThirdParty\WinObjC.Frameworks.ThirdParty.nuproj" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
<Import Project="$(NuGetAuthoringPath)\NuGet.Packaging.Authoring.targets" Condition="Exists('$(NuGetAuthoringPath)\NuGet.Packaging.Authoring.targets')" />
Expand Down
5 changes: 5 additions & 0 deletions build/WinObjC.Frameworks.ThirdParty/Readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# WinObjC.Frameworks.ThirdParty Readme

WinObjC.Frameworks.ThirdParty package provides the build and runtime support for third party libraries like libxml

See https://github.com/Microsoft/WinObjC for more information
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<GitThisAssembly>true</GitThisAssembly>
</PropertyGroup>

<PropertyGroup>
<PackageId>WinObjC.Frameworks.ThirdParty</PackageId>
<Title>WinObjC.Frameworks.ThirdParty</Title>
<Authors>Microsoft</Authors>
<Owners>Microsoft</Owners>
<Summary>WinObjC.Frameworks.ThirdParty</Summary>
<Description>WinObjC.Frameworks.ThirdParty</Description>
<PackageReleaseNotes>
</PackageReleaseNotes>
<PackageProjectUrl>
</PackageProjectUrl>
<PackageLicenseUrl>
</PackageLicenseUrl>
<Copyright>Copyright © Microsoft</Copyright>
<PackageTags>WinObjC.Frameworks.ThirdParty</PackageTags>
<IncludeSymbolsInPackage>false</IncludeSymbolsInPackage>
<IncludeFrameworkReferencesInPackage>false</IncludeFrameworkReferencesInPackage>
<NoPackageAnalysis>true</NoPackageAnalysis>
</PropertyGroup>

<!-- Inline task to check for timestamp file existence and creation-->
<UsingTask
TaskName="CreateTimestampFileIfNeeded"
TaskFactory="CodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll" >
<ParameterGroup>
<TimestampFile ParameterType="System.String" Required="true" />
<Timestamp ParameterType="System.String" Output="true" />
</ParameterGroup>
<Task>
<Reference Include="System" />
<Reference Include="System.IO" />
<Reference Include="System.Threading" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Threading" />
<Code Type="Fragment" Language="cs">
<![CDATA[
var mutex = new Mutex(false, TimestampFile.Replace("\\", "."));
try
{
mutex.WaitOne();
} catch (AbandonedMutexException e)
{
}
if (!File.Exists(TimestampFile)) {
File.Create(TimestampFile);
}
Timestamp = File.GetCreationTimeUtc(TimestampFile).ToString("yyyyMMddHHmmss");
mutex.ReleaseMutex();
]]>
</Code>
</Task>
</UsingTask>

<PropertyGroup>
<GetPackageVersionDependsOn>SetPackageVersion;$(GetPackageVersionDependsOn);</GetPackageVersionDependsOn>
</PropertyGroup>
<Target Name="SetPackageVersion" DependsOnTargets="$(GitVersionDependsOn)" >

<Error Condition="'$(GitBranch)' == ''"
Text="Cannot determine git branch. Please make sure GitInfo is listed in the project.json for this project and that git.exe is part of the PATH environment variable." />

<Warning Condition="'$(SolutionPath)' == ''"
Text="Cannot determine solution build time. Package version ThirdParty may be inconsistent as a result. Please make sure to build using .sln file." />

<CreateTimestampFileIfNeeded Condition="'$(SolutionDir)' != ''"
TimestampFile="$(SolutionDir)$(SolutionName).timestamp">
<Output PropertyName="PackageTimestamp" TaskParameter="Timestamp" />
</CreateTimestampFileIfNeeded>



<PropertyGroup>
<PackageTimestamp Condition="'$(PackageTimestamp)' == ''">$([System.DateTime]::Now.ToString(yyyyMMddHHmmss))</PackageTimestamp>

<PackageVersion Condition="'$(PackageVersion)' == '' And '$(GitBranch)' == 'master'">$(GitBaseVersionMajor).$(GitBaseVersionMinor).$(PackageTimestamp)</PackageVersion>
<PackageVersion Condition="'$(PackageVersion)' == '' And '$(GitBranch)' == 'develop'">$(GitBaseVersionMajor).$(GitBaseVersionMinor).$([MSBuild]::Add('$(GitBaseVersionPatch)', '1'))-$(PackageTimestamp).dev</PackageVersion>
<PackageVersion Condition="'$(PackageVersion)' == ''">$(GitBaseVersionMajor).$(GitBaseVersionMinor).$([MSBuild]::Add('$(GitBaseVersionPatch)', '1'))-$(PackageTimestamp).pr</PackageVersion>
</PropertyGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<_CoreCompileOverrideDependsOn Condition="'$(SkipGetPackageContentsForOtherPlatforms)' != 'true'">Pack</_CoreCompileOverrideDependsOn>
</PropertyGroup>

<Target Name="CoreCompile" DependsOnTargets="$(_CoreCompileOverrideDependsOn)" />

<Target Name="AddSingleConfigBuildOutput" Returns="@(_PackageContentsForPlat)">
<MSBuild Projects="$(SolutionPath)"
Targets="GetSolutionConfigurationContents"
Properties="Configuration=$(Configuration);Platform=$(Platform)">
<Output TaskParameter="TargetOutputs" ItemName="_SolutionConfigurationContents" />
</MSBuild>

<Message Text="AddSingleConfigBuildOutput Platform: $(Platform)" Importance="High"/>

<MSBuild Projects="$(MSBuildProjectFile)"
Targets="GetPackageContents"
Properties="SkipGetPackageContentsForOtherPlatforms=true;BuildingInsideVisualStudio=false;BuildProjectReferences=true;Configuration=$(Configuration);Platform=$(Platform);CurrentSolutionConfigurationContents=%(_SolutionConfigurationContents.Identity);GetPackageContentsDependsOn=Build;$(GetPackageContentsDependsOn)">
<Output TaskParameter="TargetOutputs" ItemName="_PackageContentsForPlat" />
</MSBuild>
</Target>

<Target Name="AddOtherConfigsBuiltOutput" BeforeTargets="GetPackageContents" Condition="'$(SkipGetPackageContentsForOtherPlatforms)' != 'true' AND '$(Platform)' == 'AnyCPU'">

<ItemGroup>
<_PackTargetPlat Include="%(ProjectConfiguration.Platform)"
Condition="'%(ProjectConfiguration.Configuration)' == '$(Configuration)' AND '%(ProjectConfiguration.Platform)' != '$(Platform)'" />
</ItemGroup>

<MSBuild Projects="$(MSBuildProjectFile)"
Targets="AddSingleConfigBuildOutput"
Properties="Platform=%(_PackTargetPlat.Identity)">
<Output TaskParameter="TargetOutputs" ItemName="_OtherPackageContents" />
</MSBuild>

<ItemGroup>
<PackageFile Include="@(_OtherPackageContents)" />
</ItemGroup>

</Target>

<Target Name="AddBuiltOutput" BeforeTargets="GetPackageContents" DependsOnTargets="$(GitVersionDependsOn)" Condition="'$(SkipGetPackageContentsForOtherPlatforms)' != 'true'">

<ItemGroup>
<!-- Include Deps for this project -->
<_DepsFiles Include="$(StarboardBasePath)\deps\prebuilt\**\icu*.dll"/>
<_DepsFiles Include="$(StarboardBasePath)\deps\prebuilt\**\icu*.lib"/>

<_DepsFiles Include="$(StarboardBasePath)\deps\prebuilt\**\libxml*.dll"/>
<_DepsFiles Include="$(StarboardBasePath)\deps\prebuilt\**\libxml*.lib"/>

<_DepsFiles Include="$(StarboardBasePath)\deps\prebuilt\**\OpenAl.dll"/>
<_DepsFiles Include="$(StarboardBasePath)\deps\prebuilt\**\OpenAl.lib"/>

<_DepsFiles Include="$(StarboardBasePath)\deps\prebuilt\**\libz.dll"/>
<_DepsFiles Include="$(StarboardBasePath)\deps\prebuilt\**\libz.lib"/>


<PackageFile Include="@(_DepsFiles)">
<PackagePath>build\deps\prebuilt\%(RecursiveDir)%(Filename)%(Extension)</PackagePath>
</PackageFile>

<!-- include folder for project -->
<_LibZIncludeFiles Include="$(StarboardBasePath)\deps\prebuilt\include\z*.*"/>

<PackageFile Include="@(_LibZIncludeFiles)" Condition="Exists('%(FullPath)')">
<PackagePath>build\include\%(RecursiveDir)%(Filename)%(Extension)</PackagePath>
</PackageFile>

<_LibXmlIncludeFiles Include="$(StarboardBasePath)\deps\prebuilt\include\libxml\**\*.*"/>

<PackageFile Include="@(_LibXmlIncludeFiles)" Condition="Exists('%(FullPath)')">
<PackagePath>build\include\libxml\%(RecursiveDir)%(Filename)%(Extension)</PackagePath>
</PackageFile>

<_ICUIncludeFiles Include="$(StarboardBasePath)\deps\prebuilt\include\icu\**\*.*"/>

<PackageFile Include="@(_ICUIncludeFiles)" Condition="Exists('%(FullPath)')">
<PackagePath>build\include\icu\%(RecursiveDir)%(Filename)%(Extension)</PackagePath>
</PackageFile>

<_OpenAlIncludeFiles Include="$(StarboardBasePath)\deps\prebuilt\include\OpenAL\**\*.*"/>

<PackageFile Include="@(_OpenAlIncludeFiles)" Condition="Exists('%(FullPath)')">
<PackagePath>build\include\OpenAL\%(RecursiveDir)%(Filename)%(Extension)</PackagePath>
</PackageFile>

<PackageFile Include="$(MSBuildThisFileDirectory)$(PackageId).props" Condition="Exists('$(MSBuildThisFileDirectory)$(PackageId).props')">
<PackagePath>build\$(PackageId).props</PackagePath>
</PackageFile>
<PackageFile Include="$(MSBuildThisFileDirectory)$(PackageId).targets" Condition="Exists('$(MSBuildThisFileDirectory)$(PackageId).targets')">
<PackagePath>build\$(PackageId).targets</PackagePath>
</PackageFile>
</ItemGroup>
</Target>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(NuGetAuthoringPath)\NuGet.Packaging.Authoring.props" Condition="Exists('$(NuGetAuthoringPath)\NuGet.Packaging.Authoring.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|AnyCPU">
<Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|AnyCPU">
<Configuration>Release</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" />
<Import Project="WinObjC.Frameworks.ThirdParty.Packaging.props" />
<PropertyGroup Label="Globals">
<OutputPath>$(SolutionDir)\OutputPackages\$(Configuration)\</OutputPath>
<ProjectGuid>DFDF94D9-2A0A-4F9B-953B-6BF383858AD3</ProjectGuid>
<InferLegacyPackageReferences>false</InferLegacyPackageReferences>
<StarboardBasePath>$(MSBuildThisFileDirectory)..\..\</StarboardBasePath>
</PropertyGroup>
<ItemGroup>
<None Include="project.json" />
<None Include="WinObjC.Frameworks.ThirdParty.Packaging.props" />
<None Include="WinObjC.Frameworks.ThirdParty.Packaging.targets" />
<None Include="WinObjC.Frameworks.ThirdParty.props" />
<None Include="WinObjC.Frameworks.ThirdParty.targets" />
</ItemGroup>
<ItemGroup>
<None Include="Readme.txt">
<IncludeInPackage>true</IncludeInPackage>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
<Import Project="$(NuGetAuthoringPath)\NuGet.Packaging.Authoring.targets" Condition="Exists('$(NuGetAuthoringPath)\NuGet.Packaging.Authoring.targets')" />
<Import Project="WinObjC.Frameworks.ThirdParty.Packaging.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
Loading

0 comments on commit 52d468b

Please sign in to comment.