Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Sandermann committed Dec 23, 2021
2 parents 792be03 + 4ce2091 commit e93a31a
Show file tree
Hide file tree
Showing 10 changed files with 275 additions and 119 deletions.
22 changes: 17 additions & 5 deletions .build/BuildToolkit.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Tool Versions
$NunitVersion = "3.12.0";
$OpenCoverVersion = "4.7.922";
$DocFxVersion = "2.56.2";
$ReportGeneratorVersion = "4.8.7";
$OpenCoverVersion = "4.7.1221";
$DocFxVersion = "2.58.4";
$ReportGeneratorVersion = "4.8.13";
$OpenCoverToCoberturaVersion = "0.3.4";

# Folder Pathes
$RootPath = $MyInvocation.PSScriptRoot;
Expand All @@ -18,6 +19,7 @@ $DocumentationArtifcacts = "$ArtifactsDir\Documentation";
# Tests
$NunitReportsDir = "$ArtifactsDir\Tests";
$OpenCoverReportsDir = "$ArtifactsDir\Tests"
$CoberturaReportsDir = "$ArtifactsDir\Tests"

# Nuget
$NugetConfig = "$RootPath\NuGet.Config";
Expand All @@ -34,6 +36,7 @@ $global:OpenCoverCli = "$BuildTools\OpenCover.$OpenCoverVersion\tools\OpenCover.
$global:NunitCli = "$BuildTools\NUnit.ConsoleRunner.$NunitVersion\tools\nunit3-console.exe";
$global:ReportGeneratorCli = "$BuildTools\ReportGenerator.$ReportGeneratorVersion\tools\net47\ReportGenerator.exe";
$global:DocFxCli = "$BuildTools\docfx.console.$DocFxVersion\tools\docfx.exe";
$global:OpenCoverToCoberturaCli = "$BuildTools\OpenCoverToCoberturaConverter.$OpenCoverToCoberturaVersion\tools\OpenCoverToCoberturaConverter.exe";

# Git
$global:GitCommitHash = "";
Expand Down Expand Up @@ -132,6 +135,7 @@ function Invoke-Initialize([string]$Version = "1.0.0", [bool]$Cleanup = $False)
Write-Variable "NUnitCli" $global:NUnitCli;
Write-Variable "ReportGeneratorCli" $global:ReportGeneratorCli;
Write-Variable "DocFxCli" $global:DocFxCli;
Write-Variable "OpenCoverToCoberturaCli" $global:OpenCoverToCoberturaCli;
Write-Variable "GitCli" $global:GitCli;
Write-Variable "GitCommitHash" $global:GitCommitHash;

Expand Down Expand Up @@ -269,6 +273,10 @@ function Invoke-CoverTests($SearchPath = $RootPath, $SearchFilter = "*.csproj",
Install-Tool "OpenCover" $OpenCoverVersion $global:OpenCoverCli;
}

if (-not (Test-Path $global:OpenCoverToCoberturaCli)) {
Install-Tool "OpenCoverToCoberturaConverter" $OpenCoverToCoberturaVersion $global:OpenCoverToCoberturaCli;
}

CreateFolderIfNotExists $OpenCoverReportsDir;
CreateFolderIfNotExists $NunitReportsDir;

Expand Down Expand Up @@ -308,6 +316,7 @@ function Invoke-CoverTests($SearchPath = $RootPath, $SearchFilter = "*.csproj",

$nunitXml = ($NunitReportsDir + "\$projectName.TestResult.xml");
$openCoverXml = ($OpenCoverReportsDir + "\$projectName.OpenCover.xml");
$coberturaXml = ($CoberturaReportsDir + "\$projectName.Cobertura.xml");

if ($isNetCore) {
$targetArgs = '"test -v ' + $env:MORYX_TEST_VERBOSITY + ' -c ' + $env:MORYX_BUILD_CONFIG + ' ' + $testProject + '"';
Expand Down Expand Up @@ -346,6 +355,9 @@ function Invoke-CoverTests($SearchPath = $RootPath, $SearchFilter = "*.csproj",
Write-Host-Error "Nunit exited with $errorText for $projectName";
Invoke-ExitCodeCheck $exitCode;
}

& $global:OpenCoverToCoberturaCli -input:$openCoverXml -output:$coberturaXml -sources:$rootPath
Invoke-ExitCodeCheck $LastExitCode;
}
}

Expand Down Expand Up @@ -655,7 +667,7 @@ function CreateFolderIfNotExists([string]$Folder) {
}

