Fix missing project error in official build (#21767)
authorSven Boemer <sbomer@gmail.com>
Mon, 7 Jan 2019 15:56:04 +0000 (07:56 -0800)
committerGitHub <noreply@github.com>
Mon, 7 Jan 2019 15:56:04 +0000 (07:56 -0800)
In response to https://github.com/dotnet/arcade/pull/1567.
This uses an empty project to work around the new behavior that requires a project file even for restore operations.

eng/build-job.yml
eng/empty.proj [new file with mode: 0644]
tests/helixpublishwitharcade.proj

index 24c7de8..dfecdc5 100644 (file)
@@ -75,7 +75,7 @@ jobs:
 
     # Sign on Windows
     - ${{ if and(ne(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest'), eq(parameters.osGroup, 'Windows_NT')) }}:
-      - script: powershell eng\common\build.ps1 -ci -sign -restore -configuration:$(buildConfig) -warnaserror:0 /p:ArcadeBuild=true /p:OfficialBuild=true /p:BuildOS=$(osGroup) /p:BuildArch=$(archType) /p:BuildType=$(buildConfig) /p:DotNetSignType=%_SignType%
+      - script: powershell eng\common\build.ps1 -ci -sign -restore -configuration:$(buildConfig) -warnaserror:0 /p:ArcadeBuild=true /p:OfficialBuild=true /p:BuildOS=$(osGroup) /p:BuildArch=$(archType) /p:BuildType=$(buildConfig) /p:DotNetSignType=%_SignType% -projects $(Build.SourcesDirectory)\eng\empty.proj
         displayName: Sign Binaries
 
       - task: PublishBuildArtifacts@1
@@ -115,7 +115,7 @@ jobs:
       - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
         - script: ./build-packages.sh -BuildArch=$(archType) -BuildType=$(buildConfigUpper) $(crossPackagesArg) -OfficialBuildId=$(Build.BuildNumber) $(portableBuildArg)
           displayName: Build packages
-        - script: ./eng/common/build.sh /p:DotNetPublishToBlobFeed=true --ci --restore
+        - script: ./eng/common/build.sh /p:DotNetPublishToBlobFeed=true --ci --restore --projects $(Build.SourcesDirectory)/eng/empty.proj
           displayName: Restore blob feed tasks
         - script: ./eng/common/msbuild.sh --ci src/publishwitharcade.proj /p:__BuildType=$(buildConfigUpper) /p:__BuildArch=$(archType) /p:OSIdentifier=$(osIdentifier) /p:AzureFeedUrl=$(dotnetfeedUrl) /p:AzureAccountKey=$(dotnetfeedPAT)
           displayName: Publish packages to blob feed
@@ -126,7 +126,7 @@ jobs:
         # TODO: pass publish feed url and access token in from the internal pipeline
         - script: build-packages.cmd -BuildArch=$(archType) -BuildType=$(buildConfigUpper) -OfficialBuildId=$(Build.BuildNumber)
           displayName: Build packages
-        - powershell: eng\common\build.ps1 /p:DotNetPublishToBlobFeed=true -ci -restore
+        - powershell: eng\common\build.ps1 /p:DotNetPublishToBlobFeed=true -ci -restore -projects $(Build.SourcesDirectory)\eng\empty.proj
           displayName: Restore blob feed tasks
         - powershell: eng\common\msbuild.ps1 -ci src\publishwitharcade.proj /p:__BuildType=$(buildConfigUpper) /p:__BuildArch=$(archType) /p:OSIdentifier=$(osIdentifier) /p:AzureFeedUrl=$(dotnetfeedUrl) /p:AzureAccountKey=$(dotnetfeedPAT)
           displayName: Publish packages to blob feed
diff --git a/eng/empty.proj b/eng/empty.proj
new file mode 100644 (file)
index 0000000..0bd280d
--- /dev/null
@@ -0,0 +1,15 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <!-- This project exists purely to work around Arcade
+       behavior. Arcade knows how to restore tasks needed for
+       publishing to blob feeds, but it requires a project file that
+       imports nuget restore targets to be specified for this to
+       work. See details in
+       https://github.com/dotnet/arcade/commit/f657be5cb7cd4920334dd9162173b131211a1e17#r31728598.
+  -->
+
+  <PropertyGroup>
+    <TargetFramework>netcoreapp2.0</TargetFramework>
+  </PropertyGroup>
+
+</Project>
index ce1bdd4..6a4622e 100644 (file)
@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="SubmitTestsToHelix">
 
-  <!-- This project uses the helix SDK ,documented at
+  <!-- This project uses the helix SDKdocumented at
        https://github.com/dotnet/arcade/tree/master/src/Microsoft.DotNet.Helix/Sdk,
        to send test jobs to helix. -->