Skip to content

Commit 7758a9e

Browse files
Merge pull request #626 from mjuen/master
Add .NET Core 3.0 target to Caliburn.Micro.Platform
2 parents 668089a + e32622d commit 7758a9e

File tree

20 files changed

+1333
-25
lines changed

20 files changed

+1333
-25
lines changed

azure-pipeline.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,15 @@ steps:
2929
displayName: Nuget Restore
3030
inputs:
3131
solution: '$(coreSolution)'
32-
configuration: '$(buildConfiguration)'
3332
msbuildArgs: '/t:Restore'
33+
configuration: '$(buildConfiguration)'
34+
35+
- task: PowerShell@2
36+
# Workaround for https://github.com/onovotny/MSBuildSdkExtras/issues/174
37+
displayName: 'Resource.Designer workaround'
38+
inputs:
39+
targetType: 'inline'
40+
script: 'New-Item -ItemType File -Path .\src\Caliburn.Micro.Core\obj\Release\MonoAndroid80\Resource.Designer.cs -Force'
3441

3542
- task: VSBuild@1
3643
displayName: Build & Pack Core Solution
@@ -40,12 +47,12 @@ steps:
4047
platform: '$(buildPlatform)'
4148
msbuildArgs: '/t:Pack /p:JavaSdkDirectory="$(JAVA_HOME_8_X64)"'
4249

43-
- task: VSTest@2
50+
- task: DotNetCoreCLI@2
4451
displayName: Run Unit Tests
4552
inputs:
46-
testAssemblyVer2: 'bin\**\*.Tests.dll'
47-
configuration: '$(buildConfiguration)'
48-
platform: '$(buildPlatform)'
53+
command: test
54+
projects: '**/*Test*/*.csproj'
55+
arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'
4956

5057
- task: NuGetCommand@2
5158
displayName: Restore Setup Solution
@@ -83,4 +90,4 @@ steps:
8390
displayName: Publish Package Artifacts
8491
inputs:
8592
pathToPublish: '$(build.artifactStagingDirectory)'
86-
artifactName: Packages
93+
artifactName: Packages

samples/features/Features.UWP/Features.UWP.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1919
<PackageCertificateKeyFile>Features.UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
2020
<RuntimeIdentifiers>win10-arm;win10-arm-aot;win10-x86;win10-x86-aot;win10-x64;win10-x64-aot</RuntimeIdentifiers>
21-
<PackageCertificateThumbprint>B7A25D83EAD631188A9505D2D7C411770734C52B</PackageCertificateThumbprint>
21+
<PackageCertificateThumbprint>714bf81d767ae7aa7fcf3bb435b0804ad3eadb05</PackageCertificateThumbprint>
2222
</PropertyGroup>
2323
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
2424
<DebugSymbols>true</DebugSymbols>
@@ -268,4 +268,4 @@
268268
<Target Name="AfterBuild">
269269
</Target>
270270
-->
271-
</Project>
271+
</Project>

samples/setup/Setup.Forms/Setup.Forms.Droid/Setup.Forms.Droid.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
1919
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
2020
<TargetFrameworkVersion>v6.0</TargetFrameworkVersion>
21-
<AndroidSupportedAbis>armeabi,armeabi-v7a,x86</AndroidSupportedAbis>
21+
<AndroidSupportedAbis>armeabi-v7a,x86</AndroidSupportedAbis>
2222
<AndroidStoreUncompressedFileExtensions />
2323
<MandroidI18n />
2424
<JavaMaximumHeapSize />

src/Caliburn.Micro.Core/Caliburn.Micro.Core.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
<RootNamespace>Caliburn.Micro</RootNamespace>
88
</PropertyGroup>
99

10+
<!-- Workaround for https://github.com/onovotny/MSBuildSdkExtras/issues/173 -->
11+
<PropertyGroup Label="Android DesignTimeBuild error workaround">
12+
<DesignTimeBuild>false</DesignTimeBuild>
13+
</PropertyGroup>
14+
1015
<PropertyGroup Condition="'$(TargetFramework)' == 'net45'">
1116
<AssemblyOriginatorKeyFile>.\..\Caliburn.Micro.snk</AssemblyOriginatorKeyFile>
1217
<SignAssembly>true</SignAssembly>

src/Caliburn.Micro.Platform.Tests/Caliburn.Micro.Platform.Tests.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
<ItemGroup>
99
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
10+
<PackageReference Include="System.Windows.Interactivity.WPF" Version="2.0.20525" />
1011
<PackageReference Include="xunit" Version="2.3.1" />
1112
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
1213
<PackageReference Include="Moq" Version="4.8.3" />
@@ -21,9 +22,6 @@
2122
<ItemGroup>
2223
<Reference Include="PresentationCore" />
2324
<Reference Include="PresentationFramework" />
24-
<Reference Include="System.Windows.Interactivity">
25-
<HintPath>C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\.NETFramework\v4.5\Libraries\System.Windows.Interactivity.dll</HintPath>
26-
</Reference>
2725
<Reference Include="System.Xaml" />
2826
</ItemGroup>
2927

