Factory Orchestrator service runs on Linux as a standalone program (#101)

Service runs on Linux as a standalone program when invoked with admin rights (sudo)

Refactored service to store persistent state (through reboots) in an XML file

Refactored service to store volatile state (lost after reboot), in XML file on Linux only. Windows still uses volatile registry.

All service state modifications use FOServiceStatus & FOVolatileServiceStatus classes. Classes handle differences between OSes opaque to the service.

Service configuration now uses appsettings.json file. Registry is still a fallback path on Windows, and allows OEM customizations to continue to work.

Fixed issues on service preventing proper operation on Linux.

Fixed issues with build scripts (can now use pwsh not only Windows PowerShell) & projects preventing proper operation on Linux. Everything but the app can be built on Linux without issue.

Release build publishes Linux service zips

Release build validates build & unit tests pass on Ubuntu

Added new CommandLineTask class, for running scripts in bash/cmd. Identical to and Inherits from BatchFileTask to ensure back-compat.

New GetOSPlatform() API

App can connect to Linux service & functions as expected
This commit is contained in:
Jake Friedman 2021-03-24 07:14:36 -07:00 коммит произвёл GitHub
Родитель 7e123bdf2a
Коммит b7a1d955e2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
64 изменённых файлов: 1560 добавлений и 711 удалений

Просмотреть файл

@ -1,2 +1,2 @@
@echo off
start cmd.exe /C "dotnet %~dp0\bin\Debug\AnyCPU\ClientSample\netcoreapp3.1\Microsoft.FactoryOrchestrator.ClientSample.dll %1 %2 %3 %4 & PAUSE"
start cmd.exe /C "dotnet %~dp0bin\Debug\AnyCPU\Microsoft.FactoryOrchestrator.ClientSample\netcoreapp3.1\Microsoft.FactoryOrchestrator.ClientSample.dll %1 %2 %3 %4 & PAUSE"

Просмотреть файл

@ -10,7 +10,7 @@ Param
$ErrorActionPreference = "stop"
[xml]$customprops = Get-Content "$PSScriptRoot\..\src\common.props"
[xml]$customprops = Get-Content "$PSScriptRoot/../src/common.props"
$msbldns = "http://schemas.microsoft.com/developer/msbuild/2003"
$ns = @{msbld = "$msbldns"}
$assemblyVersion = Select-Xml -Xml $customprops -XPath "//msbld:VersionPrefix" -Namespace $ns | Select-Object -First 1
@ -29,14 +29,14 @@ else
}
Write-Host "ProductVersion/AssemblyInformationalVersion is $productVersion"
if (Test-Path -Path "$SrcPath\Properties\AssemblyInfo.cs")
if (Test-Path -Path "$SrcPath/Properties/AssemblyInfo.cs")
{
Write-Host "Generating AssemblyInfo.cs for $SrcPath"
$file = Get-Item -Path "$SrcPath\Properties\AssemblyInfo.cs"
$file = Get-Item -Path "$SrcPath/Properties/AssemblyInfo.cs"
[string]$randString = Get-Random
$tempFile = $env:TEMP + "\" + $file.Name + $randString + ".tmp"
$tempFile = [System.IO.Path]::GetTempPath() + "/" + $file.Name + $randString + ".tmp"
Write-Host "Using temp file $tempFile"
Write-Host "Creating assembly info file for:" $file.FullName " version:" $assemblyVersion
@ -60,7 +60,7 @@ if (Test-Path -Path "$SrcPath\Properties\AssemblyInfo.cs")
Write-Host "Sucessfully modified $tempFile"
$destDir = $file.DirectoryName + "\..\obj\"
$destDir = $file.DirectoryName + "/../obj/"
$null = New-Item -Path $destDir -ItemType Directory -Force
$destFile = $destDir + $file.Name
$skip = $false
@ -102,7 +102,7 @@ if (Test-Path -Path "$SrcPath\Properties\AssemblyInfo.cs")
$psds = Get-ChildItem -Path $SrcPath -Filter "*.psd1"
ForEach ($psd in $psds)
{
$destDir = $psd.DirectoryName + "\obj\"
$destDir = $psd.DirectoryName + "/obj/"
$null = New-Item -Path $destDir -ItemType Directory -Force
$destFile = $destDir + $psd.Name
@ -129,7 +129,7 @@ ForEach ($psd in $psds)
}
[string]$randString = Get-Random
$tempFile = $env:TEMP + "\" + $file.Name + $randString + ".tmp"
$tempFile = [System.IO.Path]::GetTempPath() + "/" + $file.Name + $randString + ".tmp"
$psdContents = Get-Content $psd.FullName |
ForEach-Object{$_ -replace 'ModuleVersion.+', "ModuleVersion = '$assemblyVersion'"} |
@ -155,7 +155,7 @@ ForEach ($appx in $appxs)
}
[string]$randString = Get-Random
$tempFile = $env:TEMP + "\" + $file.Name + $randString + ".tmp"
$tempFile = [System.IO.Path]::GetTempPath() + "/" + $file.Name + $randString + ".tmp"
$appxContents = $currentFileContent |
ForEach-Object{$_ -replace 'Identity Version="[0-9,.]+?"', "Identity Version=`"$assemblyVersion.0`"" } |

Просмотреть файл

@ -38,15 +38,33 @@ variables:
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
stages:
- stage: 'Build_Test_FactoryOrchestrator_Windows_AnyCPU'
pool:
name: "Hosted Windows 2019 with VS2019"
demands:
- msbuild
- visualstudio
- stage: 'Build_Test_FactoryOrchestrator_AnyCPU'
displayName: 'Build and test Factory Orchestrator client & service'
jobs:
- job: "Build_Test_FactoryOrchestrator_Windows_AnyCPU"
# Build the solution on Linux and run tests.
# The binaries released for Linux are built in Build_Test_FactoryOrchestrator_Windows_AnyCPU on a Windows host,
# but this ensures the solution and code works properly on Linux.
- job: "Build_Test_FactoryOrchestrator_HostedLinux_AnyCPU"
pool:
vmImage: 'ubuntu-20.04'
variables:
BuildPlatform: 'AnyCPU'
BuildConfiguration: 'Release'
FORepoRoot: '$(Build.SourcesDirectory)'
steps:
- checkout: self
- template: ./templates/template-set-initial-variables.yml
- pwsh: |
Get-Item -Path env:* | Sort-Object Name
displayName: "Print all variables"
# Build & Test (Linux)
- template: ./templates/template-build-test-service.yml
- job: "Build_Test_Publish_FactoryOrchestrator_HostedWindows_AnyCPU"
pool:
name: "Hosted Windows 2019 with VS2019"
demands:
- msbuild
- visualstudio
variables:
BuildPlatform: 'AnyCPU'
steps:
@ -78,14 +96,29 @@ stages:
- template: ./templates/template-dotnet-publish-service.yml
parameters:
BuildPlatform: 'arm64'
- template: ./templates/template-dotnet-publish-service.yml
parameters:
BuildPlatform: 'x64'
BuildOS: 'linux'
- template: ./templates/template-dotnet-publish-service.yml
parameters:
BuildPlatform: 'arm'
BuildOS: 'linux'
- template: ./templates/template-dotnet-publish-service.yml
parameters:
BuildPlatform: 'arm64'
BuildOS: 'linux'
- template: ./templates/template-dotnet-publish-pwsh-library.yml
- template: ./templates/template-build-uwpclient.yml
- publish: '$(Build.ARTIFACTSTAGINGDIRECTORY)/bin/$(BuildConfiguration)/$(BuildPlatform)'
artifact: 'UnsignedBin_$(BuildConfiguration)_AnyCPU'
displayName: 'Publish unsigned binaries AnyCPU'
- publish: '$(Build.ARTIFACTSTAGINGDIRECTORY)/bin/$(BuildConfiguration)/Publish'
- publish: '$(Build.ARTIFACTSTAGINGDIRECTORY)/bin/$(BuildConfiguration)/Publish/win'
artifact: 'UnsignedBin_Windows_$(BuildConfiguration)_Publish'
displayName: 'Publish unsigned binaries service publish'
- publish: '$(Build.ARTIFACTSTAGINGDIRECTORY)/bin/$(BuildConfiguration)/Publish/linux'
artifact: 'UnsignedBin_Linux_$(BuildConfiguration)_Publish'
displayName: 'Publish unsigned binaries linux service publish'
- publish: '$(Build.ARTIFACTSTAGINGDIRECTORY)/bin/tests'
artifact: 'UnsignedBin_$(BuildConfiguration)_AnyCPU_Tests'
displayName: 'Publish unsigned test binaries and zip'
@ -100,15 +133,16 @@ stages:
displayName: 'Publish Windows UWPClient nuspecs'
- stage: 'Build_Test_FactoryOrchestrator_Windows_Apps'
displayName: 'Build Factory Orchestrator app'
dependsOn:
- 'Build_Test_FactoryOrchestrator_Windows_AnyCPU'
- 'Build_Test_FactoryOrchestrator_AnyCPU'
pool:
name: "Hosted Windows 2019 with VS2019"
demands:
- msbuild
- visualstudio
jobs:
jobs:
- job: "Build_FactoryOrchestrator_App"
strategy:
matrix:
@ -239,7 +273,7 @@ stages:
- task: CopyFiles@2
inputs:
sourceFolder: "$(Pipeline.Workspace)/UnsignedBin_Windows_$(BuildConfiguration)_Publish"
targetFolder: "$(Build.ARTIFACTSTAGINGDIRECTORY)/unsignedbin/Publish"
targetFolder: "$(Build.ARTIFACTSTAGINGDIRECTORY)/unsignedbin/Publish/win"
- task: CopyFiles@2
inputs:
sourceFolder: "$(Pipeline.Workspace)/UnsignedBin_Windows_$(BuildConfiguration)_x86"
@ -343,8 +377,9 @@ stages:
# This stage only publishes Azure DevOps pipeline artifacts. It does not release anything publicly.
- stage: 'Sign_Publish_NuGet_ServiceZip_Artifacts'
displayName: 'Create signed NuGet packages and service zip files'
dependsOn:
- 'compliance'
- 'Sign_Binaries'
pool:
name: "Hosted Windows 2019 with VS2019"
demands:
@ -389,6 +424,8 @@ stages:
- ${{ if ne(parameters.UseTestingArtifacts, true) }}:
- download: 'current'
artifact: 'SignedBin_Windows_Release_AllPlatforms'
- download: 'current'
artifact: 'UnsignedBin_Linux_Release_Publish'
- download: 'current'
artifact: 'UWPClient_Nuspecs'
- ${{ if eq(parameters.UseTestingArtifacts, true) }}:
@ -407,6 +444,17 @@ stages:
runVersion: 'latest'
tags: '__testing'
path: "$(Pipeline.Workspace)/SignedBin_Windows_Release_AllPlatforms"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
artifact: UnsignedBin_Linux_Release_Publish
allowFailedBuilds: true
allowPartiallySucceededBuilds: true
project: 'OneCore'
pipeline: $(System.DefinitionId)
runVersion: 'latest'
tags: '__testing'
path: "$(Pipeline.Workspace)/UnsignedBin_Linux_Release_Publish"
displayName: "Download from __testing build"
- task: DownloadPipelineArtifact@2
inputs:
@ -425,6 +473,10 @@ stages:
inputs:
sourceFolder: "$(Pipeline.Workspace)/SignedBin_Windows_Release_AllPlatforms"
targetFolder: "$(Build.ARTIFACTSTAGINGDIRECTORY)/bin/Release"
- task: CopyFiles@2
inputs:
sourceFolder: "$(Pipeline.Workspace)/UnsignedBin_Linux_Release_Publish"
targetFolder: "$(Build.ARTIFACTSTAGINGDIRECTORY)/bin/Release/Publish/linux"
- template: ./templates/template-pack-sign-nuget.yml
parameters:
@ -446,6 +498,21 @@ stages:
parameters:
BuildConfiguration: 'Release'
BuildPlatform: 'arm64'
- template: ./templates/template-create-service-zip.yml
parameters:
BuildConfiguration: 'Release'
BuildPlatform: 'x64'
BuildOS: 'linux'
- template: ./templates/template-create-service-zip.yml
parameters:
BuildConfiguration: 'Release'
BuildPlatform: 'arm'
BuildOS: 'linux'
- template: ./templates/template-create-service-zip.yml
parameters:
BuildConfiguration: 'Release'
BuildPlatform: 'arm64'
BuildOS: 'linux'
- publish: '$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\Release\Publish\Zips\'
artifact: ServiceZips
@ -453,9 +520,11 @@ stages:
# It uses the FO-Publish-Release environment to require manual approval before running.
# TODO: see if we can get this to publish a GitHub release
- stage: 'Publish_vPack_PSGallery_NuGet_Symbols_PUBLIC'
displayName: 'Public publish of packages and symbols'
condition: and(eq(stageDependencies.Sign_Publish_NuGet_ServiceZip_Artifacts.outputs['Job_Sign_Publish_NuGet_ServiceZip_Artifacts.SPOutput.SHOULDPUSH'], 'true'), succeeded())
dependsOn:
- 'Sign_Publish_NuGet_ServiceZip_Artifacts'
- 'compliance'
pool:
name: Package ES Standard Build
jobs:

Просмотреть файл

@ -9,7 +9,7 @@ steps:
inputs:
command: 'build'
projects: '$(FORepoRoot)/src/FactoryOrchestratorNoApp.sln'
arguments: '--configuration $(BuildConfiguration) --no-restore -fl -flp:LogFile=$(Build.ARTIFACTSTAGINGDIRECTORY)\$(BuildConfiguration)_AnyCPU_MsBuild.log;Verbosity=Diagnostic $(VERSIONSUFFIXDOTNET)'
arguments: '--configuration $(BuildConfiguration) --no-restore -fl -flp:LogFile=$(Build.ARTIFACTSTAGINGDIRECTORY)/Hosted$(Agent.OS)_$(BuildConfiguration)_AnyCPU_MsBuild.log;Verbosity=Diagnostic $(VERSIONSUFFIXDOTNET)'
displayName: 'dotnet build $(BuildConfiguration)'
condition: succeeded()
- task: DotNetCoreCLI@2
@ -29,5 +29,5 @@ steps:
- task: PublishPipelineArtifact@1
displayName: 'Publish msbuild log for AnyCPU build'
inputs:
artifactName: MSBuildLog_$(BuildConfiguration)_AnyCPU
targetPath: $(Build.ARTIFACTSTAGINGDIRECTORY)\$(BuildConfiguration)_AnyCPU_MsBuild.log
artifactName: MSBuildLog_Hosted$(Agent.OS)_$(BuildConfiguration)_AnyCPU
targetPath: $(Build.ARTIFACTSTAGINGDIRECTORY)/Hosted$(Agent.OS)_$(BuildConfiguration)_AnyCPU_MsBuild.log

Просмотреть файл

@ -1,12 +1,12 @@
stages:
- stage: 'Build_and_Test_Windows'
pool:
name: "Hosted Windows 2019 with VS2019"
demands:
- msbuild
- visualstudio
- stage: 'Build_and_Test'
jobs:
- job: "Build_Test_FactoryOrchestrator_Windows"
pool:
name: "Hosted Windows 2019 with VS2019"
demands:
- msbuild
- visualstudio
variables:
BuildPlatform: 'AnyCPU'
BuildConfiguration: 'Release'
@ -33,6 +33,8 @@ stages:
- template: ./template-checkdocs.yml
- job: "Compliance"
pool:
vmImage: windows-2019
variables:
BuildPlatform: 'AnyCPU'
BuildConfiguration: 'Release'
@ -44,3 +46,21 @@ stages:
Get-Item -Path env:* | Sort-Object Name
displayName: "Print all variables"
- template: ./template-ci-compliance.yml
- job: "Build_Test_FactoryOrchestrator_Linux"
pool:
vmImage: 'ubuntu-20.04'
variables:
BuildPlatform: 'AnyCPU'
BuildConfiguration: 'Release'
FORepoRoot: '$(Build.SourcesDirectory)'
steps:
- checkout: self
- template: ./template-set-build-version.yml
- template: ./template-install-netcore.yml
- pwsh: |
Get-Item -Path env:* | Sort-Object Name
displayName: "Print all variables"
# Build & Test (Linux)
- template: ./template-build-test-service.yml

Просмотреть файл

@ -6,15 +6,15 @@ parameters:
steps:
- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildPlatform }}'
sourceFolder: '$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\${{ parameters.BuildOS }}\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }}'
contents: '*.pdb'
targetFolder: '$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildPlatform }}.Symbols'
targetFolder: '$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\${{ parameters.BuildOS }}\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }}.Symbols'
displayName: "Copy pdbs ${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }}"
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildPlatform }}.Symbols'
rootFolderOrFile: '$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\${{ parameters.BuildOS }}\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }}.Symbols'
includeRootFolder: false
archiveType: 'zip' # Options: zip, 7z, tar, wim
archiveFile: '$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\Zips\Microsoft.FactoryOrchestrator.Service-$(VERSIONPREFIX)$(VERSIONSUFFIXVPACK)-${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }}.Symbols.zip'
@ -23,13 +23,13 @@ steps:
- task: DeleteFiles@1
inputs:
SourceFolder: '$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildPlatform }}'
SourceFolder: '$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\${{ parameters.BuildOS }}\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }}'
Contents: '*.pdb'
displayName: "Delete pdbs ${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }}"
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildPlatform }}'
rootFolderOrFile: '$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\${{ parameters.BuildOS }}\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }}'
includeRootFolder: false
archiveType: 'zip' # Options: zip, 7z, tar, wim
archiveFile: '$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\Zips\Microsoft.FactoryOrchestrator.Service-$(VERSIONPREFIX)$(VERSIONSUFFIXVPACK)-${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }}.zip'

Просмотреть файл

@ -3,34 +3,48 @@ parameters:
BuildConfiguration: 'Release'
BuildPlatform: 'x64'
BuildOS: 'win'
steps:
- pwsh: |
if ('${{ parameters.BuildOS }}' -eq 'win')
{
$vstsCommandString = "vso[task.setvariable variable=ReadyToRun]true"
}
else
{
$vstsCommandString = "vso[task.setvariable variable=ReadyToRun]false"
}
Write-Host "sending " + $vstsCommandString
Write-Host "##$vstsCommandString"
displayName: 'Set ReadyToRun'
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
publishWebProjects: False
zipAfterPublish: false
arguments: '$(System.DefaultWorkingDirectory)\src\Service\Microsoft.FactoryOrchestrator.Service.csproj --nologo -p:PublishReadyToRun=true;SolutionDir=$(System.DefaultWorkingDirectory)\src\ --self-contained --configuration ${{ parameters.BuildConfiguration }} -r ${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }} --no-dependencies --no-restore -fl -flp:LogFile=$(Build.ARTIFACTSTAGINGDIRECTORY)\BuildLogs\${{ parameters.BuildConfiguration }}_Service_${{ parameters.BuildPlatform }}_MsBuild.log;Verbosity=Detailed --output $(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildPlatform }} $(VERSIONSUFFIXDOTNET)'
arguments: '$(System.DefaultWorkingDirectory)\src\Service\Microsoft.FactoryOrchestrator.Service.csproj --nologo -p:PublishReadyToRun=$(ReadyToRun);SolutionDir=$(System.DefaultWorkingDirectory)\src\ --self-contained --configuration ${{ parameters.BuildConfiguration }} -r ${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }} --no-dependencies --no-restore -fl -flp:LogFile=$(Build.ARTIFACTSTAGINGDIRECTORY)\BuildLogs\${{ parameters.BuildConfiguration }}_Service_${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }}_MsBuild.log;Verbosity=Detailed --output $(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\${{ parameters.BuildOS }}\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }} $(VERSIONSUFFIXDOTNET)'
displayName: 'dotnet publish for ${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }} runtime ${{ parameters.BuildConfiguration }}'
- task: CopyFiles@2
displayName: 'Copy NOTICE to publish'
inputs:
SourceFolder: '$(FORepoRoot)'
Contents: 'NOTICE.txt'
TargetFolder: '$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildPlatform }}'
TargetFolder: '$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\${{ parameters.BuildOS }}\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }}'
- task: CopyFiles@2
displayName: 'Copy LICENSE to publish'
inputs:
SourceFolder: '$(FORepoRoot)'
Contents: 'LICENSE'
TargetFolder: '$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildPlatform }}'
TargetFolder: '$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\${{ parameters.BuildOS }}\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }}'
- pwsh: |
$content = "FactoryOrchestrator source code, sample projects, and documentation are all available on GitHub as MIT licensed open source!"
$content += "`n`nThe Factory Orchestrator service in this build is version $(VERSIONPREFIX)$(VERSIONSUFFIXVPACK)"
$content += "`nWhen writing Factory Orchestrator client code to interact with this service, use the Microsoft.FactoryOrchestrator.Client or Microsoft.FactoryOrchestrator.UWPClient NuGet packages, and/or Microsoft.FactoryOrchestrator.Client PowerShell Gallery module with the same major version."
$content += "`n`nDocumentation is at: https://microsoft.github.io/FactoryOrchestrator/`nSource code is at: https://github.com/microsoft/FactoryOrchestrator"
$content | out-file "$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildPlatform }}\README.txt"
$content | out-file "$(Build.ARTIFACTSTAGINGDIRECTORY)\bin\${{ parameters.BuildConfiguration }}\Publish\${{ parameters.BuildOS }}\Microsoft.FactoryOrchestrator.Service.${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }}\README.txt"
displayName: 'Create README.txt'
- publish: $(Build.ARTIFACTSTAGINGDIRECTORY)\BuildLogs\${{ parameters.BuildConfiguration }}_Service_${{ parameters.BuildPlatform }}_MsBuild.log
- publish: $(Build.ARTIFACTSTAGINGDIRECTORY)\BuildLogs\${{ parameters.BuildConfiguration }}_Service_${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }}_MsBuild.log
artifact: MSBuildLog_Publish_Service_${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }}_${{ parameters.BuildConfiguration }}
displayName: 'Publish msbuild log for publish ${{ parameters.BuildOS }}-${{ parameters.BuildPlatform }} runtime ${{ parameters.BuildConfiguration }}'

