Skip to content

Commit

Permalink
Merge pull request #374 from cdmihai/osx-baseline
Browse files Browse the repository at this point in the history
Osx Build (with xplat based dependencies)
  • Loading branch information
cdmihai committed Dec 1, 2015
2 parents f7d975f + 10c0c78 commit 036119f
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 22 deletions.
1 change: 1 addition & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<add key="myget.org dotnet-corefx" value="https://www.myget.org/F/dotnet-corefx/" />
<add key="myget.org dotnet-corefxtestdata" value="https://www.myget.org/F/dotnet-corefxtestdata/" />
<add key="myget.org dotnet-core" value="https://www.myget.org/F/dotnet-core/" />
<add key="myget.org aspnet vnext" value="https://www.myget.org/F/aspnetvnext/api/v3/index.json" />
<add key="nuget.org v2" value="https://nuget.org/api/v2/" />
</packageSources>
</configuration>
9 changes: 6 additions & 3 deletions dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

<!-- Common repo directories -->
<PropertyGroup>
<BuildToolsVersion>1.0.25-prerelease-00115</BuildToolsVersion>
<CompilerToolsVersion>1.1.0-rc1</CompilerToolsVersion>
<BuildToolsVersion>1.0.25-prerelease-00120</BuildToolsVersion>
<CompilerToolsVersion>1.2.0-beta-20151112-01</CompilerToolsVersion>
<NuSpecReferenceGeneratorVersion>1.3.1</NuSpecReferenceGeneratorVersion>
<XunitVersion>2.1.0</XunitVersion>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
Expand All @@ -35,6 +35,8 @@
<DnxVersion Condition="'$(OsEnvironment)'=='Windows_NT'">1.0.0-beta8</DnxVersion>
<DnxDir Condition="'$(OsEnvironment)'=='Unix'">dnx-coreclr-linux-x64</DnxDir>
<DnxVersion Condition="'$(OsEnvironment)'=='Unix'">1.0.0-beta8</DnxVersion>
<DnxDir Condition="'$(OsEnvironment)'=='OSX'">dnx-coreclr-darwin-x64</DnxDir>
<DnxVersion Condition="'$(OsEnvironment)'=='OSX'">1.0.0-rc2-16177</DnxVersion>

<!-- Output directories -->
<BinDir>$(RepoRoot)bin$([System.IO.Path]::DirectorySeparatorChar)</BinDir>
Expand All @@ -48,7 +50,8 @@

<DnuToolDir Condition="'$(OsEnvironment)'!='Windows_NT'">$([System.IO.Path]::Combine($(PackagesDir), "$(DnxDir).$(DnxVersion)"))</DnuToolDir>
<DnuToolPath Condition="'$(OsEnvironment)'=='Windows_NT'">$([System.IO.Path]::Combine($(DnuToolDir), "bin", "dnu.cmd"))</DnuToolPath>
<DnuToolPath Condition="'$(OsEnvironment)'=='Unix'">$([System.IO.Path]::Combine($(DnuToolDir), "bin", "dnu"))</DnuToolPath>
<DnuToolPath Condition="'$(OsEnvironment)'!='Windows_NT'">$([System.IO.Path]::Combine($(DnuToolDir), "bin", "dnu"))</DnuToolPath>

