Test packages from current build in pipeline
authorwtgodbe <wigodbe@microsoft.com>
Wed, 24 May 2017 21:34:46 +0000 (14:34 -0700)
committerwtgodbe <wigodbe@microsoft.com>
Tue, 6 Jun 2017 19:13:34 +0000 (12:13 -0700)
18 files changed:
BuildToolsVersion.txt
buildpipeline/DotNet-CoreClr-Trusted-Linux-Crossbuild.json
buildpipeline/DotNet-CoreClr-Trusted-Linux.json
buildpipeline/DotNet-CoreClr-Trusted-Mac.json
buildpipeline/DotNet-CoreClr-Trusted-Windows-x86.json
buildpipeline/DotNet-CoreClr-Trusted-Windows.json
buildpipeline/Dotnet-CoreClr-Trusted-BuildTests.json
config.json
dependencies.props
dir.props
src/createVersionFile.proj [new file with mode: 0644]
src/syncAzure.proj
sync.cmd
tests/build.proj
tests/dir.props
tests/publishdependency.targets
tests/runtest.proj
tests/src/dir.props

index a72a222..c6b2318 100644 (file)
@@ -1 +1 @@
-2.0.0-prerelease-01702-02
+2.0.0-prerelease-01702-02
\ No newline at end of file
index 6432a88..312d08c 100644 (file)
       },
       "inputs": {
         "filename": "docker",
-        "arguments": "run --rm $(DockerCommonRunArgs) ./build-packages.sh -BuildType=$(PB_BuildType) -BuildArch=$(Architecture)",
+        "arguments": "run --rm $(DockerCommonRunArgs) ./build-packages.sh -BuildType=$(PB_BuildType) -BuildArch=$(Architecture) -- /p:OfficialBuildId=$(OfficialBuildId)",
         "workingFolder": "",
         "failOnStandardError": "false"
       }
index 82c282d..882c112 100644 (file)
       },
       "inputs": {
         "filename": "docker",
-        "arguments": "run --rm $(DockerCommonRunArgs) ./build-packages.sh -BuildType=$(PB_BuildType) -BuildArch=$(Architecture)",
+        "arguments": "run --rm $(DockerCommonRunArgs) ./build-packages.sh -BuildType=$(PB_BuildType) -BuildArch=$(Architecture) -- /p:OfficialBuildId=$(OfficialBuildId)",
         "workingFolder": "",
         "failOnStandardError": "false"
       }
index ae289d1..b96ebb5 100644 (file)
@@ -67,7 +67,7 @@
       },
       "inputs": {
         "filename": "$(Agent.BuildDirectory)/s/build-packages.sh",
-        "arguments": "-BuildType=$(PB_BuildType) -BuildArch=$(Architecture)",
+        "arguments": "-BuildType=$(PB_BuildType) -BuildArch=$(Architecture) -- /p:OfficialBuildId=$(OfficialBuildId)",
         "workingFolder": "",
         "failOnStandardError": "false"
       }
index f6a852f..8ec9054 100644 (file)
       },
       "inputs": {
         "filename": "build-packages.cmd",
-        "arguments": "-BuildArch=$(Architecture) -BuildType=$(PB_BuildType)",
+        "arguments": "-BuildArch=$(Architecture) -BuildType=$(PB_BuildType) -- /p:OfficialBuildId=$(OfficialBuildId)",
         "workingFolder": "",
         "failOnStandardError": "false"
       }
index cb2e570..6cf49de 100644 (file)
       },
       "inputs": {
         "filename": "build-packages.cmd",
-        "arguments": "-BuildArch=$(Architecture) -BuildType=$(PB_BuildType)",
+        "arguments": "-BuildArch=$(Architecture) -BuildType=$(PB_BuildType) -- /p:OfficialBuildId=$(OfficialBuildId)",
         "workingFolder": "",
         "failOnStandardError": "false"
       }
index b501f9a..8e46631 100644 (file)
@@ -41,7 +41,7 @@
       "enabled": true,
       "continueOnError": true,
       "alwaysRun": false,