Просмотреть файл

@ -1,7 +1,7 @@
# Retrieves build version.
steps:
- pwsh: |
[xml]$customprops = Get-Content "$env:FORepoRoot\src\common.props"
[xml]$customprops = Get-Content "$(FORepoRoot)\src\common.props"
$msbldns = "http://schemas.microsoft.com/developer/msbuild/2003"
$ns = @{msbld = "$msbldns"}
$fullVersion = Select-Xml -Xml $customprops -XPath "//msbld:VersionPrefix" -Namespace $ns | Select-Object -First 1

Просмотреть файл

@ -0,0 +1,10 @@
#### [Microsoft.FactoryOrchestrator.Client](./Microsoft-FactoryOrchestrator-Client.md 'Microsoft.FactoryOrchestrator.Client')
### [Microsoft.FactoryOrchestrator.Client](./Microsoft-FactoryOrchestrator-Client.md 'Microsoft.FactoryOrchestrator.Client').[FactoryOrchestratorClient](./Microsoft-FactoryOrchestrator-Client-FactoryOrchestratorClient.md 'Microsoft.FactoryOrchestrator.Client.FactoryOrchestratorClient')
## FactoryOrchestratorClient.GetOSPlatform() Method
Asynchronously Returns the platform of the OS.
```csharp
public System.Threading.Tasks.Task<System.PlatformID> GetOSPlatform();
```
#### Returns
[System.Threading.Tasks.Task&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task-1 'System.Threading.Tasks.Task')[System.PlatformID](https://docs.microsoft.com/en-us/dotnet/api/System.PlatformID 'System.PlatformID')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task-1 'System.Threading.Tasks.Task')
System.PlatformID enum value representing the OS platform (Unix or Windows).

Просмотреть файл

@ -1,10 +1,10 @@
#### [Microsoft.FactoryOrchestrator.Client](./Microsoft-FactoryOrchestrator-Client.md 'Microsoft.FactoryOrchestrator.Client')
### [Microsoft.FactoryOrchestrator.Client](./Microsoft-FactoryOrchestrator-Client.md 'Microsoft.FactoryOrchestrator.Client').[FactoryOrchestratorClient](./Microsoft-FactoryOrchestrator-Client-FactoryOrchestratorClient.md 'Microsoft.FactoryOrchestrator.Client.FactoryOrchestratorClient')
## FactoryOrchestratorClient.GetOSVersionString() Method
Asynchronously Returns the version of the Windows OS.
Asynchronously Returns the version of the OS.
```csharp
public System.Threading.Tasks.Task<string> GetOSVersionString();
```
#### Returns
[System.Threading.Tasks.Task&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task-1 'System.Threading.Tasks.Task')[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task-1 'System.Threading.Tasks.Task')
string representing the Windows OS version.
string representing the OS version.

Просмотреть файл

@ -49,6 +49,7 @@ Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.O
- [GetLastServiceError()](./Microsoft-FactoryOrchestrator-Client-FactoryOrchestratorClient-GetLastServiceError().md 'Microsoft.FactoryOrchestrator.Client.FactoryOrchestratorClient.GetLastServiceError()')
- [GetLogFolder()](./Microsoft-FactoryOrchestrator-Client-FactoryOrchestratorClient-GetLogFolder().md 'Microsoft.FactoryOrchestrator.Client.FactoryOrchestratorClient.GetLogFolder()')
- [GetOEMVersionString()](./Microsoft-FactoryOrchestrator-Client-FactoryOrchestratorClient-GetOEMVersionString().md 'Microsoft.FactoryOrchestrator.Client.FactoryOrchestratorClient.GetOEMVersionString()')
- [GetOSPlatform()](./Microsoft-FactoryOrchestrator-Client-FactoryOrchestratorClient-GetOSPlatform().md 'Microsoft.FactoryOrchestrator.Client.FactoryOrchestratorClient.GetOSPlatform()')
- [GetOSVersionString()](./Microsoft-FactoryOrchestrator-Client-FactoryOrchestratorClient-GetOSVersionString().md 'Microsoft.FactoryOrchestrator.Client.FactoryOrchestratorClient.GetOSVersionString()')
- [GetServiceEvents()](./Microsoft-FactoryOrchestrator-Client-FactoryOrchestratorClient-GetServiceEvents().md 'Microsoft.FactoryOrchestrator.Client.FactoryOrchestratorClient.GetServiceEvents()')
- [GetServiceEvents(System.DateTime)](./Microsoft-FactoryOrchestrator-Client-FactoryOrchestratorClient-GetServiceEvents(System-DateTime).md 'Microsoft.FactoryOrchestrator.Client.FactoryOrchestratorClient.GetServiceEvents(System.DateTime)')

Просмотреть файл

@ -7,6 +7,9 @@ An BatchFile is a .cmd or .bat script that is run by the FactoryOrchestratorServ
public class BatchFileTask : Microsoft.FactoryOrchestrator.Core.ExecutableTask
```
Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') &#129106; [Microsoft.FactoryOrchestrator.Core.NotifyPropertyChangedBase](./../../CoreLibrary/Microsoft-FactoryOrchestrator-Core-NotifyPropertyChangedBase 'Microsoft.FactoryOrchestrator.Core.NotifyPropertyChangedBase') &#129106; [TaskBase](./Microsoft-FactoryOrchestrator-Core-TaskBase.md 'Microsoft.FactoryOrchestrator.Core.TaskBase') &#129106; [ExecutableTask](./Microsoft-FactoryOrchestrator-Core-ExecutableTask.md 'Microsoft.FactoryOrchestrator.Core.ExecutableTask') &#129106; BatchFileTask
Derived
&#8627; [CommandLineTask](./Microsoft-FactoryOrchestrator-Core-CommandLineTask.md 'Microsoft.FactoryOrchestrator.Core.CommandLineTask')
### Constructors
- [BatchFileTask(string)](./Microsoft-FactoryOrchestrator-Core-BatchFileTask-BatchFileTask(string).md 'Microsoft.FactoryOrchestrator.Core.BatchFileTask.BatchFileTask(string)')
### Properties

Просмотреть файл

@ -0,0 +1,12 @@
#### [Microsoft.FactoryOrchestrator.Core](./Microsoft-FactoryOrchestrator-Core.md 'Microsoft.FactoryOrchestrator.Core')
### [Microsoft.FactoryOrchestrator.Core](./Microsoft-FactoryOrchestrator-Core.md 'Microsoft.FactoryOrchestrator.Core').[CommandLineTask](./Microsoft-FactoryOrchestrator-Core-CommandLineTask.md 'Microsoft.FactoryOrchestrator.Core.CommandLineTask')
## CommandLineTask(string) Constructor
Initializes a new instance of the [CommandLineTask](./Microsoft-FactoryOrchestrator-Core-CommandLineTask.md 'Microsoft.FactoryOrchestrator.Core.CommandLineTask') class.
```csharp
public CommandLineTask(string scriptPath);
```
#### Parameters
<a name='Microsoft-FactoryOrchestrator-Core-CommandLineTask-CommandLineTask(string)-scriptPath'></a>
`scriptPath` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')
The script path.

Просмотреть файл

@ -0,0 +1,15 @@
#### [Microsoft.FactoryOrchestrator.Core](./Microsoft-FactoryOrchestrator-Core.md 'Microsoft.FactoryOrchestrator.Core')
### [Microsoft.FactoryOrchestrator.Core](./Microsoft-FactoryOrchestrator-Core.md 'Microsoft.FactoryOrchestrator.Core').[CommandLineTask](./Microsoft-FactoryOrchestrator-Core-CommandLineTask.md 'Microsoft.FactoryOrchestrator.Core.CommandLineTask')
## CommandLineTask.Equals(object) Method
Determines whether the specified [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object'), is equal to this instance.
```csharp
public override bool Equals(object obj);
```
#### Parameters
<a name='Microsoft-FactoryOrchestrator-Core-CommandLineTask-Equals(object)-obj'></a>
`obj` [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object')
The [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') to compare with this instance.
#### Returns
[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean')
`true` if the specified [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') is equal to this instance; otherwise, `false`.

Просмотреть файл

@ -0,0 +1,9 @@
#### [Microsoft.FactoryOrchestrator.Core](./Microsoft-FactoryOrchestrator-Core.md 'Microsoft.FactoryOrchestrator.Core')
### [Microsoft.FactoryOrchestrator.Core](./Microsoft-FactoryOrchestrator-Core.md 'Microsoft.FactoryOrchestrator.Core').[CommandLineTask](./Microsoft-FactoryOrchestrator-Core-CommandLineTask.md 'Microsoft.FactoryOrchestrator.Core.CommandLineTask')
## CommandLineTask.Name Property
The friendly name of the Task.
```csharp
public override string Name { get; set; }
```
#### Property Value
[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')

Просмотреть файл

@ -0,0 +1,11 @@
#### [Microsoft.FactoryOrchestrator.Core](./Microsoft-FactoryOrchestrator-Core.md 'Microsoft.FactoryOrchestrator.Core')
### [Microsoft.FactoryOrchestrator.Core](./Microsoft-FactoryOrchestrator-Core.md 'Microsoft.FactoryOrchestrator.Core')
## CommandLineTask Class
An CommandLineTask is a .cmd, .bat, or .sh script. This is known as a Batch file on Windows and a Shell script on Linux. The exit code of the script determines if the task passed or failed.
0 == PASS, all others == FAIL.
```csharp
public class CommandLineTask : Microsoft.FactoryOrchestrator.Core.BatchFileTask
```
Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') &#129106; [Microsoft.FactoryOrchestrator.Core.NotifyPropertyChangedBase](./../../CoreLibrary/Microsoft-FactoryOrchestrator-Core-NotifyPropertyChangedBase 'Microsoft.FactoryOrchestrator.Core.NotifyPropertyChangedBase') &#129106; [TaskBase](./Microsoft-FactoryOrchestrator-Core-TaskBase.md 'Microsoft.FactoryOrchestrator.Core.TaskBase') &#129106; [ExecutableTask](./Microsoft-FactoryOrchestrator-Core-ExecutableTask.md 'Microsoft.FactoryOrchestrator.Core.ExecutableTask') &#129106; [BatchFileTask](./Microsoft-FactoryOrchestrator-Core-BatchFileTask.md 'Microsoft.FactoryOrchestrator.Core.BatchFileTask') &#129106; CommandLineTask
### Constructors
- [CommandLineTask(string)](./Microsoft-FactoryOrchestrator-Core-CommandLineTask-CommandLineTask(string).md 'Microsoft.FactoryOrchestrator.Core.CommandLineTask.CommandLineTask(string)')

Просмотреть файл

@ -0,0 +1,10 @@
#### [Microsoft.FactoryOrchestrator.Core](./Microsoft-FactoryOrchestrator-Core.md 'Microsoft.FactoryOrchestrator.Core')
### [Microsoft.FactoryOrchestrator.Core](./Microsoft-FactoryOrchestrator-Core.md 'Microsoft.FactoryOrchestrator.Core').[IFactoryOrchestratorService](./Microsoft-FactoryOrchestrator-Core-IFactoryOrchestratorService.md 'Microsoft.FactoryOrchestrator.Core.IFactoryOrchestratorService')
## IFactoryOrchestratorService.GetOSPlatform() Method
Returns the platform of the OS.
```csharp
System.PlatformID GetOSPlatform();
```
#### Returns
[System.PlatformID](https://docs.microsoft.com/en-us/dotnet/api/System.PlatformID 'System.PlatformID')
System.PlatformID enum value representing the OS platform (Unix or Windows).

Просмотреть файл

@ -1,10 +1,10 @@
#### [Microsoft.FactoryOrchestrator.Core](./Microsoft-FactoryOrchestrator-Core.md 'Microsoft.FactoryOrchestrator.Core')
### [Microsoft.FactoryOrchestrator.Core](./Microsoft-FactoryOrchestrator-Core.md 'Microsoft.FactoryOrchestrator.Core').[IFactoryOrchestratorService](./Microsoft-FactoryOrchestrator-Core-IFactoryOrchestratorService.md 'Microsoft.FactoryOrchestrator.Core.IFactoryOrchestratorService')
## IFactoryOrchestratorService.GetOSVersionString() Method
Returns the version of the Windows OS.
Returns the version of the OS.
```csharp
string GetOSVersionString();
```
#### Returns
[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String')
string representing the Windows OS version.
string representing the OS version.

Просмотреть файл

@ -26,6 +26,7 @@ public interface IFactoryOrchestratorService
- [GetLastServiceError()](./Microsoft-FactoryOrchestrator-Core-IFactoryOrchestratorService-GetLastServiceError().md 'Microsoft.FactoryOrchestrator.Core.IFactoryOrchestratorService.GetLastServiceError()')
- [GetLogFolder()](./Microsoft-FactoryOrchestrator-Core-IFactoryOrchestratorService-GetLogFolder().md 'Microsoft.FactoryOrchestrator.Core.IFactoryOrchestratorService.GetLogFolder()')
- [GetOEMVersionString()](./Microsoft-FactoryOrchestrator-Core-IFactoryOrchestratorService-GetOEMVersionString().md 'Microsoft.FactoryOrchestrator.Core.IFactoryOrchestratorService.GetOEMVersionString()')
- [GetOSPlatform()](./Microsoft-FactoryOrchestrator-Core-IFactoryOrchestratorService-GetOSPlatform().md 'Microsoft.FactoryOrchestrator.Core.IFactoryOrchestratorService.GetOSPlatform()')
- [GetOSVersionString()](./Microsoft-FactoryOrchestrator-Core-IFactoryOrchestratorService-GetOSVersionString().md 'Microsoft.FactoryOrchestrator.Core.IFactoryOrchestratorService.GetOSVersionString()')
- [GetServiceEvents()](./Microsoft-FactoryOrchestrator-Core-IFactoryOrchestratorService-GetServiceEvents().md 'Microsoft.FactoryOrchestrator.Core.IFactoryOrchestratorService.GetServiceEvents()')
- [GetServiceEvents(System.DateTime)](./Microsoft-FactoryOrchestrator-Core-IFactoryOrchestratorService-GetServiceEvents(System-DateTime).md 'Microsoft.FactoryOrchestrator.Core.IFactoryOrchestratorService.GetServiceEvents(System.DateTime)')

Просмотреть файл

@ -30,6 +30,10 @@ The Task is a UWP app.
`PowerShell` 4
The Task is a PowerShell Core script.
<a name='Microsoft-FactoryOrchestrator-Core-TaskType-CommandLine'></a>
`CommandLine` 5
The Task is a batch file or shell script.
<a name='Microsoft-FactoryOrchestrator-Core-TaskType-BatchFile'></a>
`BatchFile` 5
The Task is a Command Prompt script.

Просмотреть файл

@ -2,6 +2,7 @@
## Microsoft.FactoryOrchestrator.Core Namespace
### Classes
- [BatchFileTask](./Microsoft-FactoryOrchestrator-Core-BatchFileTask.md 'Microsoft.FactoryOrchestrator.Core.BatchFileTask')
- [CommandLineTask](./Microsoft-FactoryOrchestrator-Core-CommandLineTask.md 'Microsoft.FactoryOrchestrator.Core.CommandLineTask')
- [ExecutableTask](./Microsoft-FactoryOrchestrator-Core-ExecutableTask.md 'Microsoft.FactoryOrchestrator.Core.ExecutableTask')
- [ExternalTask](./Microsoft-FactoryOrchestrator-Core-ExternalTask.md 'Microsoft.FactoryOrchestrator.Core.ExternalTask')
- [FactoryOrchestratorContainerDisabledException](./Microsoft-FactoryOrchestrator-Core-FactoryOrchestratorContainerDisabledException.md 'Microsoft.FactoryOrchestrator.Core.FactoryOrchestratorContainerDisabledException')

Просмотреть файл

@ -8,6 +8,10 @@
<!-- Embed source files that are not tracked by the source control manager in the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<OutputRootPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)/bin/</OutputRootPath>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == '' And '$(GITHUB_ACTIONS)' != 'true'">
<OutputRootPath>$(MSBuildThisFileDirectory)../bin/</OutputRootPath>
</PropertyGroup>
<ItemGroup Condition="'$(BUILD_REPOSITORY_URI.Contains(`dev.azure.com`))' == 'true' Or '$(BUILD_REPOSITORY_URI.Contains(`visualstudio.com`))' == 'true'">
<!-- Use AzureRepos version of SourceLink if source code is from ADO. -->

Просмотреть файл

@ -26,10 +26,7 @@
</ItemGroup>
<!-- Added for Factory Orchestrator -->
<PropertyGroup Condition="'$(AGENT_ID)' == ''">
<OutputPath>..\..\..\bin\Tests\$(Configuration)\$(Platform)\$(MSBuildProjectName)</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' != ''">
<OutputPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\Tests\$(Configuration)\$(Platform)\$(MSBuildProjectName)</OutputPath>
<PropertyGroup>
<OutDir>$(OutputRootPath)Tests/$(Configuration)/$(Platform)/$(MSBuildProjectName)</OutDir>
</PropertyGroup>
</Project>

Просмотреть файл

@ -21,10 +21,7 @@
</ItemGroup>
<!-- Added for Factory Orchestrator -->
<PropertyGroup Condition="'$(AGENT_ID)' == ''">
<OutDir>..\..\..\bin\Tests\$(Configuration)\$(Platform)\$(MSBuildProjectName)</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' != ''">
<OutDir>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\Tests\$(Configuration)\$(Platform)\$(MSBuildProjectName)</OutDir>
<PropertyGroup>
<OutDir>$(OutputRootPath)Tests/$(Configuration)/$(Platform)/$(MSBuildProjectName)</OutDir>
</PropertyGroup>
</Project>

Просмотреть файл

@ -26,12 +26,6 @@
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
<RunAnalyzersDuringLiveAnalysis>false</RunAnalyzersDuringLiveAnalysis>
<RunAnalyzers>false</RunAnalyzers>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == ''">
<OutDir>..\..\..\bin\Tests\$(Configuration)\$(Platform)\$(MSBuildProjectName)</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' != ''">
<OutDir>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\Tests\$(Configuration)\$(Platform)\$(MSBuildProjectName)</OutDir>
<OutDir>$(OutputRootPath)Tests/$(Configuration)/$(Platform)/$(MSBuildProjectName)</OutDir>
</PropertyGroup>
</Project>

Просмотреть файл

@ -6,7 +6,7 @@
<PackageLicenseUrl>https://github.com/jacqueskang/IpcServiceFramework/blob/develop/LICENSE</PackageLicenseUrl>
<!-- Below is the official repo for IpcServiceFramework. However, it confuses SourceLink, as the source used is from the FactoryOrchestrator repo. -->
<!-- Commenting out to resolve the SourceLink error, ex: -->
<!-- C:\Users\VssAdministrator\.nuget\packages\microsoft.sourcelink.common\1.0.0\build\Microsoft.SourceLink.Common.targets(52,5): warning : Source control information is not available - the generated source link is empty. [D:\a\1\s\oss\IpcFramework\JKang.IpcServiceFramework.Core\JKang.IpcServiceFramework.Core.csproj] -->
<!-- C:/Users/VssAdministrator/.nuget/packages/microsoft.sourcelink.common/1.0.0/build/Microsoft.SourceLink.Common.targets(52,5): warning : Source control information is not available - the generated source link is empty. [D:/a/1/s/oss/IpcFramework/JKang.IpcServiceFramework.Core/JKang.IpcServiceFramework.Core.csproj] -->
<!-- <RepositoryUrl>https://github.com/jacqueskang/IpcServiceFramework</RepositoryUrl> -->
<PackageProjectUrl>https://github.com/jacqueskang/IpcServiceFramework</PackageProjectUrl>
<Version>3.1.0</Version>
@ -23,7 +23,16 @@
<!-- Embed source files that are not tracked by the source control manager in the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<OutputRootPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)/bin/</OutputRootPath>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == '' And '$(GITHUB_ACTIONS)' != 'true'">
<OutputRootPath>$(MSBuildThisFileDirectory)../../bin/</OutputRootPath>
</PropertyGroup>
<PropertyGroup>
<OutDir>$(OutputRootPath)$(Configuration)/$(Platform)/$(MSBuildProjectName)</OutDir>
</PropertyGroup>
<ItemGroup Condition="'$(BUILD_REPOSITORY_URI.Contains(`dev.azure.com`))' == 'true' Or '$(BUILD_REPOSITORY_URI.Contains(`visualstudio.com`))' == 'true'">
<!-- Use AzureRepos version of SourceLink if source code is from ADO. -->
<PackageReference Include="Microsoft.SourceLink.AzureRepos.Git" Version="1.0.0" PrivateAssets="All"/>
@ -38,10 +47,4 @@
<PropertyGroup Condition="'$(DisableDynamicCodeGeneration)' == 'true'">
<DefineConstants>DISABLE_DYNAMIC_CODE_GENERATION</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == ''">
<OutDir>$(MSBuildThisFileDirectory)..\..\bin\$(Configuration)\$(Platform)\$(MSBuildProjectName)</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' != ''">
<OutDir>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\$(Configuration)\$(Platform)\$(MSBuildProjectName)</OutDir>
</PropertyGroup>
</Project>

Просмотреть файл

@ -18,11 +18,8 @@
<Version>3.0.0</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == ''">
<OutputPath>..\..\bin\$(Configuration)\$(Platform)\$(MSBuildProjectName)</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' != ''">
<OutputPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\$(Configuration)\$(Platform)\$(MSBuildProjectName)</OutputPath>
<PropertyGroup>
<OutputPath>$(OutputRootPath)$(Configuration)\$(Platform)\$(MSBuildProjectName)</OutputPath>
</PropertyGroup>
<PropertyGroup>
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>

Просмотреть файл

@ -66,7 +66,7 @@ namespace Microsoft.FactoryOrchestrator.UWP
}
}
protected override void OnNavigatedTo(NavigationEventArgs e)
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
Client = ((App)Application.Current).Client;
@ -92,6 +92,16 @@ namespace Microsoft.FactoryOrchestrator.UWP
ContainerCheckBox.IsEnabled = false;
ContainerCheckBox.IsChecked = false;
}
}
try
{
_isWindows = await Client.GetOSPlatform() == PlatformID.Win32NT;
}
catch (FactoryOrchestratorVersionMismatchException)
{
// Assume service is Windows and this API isn't implemented (Service version < 9.1.0)
_isWindows = true;
}
base.OnNavigatedTo(e);
@ -180,7 +190,28 @@ namespace Microsoft.FactoryOrchestrator.UWP
try
{
_activeRunSem.Wait();
_activeCmdTaskRun = await Client.RunExecutable(@"cmd.exe", $"/C \"{command}\"", null, (bool)ContainerCheckBox.IsChecked);
if (_isWindows)
{
_activeCmdTaskRun = await Client.RunExecutable(@"cmd.exe", $"/C \"{command}\"", null, (bool)ContainerCheckBox.IsChecked);
}
else
{
// Unlike Windows, every command is a file in $PATH, so we need to split the given string into the program & arguments
var spaceIndex = command.IndexOf(" ", StringComparison.InvariantCultureIgnoreCase);
string program;
string args = null;
if (spaceIndex == -1)
{
program = command;
}
else
{
program = command.Substring(0, spaceIndex);
args = command.Substring(spaceIndex);
}
_activeCmdTaskRun = await Client.RunExecutable(program, args, null, (bool)ContainerCheckBox.IsChecked);
}
}
finally
{
@ -421,8 +452,8 @@ namespace Microsoft.FactoryOrchestrator.UWP
private readonly SemaphoreSlim _cmdSem;
private readonly SemaphoreSlim _outSem;
private readonly SemaphoreSlim _activeRunSem;
private FactoryOrchestratorUWPClient Client = ((App)Application.Current).Client;
private FactoryOrchestratorUWPClient Client = ((App)Application.Current).Client;
private bool _isWindows;
private const int MaxBlocks = 10; // @500 lines per block this is 5000 lines or 10 commands maximum
private const int MaxLinesPerBlock = 500;
}

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap mp rescap">
<Identity Version="9.0.0.0" Name="Microsoft.FactoryOrchestratorApp.DEV" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
<Identity Version="9.1.0.0" Name="Microsoft.FactoryOrchestratorApp.DEV" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
<mp:PhoneIdentity PhoneProductId="598c7e0f-acaf-4866-90a5-de8ad458aa53" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>Factory Orchestrator (DEV)</DisplayName>

Просмотреть файл

@ -61,6 +61,17 @@ namespace Microsoft.FactoryOrchestrator.UWP
AppComboBox.ItemsSource = new List<string>();
}
try
{
_ = await Client.GetOSPlatform();
supportsCommandLineTask = true;
}
catch (FactoryOrchestratorVersionMismatchException)
{
// Service version < 9.1.0, must use BatchFileTask
supportsCommandLineTask = false;
}
ParallelCheck.IsChecked = activeList.RunInParallel;
BlockingCheck.IsChecked = activeList.AllowOtherTaskListsToRun;
TerminateBgTasksCheck.IsChecked = activeList.TerminateBackgroundTasksOnCompletion;
@ -208,7 +219,16 @@ namespace Microsoft.FactoryOrchestrator.UWP
activeTask = new TAEFTest(TaskPathBox.Text);
break;
case TaskType.BatchFile:
activeTask = new BatchFileTask(TaskPathBox.Text);
if (supportsCommandLineTask)
{
activeTask = new CommandLineTask(TaskPathBox.Text);
}
else
{
#pragma warning disable CS0618 // Type or member is obsolete
activeTask = new BatchFileTask(TaskPathBox.Text);
#pragma warning restore CS0618 // Type or member is obsolete
}
break;
case TaskType.PowerShell:
activeTask = new PowerShellTask(TaskPathBox.Text);
@ -428,7 +448,7 @@ namespace Microsoft.FactoryOrchestrator.UWP
resourceLoader.GetString("Path");
break;
case TaskType.BatchFile:
var cmd = activeTask as BatchFileTask;
var cmd = activeTask as CommandLineTask;
TaskPathBox.Text = cmd.Path;
ArgumentsBox.Text = cmd.Arguments;
EditFlyoutTextHeader.Text = resourceLoader.GetString("EditFlyoutTextHeaderEditingCMD");
@ -739,6 +759,7 @@ namespace Microsoft.FactoryOrchestrator.UWP
private bool activeTaskIsNowBg;
private bool isNewList;
private bool listEdited;
private bool supportsCommandLineTask;
private readonly FactoryOrchestratorUWPClient Client = ((App)Application.Current).Client;
private readonly ResourceLoader resourceLoader = ResourceLoader.GetForCurrentView();
}

Просмотреть файл

@ -99,11 +99,8 @@
<PropertyGroup>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == ''">
<OutputPath>..\..\bin\$(Configuration)\$(Platform)\$(AssemblyName)</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' != ''">
<OutputPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\$(Configuration)\$(Platform)\$(AssemblyName)</OutputPath>
<PropertyGroup>
<OutputPath>$(OutputRootPath)$(Configuration)/$(Platform)/$(TargetName)</OutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="AboutPage.xaml.cs">
@ -298,7 +295,7 @@
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<Target Name="BeforeBuildPS" BeforeTargets="Build;CoreCompile;XefVersionResourceCompile;XamlPreCompile">
<Exec Command="Powershell.exe $(ProjectDir)..\..\build\SetSourceVersion.ps1 -SrcPath $(ProjectDir)" />
<Exec Command="$(PowerShellExeName) $(ProjectDir)..\..\build\SetSourceVersion.ps1 -SrcPath $(ProjectDir)" />
</Target>
<Target Name="AfterBuild" Condition="'$(AGENT_ID)' != ''">
<Copy SourceFiles="$(AppxPackageOutput)" DestinationFolder="$(OutputPath)" />

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap mp rescap">
<Identity Version="9.0.0.0" Name="Microsoft.FactoryOrchestratorApp" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
<Identity Version="9.1.0.0" Name="Microsoft.FactoryOrchestratorApp" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
<mp:PhoneIdentity PhoneProductId="598c7e0f-acaf-4866-90a5-de8ad458aa53" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>Factory Orchestrator</DisplayName>

Просмотреть файл

@ -417,7 +417,8 @@ If "Factory Reset" is chosen, the service is restarted as if it is first boot. F
<value>Network information</value>
</data>
<data name="NewCMDButton.Content" xml:space="preserve">
<value>New Batch File Task</value>
<value>New Command Line File Task</value>
<comment>button to create a new command line file task (batch file on windows, shell script on linux)</comment>
</data>
<data name="NewExecutableButton.Content" xml:space="preserve">
<value>New Executable Task</value>

Просмотреть файл

@ -501,9 +501,14 @@ namespace Microsoft.FactoryOrchestrator.Client
}
else if (ex is IpcFaultException ipc)
{
// Return the actual exception the server threw
if (ipc.Status == IpcStatus.BadRequest)
{
// This is almost certainly due to a client<->server version mismatch
ex = new FactoryOrchestratorVersionMismatchException(Resources.IpcInvalidOperationError, ex);
}
if ((ipc.Status == IpcStatus.InternalServerError) && (ipc.InnerException != null))
{
// Return the actual exception the server threw
ex = ipc.InnerException;
if ((ex.InnerException != null) && (ex is TargetInvocationException))

Просмотреть файл

@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<Import Project="../common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
@ -7,17 +7,13 @@
<PackageId>Microsoft.FactoryOrchestrator.Client</PackageId>
<Description>.NET Standard library containing the client-side FactoryOrchestrator classes, required to interact with Factory Orchestrator Service. Also contains optional helper classes. See https://microsoft.github.io/FactoryOrchestrator/ for more information.</Description>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == ''">
<OutputPath>..\..\bin\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
<DocumentationFile>..\..\bin\$(Configuration)\$(Platform)\$(TargetName)\$(TargetFramework)\$(TargetName).xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' != ''">
<OutputPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
<DocumentationFile>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\$(Configuration)\$(Platform)\$(TargetName)\$(TargetName).xml</DocumentationFile>
<PropertyGroup>
<OutputPath>$(OutputRootPath)$(Configuration)/$(Platform)/$(TargetName)</OutputPath>
<DocumentationFile>$(OutputRootPath)$(Configuration)/$(Platform)/$(TargetName)/$(TargetName).xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<DefaultDocumentationHome>$(TargetName)</DefaultDocumentationHome>
<DefaultDocumentationFolder>$(OutputRootPath)\DefaultDocumentation\ClientLibrary</DefaultDocumentationFolder>
<DefaultDocumentationFolder>$(OutputRootPath)/DefaultDocumentation/ClientLibrary</DefaultDocumentationFolder>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DefaultDocumentation" Version="0.6.13">
@ -31,20 +27,20 @@
<ItemGroup>
<!-- Created by AutoGenerateInterfaceHelper in CoreLibrary -->
<Compile Include="obj\FactoryOrchestratorClientAutogenerated.cs" />
<Compile Include="obj/FactoryOrchestratorClientAutogenerated.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CoreLibrary\Microsoft.FactoryOrchestrator.Core.csproj" />
<ProjectReference Include="../CoreLibrary/Microsoft.FactoryOrchestrator.Core.csproj" />
<!-- IncludeAssets = none or else dotnet pack thinks these can be satisfied by NuGet.org package dependencies. -->
<!-- However, NuGet.org IPC packages use dynamic code generation, which we don't support, hence the source code fork. -->
<ProjectReference Include="..\..\oss\IpcFramework\JKang.IpcServiceFramework.Client.Tcp\JKang.IpcServiceFramework.Client.Tcp.csproj" >
<ProjectReference Include="../../oss/IpcFramework/JKang.IpcServiceFramework.Client.Tcp/JKang.IpcServiceFramework.Client.Tcp.csproj" >
<IncludeAssets>none</IncludeAssets>
</ProjectReference>
<ProjectReference Include="..\..\oss\IpcFramework\JKang.IpcServiceFramework.Client\JKang.IpcServiceFramework.Client.csproj" >
<ProjectReference Include="../../oss/IpcFramework/JKang.IpcServiceFramework.Client/JKang.IpcServiceFramework.Client.csproj" >
<IncludeAssets>none</IncludeAssets>
</ProjectReference>
<ProjectReference Include="..\..\oss\IpcFramework\JKang.IpcServiceFramework.Core\JKang.IpcServiceFramework.Core.csproj" >
<ProjectReference Include="../../oss/IpcFramework/JKang.IpcServiceFramework.Core/JKang.IpcServiceFramework.Core.csproj" >
<IncludeAssets>none</IncludeAssets>
</ProjectReference>
@ -57,30 +53,30 @@
<!-- Add IPC OSS binaries to package -->
<Target Name="CopyProjectReferencesToPackage">
<ItemGroup>
<BuildOutputInPackage Include="$(OutputRootPath)\$(Configuration)\$(Platform)\JKang.IpcServiceFramework.Client.Tcp\**\*.dll"/>
<BuildOutputInPackage Include="$(OutputRootPath)/$(Configuration)/$(Platform)/JKang.IpcServiceFramework.Client.Tcp/**/*.dll"/>
</ItemGroup>
<!-- Print for debug purposes -->
<Message Text="CopyProjectReferencesToPackage - $(OutputRootPath)\$(Configuration)\$(Platform)\JKang.IpcServiceFramework.Client.Tcp\**\*.dll found: @(BuildOutputInPackage)" Importance="High"/>
<Message Text="CopyProjectReferencesToPackage - $(OutputRootPath)/$(Configuration)/$(Platform)/JKang.IpcServiceFramework.Client.Tcp/**/*.dll found: @(BuildOutputInPackage)" Importance="High"/>
</Target>
<!-- Add IPC OSS symbols to symbol package -->
<Target Name="UpdateSymTfm" BeforeTargets="_GetDebugSymbolsWithTfm">
<ItemGroup>
<_TargetPathsToSymbolsWithTfm Include="$(OutputRootPath)\$(Configuration)\$(Platform)\JKang.IpcServiceFramework.Client.Tcp\**\*.pdb">
<_TargetPathsToSymbolsWithTfm Include="$(OutputRootPath)/$(Configuration)/$(Platform)/JKang.IpcServiceFramework.Client.Tcp/**/*.pdb">
<TargetFramework>netstandard2.0</TargetFramework>
</_TargetPathsToSymbolsWithTfm>
</ItemGroup>
<!-- Print for debug purposes -->
<Message Text="UpdateSymTfm - $(OutputRootPath)\$(Configuration)\$(Platform)\JKang.IpcServiceFramework.Client.Tcp\**\*.pdb found: @(_TargetPathsToSymbolsWithTfm)" Importance="High"/>
<Message Text="UpdateSymTfm - $(OutputRootPath)/$(Configuration)/$(Platform)/JKang.IpcServiceFramework.Client.Tcp/**/*.pdb found: @(_TargetPathsToSymbolsWithTfm)" Importance="High"/>
</Target>
<Target Name="FixAndCopyMd" AfterTargets="Build">
<ItemGroup>
<FilesToMove Include="$(DefaultDocumentationFolder)\*.md"/>
<FilesToMove Include="$(DefaultDocumentationFolder)/*.md"/>
</ItemGroup>
<Exec Command="Powershell.exe $(ProjectDir)..\..\build\FixupAPIMarkdown.ps1 -DefaultDocumentationFolder $(DefaultDocumentationFolder)" />
<Move SourceFiles="@(FilesToMove)" DestinationFolder="..\..\docs\docs\ClientLibrary" />
<Exec Command="$(PowerShellExeName) $(ProjectDir)../../build/FixupAPIMarkdown.ps1 -DefaultDocumentationFolder $(DefaultDocumentationFolder)" />
<Move SourceFiles="@(FilesToMove)" DestinationFolder="../../docs/docs/ClientLibrary" />
</Target>
</Project>

Просмотреть файл

@ -9,15 +9,12 @@
<NeutralLanguage>en-US</NeutralLanguage>
<DefaultLanguage>en-US</DefaultLanguage>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == ''">
<OutputPath>..\..\bin\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' != ''">
<OutputPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
<PropertyGroup>
<OutputPath>$(OutputRootPath)$(Configuration)/$(Platform)/$(TargetName)</OutputPath>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\ClientLibrary\Microsoft.FactoryOrchestrator.Client.csproj" />
<ProjectReference Include="../ClientLibrary/Microsoft.FactoryOrchestrator.Client.csproj" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -6,7 +6,8 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Net;
using System.Runtime.InteropServices;
namespace Microsoft.FactoryOrchestrator.Core
{
/// <summary>
@ -210,11 +211,16 @@ namespace Microsoft.FactoryOrchestrator.Core
/// <returns>string representing the Service version.</returns>
string GetServiceVersionString();
/// <summary>
/// Returns the version of the Windows OS.
/// Returns the version of the OS.
/// </summary>
/// <returns>string representing the Windows OS version.</returns>
/// <returns>string representing the OS version.</returns>
string GetOSVersionString();
/// <summary>
/// Returns the platform of the OS.
/// </summary>
/// <returns>System.PlatformID enum value representing the OS platform (Unix or Windows).</returns>
PlatformID GetOSPlatform();
/// <summary>
/// Returns the version set by the OEM duing WSK Image Customization.
/// </summary>
/// <returns>string representing the OEM version.</returns>

Просмотреть файл

@ -46,13 +46,27 @@ namespace Microsoft.FactoryOrchestrator.Core.JSONConverters
return JsonConvert.DeserializeObject<UWPTask>(jo.ToString());
case TaskType.PowerShell:
return JsonConvert.DeserializeObject<PowerShellTask>(jo.ToString());
case TaskType.BatchFile:
return JsonConvert.DeserializeObject<BatchFileTask>(jo.ToString());
case TaskType.CommandLine:
{
// Use the object type the serializer used to ensure back-compatibiilty
#pragma warning disable CA1062 // Validate arguments of public methods
if (jo["$type"].Value<string>().Equals("Microsoft.FactoryOrchestrator.Core.CommandLineTask, Microsoft.FactoryOrchestrator.Core", StringComparison.InvariantCultureIgnoreCase))
#pragma warning restore CA1062 // Validate arguments of public methods
{
return JsonConvert.DeserializeObject<CommandLineTask>(jo.ToString());
}
else
{
#pragma warning disable CS0618 // Type or member is obsolete
return JsonConvert.DeserializeObject<BatchFileTask>(jo.ToString());
#pragma warning restore CS0618 // Type or member is obsolete
}
}
default:
throw new FactoryOrchestratorException(Resources.TaskBaseDeserializationException);
}
}
}
/// <summary>Gets a value indicating whether this <see cref="Newtonsoft.Json.JsonConverter"/> can write JSON.</summary>
/// <value>
/// <c>true</c> if this <see cref="Newtonsoft.Json.JsonConverter"/> can write JSON; otherwise, <c>false</c>.</value>
@ -61,6 +75,14 @@ namespace Microsoft.FactoryOrchestrator.Core.JSONConverters
get { return true; }
}
/// <summary>Gets a value indicating whether this <see cref="Newtonsoft.Json.JsonConverter"/> can read JSON.</summary>
/// <value>
/// <c>true</c> if this <see cref="Newtonsoft.Json.JsonConverter"/> can read JSON; otherwise, <c>false</c>.</value>
public override bool CanRead
{
get { return true; }
}
/// <summary>
/// Writes the JSON representation of the object.
/// </summary>
@ -97,8 +119,18 @@ namespace Microsoft.FactoryOrchestrator.Core.JSONConverters
case TaskType.PowerShell:
serializer.Serialize(writer, value, typeof(PowerShellTask));
break;
case TaskType.BatchFile:
serializer.Serialize(writer, value, typeof(BatchFileTask));
case TaskType.CommandLine:
// Use the exact object type to ensure back-compatibiilty
if (task.GetType().Equals(typeof(CommandLineTask)))
{
serializer.Serialize(writer, value, typeof(CommandLineTask));
}
else
{
#pragma warning disable CS0618 // Type or member is obsolete
serializer.Serialize(writer, value, typeof(BatchFileTask));
#pragma warning restore CS0618 // Type or member is obsolete
}
break;
default:
throw new FactoryOrchestratorException(Resources.TaskBaseSerializationException);
@ -170,4 +202,4 @@ namespace Microsoft.FactoryOrchestrator.Core.JSONConverters
throw new NotImplementedException();
}
}
}
}

Просмотреть файл

@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<Import Project="../common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
@ -9,17 +9,13 @@
<PackageId>Microsoft.FactoryOrchestrator.Core</PackageId>
<Description>A .NET Standard library containing the core FactoryOrchestrator classes. Required in all projects. See https://microsoft.github.io/FactoryOrchestrator/ for more information.</Description>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == ''">
<OutputPath>$(OutputRootPath)$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
<DocumentationFile>$(OutputPath)\$(TargetFramework)\$(TargetName).xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' != ''">
<OutputPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
<DocumentationFile>$(OutputPath)\$(TargetName).xml</DocumentationFile>
<PropertyGroup>
<OutputPath>$(OutputRootPath)$(Configuration)/$(Platform)/$(TargetName)</OutputPath>
<DocumentationFile>$(OutputPath)/$(TargetFramework)/$(TargetName).xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<DefaultDocumentationHome>$(TargetName)</DefaultDocumentationHome>
<DefaultDocumentationFolder>$(OutputRootPath)\DefaultDocumentation\CoreLibrary</DefaultDocumentationFolder>
<DefaultDocumentationFolder>$(OutputRootPath)/DefaultDocumentation/CoreLibrary</DefaultDocumentationFolder>
</PropertyGroup>
<ItemGroup>
<Compile Remove="ClientTemplate\IPCInterfaceHelperTemplate.cs" />
@ -62,14 +58,14 @@
</ItemGroup>
<Target Name="AfterBuildPS" AfterTargets="Build">
<Exec Command="Powershell.exe $(ProjectDir)..\..\build\AutoGenerateInterfaceHelper.ps1 -InterfaceName IFactoryOrchestratorService -InterfaceFile $(ProjectDir)IPCInterface.cs -TemplateFile $(ProjectDir)ClientTemplate\IPCInterfaceHelperTemplate.cs -OutputFile $(ProjectDir)..\ClientLibrary\obj\FactoryOrchestratorClientAutogenerated.cs -Async" />
<Exec Command="Powershell.exe $(ProjectDir)..\..\build\AutoGenerateInterfaceHelper.ps1 -InterfaceName IFactoryOrchestratorService -InterfaceFile $(ProjectDir)IPCInterface.cs -TemplateFile $(ProjectDir)ClientTemplate\IPCInterfaceHelperTemplateSync.cs -OutputFile $(ProjectDir)..\PowerShellLibrary\obj\FactoryOrchestratorClientSyncAutogenerated.cs" />
<Exec Command="$(PowerShellExeName) $(ProjectDir)../../build/AutoGenerateInterfaceHelper.ps1 -InterfaceName IFactoryOrchestratorService -InterfaceFile $(ProjectDir)IPCInterface.cs -TemplateFile $(ProjectDir)ClientTemplate/IPCInterfaceHelperTemplate.cs -OutputFile $(ProjectDir)../ClientLibrary/obj/FactoryOrchestratorClientAutogenerated.cs -Async" />
<Exec Command="$(PowerShellExeName) $(ProjectDir)../../build/AutoGenerateInterfaceHelper.ps1 -InterfaceName IFactoryOrchestratorService -InterfaceFile $(ProjectDir)IPCInterface.cs -TemplateFile $(ProjectDir)ClientTemplate/IPCInterfaceHelperTemplateSync.cs -OutputFile $(ProjectDir)../PowerShellLibrary/obj/FactoryOrchestratorClientSyncAutogenerated.cs" />
</Target>
<Target Name="FixAndCopyMd" AfterTargets="Build">
<ItemGroup>
<FilesToMove Include="$(DefaultDocumentationFolder)\*.md"/>
<FilesToMove Include="$(DefaultDocumentationFolder)/*.md"/>
</ItemGroup>
<Exec Command="Powershell.exe $(ProjectDir)..\..\build\FixupAPIMarkdown.ps1 -DefaultDocumentationFolder $(DefaultDocumentationFolder)" />
<Move SourceFiles="@(FilesToMove)" DestinationFolder="..\..\docs\docs\CoreLibrary" />
<Exec Command="$(PowerShellExeName) $(ProjectDir)../../build/FixupAPIMarkdown.ps1 -DefaultDocumentationFolder $(DefaultDocumentationFolder)" />
<Move SourceFiles="@(FilesToMove)" DestinationFolder="../../docs/docs/CoreLibrary" />
</Target>
</Project>

18
src/CoreLibrary/Resources/Resources.Designer.cs сгенерированный
Просмотреть файл

@ -781,6 +781,15 @@ namespace Microsoft.FactoryOrchestrator.Core {
}
}
/// <summary>
/// Looks up a localized string similar to Argument must be FOServiceStatus or FOVolatileServiceStatus object!.
/// </summary>
public static string ServiceStatusTypeException {
get {
return ResourceManager.GetString("ServiceStatusTypeException", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Service {0} stopped.
/// </summary>
@ -952,6 +961,15 @@ namespace Microsoft.FactoryOrchestrator.Core {
}
}
/// <summary>
/// Looks up a localized string similar to Unable to parse {0}!.
/// </summary>
public static string UnableToParseError {
get {
return ResourceManager.GetString("UnableToParseError", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unknown.
/// </summary>

Просмотреть файл

@ -465,4 +465,12 @@
<value>Operating System does not support containers. Disabling container support.</value>
<comment>Message shown when the operating system doesn't support containers.</comment>
</data>
<data name="ServiceStatusTypeException" xml:space="preserve">
<value>Argument must be FOServiceStatus or FOVolatileServiceStatus object!</value>
<comment>Exception message when UpdateServiceStatusFile() is passed an invalid object type.</comment>
</data>
<data name="UnableToParseError" xml:space="preserve">
<value>Unable to parse {0}!</value>
<comment>Error shown if the given file cannot be read properly (missing/corrupt)</comment>
</data>
</root>

Просмотреть файл

@ -132,9 +132,13 @@ namespace Microsoft.FactoryOrchestrator.Core
/// </summary>
PowerShell = 4,
/// <summary>
/// The Task is a batch file or shell script.
/// </summary>
CommandLine = 5,
/// <summary>
/// The Task is a Command Prompt script.
/// </summary>
BatchFile = 5
BatchFile = CommandLine,
}
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
@ -176,7 +180,10 @@ namespace Microsoft.FactoryOrchestrator.Core
[XmlInclude(typeof(ExternalTask))]
[XmlInclude(typeof(TAEFTest))]
[XmlInclude(typeof(PowerShellTask))]
#pragma warning disable CS0618 // Type or member is obsolete
[XmlInclude(typeof(BatchFileTask))]
#pragma warning restore CS0618 // Type or member is obsolete
[XmlInclude(typeof(CommandLineTask))]
public abstract class TaskBase : NotifyPropertyChangedBase
{
// TODO: Quality: Use Semaphore internally to guarantee accurate state if many things are setting task state
@ -810,7 +817,7 @@ namespace Microsoft.FactoryOrchestrator.Core
switch (run.TaskType)
{
case TaskType.BatchFile:
task = new BatchFileTask(run.TaskPath);
task = new CommandLineTask(run.TaskPath);
(task as ExecutableTask).BackgroundTask = run.BackgroundTask;
break;
case TaskType.Executable:
@ -1029,12 +1036,14 @@ namespace Microsoft.FactoryOrchestrator.Core
/// 0 == PASS, all others == FAIL.
/// </summary>
[JsonConverter(typeof(NoConverter))]
[Obsolete("BatchFileTask is deprecated, please use CommandLineTask instead.")]
#pragma warning disable CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode()
public class BatchFileTask : ExecutableTask
{
#pragma warning restore CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode()
private BatchFileTask() : base(null, TaskType.BatchFile)
private protected BatchFileTask() : base(null, TaskType.BatchFile)
{
}
@ -1094,6 +1103,28 @@ namespace Microsoft.FactoryOrchestrator.Core
private string _testFriendlyName;
}
/// <summary>
/// An CommandLineTask is a .cmd, .bat, or .sh script. This is known as a Batch file on Windows and a Shell script on Linux. The exit code of the script determines if the task passed or failed.
/// 0 == PASS, all others == FAIL.
/// </summary>
[JsonConverter(typeof(NoConverter))]
#pragma warning disable CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode()
#pragma warning disable CS0618 // Type or member is obsolete
// Ideally BatchFileTask would be renamed CommandLineTask when Linux support was added. However, that would be a breaking change.
// By creating a new class that inherits from the now "obsolete" BatchFileTask, we can maintain back compatibility with existing code
// while directing any new code to the CommandLineTask class.
public class CommandLineTask : BatchFileTask
#pragma warning restore CS0618 // Type or member is obsolete
{
private CommandLineTask() : base() {}
/// <summary>
/// Initializes a new instance of the <see cref="CommandLineTask"/> class.
/// </summary>
/// <param name="scriptPath">The script path.</param>
public CommandLineTask(string scriptPath) : base(scriptPath) {}
}
/// <summary>
/// A TAEFTest is a type of ExecutableTask, which is always run by TE.exe. TAEF tests are comprised of one or more sub-tests (TAEFTestCase).
/// Pass/Fail is determined by TE.exe.

Просмотреть файл

@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28729.10
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.FactoryOrchestrator.CoreLibrary", "CoreLibrary\Microsoft.FactoryOrchestrator.Core.csproj", "{5ED97075-7281-4FA3-8E5F-D4B8D273BDCB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.FactoryOrchestrator.Core", "CoreLibrary\Microsoft.FactoryOrchestrator.Core.csproj", "{5ED97075-7281-4FA3-8E5F-D4B8D273BDCB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.FactoryOrchestrator.Service", "Service\Microsoft.FactoryOrchestrator.Service.csproj", "{1F7BBB14-DFAF-4FBD-8977-5B2C78025B74}"
EndProject
@ -62,18 +62,21 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{492B979A-F7D2-40A1-B311-1416F9CE7A2A}"
ProjectSection(SolutionItems) = preProject
..\build\AutoGenerateInterfaceHelper.ps1 = ..\build\AutoGenerateInterfaceHelper.ps1
..\build\azure-pipelines-ci.yml = ..\build\azure-pipelines-ci.yml
..\build\azure-pipelines.loc.yml = ..\build\azure-pipelines.loc.yml
..\build\azure-pipelines.pr.yml = ..\build\azure-pipelines.pr.yml
..\build\azure-pipelines.yml = ..\build\azure-pipelines.yml
custom.props = custom.props
..\build\FixupAPIMarkdown.ps1 = ..\build\FixupAPIMarkdown.ps1
..\build\release-pipeline.yml = ..\build\release-pipeline.yml
..\build\SetSourceVersion.ps1 = ..\build\SetSourceVersion.ps1
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "internal", "internal", "{A33F40C3-2BAD-406E-86BE-DBE33F12BB29}"
ProjectSection(SolutionItems) = preProject
..\build\internal\CopyUniqueBins.ps1 = ..\build\internal\CopyUniqueBins.ps1
..\build\internal\CreateServiceManifest.ps1 = ..\build\internal\CreateServiceManifest.ps1
..\build\internal\CreateServiceManifestForPkgES.ps1 = ..\build\internal\CreateServiceManifestForPkgES.ps1
..\build\internal\CreateTestZip.ps1 = ..\build\internal\CreateTestZip.ps1
..\build\internal\CreateUWPClientNuGet.ps1 = ..\build\internal\CreateUWPClientNuGet.ps1
..\build\internal\FactoryOrchestratorServiceTemplate.wm.xml = ..\build\internal\FactoryOrchestratorServiceTemplate.wm.xml
..\build\internal\ftf-ci-hosted.yml = ..\build\internal\ftf-ci-hosted.yml
..\build\internal\ftf-pkges-vpack.yml = ..\build\internal\ftf-pkges-vpack.yml
@ -90,7 +93,24 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{B4F05B
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "templates", "templates", "{0FD8AFF8-3868-4FD5-A8A6-DA8DAA02B52F}"
ProjectSection(SolutionItems) = preProject
..\build\templates\template-build-all-arch.yml = ..\build\templates\template-build-all-arch.yml
..\build\templates\template-build-app.yml = ..\build\templates\template-build-app.yml
..\build\templates\template-build-test-service.yml = ..\build\templates\template-build-test-service.yml
..\build\templates\template-build-uwpclient.yml = ..\build\templates\template-build-uwpclient.yml
..\build\templates\template-checkdocs.yml = ..\build\templates\template-checkdocs.yml
..\build\templates\template-ci-compliance.yml = ..\build\templates\template-ci-compliance.yml
..\build\templates\template-ci-pr-stages.yml = ..\build\templates\template-ci-pr-stages.yml
..\build\templates\template-create-service-zip.yml = ..\build\templates\template-create-service-zip.yml
..\build\templates\template-dotnet-publish-pwsh-library.yml = ..\build\templates\template-dotnet-publish-pwsh-library.yml
..\build\templates\template-dotnet-publish-service.yml = ..\build\templates\template-dotnet-publish-service.yml
..\build\templates\template-install-netcore.yml = ..\build\templates\template-install-netcore.yml
..\build\templates\template-pack-sign-nuget.yml = ..\build\templates\template-pack-sign-nuget.yml
..\build\templates\template-push-vpack-other.yml = ..\build\templates\template-push-vpack-other.yml
..\build\templates\template-push-vpack-service.yml = ..\build\templates\template-push-vpack-service.yml
..\build\templates\template-set-build-version.yml = ..\build\templates\template-set-build-version.yml
..\build\templates\template-set-FORepoRoot.yml = ..\build\templates\template-set-FORepoRoot.yml
..\build\templates\template-set-initial-variables.yml = ..\build\templates\template-set-initial-variables.yml
..\build\templates\template-set-should-sign.yml = ..\build\templates\template-set-should-sign.yml
..\build\templates\template-sign-binaries-windows.yml = ..\build\templates\template-sign-binaries-windows.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{422A5B26-B858-44D2-9E64-DD88B7B0A1F1}"

Просмотреть файл

@ -124,6 +124,23 @@ namespace Microsoft.FactoryOrchestrator.Client
[Parameter(Mandatory = false)]
public string Arguments { get; set; }
/// <summary>
/// Create a BatchFileTask instead of a CommandLineTask. Only needed for backwards compatibility with FactoryOrchestrator version 9.0.0 or order.
/// </summary>
[Parameter(Mandatory = false)]
public SwitchParameter ForceBatchFileTaskType
{
get
{
return forceBatch;
}
set
{
forceBatch = value;
}
}
private bool forceBatch;
/// <summary>
/// Creates a PowerShell object.
/// </summary>
@ -133,7 +150,16 @@ namespace Microsoft.FactoryOrchestrator.Client
switch (Type)
{
case TaskType.BatchFile:
t = new BatchFileTask(Path);
if (ForceBatchFileTaskType)
{
#pragma warning disable CS0618 // Type or member is obsolete
t = new BatchFileTask(Path);
#pragma warning restore CS0618 // Type or member is obsolete
}
else
{
t = new CommandLineTask(Path);
}
t.Arguments = Arguments;
t.Name = Name;
break;

Просмотреть файл

@ -1,17 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<Import Project="../common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetName>Microsoft.FactoryOrchestrator.PowerShell</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == ''">
<OutputPath>..\..\bin\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
<DocumentationFile>..\..\bin\$(Configuration)\$(Platform)\$(TargetName)\$(TargetFramework)\$(TargetName).xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' != ''">
<OutputPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
<DocumentationFile>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\$(Configuration)\$(Platform)\$(TargetName)\$(TargetName).xml</DocumentationFile>
<PropertyGroup>
<OutputPath>$(OutputRootPath)$(Configuration)/$(Platform)/$(TargetName)</OutputPath>
<DocumentationFile>$(OutputRootPath)$(Configuration)/$(Platform)/$(TargetName)/$(TargetFramework)/$(TargetName).xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.7" />
@ -22,33 +18,30 @@
<ItemGroup>
<!-- Created by AutoGenerateInterfaceHelper in CoreLibrary -->
<Compile Include="obj\FactoryOrchestratorClientSyncAutogenerated.cs" />
<Compile Include="obj/FactoryOrchestratorClientSyncAutogenerated.cs" />
<!-- Created by SetSourceVersion -->
<None Include="obj\Microsoft.FactoryOrchestrator.Client.psd1" CopyToOutputDirectory="Always" CopyToPublishDirectory="Always" />
<None Include="obj/Microsoft.FactoryOrchestrator.Client.psd1" CopyToOutputDirectory="Always" CopyToPublishDirectory="Always" />
<None Include="license.txt" CopyToOutputDirectory="Always" CopyToPublishDirectory="Always" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ClientLibrary\Microsoft.FactoryOrchestrator.Client.csproj" />
<ProjectReference Include="..\CoreLibrary\Microsoft.FactoryOrchestrator.Core.csproj" />
<ProjectReference Include="..\..\oss\IpcFramework\JKang.IpcServiceFramework.Client.Tcp\JKang.IpcServiceFramework.Client.Tcp.csproj" />
<ProjectReference Include="..\..\oss\IpcFramework\JKang.IpcServiceFramework.Client\JKang.IpcServiceFramework.Client.csproj" />
<ProjectReference Include="../ClientLibrary/Microsoft.FactoryOrchestrator.Client.csproj" />
<ProjectReference Include="../CoreLibrary/Microsoft.FactoryOrchestrator.Core.csproj" />
<ProjectReference Include="../../oss/IpcFramework/JKang.IpcServiceFramework.Client.Tcp/JKang.IpcServiceFramework.Client.Tcp.csproj" />
<ProjectReference Include="../../oss/IpcFramework/JKang.IpcServiceFramework.Client/JKang.IpcServiceFramework.Client.csproj" />
</ItemGroup>
<Target Name="BeforeBuildPS_VSO" BeforeTargets="Build;CoreCompile" Condition="'$(AGENT_ID)' != '' Or '$(Configuration)' == 'Release'">
<Exec Command="Powershell.exe $(ProjectDir)..\..\build\SetSourceVersion.ps1 -SrcPath $(ProjectDir)" />
</Target>
<Target Name="BeforeBuildPS_Local" BeforeTargets="Build;CoreCompile" Condition="'$(AGENT_ID)' == '' And '$(Configuration)' == 'Debug'">
<Exec Command="Powershell.exe $(ProjectDir)..\..\build\SetSourceVersion.ps1 -SrcPath $(ProjectDir) -MajorMinorOnly" />
<Target Name="BeforeBuildPS_VSO" BeforeTargets="Build;CoreCompile">
<Exec Command="$(PowerShellExeName) $(ProjectDir)../../build/SetSourceVersion.ps1 -SrcPath $(ProjectDir)" />
</Target>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Move SourceFiles="$(OutputPath)\obj\Microsoft.FactoryOrchestrator.Client.psd1"
DestinationFolder="$(OutputPath)\" />
<RemoveDir Directories="$(OutputPath)\obj" />
<Move SourceFiles="$(OutputPath)/obj/Microsoft.FactoryOrchestrator.Client.psd1"
DestinationFolder="$(OutputPath)/" />
<RemoveDir Directories="$(OutputPath)/obj" />
</Target>
<Target Name="PostBuildPub" AfterTargets="Publish">
<Move SourceFiles="$(PublishDir)\obj\Microsoft.FactoryOrchestrator.Client.psd1"
DestinationFolder="$(PublishDir)\" />
<RemoveDir Directories="$(PublishDir)\obj" />
<Move SourceFiles="$(PublishDir)/obj/Microsoft.FactoryOrchestrator.Client.psd1"
DestinationFolder="$(PublishDir)/" />
<RemoveDir Directories="$(PublishDir)/obj" />
</Target>
</Project>

Просмотреть файл

@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<Import Project="../common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
@ -7,18 +7,15 @@
<PackageId>Microsoft.FactoryOrchestrator.Server</PackageId>
<Description>A .NET Standard library containing the server-side FactoryOrchestrator classes. Required on all FactoryOrchestrator server projects. See https://microsoft.github.io/FactoryOrchestrator/ for more information.</Description>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == ''">
<OutputPath>..\..\bin\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' != ''">
<OutputPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
<PropertyGroup>
<OutputPath>$(OutputRootPath)$(Configuration)/$(Platform)/$(TargetName)</OutputPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Security.Principal.Windows" Version="4.7.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CoreLibrary\Microsoft.FactoryOrchestrator.Core.csproj" />
<ProjectReference Include="..\..\oss\Pe-Utility\Pe-Utility.csproj">
<ProjectReference Include="../CoreLibrary/Microsoft.FactoryOrchestrator.Core.csproj" />
<ProjectReference Include="../../oss/Pe-Utility/Pe-Utility.csproj">
<IncludeAssets>none</IncludeAssets>
</ProjectReference>
</ItemGroup>
@ -30,23 +27,23 @@
<!-- Add Pe-Utility OSS binaries to package -->
<Target Name="CopyProjectReferencesToPackage">
<ItemGroup>
<BuildOutputInPackage Include="$(OutputRootPath)\$(Configuration)\$(Platform)\Pe-Utility\**\*.dll"/>
<BuildOutputInPackage Include="$(OutputRootPath)/$(Configuration)/$(Platform)/Pe-Utility/**/*.dll"/>
</ItemGroup>
<!-- Print for debug purposes -->
<Message Text="CopyProjectReferencesToPackage - $(OutputRootPath)\$(Configuration)\$(Platform)\Pe-Utility\**\*.dll found: @(BuildOutputInPackage)" Importance="High"/>
<Message Text="CopyProjectReferencesToPackage - $(OutputRootPath)/$(Configuration)/$(Platform)/Pe-Utility/**/*.dll found: @(BuildOutputInPackage)" Importance="High"/>
</Target>
<!-- Add Pe-Utility OSS symbols to symbol package -->
<Target Name="UpdateSymTfm" BeforeTargets="_GetDebugSymbolsWithTfm">
<ItemGroup>
<_TargetPathsToSymbolsWithTfm Include="$(OutputRootPath)\$(Configuration)\$(Platform)\Pe-Utility\**\*.pdb">
<_TargetPathsToSymbolsWithTfm Include="$(OutputRootPath)/$(Configuration)/$(Platform)/Pe-Utility/**/*.pdb">
<TargetFramework>netstandard2.0</TargetFramework>
</_TargetPathsToSymbolsWithTfm>
</ItemGroup>
<!-- Print for debug purposes -->
<Message Text="UpdateSymTfm - $(OutputRootPath)\$(Configuration)\$(Platform)\(OutputRootPath)\$(Configuration)\$(Platform)\Pe-Utility\**\*.pdb found: @(_TargetPathsToSymbolsWithTfm)" Importance="High"/>
<Message Text="UpdateSymTfm - $(OutputRootPath)/$(Configuration)/$(Platform)/(OutputRootPath)/$(Configuration)/$(Platform)/Pe-Utility/**/*.pdb found: @(_TargetPathsToSymbolsWithTfm)" Importance="High"/>
</Target>
</Project>

Просмотреть файл

@ -45,7 +45,7 @@ namespace Microsoft.FactoryOrchestrator.Server
_taskMapLock = new object();
TaskListStateFile = taskListStateFile;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
if (_isWindows)
{
_supportsWin32Gui = NativeMethods.IsApiSetImplemented("ext-ms-win-ntuser-window-l1-1-4");
}
@ -79,7 +79,7 @@ namespace Microsoft.FactoryOrchestrator.Server
if (moveFiles && (LogFolder != null) && (Directory.Exists(LogFolder)))
{
// Move existing folder to temp folder
var tempDir = Path.Combine(Environment.GetEnvironmentVariable("TEMP"), "FOTemp");
var tempDir = Path.Combine(Path.GetTempPath(), "FOTemp");
CopyDirectory(LogFolder, tempDir, true);
// Delete old folder
@ -151,8 +151,7 @@ namespace Microsoft.FactoryOrchestrator.Server
var searchOption = recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly;
var exes = Directory.EnumerateFiles(path, "*.exe", searchOption);
var dlls = Directory.EnumerateFiles(path, "*.dll", searchOption);
var bats = Directory.EnumerateFiles(path, "*.bat", searchOption);
var cmds = Directory.EnumerateFiles(path, "*.cmd", searchOption);
var commands = Directory.EnumerateFiles(path, "*.bat", searchOption).Concat(Directory.EnumerateFiles(path, "*.cmd", searchOption)).Concat(Directory.EnumerateFiles(path, "*.sh", searchOption));
var ps1s = Directory.EnumerateFiles(path, "*.ps1", searchOption);
TaskList tests = new TaskList(path, Guid.NewGuid());
@ -179,15 +178,9 @@ namespace Microsoft.FactoryOrchestrator.Server
tests.Tasks.Add(task);
}
foreach (var cmd in cmds)
foreach (var command in commands)
{
var task = new BatchFileTask(cmd);
tests.Tasks.Add(task);
}
foreach (var bat in bats)
{
var task = new BatchFileTask(bat);
var task = new CommandLineTask(command);
tests.Tasks.Add(task);
}
@ -903,8 +896,13 @@ namespace Microsoft.FactoryOrchestrator.Server
taskRun.WriteLogHeader();
// Attempt to start the UWP app
if ((taskRun.TaskType == TaskType.UWP) && (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)))
if (taskRun.TaskType == TaskType.UWP)
{
if (!_isWindows)
{
throw new PlatformNotSupportedException(string.Format(CultureInfo.CurrentCulture, Resources.WindowsOnlyError, taskRun.TaskType));
}
HttpWebResponse response = null;
bool restFailed = false;
var errorCode = 0;
@ -1000,7 +998,7 @@ namespace Microsoft.FactoryOrchestrator.Server
taskRun.TaskStatus = TaskStatus.Aborted;
if ((UWPTask != null) && (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)))
if (UWPTask != null)
{
KillAppProcess(taskRun);
}
@ -1017,6 +1015,7 @@ namespace Microsoft.FactoryOrchestrator.Server
taskRun.ExitCode = (e.HResult == 0) ? -2147467259 : e.HResult; // E_FAIL
taskRun.TimeFinished = DateTime.Now;
taskRun.TaskStatus = TaskStatus.Failed;
waitingForResult = false;
}
finally
{
@ -1033,8 +1032,7 @@ namespace Microsoft.FactoryOrchestrator.Server
if (waitingForResult)
{
// Exit the app (if desired)
if (UWPTask != null && !UWPTask.AutoPassedIfLaunched && UWPTask.TerminateOnCompleted &&
RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && KillAppProcess(taskRun))
if (UWPTask != null && !UWPTask.AutoPassedIfLaunched && UWPTask.TerminateOnCompleted && KillAppProcess(taskRun))
{
taskRun.TaskOutput.Add(string.Format(CultureInfo.CurrentCulture, Resources.AppTerminated, taskRun.TaskPath));
}
@ -1723,6 +1721,7 @@ namespace Microsoft.FactoryOrchestrator.Server
private readonly SemaphoreSlim _startNonParallelTaskRunLock;
private readonly bool _supportsWin32Gui;
private bool _isDisposed;
private bool _isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
/// <summary>
/// Tracks all the task runs that have ever occured, mapped by the task run GUID
@ -1830,8 +1829,8 @@ namespace Microsoft.FactoryOrchestrator.Server
{
if (string.IsNullOrEmpty(_globalTeExePath))
{
// Default TAEF (TE.exe) path.
return Environment.ExpandEnvironmentVariables(@"%SystemDrive%\taef\te.exe");
// Default TAEF (TE.exe) path, will use %PATH% var to find te.exe
return "te.exe";
}
else
{
@ -1922,23 +1921,38 @@ namespace Microsoft.FactoryOrchestrator.Server
}
else if (ActiveTaskRun.TaskType == TaskType.PowerShell)
{
if (FindFileInPath("pwsh.exe") != "pwsh.exe")
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
// pwsh.exe (PowerShell Core 6, PowerShell 7+) is installed on the system, use it
startInfo.FileName = "pwsh.exe";
if (FindFileInPath("pwsh.exe") != "pwsh.exe")
{
// pwsh.exe (PowerShell Core 6, PowerShell 7+) is installed on the system, use it
startInfo.FileName = "pwsh.exe";
}
else
{
// Assume legacy powershell.exe is present. If it isn't, StartProcess() will fail gracefully.
startInfo.FileName = "powershell.exe";
}
}
else
{
// Assume legacy powershell.exe is present. If it isn't, StartProcess() will fail gracefully.
startInfo.FileName = "powershell.exe";
startInfo.FileName = "pwsh";
}
startInfo.Arguments += $"-NonInteractive -File \"{ActiveTaskRun.TaskPath}\" ";
}
else if (ActiveTaskRun.TaskType == TaskType.BatchFile)
{
startInfo.FileName = "cmd.exe";
startInfo.Arguments += $"/C \"{ActiveTaskRun.TaskPath}\" ";
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
startInfo.FileName = "cmd.exe";
startInfo.Arguments += $"/C \"{ActiveTaskRun.TaskPath}\" ";
}
else
{
startInfo.FileName = "bash";
startInfo.Arguments += $" \"{ActiveTaskRun.TaskPath}\" ";
}
}
else
{
@ -1953,11 +1967,11 @@ namespace Microsoft.FactoryOrchestrator.Server
startInfo.RedirectStandardInput = true;
startInfo.RedirectStandardOutput = true;
startInfo.CreateNoWindow = true;
startInfo.Environment["Path"] = Environment.GetEnvironmentVariable("Path");
startInfo.Environment["PATH"] = Environment.GetEnvironmentVariable("PATH");
if (ActiveTaskRun.TaskType == TaskType.TAEFDll)
{
startInfo.Environment["Path"] += ";" + Path.GetDirectoryName(ActiveTaskRun.TaskPath);
startInfo.Environment["PATH"] += ";" + Path.GetDirectoryName(ActiveTaskRun.TaskPath);
startInfo.WorkingDirectory = Path.GetDirectoryName(startInfo.FileName);
}
else
@ -2552,7 +2566,17 @@ namespace Microsoft.FactoryOrchestrator.Server
{
if (String.IsNullOrEmpty(Path.GetDirectoryName(file)))
{
foreach (string testPath in (Environment.GetEnvironmentVariable("PATH") ?? "").Split(';'))
string[] paths;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
paths = (Environment.GetEnvironmentVariable("PATH") ?? "").Split(';');
}
else
{
paths = (Environment.GetEnvironmentVariable("PATH") ?? "").Split(':');
}
foreach (string testPath in paths)
{
string path = testPath.Trim();
if (!String.IsNullOrEmpty(path) && File.Exists(path = Path.Combine(path, file)))

Просмотреть файл

@ -25,13 +25,13 @@ namespace Microsoft.FactoryOrchestrator.Service
lock (_logLock)
{
_logCount++;
String _logPath = Path.Combine(FOServiceExe.ServiceLogFolder, LogName);
String _logPath = Path.Combine(FOServiceExe.ServiceExeLogFolder, LogName);
if (_logStream == null)
{
try
{
Directory.CreateDirectory(FOServiceExe.ServiceLogFolder);
Directory.CreateDirectory(FOServiceExe.ServiceExeLogFolder);
_logStream = new StreamWriter(_logPath, true);
}
catch (Exception)

Просмотреть файл

@ -1,17 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<Import Project="../common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetName>Microsoft.FactoryOrchestrator.Service</TargetName>
<RuntimeIdentifiers>win-x64;win-x86;win-arm;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers>win-x64;win-x86;win-arm;win-arm64;linux-x64;linux-arm;linux-arm64</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == ''">
<OutputPath>..\..\bin\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' != ''">
<OutputPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
<PropertyGroup>
<OutputPath>$(OutputRootPath)$(Configuration)/$(Platform)/$(TargetName)</OutputPath>
</PropertyGroup>
<ItemGroup>
@ -25,11 +22,11 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ClientLibrary\Microsoft.FactoryOrchestrator.Client.csproj" />
<ProjectReference Include="..\CoreLibrary\Microsoft.FactoryOrchestrator.Core.csproj" />
<ProjectReference Include="..\..\oss\IpcFramework\JKang.IpcServiceFramework.Hosting.Tcp\JKang.IpcServiceFramework.Hosting.Tcp.csproj" />
<ProjectReference Include="..\..\oss\IpcFramework\JKang.IpcServiceFramework.Hosting\JKang.IpcServiceFramework.Hosting.csproj" />
<ProjectReference Include="..\ServerLibrary\Microsoft.FactoryOrchestrator.Server.csproj" />
<ProjectReference Include="../ClientLibrary/Microsoft.FactoryOrchestrator.Client.csproj" />
<ProjectReference Include="../CoreLibrary/Microsoft.FactoryOrchestrator.Core.csproj" />
<ProjectReference Include="../../oss/IpcFramework/JKang.IpcServiceFramework.Hosting.Tcp/JKang.IpcServiceFramework.Hosting.Tcp.csproj" />
<ProjectReference Include="../../oss/IpcFramework/JKang.IpcServiceFramework.Hosting/JKang.IpcServiceFramework.Hosting.csproj" />
<ProjectReference Include="../ServerLibrary/Microsoft.FactoryOrchestrator.Server.csproj" />
</ItemGroup>
<ItemGroup>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,298 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml.Serialization;
using System.Xml;
using System.Xml.Schema;
using System.Reflection;
using System.Threading.Tasks;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Globalization;
using System.Collections;
using System.Runtime.InteropServices;
using Microsoft.Extensions.Logging;
using Microsoft.FactoryOrchestrator.Core;
using Microsoft.Win32;
namespace Microsoft.FactoryOrchestrator.Service
{
/// <summary>
/// A file-backed representation of key service state that persists through reboots.
/// </summary>
[XmlRootAttribute(ElementName = "FOServiceStatus", IsNullable = false)]
public sealed class FOServiceStatus
{
private FOServiceStatus()
{
_firstBootStateLoaded = false;
_firstBootTaskListsComplete = false;
_logFolder = "";
}
[XmlElement]
public bool FirstBootStateLoaded
{
get => _firstBootStateLoaded;
set
{
if (!Equals(value, _firstBootStateLoaded))
{
_firstBootStateLoaded = value;
UpdateServiceStatus();
}
}
}
private bool _firstBootStateLoaded;
[XmlElement]
public bool FirstBootTaskListsComplete
{
get => _firstBootTaskListsComplete;
set
{
if (!Equals(value, _firstBootTaskListsComplete))
{
_firstBootTaskListsComplete = value;
UpdateServiceStatus();
}
}
}
private bool _firstBootTaskListsComplete;
/// <summary>
/// Directory where the TaskRun logs are stored. This directory path can be changed by the user at runtime, unlike the Service log directory (FOServiceExe.ServiceExeLogFolder). Therefore it is not necessarily related to the Service log directory.
/// </summary>
[XmlElement]
public string LogFolder
{
get => _logFolder;
set
{
if (!Equals(value, _logFolder))
{
_logFolder = value;
UpdateServiceStatus();
}
}
}
private string _logFolder;
[XmlIgnore]
private string _filename;
[XmlIgnore]
private ILogger _logger;
public static FOServiceStatus CreateOrLoad(string filename, ILogger logger)
{
FOServiceStatus status = null;
if (filename == null)
{
throw new ArgumentException(null, nameof(filename));
}
if (File.Exists(filename))
{
try
{
var deserializer = new XmlSerializer(typeof(FOServiceStatus));
using (FileStream fs = new FileStream(filename, FileMode.Open))
using (XmlReader reader = XmlReader.Create(fs))
{
status = (FOServiceStatus)deserializer.Deserialize(reader);
status._filename = filename;
status._logger = logger;
}
}
catch (Exception e)
{
logger?.LogError($"{string.Format(CultureInfo.CurrentCulture, Resources.UnableToParseError, filename)} {e.Message}");
status = null;
}
}
if (status == null)
{
status = new FOServiceStatus();
status._filename = filename;
status._logger = logger;
}
return status;
}
private void UpdateServiceStatus()
{
if (_filename != null)
{
try
{
XmlSerializer serializer = new XmlSerializer(typeof(FOServiceStatus));
using (XmlWriter writer = new XmlTextWriter(_filename, null))
{
serializer.Serialize(writer, this);
}
}
catch (Exception e)
{
_logger?.LogError($"{string.Format(CultureInfo.CurrentCulture, Resources.FileSaveError, _filename)} {e.Message}");
}
}
}
}
/// <summary>
/// A file or registry backed representation of key service state that does not persist through reboots.
/// </summary>
[XmlRootAttribute(ElementName = "FOVolatileServiceStatus", IsNullable = false)]
public sealed class FOVolatileServiceStatus
{
// user tasklists state registry values
private const string _everyBootCompleteValue = @"EveryBootTaskListsComplete";
private const string _loopbackEnabledValue = @"UWPLocalLoopbackEnabled";
private FOVolatileServiceStatus()
{
_everyBootTaskListsComplete = false;
_localLoopbackEnabled = false;
}
[XmlElement]
public bool EveryBootTaskListsComplete
{
get => _everyBootTaskListsComplete;
set
{
if (!Equals(value, _everyBootTaskListsComplete))
{
_everyBootTaskListsComplete = value;
UpdateServiceStatus(_everyBootCompleteValue);
}
}
}
private bool _everyBootTaskListsComplete;
/// <summary>
/// Windows only. True if UWP LocalLoopback has been enabled for the requested apps.
/// </summary>
[XmlIgnore]
public bool LocalLoopbackEnabled
{
get => _localLoopbackEnabled;
set
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
throw new PlatformNotSupportedException(string.Format(CultureInfo.CurrentCulture, Resources.WindowsOnlyError, "LocalLoopbackEnabled"));
}
if (!Equals(value, _localLoopbackEnabled))
{
_localLoopbackEnabled = value;
UpdateServiceStatus(_loopbackEnabledValue);
}
}
}
private bool _localLoopbackEnabled;
[XmlIgnore]
private string _filename;
[XmlIgnore]
private RegistryKey _volatileKey;
[XmlIgnore]
private ILogger _logger;
public static FOVolatileServiceStatus CreateOrLoad(string filename, RegistryKey volatileKey, ILogger logger)
{
FOVolatileServiceStatus status = null;
// On Unix, FOVolatileServiceStatus is file backed
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && File.Exists(filename))
{
if (filename == null)
{
throw new ArgumentException(null, nameof(filename));
}
try
{
var deserializer = new XmlSerializer(typeof(FOVolatileServiceStatus));
using (FileStream fs = new FileStream(filename, FileMode.Open))
using (XmlReader reader = XmlReader.Create(fs))
{
status = (FOVolatileServiceStatus)deserializer.Deserialize(reader);
status._filename = filename;
status._logger = logger;
}
}
catch (Exception e)
{
logger?.LogError($"{string.Format(CultureInfo.CurrentCulture, Resources.UnableToParseError, filename)} {e.Message}");
status = null;
}
}
if (status == null)
{
status = new FOVolatileServiceStatus();
status._filename = filename;
status._logger = logger;
}
// On Windows, FOVolatileServiceStatus is registry backed
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
if (volatileKey == null)
{
throw new ArgumentException(null, nameof(volatileKey));
}
status._volatileKey = volatileKey;
status._everyBootTaskListsComplete = Convert.ToBoolean((int)volatileKey.GetValue(_everyBootCompleteValue, 0));
status._localLoopbackEnabled = Convert.ToBoolean((int)volatileKey.GetValue(_loopbackEnabledValue, 0));
}
return status;
}
private void UpdateServiceStatus(string valueName)
{
try
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
switch (valueName)
{
case _everyBootCompleteValue:
_volatileKey.SetValue(valueName, EveryBootTaskListsComplete, RegistryValueKind.DWord);
break;
case _loopbackEnabledValue:
_volatileKey.SetValue(valueName, LocalLoopbackEnabled, RegistryValueKind.DWord);
break;
default:
throw new ArgumentException(null, nameof(valueName));
}
}
else if (_filename != null)
{
XmlSerializer serializer = new XmlSerializer(typeof(FOVolatileServiceStatus));
using (XmlWriter writer = new XmlTextWriter(_filename, null))
{
serializer.Serialize(writer, this);
}
}
}
catch (Exception e)
{
_logger?.LogError($"{string.Format(CultureInfo.CurrentCulture, Resources.FileSaveError, _filename)} {e.Message}");
}
}
}
}

Просмотреть файл

@ -14,15 +14,12 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\ClientLibrary\Microsoft.FactoryOrchestrator.Client.csproj" />
<ProjectReference Include="..\..\ClientSample\Microsoft.FactoryOrchestrator.ClientSample.csproj" />
<ProjectReference Include="../../ClientLibrary/Microsoft.FactoryOrchestrator.Client.csproj" />
<ProjectReference Include="../../ClientSample/Microsoft.FactoryOrchestrator.ClientSample.csproj" />
</ItemGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == ''">
<OutputPath>..\..\..\bin\Tests\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' != ''">
<OutputPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\Tests\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
<PropertyGroup>
<OutputPath>$(OutputRootPath)Tests/$(Configuration)/$(Platform)/$(TargetName)</OutputPath>
</PropertyGroup>
</Project>

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\common.props" />
<Import Project="$(MSBuildThisFileDirectory)/../common.props" />
<!-- Don't run FxCop on Tests -->
<PropertyGroup>
@ -10,10 +10,7 @@
<RunAnalyzers>false</RunAnalyzers>
</PropertyGroup>
<!-- Default run settings -->
<PropertyGroup Condition="'$(SolutionDir)' != ''">
<RunSettingsFilePath>$(SolutionDir)\Tests\defaults.runsettings</RunSettingsFilePath>
</PropertyGroup>
<PropertyGroup Condition="'$(SolutionDir)' == ''">
<RunSettingsFilePath>..\Tests\defaults.runsettings</RunSettingsFilePath>
<PropertyGroup>
<RunSettingsFilePath>$(MSBuildThisFileDirectory)defaults.runsettings</RunSettingsFilePath>
</PropertyGroup>
</Project>

Просмотреть файл

@ -6,11 +6,8 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == ''">
<OutputPath>..\..\..\..\bin\Tests\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' != ''">
<OutputPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\Tests\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
<PropertyGroup>
<OutputPath>$(OutputRootPath)Tests/$(Configuration)/$(Platform)/$(TargetName)</OutputPath>
</PropertyGroup>
<ItemGroup>
@ -31,7 +28,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\CoreLibrary\Microsoft.FactoryOrchestrator.Core.csproj" />
<ProjectReference Include="../../../CoreLibrary/Microsoft.FactoryOrchestrator.Core.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -6,11 +6,8 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == ''">
<OutputPath>..\..\..\..\bin\Tests\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' != ''">
<OutputPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\Tests\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
<PropertyGroup>
<OutputPath>$(OutputRootPath)Tests/$(Configuration)/$(Platform)/$(TargetName)</OutputPath>
</PropertyGroup>
<ItemGroup>
@ -24,8 +21,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\ClientLibrary\Microsoft.FactoryOrchestrator.Client.csproj" />
<ProjectReference Include="..\..\..\PowerShellLibrary\Microsoft.FactoryOrchestrator.PowerShell.csproj" />
<ProjectReference Include="../../../ClientLibrary/Microsoft.FactoryOrchestrator.Client.csproj" />
<ProjectReference Include="../../../PowerShellLibrary/Microsoft.FactoryOrchestrator.PowerShell.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -3,7 +3,7 @@
<TaskLists>
<TaskList Guid="8886302c-070c-4e19-b9e3-1b76f8c03f4e" Name="Display Tests" RunInParallel="false" AllowOtherTaskListsToRun="false">
<Tasks>
<Task xsi:type="UWPTask" Name="DeadPixelTest" Path="Microsoft.ColorCycleSample_8wekyb3d8bbwe" Arguments="Did you see any dead pixels?" Guid="9fe8d491-546b-4622-b5a2-035e68f69f36" />
<Task xsi:type="CommandLineTask" Name="DeadPixelTest" Path="Microsoft.ColorCycleSample_8wekyb3d8bbwe" Arguments="Did you see any dead pixels?" Guid="9fe8d491-546b-4622-b5a2-035e68f69f36" />
</Tasks>
</TaskList>
</TaskLists>

Просмотреть файл

@ -3,7 +3,7 @@
<TaskLists>
<TaskList Name="Display Tests" RunInParallel="false" AllowOtherTaskListsToRun="false">
<Tasks>
<Task xsi:type="UWPTask" Name="DeadPixelTest" Path="Microsoft.ColorCycleSample_8wekyb3d8bbwe" Arguments="Did you see any dead pixels?" Guid="8886302c-070c-4e19-b9e3-1b76f8c03f4e" />
<Task xsi:type="CommandLineTask" Name="DeadPixelTest" Path="Microsoft.ColorCycleSample_8wekyb3d8bbwe" Arguments="Did you see any dead pixels?" Guid="8886302c-070c-4e19-b9e3-1b76f8c03f4e" />
</Tasks>
</TaskList>
</TaskLists>

Просмотреть файл

@ -5,6 +5,7 @@ using System.Xml.Schema;
using Microsoft.FactoryOrchestrator.Server;
using System.IO;
using System.Xml;
using System.Runtime.InteropServices;
namespace Microsoft.FactoryOrchestrator.Test
{
@ -17,7 +18,6 @@ namespace Microsoft.FactoryOrchestrator.Test
static bool validXmlLoaded = false;
[ClassInitialize]
[DeploymentItem("Valid.xml")]
public static void Init(TestContext context)
{
#pragma warning disable CA1062
@ -41,11 +41,14 @@ namespace Microsoft.FactoryOrchestrator.Test
}
t.LoadTaskListsFromXmlFile(Path.Combine(DeploymentDir, "Valid.xml"));
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
t.LoadTaskListsFromXmlFile(Path.Combine(DeploymentDir, "Valid_Windows.xml"));
}
validXmlLoaded = true;
}
[TestMethod]
[DeploymentItem("DupGuid1.xml")]
public void TestDuplicateGuidInXmlAndKnownTaskList()
{
if (!validXmlLoaded)
@ -69,7 +72,6 @@ namespace Microsoft.FactoryOrchestrator.Test
}
[TestMethod]
[DeploymentItem("DupGuid2.xml")]
public void TestDuplicateGuidInXmlAndKnownTaskList2()
{
if (!validXmlLoaded)

Просмотреть файл

@ -6,11 +6,8 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == ''">
<OutputPath>..\..\..\..\bin\Tests\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' != ''">
<OutputPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\Tests\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
<PropertyGroup>
<OutputPath>$(OutputRootPath)Tests/$(Configuration)/$(Platform)/$(TargetName)</OutputPath>
</PropertyGroup>
<ItemGroup>
@ -24,7 +21,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\ServerLibrary\Microsoft.FactoryOrchestrator.Server.csproj" />
<ProjectReference Include="../../../ServerLibrary/Microsoft.FactoryOrchestrator.Server.csproj" />
</ItemGroup>
<ItemGroup>
@ -34,6 +31,9 @@
<None Update="DupGuid2.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Valid_Windows.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Valid.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>

Просмотреть файл

@ -116,18 +116,18 @@
</TaskList>
<TaskList Guid="97d0eae2-913d-428a-a51b-160fd9bf0826" Name="Camera Tests" RunInParallel="false" AllowOtherTaskListsToRun="false">
<Tasks>
<Task xsi:type="UWPTask" Name="CameraPhotoVideoTest" Path="Microsoft.CameraPhotoVideoCaptureSample_8wekyb3d8bbwe" Arguments="Could you take photos and record video on all devices?" Guid="fce74829-42e2-4f94-a39f-067bff8c13de" />
<Task xsi:type="CommandLineTask" Name="CameraPhotoVideoTest" Path="Microsoft.CameraPhotoVideoCaptureSample_8wekyb3d8bbwe" Arguments="Could you take photos and record video on all devices?" Guid="fce74829-42e2-4f94-a39f-067bff8c13de" />
</Tasks>
</TaskList>
<TaskList Guid="8886302c-070c-4e19-b9e3-1b76f8c03f4e" Name="Display Tests" RunInParallel="false" AllowOtherTaskListsToRun="false">
<Tasks>
<Task xsi:type="UWPTask" Name="DeadPixelTest" Path="Microsoft.ColorCycleSample_8wekyb3d8bbwe" Arguments="Did you see any dead pixels?" Guid="9fe8d491-546b-4622-b5a2-035e68f69f36" />
<Task xsi:type="CommandLineTask" Name="DeadPixelTest" Path="Microsoft.ColorCycleSample_8wekyb3d8bbwe" Arguments="Did you see any dead pixels?" Guid="9fe8d491-546b-4622-b5a2-035e68f69f36" />
<!-- <Task xsi:type="UWPTask" Name="VideoPlaybackTest" Path="Microsoft.VideoPlaybackSample_8wekyb3d8bbwe" Arguments="Did you see the video and hear audio?" Guid="3a84168d-5f38-4120-a318-6bb671b9b37f" /> -->
</Tasks>
</TaskList>
<TaskList Guid="baf64435-022d-4c8b-880e-c4bb06a2f67b" Name="Touch and Ink Tests" RunInParallel="false" AllowOtherTaskListsToRun="false">
<Tasks>
<Task xsi:type="UWPTask" Name="TouchTest" Path="Microsoft.TouchAndPenSample_8wekyb3d8bbwe" Arguments="Could you trace the lines?" Guid="57c9b758-9778-45ae-bcb2-44c55c71adf3" />
<Task xsi:type="CommandLineTask" Name="TouchTest" Path="Microsoft.TouchAndPenSample_8wekyb3d8bbwe" Arguments="Could you trace the lines?" Guid="57c9b758-9778-45ae-bcb2-44c55c71adf3" />
<!-- <Task xsi:type="UWPTask" Name="InkTest" Path="Microsoft.TouchAndPenSample_8wekyb3d8bbwe" Arguments="Could you ink on the screen with various pressure?" Guid="fc008cf9-95ac-43ff-81be-e4540967a7a2" /> -->
</Tasks>
</TaskList>

Просмотреть файл

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<FactoryOrchestratorXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<TaskLists>
<TaskList Guid="baf64435-022d-4c8b-880e-c4bb06a2f687" Name="Touch and Ink Tests" RunInParallel="false" AllowOtherTaskListsToRun="false">
<Tasks>
<Task xsi:type="UWPTask" Name="TouchTest" Path="Microsoft.TouchAndPenSample_8wekyb3d8bbwe" Arguments="Could you trace the lines?" Guid="57c9b758-9778-45ae-bcb2-44c55c71ad03" AutoPassedIfLaunched="true" />
<Task xsi:type="UWPTask" Name="TouchTest" Path="Microsoft.TouchAndPenSample_8wekyb3d8bbwe" Arguments="Could you trace the lines?" Guid="57c9b758-9778-45ae-bcb2-44c55c71ad04" AutoPassedIfLaunched="false" TerminateOnCompleted="true" />
<!-- <Task xsi:type="UWPTask" Name="InkTest" Path="Microsoft.TouchAndPenSample_8wekyb3d8bbwe" Arguments="Could you ink on the screen with various pressure?" Guid="fc008cf9-95ac-43ff-81be-e4540967a7a2" /> -->
</Tasks>
</TaskList>
</TaskLists>
</FactoryOrchestratorXML>

Просмотреть файл

@ -5,8 +5,14 @@
<MaxCpuCount>1</MaxCpuCount>
<TargetPlatform>x64</TargetPlatform>
<TargetFrameworkVersion>FrameworkCore10</TargetFrameworkVersion>
<ResultsDirectory>..\..\bin\TestResults</ResultsDirectory>
<ResultsDirectory>../../bin/TestResults</ResultsDirectory>
<!-- Specify timeout in milliseconds. A valid value should be greater than 0 -->
<TestSessionTimeout>60000</TestSessionTimeout>
</RunConfiguration>
<LoggerRunSettings>
<Loggers>
<Logger friendlyName="console" enabled="True"/>
<Logger friendlyName="trx" enabled="True"/>
</Loggers>
</LoggerRunSettings>
</RunSettings>

Просмотреть файл

@ -48,13 +48,9 @@
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == ''">
<OutputPath>..\..\bin\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
<DocumentationFile>..\..\bin\$(Configuration)\$(Platform)\$(TargetName)\$(TargetName).XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' != ''">
<OutputPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\$(Configuration)\$(Platform)\$(TargetName)</OutputPath>
<DocumentationFile>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\$(Configuration)\$(Platform)\$(TargetName)\$(TargetName).XML</DocumentationFile>
<PropertyGroup>
<OutputPath>$(OutputRootPath)$(Configuration)/$(Platform)/$(TargetName)</OutputPath>
<DocumentationFile>$(OutputRootPath)$(Configuration)/$(Platform)/$(TargetName)/$(TargetFramework)/$(TargetName).xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<PackageOutputPath>$(OutputPath)\..\$(TargetName).NuGet</PackageOutputPath>
@ -85,7 +81,7 @@
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<Target Name="BeforeBuildPS" BeforeTargets="Build;CoreCompile;XefVersionResourceCompile;XamlPreCompile">
<Exec Command="Powershell.exe $(ProjectDir)..\..\build\SetSourceVersion.ps1 -SrcPath $(ProjectDir)" />
<Exec Command="$(PowerShellExeName) $(ProjectDir)..\..\build\SetSourceVersion.ps1 -SrcPath $(ProjectDir)" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

Просмотреть файл

@ -3,7 +3,7 @@
<!-- Assembly, App, Package version for all non-OSS files. Uses SemVer. -->
<PropertyGroup Label="Version">
<VersionPrefix>9.0.0</VersionPrefix>
<VersionPrefix>9.1.0</VersionPrefix>
</PropertyGroup>
<!-- Common packaging properties -->
@ -28,10 +28,10 @@
<!-- Embed source files that are not tracked by the source control manager in the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<OutputRootPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\bin\</OutputRootPath>
<OutputRootPath>$(BUILD_ARTIFACTSTAGINGDIRECTORY)/bin/</OutputRootPath>
</PropertyGroup>
<PropertyGroup Condition="'$(AGENT_ID)' == '' And '$(GITHUB_ACTIONS)' != 'true'">
<OutputRootPath>$(MSBuildThisFileDirectory)..\bin\</OutputRootPath>
<OutputRootPath>$(MSBuildThisFileDirectory)../bin/</OutputRootPath>
</PropertyGroup>
<!-- Add notice file to all nuget packages -->
@ -40,7 +40,7 @@
</PropertyGroup>
<Target Name="IncludeNoticeInPack">
<ItemGroup>
<TfmSpecificPackageFile Include="$(MSBuildThisFileDirectory)..\NOTICE.txt"/>
<TfmSpecificPackageFile Include="$(MSBuildThisFileDirectory)../NOTICE.txt"/>
</ItemGroup>
<Message Text="IncludeNoticeInPack - found: @(TfmSpecificPackageFile)" Importance="High"/>
</Target>
@ -52,7 +52,10 @@
<RunAnalyzersDuringLiveAnalysis>true</RunAnalyzersDuringLiveAnalysis>
<RunAnalyzers>true</RunAnalyzers>
</PropertyGroup>
<PropertyGroup>
<PowerShellExeName Condition="Exists('C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe') And !Exists('C:\Program Files\PowerShell\7\pwsh.exe')">powershell.exe</PowerShellExeName>
<PowerShellExeName Condition="'$(PowerShellExeName)' == ''">pwsh</PowerShellExeName>
</PropertyGroup>
<ItemGroup Condition="Exists('$(MSBuildThisFileDirectory).editorconfig')" >
<AdditionalFiles Include="$(MSBuildThisFileDirectory).editorconfig" />
</ItemGroup>