</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion override.targets
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<PrereleaseResolveNuGetPackageAssets Condition="'$(ProjectLockFile)' != ''"
AllowFallbackOnTargetSelection="false"
IncludeFrameworkReferences="true"
ProjectLanguage="$(Language)"
ProjectLanguage="C#"
ProjectLockFile="$(ProjectLockFile)"
TargetMonikers="$(NuGetTargetMoniker)"
OmitTransitiveCompileReferences="$(_OmitTransitiveReferences)">
Expand Down
13 changes: 9 additions & 4 deletions src/.nuget/packageLoad.targets
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@
<!-- UNDO: When fixed https://github.com/NuGet/Home/issues/1517 -->
<NuGetPackageRestoreOptions Condition="'$(OsEnvironment)'!='Windows_NT'">$(NuGetPackageRestoreOptions) -PackagesDirectory "$(PackagesCache)"</NuGetPackageRestoreOptions>
<NuGetRestoreCommand>$(NuGetToolPath) restore $(NuGetCommonOptions)</NuGetRestoreCommand>
<NuGetRestoreCommand Condition="'$(OsEnvironment)'!='Windows_NT'">MONO_THREADS_PER_CPU=2000 mono --server $(NuGetRestoreCommand)</NuGetRestoreCommand>
<NuGetInstallCommand>$(NuGetToolPath) install $(NuGetCommonOptions)</NuGetInstallCommand>
<NuGetInstallCommand Condition="'$(OsEnvironment)'!='Windows_NT' and '$(MonoBuild)' == 'true'">export MONO_THREADS_PER_CPU=2000; mono $(NuGetInstallCommand)</NuGetInstallCommand>
<NuGetInstallCommand Condition="'$(OsEnvironment)'!='Windows_NT'">MONO_THREADS_PER_CPU=2000 mono --server $(NuGetInstallCommand)</NuGetInstallCommand>
<SolutionSemaphore>$(NuGetDir)Solution.semaphore</SolutionSemaphore>
<NugetDownloadURL>https://dist.nuget.org/win-x86-commandline/v3.2.1-rc/nuget.exe</NugetDownloadURL>
<DownloadCommand Condition="'$(OsEnvironment)'=='Windows_NT'">powershell -noprofile -nologo -command "(new-object System.Net.WebClient).DownloadFile('$(NugetDownloadURL)', '$(NuGetToolPath)')"</DownloadCommand>
Expand Down Expand Up @@ -129,15 +130,19 @@
Inputs="@(ProjectJsonFile)"
Outputs="%(ProjectJsonFile.RootDir)%(ProjectJsonFile.Directory)project.lock.json"
AfterTargets="_RestoreGlobalReferences"
Condition="('$(SolutionFile)'=='' or !Exists('$(SolutionFile)')) and '$(OS)'=='Unix'" >
Condition="('$(SolutionFile)'=='' or !Exists('$(SolutionFile)')) and '$(OS)'!='Windows_NT'" >
<PropertyGroup>
<ProjectDirectory>%(ProjectJsonFile.RootDir)%(ProjectJsonFile.Directory)</ProjectDirectory>
</PropertyGroup>

<Message Importance="High" Text="Restoring in $(ProjectDirectory)" />

<!-- Restore packages for this directory -->
<Exec Command="$(NugetRestoreCommand) $(NuGetPackageRestoreOptions) -PackagesDirectory &quot;$(HOME)/.nuget/packages&quot; &quot;@(ProjectJsonFile)&quot;" />
<!-- TODO: Restore back to Nuget once Nuget works -->
<!-- Restore packages for this directory using Nuget-->
<!-- <Exec Command="$(NugetRestoreCommand) $(NuGetPackageRestoreOptions) -PackagesDirectory &quot;$(HOME)/.nuget/packages&quot; &quot;@(ProjectJsonFile)&quot;" /> -->

<!-- Restore packages for this directory using DNU-->
<Exec Condition="'$(OsEnvironment)'!='Windows_NT'" Command="$(DnuRestoreCommand) &quot;@(ProjectJsonFile)&quot;" />
</Target>