src/Caliburn.Micro.Platform/ActionMessage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ void ElementLoaded(object sender, RoutedEventArgs e) {
191191
}
192192
else currentElement = context.View;
193193

194-
#if NET
194+
#if NET || NETCORE
195195
var binding = new Binding {
196196
Path = new PropertyPath(Message.HandlerProperty),
197197
Source = currentElement

src/Caliburn.Micro.Platform/Bind.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static void ModelWithoutContextChanged(DependencyObject d, DependencyPropertyCha
154154
/// </summary>
155155
/// <param name="dependencyObject">The ui to apply conventions to.</param>
156156
/// <returns>Whether or not conventions are applied.</returns>
157-
#if NET
157+
#if NET || NETCORE
158158
[AttachedPropertyBrowsableForTypeAttribute(typeof(DependencyObject))]
159159
#endif
160160
public static bool GetAtDesignTime(DependencyObject dependencyObject) {

src/Caliburn.Micro.Platform/BindingScope.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public static bool RemoveChildResolver(ChildResolver resolver) {
169169
continue;
170170
}
171171

172-
#if NET
172+
#if NET || NETCORE
173173
var childCount = (current is Visual || current is Visual3D)
174174
? VisualTreeHelper.GetChildrenCount(current) : 0;
175175
#else

src/Caliburn.Micro.Platform/Caliburn.Micro.Platform.csproj

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
<Project Sdk="MSBuild.Sdk.Extras">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net45;uap10.0.16299;Xamarin.iOS10;MonoAndroid80;netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>net45;uap10.0.16299;Xamarin.iOS10;MonoAndroid80;netstandard2.0;netcoreapp3.0</TargetFrameworks>
55
<PackageId>Caliburn.Micro</PackageId>
66
<Product>Caliburn.Micro</Product>
77
<RootNamespace>Caliburn.Micro</RootNamespace>
88
</PropertyGroup>
99

10+
<!-- Workaround for https://github.com/onovotny/MSBuildSdkExtras/issues/173 -->
11+
<PropertyGroup Label="Android DesignTimeBuild error workaround">
12+
<DesignTimeBuild>false</DesignTimeBuild>
13+
</PropertyGroup>
14+
1015
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'Xamarin.iOS10' or '$(TargetFramework)' == 'MonoAndroid80'">
1116
<DefineConstants>XFORMS</DefineConstants>
1217
</PropertyGroup>
@@ -28,7 +33,13 @@
2833
<Reference Include="PresentationFramework" />
2934
<Reference Include="System.Xaml" />
3035
<Reference Include="WindowsBase" />
31-
<Compile Include="Platforms\net46\**\*.cs" />
36+
<Compile Include="Platforms\net46-netcore\**\*.cs" />
37+
</ItemGroup>
38+
39+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
40+
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.0.1" />
41+
<PackageReference Include="Microsoft.WindowsDesktop.App" Version="3.0.0-preview7-27912-14" />
42+
<Compile Include="Platforms\net46-netcore\**\*.cs" />
3243
</ItemGroup>
3344

3445
<ItemGroup Label="Package">
@@ -73,8 +84,4 @@
7384
<Compile Include="ViewModelLocator.cs" />
7485
</ItemGroup>
7586

76-
<ItemGroup>
77-
<None Remove="Platforms\net46\AssemblyInfo.cs" />
78-
</ItemGroup>
79-
8087
</Project>

src/Caliburn.Micro.Platform/ConventionManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public static class ConventionManager {
177177
/// Determines whether a custom update source trigger should be applied to the binding.
178178
/// </summary>
179179
public static Action<DependencyProperty, DependencyObject, Binding, PropertyInfo> ApplyUpdateSourceTrigger = (bindableProperty, element, binding, info) => {
180-
#if WINDOWS_UWP || NET
180+
#if WINDOWS_UWP || NET || NETCORE
181181
binding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
182182
#endif
183183
};
@@ -363,7 +363,7 @@ public static ElementConvention GetElementConvention(Type elementType) {
363363
/// Determines whether a particular dependency property already has a binding on the provided element.
364364
/// </summary>
365365
public static bool HasBinding(FrameworkElement element, DependencyProperty property) {
366-
#if NET
366+
#if NET || NETCORE
367367
return BindingOperations.GetBindingBase(element, property) != null;
368368
#else
369369
return element.GetBindingExpression(property) != null;

0 commit comments

Comments
 (0)