function CopyAndReplaceFolder($SourceDir, $TargetDir) {
Write-Host-Info "Copy $TargetDir to $SourceDir!"
Write-Host-Info "Copy $SourceDir to $TargetDir!"
# Remove old folder if exists
if (Test-Path $TargetDir) {
Write-Host "Target path already exists, removing ..." -ForegroundColor Yellow
Expand All @@ -665,4 +677,4 @@ function CopyAndReplaceFolder($SourceDir, $TargetDir) {
# Copy to target path
Write-Host "Copy from $SourceDir to $TargetDir ..." -ForegroundColor Green
Copy-Item -Path $SourceDir -Recurse -Destination $TargetDir -Container
}
}
12 changes: 0 additions & 12 deletions .build/Global.DotSettings

This file was deleted.

21 changes: 16 additions & 5 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@ name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
on:
push:
branches:
branches:
- dev
- future
tags:
- v[0-9]+.[0-9]+.[0-9]+ # Matches all semantic versioning tags with major, minor, patch
pull_request:
branches:
branches:
- dev
- future

env:
MORYX_OPTIMIZE_CODE: "false"
MORYX_BUILD_CONFIG: "Release"
MORYX_BUILDNUMBER: ${{github.run_number}}
dotnet_sdk_version: '5.0.100'
dotnet_sdk_version: '5.0.403'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

jobs:
Expand Down Expand Up @@ -112,15 +114,24 @@ jobs:
name: packages
path: artifacts/Packages/

- name: Publish on MyGet
if: ${{ startsWith(github.ref, 'refs/heads/') }} # Normal branches are published to myget
- name: Publish on MyGet-CI
if: ${{ github.ref == 'refs/heads/dev' }} # dev branche is published to myget moryx
shell: pwsh
env:
MORYX_NUGET_APIKEY: ${{secrets.MYGET_TOKEN}}
MORYX_PACKAGE_TARGET: "https://www.myget.org/F/moryx/api/v2/package"
MORYX_PACKAGE_TARGET_V3: "https://www.myget.org/F/moryx/api/v3/index.json"
run: ./Build.ps1 -Publish

- name: Publish on MyGet-Future
if: ${{ github.ref == 'refs/heads/future' }} # Future branch is published to myget moryx-future
shell: pwsh
env:
MORYX_NUGET_APIKEY: ${{secrets.MYGET_TOKEN}}
MORYX_PACKAGE_TARGET: "https://www.myget.org/F/moryx-future/api/v2/package"
MORYX_PACKAGE_TARGET_V3: "https://www.myget.org/F/moryx-future/api/v3/index.json"
run: ./Build.ps1 -Publish

- name: Publish on NuGet
if: ${{ startsWith(github.ref, 'refs/tags/v') }} # Version Tags are published to nuget
shell: pwsh
Expand Down
8 changes: 4 additions & 4 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
<PackageReference Update="Caliburn.Micro" Version="3.2.0" />
<PackageReference Update="Castle.Windsor" Version="5.0.1" />
<PackageReference Update="CommandLineParser" Version="2.8.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.8.0" />
<PackageReference Update="Moq" Version="4.15.1" />
<PackageReference Update="NUnit" Version="3.12.0" />
<PackageReference Update="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Update="Moq" Version="4.16.1" />
<PackageReference Update="NUnit" Version="3.13.2" />
<PackageReference Update="NUnit3TestAdapter" Version="4.1.0" />

<!--Platform dependencies-->
<PackageReference Update="Moryx" Version="$(MoryxCoreVersion)" />
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ The **MORYX ClientFramework** is the foundation for MORYX WPF desktop frontends.

If you want to start developing with or for MORYX, the easiest way is our [template repository](https://github.com/PHOENIXCONTACT/MORYX-Template). It comes with two empty solutions, the necessary package feeds and preinstalled empty MORYX runtime. Add projects and packages to backend and frontend solutions depending on your specific requirements. Install stable releases via Nuget; development releases are available via MyGet.

| Package Name | Release (NuGet) | CI (MyGet) |
|--------------|-----------------|------------|
| `Moryx.WpfToolkit` | [![NuGet](https://img.shields.io/nuget/v/Moryx.WpfToolkit.svg)](https://www.nuget.org/packages/Moryx.WpfToolkit/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.WpfToolkit)](https://www.myget.org/feed/moryx/package/nuget/Moryx.WpfToolkit) |
| `Moryx.Controls` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Controls.svg)](https://www.nuget.org/packages/Moryx.Controls/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Controls)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Controls) |
| `Moryx.ClientFramework` | [![NuGet](https://img.shields.io/nuget/v/Moryx.ClientFramework.svg)](https://www.nuget.org/packages/Moryx.ClientFramework/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.ClientFramework)](https://www.myget.org/feed/moryx/package/nuget/Moryx.ClientFramework) |
| `Moryx.ClientFramework.Configurator` | [![NuGet](https://img.shields.io/nuget/v/Moryx.ClientFramework.Configurator.svg)](https://www.nuget.org/packages/Moryx.ClientFramework.Configurator/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.ClientFramework.Configurator)](https://www.myget.org/feed/moryx/package/nuget/Moryx.ClientFramework.Configurator) |
| `Moryx.ClientFramework.Kernel` | [![NuGet](https://img.shields.io/nuget/v/Moryx.ClientFramework.Kernel.svg)](https://www.nuget.org/packages/Moryx.ClientFramework.Kernel/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.ClientFramework.Kernel)](https://www.myget.org/feed/moryx/package/nuget/Moryx.ClientFramework.Kernel) |
| `Moryx.ClientFramework.SimpleShell` | [![NuGet](https://img.shields.io/nuget/v/Moryx.ClientFramework.SimpleShell.svg)](https://www.nuget.org/packages/Moryx.ClientFramework.SimpleShell/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.ClientFramework.SimpleShell)](https://www.myget.org/feed/moryx/package/nuget/Moryx.ClientFramework.SimpleShell) |
| `Moryx.Tools.WcfClient.UI.Viewer` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Tools.WcfClient.UI.Viewer.svg)](https://www.nuget.org/packages/Moryx.Tools.WcfClient.UI.Viewer/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Tools.WcfClient.UI.Viewer)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Tools.WcfClient.UI.Viewer) |
| Package Name | Release (NuGet) | CI (MyGet) | Future (MyGet) |
|--------------|-----------------|------------|----------------|
| `Moryx.WpfToolkit` | [![NuGet](https://img.shields.io/nuget/v/Moryx.WpfToolkit.svg)](https://www.nuget.org/packages/Moryx.WpfToolkit/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.WpfToolkit)](https://www.myget.org/feed/moryx/package/nuget/Moryx.WpfToolkit) | [![MyGet-Release](https://img.shields.io/myget/moryx-future/vpre/Moryx.WpfToolkit)](https://www.myget.org/feed/moryx-future/package/nuget/Moryx.WpfToolkit) |
| `Moryx.Controls` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Controls.svg)](https://www.nuget.org/packages/Moryx.Controls/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Controls)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Controls) | [![MyGet-Release](https://img.shields.io/myget/moryx-future/vpre/Moryx.Controls)](https://www.myget.org/feed/moryx-future/package/nuget/Moryx.Controls) |
| `Moryx.ClientFramework` | [![NuGet](https://img.shields.io/nuget/v/Moryx.ClientFramework.svg)](https://www.nuget.org/packages/Moryx.ClientFramework/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.ClientFramework)](https://www.myget.org/feed/moryx/package/nuget/Moryx.ClientFramework) | [![MyGet-Release](https://img.shields.io/myget/moryx-future/vpre/Moryx.ClientFramework)](https://www.myget.org/feed/moryx-future/package/nuget/Moryx.ClientFramework) |
| `Moryx.ClientFramework.Kernel` | [![NuGet](https://img.shields.io/nuget/v/Moryx.ClientFramework.Kernel.svg)](https://www.nuget.org/packages/Moryx.ClientFramework.Kernel/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.ClientFramework.Kernel)](https://www.myget.org/feed/moryx/package/nuget/Moryx.ClientFramework.Kernel) | [![MyGet-Release](https://img.shields.io/myget/moryx-future/vpre/Moryx.ClientFramework.Kernel)](https://www.myget.org/feed/moryx-future/package/nuget/Moryx.ClientFramework.Kernel) |
| `Moryx.ClientFramework.Configurator` | [![NuGet](https://img.shields.io/nuget/v/Moryx.ClientFramework.Configurator.svg)](https://www.nuget.org/packages/Moryx.ClientFramework.Configurator/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.ClientFramework.Configurator)](https://www.myget.org/feed/moryx/package/nuget/Moryx.ClientFramework.Configurator) | [![MyGet-Release](https://img.shields.io/myget/moryx-future/vpre/Moryx.ClientFramework.Configurator)](https://www.myget.org/feed/moryx-future/package/nuget/Moryx.ClientFramework.Configurator) |
| `Moryx.ClientFramework.SimpleShell` | [![NuGet](https://img.shields.io/nuget/v/Moryx.ClientFramework.SimpleShell.svg)](https://www.nuget.org/packages/Moryx.ClientFramework.SimpleShell/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.ClientFramework.SimpleShell)](https://www.myget.org/feed/moryx/package/nuget/Moryx.ClientFramework.SimpleShell) | [![MyGet-Release](https://img.shields.io/myget/moryx-future/vpre/Moryx.ClientFramework.SimpleShell)](https://www.myget.org/feed/moryx-future/package/nuget/Moryx.ClientFramework.SimpleShell) |
| `Moryx.ClientFramework.Wcf` | [![NuGet](https://img.shields.io/nuget/v/Moryx.ClientFramework.Wcf.svg)](https://www.nuget.org/packages/Moryx.ClientFramework.Wcf/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.ClientFramework.Wcf)](https://www.myget.org/feed/moryx/package/nuget/Moryx.ClientFramework.Wcf) | [![MyGet-Release](https://img.shields.io/myget/moryx-future/vpre/Moryx.ClientFramework.Wcf)](https://www.myget.org/feed/moryx-future/package/nuget/Moryx.ClientFramework.Wcf) |
| `Moryx.Tools.WcfClient.UI.Viewer` | [![NuGet](https://img.shields.io/nuget/v/Moryx.Tools.WcfClient.UI.Viewer.svg)](https://www.nuget.org/packages/Moryx.Tools.WcfClient.UI.Viewer/) | [![MyGet](https://img.shields.io/myget/moryx/vpre/Moryx.Tools.WcfClient.UI.Viewer)](https://www.myget.org/feed/moryx/package/nuget/Moryx.Tools.WcfClient.UI.Viewer) | [![MyGet-Release](https://img.shields.io/myget/moryx-future/vpre/Moryx.Tools.WcfClient.UI.Viewer)](https://www.myget.org/feed/moryx-future/package/nuget/Moryx.Tools.WcfClient.UI.Viewer) |
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.0
3.2.0
39 changes: 39 additions & 0 deletions src/Moryx.Controls.Demo/ViewModels/EntryEditorViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) 2020, Phoenix Contact GmbH & Co. KG
// Licensed under the Apache License, Version 2.0

using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Input;
Expand All @@ -13,12 +14,30 @@ namespace Moryx.Controls.Demo.ViewModels
{
public class EntryEditorViewModel : Screen
{
private bool _isEditMode;

public override string DisplayName => "EntryEditor";

public EntryViewModel EntryViewModels { get; }

public ICommand ShowExceptionCommand { get; }

public ICommand BeginEditCmd { get; }

public ICommand EndEditCmd { get; }

public ICommand CancelEditCmd { get; }

public bool IsEditMode
{
get { return _isEditMode; }
private set
{
_isEditMode = value;
NotifyOfPropertyChange();
}
}

public EntryEditorViewModel()
{
var entryModel = new EntryClass
Expand Down Expand Up @@ -62,6 +81,26 @@ public EntryEditorViewModel()
EntryViewModels = new EntryViewModel(entry);

ShowExceptionCommand = new RelayCommand(ShowException);
BeginEditCmd = new RelayCommand(BeginEdit);
EndEditCmd = new RelayCommand(EndEdit);
CancelEditCmd = new RelayCommand(CancelEdit);
}

private void EndEdit(object obj)
{
throw new NotImplementedException();
}

private void CancelEdit(object obj)
{
IsEditMode = false;
EntryViewModels.CancelEdit();
}

private void BeginEdit(object obj)
{
IsEditMode = true;
EntryViewModels.BeginEdit();
}

public void ShowException(object parameter)
Expand Down
19 changes: 18 additions & 1 deletion src/Moryx.Controls.Demo/Views/EntryEditorView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,22 @@
xmlns:controls="clr-namespace:Moryx.Controls;assembly=Moryx.Controls"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance viewModels:EntryEditorViewModel}">
<controls:EntryEditor Margin="20" RootEntry="{Binding EntryViewModels}" IsEditMode="True" ShowExceptionCommand="{Binding ShowExceptionCommand}" />
<DockPanel LastChildFill="True">
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" Margin="0,5,5,5" HorizontalAlignment="Right">
<EddieButton Icon="{CommonShape Pencil}"
Command="{Binding BeginEditCmd}"
Content="Begin Edit"/>
<EddieButton Icon="{CommonShape Cross}"
Margin="5,0,0,0"
Command="{Binding CancelEditCmd}"
Content="Cancel Edit"/>
<EddieButton Icon="{CommonShape CheckMark}"
Margin="5,0,0,0"
Command="{Binding EndEditCmd}"
Content="End Edit"/>
</StackPanel>

<controls:EntryEditor Margin="20" DockPanel.Dock="Top" RootEntry="{Binding EntryViewModels}" IsEditMode="{Binding IsEditMode}"
ShowExceptionCommand="{Binding ShowExceptionCommand}" />
</DockPanel>
</UserControl>
Loading

0 comments on commit e93a31a

Please sign in to comment.