<!--
Expand Down
4 changes: 4 additions & 0 deletions src/.nuget/packages.OSX.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="dnx-coreclr-darwin-x64" version="1.0.0-rc2-16177" />
</packages>
4 changes: 2 additions & 2 deletions src/.nuget/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.DotNet.BuildTools" version="1.0.25-prerelease-00115" />
<package id="Microsoft.Net.Compilers" version="1.1.0-rc1" targetFramework="net451" userInstalled="true" />
<package id="Microsoft.DotNet.BuildTools" version="1.0.25-prerelease-00120" />
<package id="Microsoft.Net.Compilers" version="1.2.0-beta-20151112-01" targetFramework="net451" userInstalled="true" />
<package id="xunit.runner.console" version="2.1.0" />
<package id="NuSpec.ReferenceGenerator" version="1.3.1" />
</packages>
4 changes: 2 additions & 2 deletions src/XMakeBuildEngine/project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"dependencies": {
"System.Reflection.Metadata": "1.0.23-beta-23406",
"System.Runtime.Loader": "4.0.0-beta-23428",
"System.Threading.Tasks.Dataflow": "4.5.26-beta-23406"
},
"frameworks": {
Expand All @@ -21,6 +20,7 @@
"System.Console": "4.0.0-beta-23406",
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0-beta-23406",
"System.Runtime.Extensions": "4.0.11-beta-23406",
"System.Runtime.Loader": "4.0.0-beta-23406",
"System.Diagnostics.FileVersionInfo": "4.0.0-beta-23406",
"System.Diagnostics.Process": "4.1.0-beta-23406",
"System.Diagnostics.TraceSource": "4.0.0-beta-23406",
Expand All @@ -39,4 +39,4 @@
"imports": "portable-net451+win81"
}
}
}
}
3 changes: 2 additions & 1 deletion src/XMakeCommandLine/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"System.Diagnostics.FileVersionInfo": "4.0.0-beta-23406",
"System.Diagnostics.Process": "4.1.0-beta-23406",
"System.Diagnostics.TraceSource": "4.0.0-beta-23406",
"System.Runtime.Loader": "4.0.0-beta-23406",
"System.Security.Cryptography.X509Certificates": "4.0.0-beta-23413",
"System.Threading.Thread": "4.0.0-beta-23406",
"System.Threading.ThreadPool": "4.0.10-beta-23413",
Expand All @@ -27,4 +28,4 @@
"imports": "portable-net451+win81"
}
}
}
}
4 changes: 2 additions & 2 deletions targets/DeployDependencies.proj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<RuntimeProjectJson>$(MSBuildThisFileDirectory)\runtime.project.json</RuntimeProjectJson>
<RuntimeProjectLockJson>$(MSBuildThisFileDirectory)\runtime.project.lock.json</RuntimeProjectLockJson>
<RestoreRuntimePackagesCommand>"$(NuGetToolPath)" restore $(RuntimeProjectJson) -Verbosity detailed</RestoreRuntimePackagesCommand>
<RestoreRuntimePackagesCommand Condition="'$(OsEnvironment)'!='Windows_NT' and '$(MonoBuild)' == 'true'">export MONO_THREADS_PER_CPU=2000; mono $(RestoreRuntimePackagesCommand)</RestoreRuntimePackagesCommand>
<RestoreRuntimePackagesCommand Condition="'$(OsEnvironment)'!='Windows_NT' and '$(MonoBuild)' == 'true'">MONO_THREADS_PER_CPU=2000 mono $(RestoreRuntimePackagesCommand)</RestoreRuntimePackagesCommand>
<NuGetRuntimeIdentifier>$(RuntimeSystem)-$(RuntimeArchitecture)</NuGetRuntimeIdentifier>
</PropertyGroup>

Expand All @@ -65,7 +65,7 @@
IncludeFrameworkReferences="false"
NuGetPackagesDirectory=""
RuntimeIdentifier="$(NuGetRuntimeIdentifier)"
ProjectLanguage=""
ProjectLanguage="C#"
ProjectLockFile="$(RuntimeProjectLockJson)"
TargetMonikers="$(NuGetTargetMoniker)">

Expand Down
28 changes: 22 additions & 6 deletions targets/LinuxDeployDependencies.proj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
<Import Project="../override.targets" />