-      "displayName": "Run sync.cmd",
+      "displayName": "Sync test native binaries",
       "timeoutInMinutes": 0,
       "task": {
         "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
       "enabled": true,
       "continueOnError": false,
       "alwaysRun": false,
+      "displayName": "Sync packages",
+      "timeoutInMinutes": 0,
+      "task": {
+        "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
+        "versionSpec": "1.*",
+        "definitionType": "task"
+      },
+      "inputs": {
+        "filename": "sync.cmd",
+        "arguments": "-ab -AzureAccount=$(CloudDropAccountName) -AzureToken=$(CloudDropAccessToken) -Container=$(Label) -BlobNamePrefix=$(PB_BuildType)/pkg/Microsoft",
+        "workingFolder": "",
+        "failOnStandardError": "false"
+      }
+    },
+    {
+      "enabled": true,
+      "continueOnError": false,
+      "alwaysRun": false,
+      "displayName": "Sync runtime packages",
+      "timeoutInMinutes": 0,
+      "task": {
+        "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
+        "versionSpec": "1.*",
+        "definitionType": "task"
+      },
+      "inputs": {
+        "filename": "sync.cmd",
+        "arguments": "-ab -AzureAccount=$(CloudDropAccountName) -AzureToken=$(CloudDropAccessToken) -Container=$(Label) -BlobNamePrefix=$(PB_BuildType)/pkg/runtime",
+        "workingFolder": "",
+        "failOnStandardError": "false"
+      }
+    },
+    {
+      "enabled": true,
+      "continueOnError": false,
+      "alwaysRun": false,
+      "displayName": "Generate version props file",
+      "timeoutInMinutes": 0,
+      "task": {
+        "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
+        "versionSpec": "1.*",
+        "definitionType": "task"
+      },
+      "inputs": {
+        "filename": "msbuild",
+        "arguments": "createVersionFile.proj /p:OfficialBuildId=$(OfficialBuildId)",
+        "workingFolder": "src",
+        "failOnStandardError": "false"
+      }
+    },
+    {
+      "enabled": true,
+      "continueOnError": false,
+      "alwaysRun": false,
       "displayName": "Run build-test.cmd",
       "timeoutInMinutes": 0,
       "task": {
       },
       "inputs": {
         "filename": "build-test.cmd",
-        "arguments": "$(PB_BuildType) $(Architecture) buildagainstpackages runtimeid $(Rid) $(TargetsNonWindowsArg)$(CrossgenArg)-OfficialBuildId=$(OfficialBuildId) -Priority=$(Priority)",
+        "arguments": "$(PB_BuildType) $(Architecture) buildagainstpackages runtimeid $(Rid) $(TargetsNonWindowsArg)$(CrossgenArg)-OfficialBuildId=$(OfficialBuildId) -OverwriteCoreClrPackageVersion -Priority=$(Priority)",
         "workingFolder": "",
         "failOnStandardError": "false"
       }
index a5f98aa..a85dcd5 100644 (file)
       "values": [],
       "defaultValue": ""
     },
+    "__BlobNamePrefix": {
+      "description": "Blob Prefix for Azure download.",
+      "valueType": "property",
+      "values": [],
+      "defaultValue": ""
+    },
     "MsBuildFileLogging": {
       "description": "MsBuild logging options.",
       "valueType": "passThrough",
       "values": [],
       "defaultValue": ""
     },
+    "OverwriteCoreClrPackageVersion": {
+      "description": "Sets the property specifying to overwrite CoreClr Package version using OfficialBuildId",
+      "valueType": "property",
+      "values": [ true, false ],
+      "defaultValue": true
+    },
     "OfficialBuildId": {
       "description": "Official Build Id.",
       "valueType": "property",
             "__Container": "default"
           }
         },
