Skip to content

Commit

Permalink
JobScheduler: Documentation #757
Browse files Browse the repository at this point in the history
  • Loading branch information
apobekiaris committed Jan 5, 2021
1 parent ea80b86 commit b61b2da
Show file tree
Hide file tree
Showing 21 changed files with 307 additions and 133 deletions.
162 changes: 90 additions & 72 deletions Build/BuildDevExpress.XAF.ps1
@@ -1,6 +1,6 @@
Framework "4.6"
$ErrorActionPreference = "Stop"
$Global:Configuration="Debug"
$Global:Configuration = "Debug"

Properties {
$packageSources = $null
Expand All @@ -15,24 +15,22 @@ Properties {
}

Task BuildNugetConsumers -depends CreateNuspec, PackNuspec, CompileNugetConsumers
Task Build -depends Clean, Init, UpdateProjects, Compile,CheckVersions, IndexSources,CompileTests
Task Build -depends Clean, Init, UpdateProjects, Compile, CheckVersions, IndexSources, CompileTests

function CompileTestSolution($solution){
function CompileTestSolution($solution) {
Write-HostFormatted "Building Tests" -Section
New-Item -Name Nupkg -ItemType Directory -Path "$root\bin" -ErrorAction SilentlyContinue
$conf=GetConfiguration $solution "Debug"
$conf = GetConfiguration $solution "Debug"
"Configuration=$conf"
Start-Build -Path $solution -Configuration $conf -BinaryLogPath "$Root\Bin\Test$conf.binlog" -Verbosity minimal -WarnAsError

Start-Build -Path "$Root\src\Tests\Office.DocumentStyleManager\Xpand.XAF.Modules.Office.DocumentStyleManager.Tests.csproj"

Copy-Item -path $root\bin\runtimes -Recurse -Destination $root\bin\TestWinApplication\runtimes -Container -Force
}

Task IndexSources {
Invoke-Script {
$sha = Get-GitLastSha "https://github.com/eXpandFramework/DevExpress.XAF" $branch
"Xpand.XAF.Modules.*.pdb","Xpand.Extensions.*.pdb"|ForEach-Object{
"Xpand.XAF.Modules.*.pdb", "Xpand.Extensions.*.pdb" | ForEach-Object {
Get-ChildItem "$root\bin" $_ | Update-XSymbols -SourcesRoot "$Root" -TargetRoot "https://raw.githubusercontent.com/eXpandFramework/DevExpress.XAF/$sha"
Get-ChildItem "$root\bin\net461" $_ | Update-XSymbols -SourcesRoot "$Root" -TargetRoot "https://raw.githubusercontent.com/eXpandFramework/DevExpress.XAF/$sha"
}
Expand All @@ -52,9 +50,9 @@ Task Init {

dotnet tool restore
Set-Location $root
Invoke-Script{Invoke-PaketRestore -strict }
Invoke-Script { Invoke-PaketRestore -strict }

Get-ChildItem "$(Get-NugetInstallationFolder)\grpc.core" "runtimes" -Recurse|Select-Object -Last 1|Copy-Item -Destination "$root\bin\runtimes" -Recurse -Force
Get-ChildItem "$(Get-NugetInstallationFolder)\grpc.core" "runtimes" -Recurse | Select-Object -Last 1 | Copy-Item -Destination "$root\bin\runtimes" -Recurse -Force
}
}

Expand All @@ -67,124 +65,144 @@ Task UpdateProjects {

Task CompileTests -precondition { return $compile } {
Invoke-Script {
if ((Test-AzDevops)){
$nugetConfigPath="$root\src\tests\nuget.config"
$nugetConfig=Get-XmlContent $nugetConfigPath
$a=@{
key="DXAzDevops"
value=$env:DxFeed
if ((Test-AzDevops)) {
$nugetConfigPath = "$root\src\tests\nuget.config"
$nugetConfig = Get-XmlContent $nugetConfigPath
$a = @{
key = "DXAzDevops"
value = $env:DxFeed
}
Add-XmlElement $nugetConfig "add" "packageSources" -Attributes $a
$nugetConfig|Save-Xml $nugetConfigPath
$nugetConfig | Save-Xml $nugetConfigPath
}
CompileTestSolution "$Root\src\Tests\Tests.sln"
if (!(Test-AzDevops)){
FixNet461DXAssembliesTargetFramework
if (!(Test-AzDevops)) {
Invoke-Task -taskName BuildNugetConsumers
}
} -Maximum 3
Get-ChildItem $root\bin "*xpand*.dll"| Test-AssemblyReference -VersionFilter $DXVersion
Get-ChildItem $root\bin "*xpand*.dll" | Test-AssemblyReference -VersionFilter $DXVersion
}

function FixNet461DXAssembliesTargetFramework {
Start-Build -Path "$root\src\Tests\ModelMapper\Xpand.XAF.Modules.ModelMapper.Tests.csproj"
return
$nugetAssemblies = Get-ChildItem (Get-NugetInstallationFolder) DevExpress*.dll -Recurse | Where-Object {
$_.Directory.Name -eq "net452" -and $_.Directory.Parent.Parent.Name -eq "20.2.4"
}
get-childitem "$root\bin\net461" Dev*.dll | ForEach-Object {
[PSCustomObject]@{
Name = $_.BaseName
Framework = Get-AssemblyTargetFramework $_.FullName
}
} | Where-Object { $_.Framework -notmatch ".netframework" } | ForEach-Object {
$name = $_.Name
$nugetAssemblies | Where-Object { $_.BaseName -eq $name }
} | Copy-Item -Destination "$root\bin\net461" -Force -Verbose

}
Task CompileNugetConsumers -precondition { return $compile } {
Invoke-Script {
$localPackages = @(& (Get-NugetPath) list -source "$root\bin\nupkg;"|ConvertTo-PackageObject|Where-Object{$_.id -like "*.ALL"} | ForEach-Object {
$version = [version]$_.Version
if ($version.revision -eq 0) {
$version = New-Object System.Version ($version.Major, $version.Minor, $version.build)
}
[PSCustomObject]@{
Id = $_.Id
Version = $version
}
})
$localPackages = @(& (Get-NugetPath) list -source "$root\bin\nupkg;" | ConvertTo-PackageObject | Where-Object { $_.id -like "*.ALL" } | ForEach-Object {
$version = [version]$_.Version
if ($version.revision -eq 0) {
$version = New-Object System.Version ($version.Major, $version.Minor, $version.build)
}
[PSCustomObject]@{
Id = $_.Id
Version = $version
}
})

Write-HostFormatted "Update all package versions" -ForegroundColor Magenta
Get-ChildItem "$root\src\Tests\EasyTests" *.csproj -Recurse|ForEach-Object{
$prefs=Get-PackageReference $_
$prefs|Where-Object{$_.include -like "Xpand.XAF.*"}|ForEach-Object{
$ref=$_
$localPackages|Where-Object{$_.id-eq $ref.include}|ForEach-Object{
$ref.version=$_.version.ToString()
Get-ChildItem "$root\src\Tests\EasyTests" *.csproj -Recurse | ForEach-Object {
$prefs = Get-PackageReference $_
$prefs | Where-Object { $_.include -like "Xpand.XAF.*" } | ForEach-Object {
$ref = $_
$localPackages | Where-Object { $_.id -eq $ref.include } | ForEach-Object {
$ref.version = $_.version.ToString()
}
}
($prefs|Select-Object -First 1).OwnerDocument.Save($_)
($prefs | Select-Object -First 1).OwnerDocument.Save($_)
}
CompileTestSolution "$Root\src\Tests\\EasyTests\EasyTests.sln"
} -Maximum 3
Get-ChildItem $root\bin "*xpand*.dll"| Test-AssemblyReference -VersionFilter $DXVersion
Get-ChildItem $root\bin "*xpand*.dll" | Test-AssemblyReference -VersionFilter $DXVersion
}

function GetConfiguration($solution,$conf){
$conf=$conf.ToLower()
$match=(Read-MSBuildSolutionFile $solution).SolutionConfigurations.ConfigurationName|Sort-Object -Unique|ForEach-Object{
$configVersion=$_.ToLower().Replace("$conf`_","")
if ((($_ -like "$conf`_*") -and (Test-Version $configVersion))){
if (([version]$configVersion) -ge ([version](Get-VersionPart $dxVersion Minor))){
function GetConfiguration($solution, $conf) {
$conf = $conf.ToLower()
$match = (Read-MSBuildSolutionFile $solution).SolutionConfigurations.ConfigurationName | Sort-Object -Unique | ForEach-Object {
$configVersion = $_.ToLower().Replace("$conf`_", "")
if ((($_ -like "$conf`_*") -and (Test-Version $configVersion))) {
if (([version]$configVersion) -ge ([version](Get-VersionPart $dxVersion Minor))) {
$_
}

}
}
if ($match){
if ($match) {
$match
}
else{
else {
$conf
}
}

Task Compile -precondition { return $compile } {
if (($branch -eq "master") -and ((Get-DevExpressVersion) -eq $DXVersion)){
$Global:Configuration="Release"
if (($branch -eq "master") -and ((Get-DevExpressVersion) -eq $DXVersion)) {
$Global:Configuration = "Release"
}

Invoke-Script {
Write-HostFormatted "Building Extensions" -Section
$solution="$Root\src\Extensions\Extensions.sln"
$solution = "$Root\src\Extensions\Extensions.sln"

$Configuration=GetConfiguration $solution $Global:Configuration
$Configuration = GetConfiguration $solution $Global:Configuration
Start-Build -Path $solution -Configuration $Configuration -BinaryLogPath "$Root\Bin\Extensions.binlog" -Verbosity minimal -WarnAsError -PropertyValue "skipNugetReplace=true"
} -Maximum 3


Invoke-Script {
$solution="$Root\src\Modules\Modules.sln"
$solution = "$Root\src\Modules\Modules.sln"
Write-HostFormatted "Building Modules" -Section
$Configuration=GetConfiguration $solution $Global:Configuration
$Configuration = GetConfiguration $solution $Global:Configuration
Start-Build -Path $solution -Configuration $Configuration -BinaryLogPath "$Root\Bin\Modules.binlog" -Verbosity minimal -WarnAsError -PropertyValue "skipNugetReplace=true"
} -Maximum 3

Invoke-Script {
Write-HostFormatted "Building Xpand.XAF.ModelEditor" -Section
Start-Build -Path "$Root\tools\Xpand.XAF.ModelEditor\Xpand.XAF.ModelEditor.csproj" -WarnAsError
Write-HostFormatted "Building Xpand.XAF.ModelEditor.WinDesktop" -Section
Start-Build -Path "$Root\tools\Xpand.XAF.ModelEditor\Xpand.XAF.ModelEditor.WinDesktop.csproj" -WarnAsError
} -Maximum 3
if ($dxVersion -eq (Get-XAFLatestMinors | Select-Object -First 1)) {
Invoke-Script {
Write-HostFormatted "Building Xpand.XAF.ModelEditor" -Section
Start-Build -Path "$Root\tools\Xpand.XAF.ModelEditor\Xpand.XAF.ModelEditor.csproj" -WarnAsError
Write-HostFormatted "Building Xpand.XAF.ModelEditor.WinDesktop" -Section
Start-Build -Path "$Root\tools\Xpand.XAF.ModelEditor\Xpand.XAF.ModelEditor.WinDesktop.csproj" -WarnAsError
} -Maximum 3
}

Write-HostFormatted "Build Versions:" -Section
Get-ChildItem "$Root\Bin" "*Xpand.*.dll"|ForEach-Object{
Get-ChildItem "$Root\Bin" "*Xpand.*.dll" | ForEach-Object {
[PSCustomObject]@{
Id = $_.BaseName
Version=[System.Diagnostics.FileVersionInfo]::GetVersionInfo($_.FullName).FileVersion
}|Write-Output
}|Format-Table
Get-ChildItem $root\bin "*xpand*.dll"| Test-AssemblyReference -VersionFilter $DXVersion|Format-Table -AutoSize
Id = $_.BaseName
Version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($_.FullName).FileVersion
} | Write-Output
} | Format-Table
Get-ChildItem $root\bin "*xpand*.dll" | Test-AssemblyReference -VersionFilter $DXVersion | Format-Table -AutoSize
}

Task CreateNuspec {
Invoke-Script {
$a = @{
DxVersion = $dxVersion
Branch=$branch
Branch = $branch
}
New-Item -Path "$root\bin\Nupkg" -ItemType Directory -ErrorAction SilentlyContinue -Force | Out-Null
$version=(& (Get-NugetPath) list -source "$root\bin\nupkg;"|ConvertTo-PackageObject|Select-Object -First 1).Version
$currentVersion=[System.Diagnostics.FileVersionInfo]::GetVersionInfo("$root\bin\Xpand.XAF.Modules.Reactive.dll").FileVersion
if ($currentVersion -ne $version){
Get-ChildItem "$root\bin\nupkg" |Remove-Item -Force
$version = (& (Get-NugetPath) list -source "$root\bin\nupkg;" | ConvertTo-PackageObject | Select-Object -First 1).Version
$currentVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("$root\bin\Xpand.XAF.Modules.Reactive.dll").FileVersion
if ($currentVersion -ne $version) {
Get-ChildItem "$root\bin\nupkg" | Remove-Item -Force
}

if (!(Test-Path "$Root\bin\Nupkg") -or !(Get-ChildItem "$Root\bin\Nupkg")){
if (!(Test-Path "$Root\bin\Nupkg") -or !(Get-ChildItem "$Root\bin\Nupkg")) {
& "$PSScriptRoot\CreateNuspec.ps1" @a
}

Expand All @@ -193,7 +211,7 @@ Task CreateNuspec {

Task PackNuspec {
Invoke-Script {
if (!(Test-Path "$Root\bin\Nupkg") -or !(Get-ChildItem "$Root\bin\Nupkg")){
if (!(Test-Path "$Root\bin\Nupkg") -or !(Get-ChildItem "$Root\bin\Nupkg")) {
& "$PSScriptRoot\PackNuspec.ps1" -branch $branch -dxversion $dxVersion
}
} -Maximum 3
Expand All @@ -203,16 +221,16 @@ Task PackNuspec {
Task Clean -precondition { return $cleanBin } {
$bin = "$Root\bin\"
if (Test-Path $bin) {
Get-ChildItem $bin -Recurse -Exclude "*Nupkg*"|Remove-Item -Force -Recurse
Get-ChildItem $bin -Recurse -Exclude "*Nupkg*" | Remove-Item -Force -Recurse
}
Set-Location "$Root\src"
Clear-XProjectDirectories
}

Task CheckVersions -precondition { return $branch -eq "master" } {
Push-Location "$Root\bin\"
$labPackages=Get-ChildItem Xpand*.dll|Where-Object{([version][System.Diagnostics.FileVersionInfo]::GetVersionInfo($_).FileVersion).Revision -gt 0}
if ($labPackages){
$labPackages = Get-ChildItem Xpand*.dll | Where-Object { ([version][System.Diagnostics.FileVersionInfo]::GetVersionInfo($_).FileVersion).Revision -gt 0 }
if ($labPackages) {
$labPackages
throw "Lab packages found in a release build"
}
Expand Down
11 changes: 5 additions & 6 deletions Build/UpdateALLNuspec.ps1
Expand Up @@ -2,18 +2,14 @@ param(
$root = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\"),
$Release=$false,
$Branch="lab",
$dxVersion=(Get-DevExpressVersion)
$dxVersion="20.1.9"
)
Use-MonoCecil | Out-Null
# $VerbosePreference ="continue"
function UpdateALLNuspec($platform, $allNuspec, $nuspecs,$allModuleNuspecs,$csProjects) {

$platformNuspecs = $allModuleNuspecs | ForEach-Object {
[xml]$nuspec = Get-Content $_.FullName

if ($_.BaseName -eq "Xpand.XAF.Modules.Reactive"){
Write-Verbose $_.BaseName
}
$nuspecBaseName=$_.BaseName
$filesrc=($nuspec.package.Files.file|Where-Object{$_.src -like "*$nuspecBaseName.dll"}).src
$platformMetada = Get-AssemblyMetadata "$root\bin\$filesrc" -key "Platform"
Expand Down Expand Up @@ -74,7 +70,10 @@ $allModuleNuspecs = $nuspecs | Where-Object { $_ -notlike "*ALL*" -and ($_ -like
$csProjects=Get-MSBuildProjects $root\src
UpdateALLNuspec "Core" $allNuspec $nuspecs $allModuleNuspecs $csProjects
$googleBlazorVersion=(Get-XmlContent "$root\Build\nuspec\Xpand.Extensions.Office.Cloud.Google.Blazor.nuspec").package.metadata.version
Add-NuspecDependency Xpand.Extensions.Office.Cloud.Google.Blazor $googleBlazorVersion $allNuspec "netstandard2.0"
if ($dxVersion -gt "20.2.2"){
Add-NuspecDependency Xpand.Extensions.Office.Cloud.Google.Blazor $googleBlazorVersion $allNuspec "netstandard2.1"
}

$allNuspec|Save-Xml $allFileName

Get-Content $allFileName -Raw
Expand Down
4 changes: 2 additions & 2 deletions Build/UpdateProjects.ps1
@@ -1,5 +1,5 @@
param(
[version]$DXVersion = "20.1.8"
[version]$DXVersion = "20.1.9"
)
$ErrorActionPreference = "Stop"
$rootLocation = "$PSScriptRoot\..\"
Expand Down Expand Up @@ -31,7 +31,7 @@ Get-ChildItem -Filter *.csproj -Recurse | ForEach-Object {
Update-ProjectAutoGenerateBindingRedirects $projXml $true
if ($fileName -notlike "*.Tests.csproj" -or $fileName -like "*EasyTest*.csproj" ) {
if ($fileName -notlike "*TestApplication.Web*.csproj") {
Update-OutputPath $fileName "$rootLocation\bin\"
Update-OutputPath $fileName "$rootLocation\bin\"|Out-Null
}

}
Expand Down
14 changes: 8 additions & 6 deletions Build/nuspec/Xpand.XAF.Core.All.nuspec
Expand Up @@ -14,11 +14,7 @@
<copyright>eXpandFramework.com</copyright>
<tags>DevExpress XAF modules, eXpandFramework, XAF, eXpressApp, Xpand.XAF.Core.All</tags>
<dependencies>
<group targetFramework="net461">
<dependency id="Xpand.XAF.Modules.Office.Cloud.Microsoft.Calendar" version="4.202.47.3" />
<dependency id="Xpand.XAF.Modules.Office.Cloud.Microsoft" version="4.202.47.3" />
<dependency id="Xpand.XAF.Modules.Office.Cloud.Microsoft.Todo" version="4.202.47.3" />
<dependency id="Xpand.XAF.Modules.Office.DocumentStyleManager" version="4.202.47.3" />
<group targetFramework="netstandard2.0">
<dependency id="Xpand.Extensions.Mono.Cecil" version="4.202.47.3" />
<dependency id="Xpand.Extensions" version="4.202.47.3" />
<dependency id="Xpand.Extensions.Office.Cloud" version="4.202.47.3" />
Expand Down Expand Up @@ -47,7 +43,11 @@
<dependency id="Xpand.XAF.Modules.ViewItemValue" version="4.202.47.3" />
<dependency id="Xpand.XAF.Modules.ViewWizard" version="4.202.47.3" />
</group>
<group targetFramework="netstandard2.0">
<group targetFramework="net461">
<dependency id="Xpand.XAF.Modules.Office.Cloud.Microsoft.Calendar" version="4.202.47.3" />
<dependency id="Xpand.XAF.Modules.Office.Cloud.Microsoft" version="4.202.47.3" />
<dependency id="Xpand.XAF.Modules.Office.Cloud.Microsoft.Todo" version="4.202.47.3" />
<dependency id="Xpand.XAF.Modules.Office.DocumentStyleManager" version="4.202.47.3" />
<dependency id="Xpand.Extensions.Mono.Cecil" version="4.202.47.3" />
<dependency id="Xpand.Extensions" version="4.202.47.3" />
<dependency id="Xpand.Extensions.Office.Cloud" version="4.202.47.3" />
Expand Down Expand Up @@ -75,6 +75,8 @@
<dependency id="Xpand.XAF.Modules.ViewEditMode" version="4.202.47.3" />
<dependency id="Xpand.XAF.Modules.ViewItemValue" version="4.202.47.3" />
<dependency id="Xpand.XAF.Modules.ViewWizard" version="4.202.47.3" />
</group>
<group targetFramework="netstandard2.1">
<dependency id="Xpand.Extensions.Office.Cloud.Google.Blazor" version="4.202.47.3" />
</group>
</dependencies>
Expand Down

0 comments on commit b61b2da

Please sign in to comment.