<PropertyGroup>
<NuGetRuntimeIdentifier Condition="'$(NetCoreBuild)' == 'true'">ubuntu.14.04-x64</NuGetRuntimeIdentifier>
<NuGetRuntimeIdentifier Condition="'$(NetCoreBuild)' != 'true'">win7-x64</NuGetRuntimeIdentifier>
<NuGetRuntimeIdentifier>$(RuntimeSystem)-$(RuntimeArchitecture)</NuGetRuntimeIdentifier>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -47,6 +46,7 @@
Inputs="@(IntermediateRuntimeProjectJsonLockFile)"
Outputs="@(RuntimeProjectJsonLockFile)"
AfterTargets="RestoreRuntimePackagesDnu"
BeforeTargets="DeployRuntime"
>
<Copy SourceFiles="@(IntermediateRuntimeProjectJsonLockFile)"
DestinationFiles="@(RuntimeProjectJsonLockFile)"
Expand All @@ -63,7 +63,7 @@
Outputs="@(RuntimeProjectJsonFile->'%(Directory)%(Filename).lock.json')"
>

<Exec Condition="'$(OsEnvironment)'!='Windows_NT'" Command="$(DnuRestoreCommand) &quot;%(IntermediateRuntimeProjectJsonFile.FullPath)&quot; --parallel " />
<Exec Condition="'$(OsEnvironment)'!='Windows_NT'" Command="$(DnuRestoreCommand) &quot;%(IntermediateRuntimeProjectJsonFile.FullPath)&quot;" />

</Target>

Expand Down Expand Up @@ -94,23 +94,39 @@
<_OmitTransitiveReferences Condition="'$(NetCoreBuild)'!='true'">true</_OmitTransitiveReferences>
</PropertyGroup>

<PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="false"
<Error
Text="'%(RuntimeProjectJsonLockFile.FullPath)' does not exist"
Condition="!Exists('%(RuntimeProjectJsonLockFile.FullPath)')" />


<PrereleaseResolveNuGetPackageAssets AllowFallbackOnTargetSelection="true"
IncludeFrameworkReferences="false"
RuntimeIdentifier="$(NuGetRuntimeIdentifier)"
NuGetPackagesDirectory="$(PackagesCache)"
ProjectLanguage="$(Language)"
ProjectLanguage="C#"
ProjectLockFile="%(RuntimeProjectJsonLockFile.FullPath)"
TargetMonikers="$(NuGetTargetMoniker)"
OmitTransitiveCompileReferences="$(_OmitTransitiveReferences)">
<Output TaskParameter="ResolvedCopyLocalItems" ItemName="ResolvedRuntimeFiles" />

</PrereleaseResolveNuGetPackageAssets>

<!-- Copy the dependencies to both the deployment and the test directories -->

<Copy SourceFiles="@(ResolvedRuntimeFiles)"
DestinationFolder="$(RuntimeDirectory)"
DestinationFolder="$(DeploymentDir)"
SkipUnchangedFiles="true"
/>

<Copy SourceFiles="@(ResolvedRuntimeFiles)"
DestinationFolder="$(TestDeploymentDir)"
SkipUnchangedFiles="true"
/>

<Exec Command="find &quot;$(DeploymentDir)&quot; -type f -a -name &quot;*&quot; -print0 | xargs -0 -I {} chmod a+xr {}" />

<Exec Command="find &quot;$(TestDeploymentDir)&quot; -type f -a -name &quot;*&quot; -print0 | xargs -0 -I {} chmod a+xr {}" />

</Target>

<Target Name="DeployDependencies"
Expand Down
3 changes: 2 additions & 1 deletion targets/runtime.project.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"System.Reflection": "4.1.0-beta-23406",
"System.Reflection.Metadata": "1.1.0",
"System.Runtime.Extensions": "4.0.11-beta-23406",
"System.Runtime.Loader": "4.0.0-beta-23406",
"System.Threading.Thread": "4.0.0-beta-23406",
"System.Threading.ThreadPool": "4.0.10-beta-23413",
"System.Xml.XmlDocument": "4.0.1-beta-23406",
Expand All @@ -52,4 +53,4 @@
"imports": "portable-net451+win81"
}
}
}
}

0 comments on commit 036119f

Please sign in to comment.