Skip to content

Commit 98f7f10

Browse files
authored
Create a DevCheck NuGet Package from which DevCheck.cmd in feeder repos can restore and utilize (#4714)
1 parent b9a3c8c commit 98f7f10

7 files changed

+108
-7
lines changed

DevCheck.cmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
22

3-
powershell -ExecutionPolicy Unrestricted -NoLogo -NoProfile -File %~dp0\eng\common\DevCheck.ps1 %*
3+
powershell -ExecutionPolicy Unrestricted -NoLogo -NoProfile -File %~dp0\tools\DevCheck\DevCheck.ps1 %*
44

55
exit /b %ERRORLEVEL%

build/AzurePipelinesTemplates/WindowsAppSDK-BuildInstaller-Steps.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ steps:
6262
displayName: 'Create test pfx to sign MSIX test packages (DevCheck)'
6363
inputs:
6464
targetType: filePath
65-
filePath: $(foundationRepoPath)eng\common\DevCheck.ps1
65+
filePath: $(foundationRepoPath)tools\DevCheck\DevCheck.ps1
6666
arguments: -NoInteractive -Offline -Verbose -CertPassword 'BuildPipeline' -CheckTestPfx -Clean
6767
workingDirectory: '$(Build.SourcesDirectory)'
6868

6969
- task: powershell@2
7070
displayName: 'Install test certificate for MSIX test packages (DevCheck)'
7171
inputs:
7272
targetType: filePath
73-
filePath: $(foundationRepoPath)eng\common\DevCheck.ps1
73+
filePath: $(foundationRepoPath)tools\DevCheck\DevCheck.ps1
7474
arguments: -NoInteractive -Offline -Verbose -CheckTestCert
7575
workingDirectory: '$(Build.SourcesDirectory)'
7676

@@ -257,7 +257,7 @@ steps:
257257
displayName: 'Remove test certificate for MSIX test packages (DevCheck)'
258258
inputs:
259259
targetType: filePath
260-
filePath: $(foundationRepoPath)eng\common\DevCheck.ps1
260+
filePath: $(foundationRepoPath)tools\DevCheck\DevCheck.ps1
261261
arguments: -NoInteractive -Offline -Verbose -RemoveTestCert -RemoveTestPfx
262262
workingDirectory: '$(Build.SourcesDirectory)'
263263

build/AzurePipelinesTemplates/WindowsAppSDK-RunTests-Steps.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ steps:
1010
displayName: 'DevCheck: Setup/Verify development environment'
1111
inputs:
1212
targetType: filePath
13-
filePath: eng\common\DevCheck.ps1
13+
filePath: tools\DevCheck\DevCheck.ps1
1414
arguments: -NoInteractive -Offline -Verbose -CertPassword 'BuildPipeline' -CheckTestPfx -Clean -CheckDependencies -ShowSystemInfo
1515
workingDirectory: '$(Build.SourcesDirectory)'
1616

@@ -93,7 +93,7 @@ steps:
9393
displayName: 'Run TE.Service'
9494
inputs:
9595
targetType: filePath
96-
filePath: eng\common\DevCheck.ps1
96+
filePath: tools\DevCheck\DevCheck.ps1
9797
arguments: -NoInteractive -Offline -Verbose -CheckTAEFService -ShowSystemInfo
9898
workingDirectory: '$(Build.SourcesDirectory)'
9999

build/AzurePipelinesTemplates/WindowsAppSDK-SetupBuildEnvironment-Steps.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ steps:
7171
displayName: 'DevCheck: Setup/Verify development environment'
7272
inputs:
7373
targetType: filePath
74-
filePath: eng\common\DevCheck.ps1
74+
filePath: tools\DevCheck\DevCheck.ps1
7575
arguments: -NoInteractive -Offline -Verbose -CertPassword 'BuildPipeline' -CheckTestPfx -Clean -CheckDependencies -ShowSystemInfo
7676
workingDirectory: '$(Build.SourcesDirectory)'
7777

build/WindowsAppSDK-BuildDevCheck.yml

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
2+
3+
parameters:
4+
- name: "PushPackageToInternalFeed"
5+
type: boolean
6+
default: true
7+
8+
variables:
9+
- template: ${{variables['System.DefaultWorkingDirectory']}}\build\WindowsAppSDK-Versions.yml
10+
- template: ${{variables['System.DefaultWorkingDirectory']}}\build\WindowsAppSDK-CommonVariables.yml
11+
12+
resources:
13+
repositories:
14+
- repository: templates
15+
type: git
16+
name: OneBranch.Pipelines/GovernedTemplates
17+
ref: refs/heads/main
18+
19+
extends:
20+
template: v2/Microsoft.NonOfficial.yml@templates # https://aka.ms/obpipelines/templates
21+
parameters:
22+
platform:
23+
name: 'windows_undocked' # windows undocked
24+
25+
stages:
26+
- stage: PackageDevCheck
27+
dependsOn: []
28+
jobs:
29+
- job: PackageDevCheck
30+
pool:
31+
# read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs
32+
type: windows
33+
variables:
34+
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)\NuGet'
35+
steps:
36+
- task: PowerShell@2
37+
displayName: Update version
38+
inputs:
39+
targetType: 'inline'
40+
script: |
41+
Write-Host version: '$(version)'
42+
[xml]$publicNuspec = Get-Content -Encoding utf8 -Path $(Build.SourcesDirectory)\tools\DevCheck\nuspec\Microsoft.WindowsAppSDK.DevCheck.nuspec
43+
$publicNuspec.package.metadata.version = '$(version)'
44+
Set-Content -Encoding utf8 -Value $publicNuspec.OuterXml $(Build.SourcesDirectory)\tools\DevCheck\nuspec\Microsoft.WindowsAppSDK.DevCheck.nuspec
45+
46+
- task: CopyFiles@2
47+
displayName: 'Add DevCheck.ps1 to Nuget'
48+
inputs:
49+
SourceFolder: '$(Build.SourcesDirectory)\tools\DevCheck'
50+
Contents: |
51+
DevCheck.ps1
52+
TargetFolder: '$(Build.SourcesDirectory)\PackLocation'
53+
flattenFolders: false
54+
55+
- task: CopyFiles@2
56+
displayName: 'Add License.txt to Nuget'
57+
inputs:
58+
SourceFolder: '$(Build.SourcesDirectory)'
59+
Contents: |
60+
LICENSE
61+
TargetFolder: '$(Build.SourcesDirectory)\PackLocation'
62+
flattenFolders: false
63+
64+
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
65+
displayName: 'Pack DevCheckPackage'
66+
inputs:
67+
command: 'pack'
68+
packagesToPack: '$(Build.SourcesDirectory)\tools\DevCheck\nuspec\Microsoft.WindowsAppSDK.DevCheck.nuspec'
69+
versioningScheme: off
70+
basePath: '$(Build.SourcesDirectory)\PackLocation'
71+
packDestination: '$(ob_outputDirectory)'
72+
73+
- ${{ if eq(parameters.PushPackageToInternalFeed, 'true') }}:
74+
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
75+
displayName: 'NuGet push package to Project.Reunion.nuget.internal'
76+
inputs:
77+
command: 'push'
78+
packagesToPush: '$(ob_outputDirectory)\Microsoft.WinAppSDK.DevCheck.*.nupkg'
79+
verbosityPush: 'Detailed'
80+
nuGetFeedType: 'internal'
81+
# ignore conflicts which come from rerunning with the same input packages
82+
allowPackageConflicts: true
83+
#Note: The project qualifier is always required when using a feed name. Also, do not use organization scoped feeds.
84+
publishVstsFeed: 'ProjectReunion/Project.Reunion.nuget.internal'
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
3+
<metadata>
4+
<id>Microsoft.WinAppSDK.DevCheck</id>
5+
<version>0.0.0.0</version>
6+
<title>Microsoft WindowsAppSDK DevCheck</title>
7+
<authors>Microsoft</authors>
8+
<owners>Microsoft</owners>
9+
<requireLicenseAcceptance>true</requireLicenseAcceptance>
10+
<license type="file">LICENSE</license>
11+
<projectUrl>https://github.com/microsoft/windowsappsdk</projectUrl>
12+
<iconUrl>https://raw.githubusercontent.com/microsoft/WindowsAppSDK/main/assets/WindowsAppSDK64.png</iconUrl>
13+
<description>DevCheck for WindowsAppSDK </description>
14+
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
15+
<tags>Windows,Windows App SDK,DevCheck</tags>
16+
</metadata>
17+
</package>

0 commit comments

Comments
 (0)