+        "blobNamePrefix": {
+          "description": "Blob Prefix to download from in Azure container.",
+          "settings": {
+            "__BlobNamePrefix": "default"
+          }
+        },
         "runtimeId": {
           "description": "Runtime ID of the binaries in the specified container.",
           "settings": {
index 77f5c79..530ac23 100644 (file)
@@ -1,4 +1,16 @@
 <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+  <PropertyGroup>
+    <!-- Central place to set the versions of all nuget packages produced in the repo -->
+    <PackageVersion Condition="'$(PackageVersion)' == ''">2.1.0</PackageVersion>
+    
+    <!-- Set the boolean below to true to generate packages with stabilized versions -->
+    <StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
+    <StableVersion Condition="'$(StabilizePackageVersion)' == 'true' and '$(StableVersion)' == ''">$(PackageVersion)</StableVersion>
+
+    <PreReleaseLabel>preview1</PreReleaseLabel>
+  </PropertyGroup>
+  
   <!-- Source of truth for dependency tooling: the commit hash of the dotnet/versions master branch as of the last auto-upgrade. -->
   <PropertyGroup>
     <CoreFxCurrentRef>6fa6ed1a40843f4ec7c0779aed68ec01b888ba1a</CoreFxCurrentRef>
index 451e550..9039f49 100644 (file)
--- a/dir.props
+++ b/dir.props
   <!-- Packaging properties -->
   <PropertyGroup>
     <LicenseUrl>https://github.com/dotnet/coreclr/blob/master/LICENSE.TXT</LicenseUrl>
-    <PreReleaseLabel>preview1</PreReleaseLabel>
     <PackageDescriptionFile>$(SourceDir).nuget/descriptions.json</PackageDescriptionFile>
     <PackageLicenseFile>$(ProjectDir)LICENSE.TXT</PackageLicenseFile>
     <PackageThirdPartyNoticesFile>$(ProjectDir)THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile>
     <ReleaseNotes>https://go.microsoft.com/fwlink/?LinkID=799421</ReleaseNotes>
 
     <ProjectUrl>https://dot.net</ProjectUrl>
-
-    <!-- Central place to set the versions of all nuget packages produced in the repo -->
-    <PackageVersion Condition="'$(PackageVersion)' == ''">2.1.0</PackageVersion>
-    
-    <!-- Set the boolean below to true to generate packages with stabilized versions -->
-    <StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
-    <StableVersion Condition="'$(StabilizePackageVersion)' == 'true' and '$(StableVersion)' == ''">$(PackageVersion)</StableVersion>
     
     <!-- On Windows, MSbuild still runs against Desktop FX while it runs on .NET Core on non-Windows. this requires
          pulling in different packaging dependencies.
     <PackageIndex Include="$(PackageIndexFile)" />
   </ItemGroup>
 
+  <PropertyGroup>
+    <BuildVersionFile>$(BaseIntermediateOutputPath)BuildVersion-$(OfficialBuildId).props</BuildVersionFile>
+  </PropertyGroup>
+
   <!-- Use Roslyn Compilers to build -->
   <Import Project="$(RoslynPropsFile)" Condition="'$(RunningOnUnix)'!='true' and Exists('$(RoslynPropsFile)') and '$(UseRoslynCompilers)'!='false'" />
   <Import Project="$(RoslynPropsFile)" Condition="'$(RunningOnUnix)'=='true' and Exists('$(RoslynPropsFile)')" />
diff --git a/src/createVersionFile.proj b/src/createVersionFile.proj
new file mode 100644 (file)
index 0000000..4edddc7
--- /dev/null
@@ -0,0 +1,13 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+  <Import Project="..\dir.props" />
+  <Import Project="$(ToolsDir)versioning.targets" Condition="Exists('$(ToolsDir)versioning.targets')"/>
+
+  <PropertyGroup>
+    <VersionPropsImported>false</VersionPropsImported>
+  </PropertyGroup>
+
+  <Target Name="Build"
+    DependsOnTargets="CreateOrUpdateCurrentVersionFile">
+  </Target>
+</Project>
\ No newline at end of file
index a5bb495..aeea48d 100644 (file)
@@ -7,6 +7,7 @@
     <ContainerName Condition="'$(__Container)' == '' and '$(ContainerNamePrefix)' != '' and '$(BuildNumberMajor)' != '' and '$(BuildNumberMinor)' != ''">$(ContainerNamePrefix)-$(BuildNumberMajor)-$(BuildNumberMinor)</ContainerName>
     <ContainerName Condition="'$(__Container)' != ''">$(__Container)</ContainerName>
     <ContainerName>$(ContainerName.Replace(".","-"))</ContainerName>
+    <BlobNamePrefix>$(__BlobNamePrefix)</BlobNamePrefix>
     <DownloadDirectory Condition="'$(PublishTestNativeBins)' != 'true'">$(PackagesDir)AzureTransfer</DownloadDirectory>
     <DownloadDirectory Condition="'$(PublishTestNativeBins)' == 'true'">$(PackagesDir)TestNativeBins\$(RuntimeId)</DownloadDirectory>
   </PropertyGroup>
index f633155..218fb9d 100644 (file)
--- a/sync.cmd
+++ b/sync.cmd
@@ -26,6 +26,8 @@ echo                 -BuildMajor
 echo                 -BuildMinor
 echo              To download from a specific container, specify:
 echo                 -Container="container name"
+echo              To download blobs starting with a specific prefix, specify:
+echo                 -BlobNamePrefix="Blob name prefix"
 echo     -n     - Downloads test native binaries from the specified container
 echo              The following properties are required:
 echo                 -AzureAccount="Account name"
index 584ac58..a57c883 100644 (file)
@@ -51,7 +51,7 @@
   </Target>
 
   <Target Name="RestorePackage">
-    <Exec Command="$(DotnetRestoreCommand) $(RestoreProj)"
+    <Exec Command="$(DotnetRestoreCommand) $(RestoreProj) $(PackageVersionArg)"
           StandardOutputImportance="Low" />
   </Target>
 
index f44d73a..0b548db 100644 (file)
@@ -1,5 +1,4 @@
 <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-
   <!--
     $(OS) is set to Unix/Windows_NT. This comes from an environment variable on Windows and MSBuild on Unix.
   -->
@@ -85,6 +84,7 @@
 
    <ItemGroup> 
      <!-- Need to escape double forward slash (%2F) or MSBuild will normalize to one slash on Unix. -->
+     <DotnetSourceList Include="$(PackagesDir)AzureTransfer\$(__BuildType)\pkg\" Condition="'$(OverwriteCoreClrPackageVersion)' == 'true'" />
      <DotnetSourceList Include="https:%2F%2Fdotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json" />
      <DotnetSourceList Include="https:%2F%2Fdotnet.myget.org/F/dotnet-core/api/v3/index.json" /> 
      <DotnetSourceList Include="https:%2F%2Fapi.nuget.org/v3/index.json" /> 
     <RestorePackages>false</RestorePackages>
   </PropertyGroup>
 
+  <PropertyGroup>
+    <BuildVersionFile>$(BaseIntermediateOutputPath)BuildVersion-$(OfficialBuildId).props</BuildVersionFile>
+  </PropertyGroup>
+
+  <!-- If we want to overwrite the desired CoreCLR package version, we need to get the new version from the generated props file in bin/obj -->
+  <Import Condition="'$(OverwriteCoreClrPackageVersion)' == 'true'" Project="$(BuildVersionFile)" />
+
+  <PropertyGroup Condition="'$(OverwriteCoreClrPackageVersion)' == 'true'">
+    <VersionToRestore Condition="'$(StableVersion)' != ''">$(StableVersion)</VersionToRestore>
+    <VersionToRestore Condition="'$(VersionToRestore)' == ''">$(PackageVersion)</VersionToRestore>
+    <PackageVersionArg>/p:CoreClrPackageVersion=$(VersionToRestore)-$(PreReleaseLabel)-$(BuildNumberMajor)-$(BuildNumberMinor)</PackageVersionArg>
+  </PropertyGroup>
+
   <!-- Which tests shall we build? Default: Priority 0 tests.
     At the command-line, the user can specify /p:CLRTestPriorityToBuild=666 (for example), and
     all tests with CLRTestPriority 666,..., 1 AND 0 will build. 
index 80d1f71..8cae729 100644 (file)
@@ -31,7 +31,7 @@
   </ItemGroup>
 
   <ItemGroup>
-    <CrossGenFiles Include="..\packages\runtime.$(TargetRid).Microsoft.NETCore.Runtime.CoreCLR\$(CoreClrPackageVersion)\tools\crossgen*"/>
+    <CrossGenFiles Include="..\packages\runtime.$(TargetRid).Microsoft.NETCore.Runtime.CoreCLR\$(DesiredPackageVersionArg)\tools\crossgen*"/>
   </ItemGroup>
 
   <PropertyGroup>
index 18b3304..15734ce 100644 (file)
@@ -323,7 +323,16 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
     <ItemGroup>
       <AllRunnableTestPaths Include="$(XunitTestBinBase)\**\*.cmd" />
     </ItemGroup>
-  </Target> 
+  </Target>
+
+  <!-- If we want to overwrite the desired CoreCLR package version, we need to get the new version from the generated props file in bin/obj -->
+  <Import Condition="'$(OverwriteCoreClrPackageVersion)' == 'true'" Project="$(BuildVersionFile)" />
+
+  <PropertyGroup Condition="'$(OverwriteCoreClrPackageVersion)' == 'true'">
+    <VersionToRestore Condition="'$(StableVersion)' != ''">$(StableVersion)</VersionToRestore>
+    <VersionToRestore Condition="'$(VersionToRestore)' == ''">$(PackageVersion)</VersionToRestore>
+    <DesiredPackageVersionArg>$(VersionToRestore)-$(PreReleaseLabel)-$(BuildNumberMajor)-$(BuildNumberMinor)</DesiredPackageVersionArg>
+  </PropertyGroup> 
 
   <Import Project="tests.targets" />
   <Import Project="publishdependency.targets" />
@@ -331,6 +340,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
   <PropertyGroup>
     <TargetRid Condition="'$(RuntimeId)' != ''">$(RuntimeId)</TargetRid>
     <TargetRid Condition="'$(RuntimeId)' == ''">$(TestNugetRuntimeId)</TargetRid>
+    <DesiredPackageVersionArg Condition="'$(DesiredPackageVersionArg)' == ''">$(CoreClrPackageVersion)</DesiredPackageVersionArg>
   </PropertyGroup>
 
   <Target Name="CreateTestOverlay">
index 7f1f523..8fb03f2 100644 (file)
@@ -94,4 +94,5 @@
     <NuGetTargetMonikerShort>netcoreapp2.0</NuGetTargetMonikerShort>
     <PrereleaseResolveNuGetPackages>true</PrereleaseResolveNuGetPackages>
   </PropertyGroup>
+
 </Project>