Skip to content

Commit 4319083

Browse files
authored
Fix build uno uwp xamarin (#366)
* fix Uno routing App * Reworked Cinephile App NOTE: movie list not loading at present due to NULL reference when loading * fix Master Detail App * Try to create a matrix based build strategy * v2 * V3 * V4
1 parent 46cc11a commit 4319083

File tree

465 files changed

+16925
-19288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

465 files changed

+16925
-19288
lines changed

.github/workflows/dotnet-desktop.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: BuildMain
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
types: [opened, synchronize, reopened, closed]
8+
branches: [ main ]
9+
10+
env:
11+
configuration: Release
12+
productNamespacePrefix: "ReactiveUI"
13+
14+
jobs:
15+
build:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [macos-latest, windows-latest]
20+
include:
21+
- os: macos-latest
22+
buildtype: "iphone"
23+
- name: Set default Xamarin SDK versions
24+
run: |
25+
$VM_ASSETS/select-xamarin-sdk-v2.sh --mono=6.12 --ios=14.10
26+
- name: Set default Xcode 12.3
27+
run: |
28+
XCODE_ROOT=/Applications/Xcode_12.3.0.app
29+
echo "MD_APPLE_SDK_ROOT=$XCODE_ROOT" >> $GITHUB_ENV
30+
sudo xcode-select -s $XCODE_ROOT
31+
32+
- os: macos-latest
33+
buildtype: "android"
34+
- name: Set default Xamarin SDK versions
35+
run: |
36+
$VM_ASSETS/select-xamarin-sdk-v2.sh --mono=6.10 --android=10.2
37+
38+
- os: windows-latest
39+
buildtype: "windows"
40+
- name: Install .NET Core
41+
uses: actions/[email protected]
42+
with:
43+
dotnet-version: 3.1.x
44+
runs-on: ${{ matrix.os }}
45+
steps:
46+
- name: Echo build details
47+
env:
48+
BUILDTYPE: ${{ matrix.buildtype }}
49+
run: echo $BUILDTYPE
50+
51+
- name: Checkout
52+
uses: actions/checkout@v2
53+
54+
# Install the .NET Core workload
55+
- name: Install .NET Core
56+
uses: actions/[email protected]
57+
with:
58+
dotnet-version: 5.0.x
59+
60+
- name: NuGet Restore
61+
run: dotnet restore
62+
63+
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
64+
- name: Setup MSBuild.exe
65+
uses: microsoft/[email protected]
66+
67+
- name: build iphone
68+
if: "contains(matrix.buildtype, 'iphone')"
69+
run: msbuild <csproj_file_path> /p:Configuration=${{ env.configuration }} /p:Platform=iPhoneSimulator /t:Rebuild
70+
71+
- name: build android
72+
if: "contains(matrix.buildtype, 'android')"
73+
run: msbuild <csproj_file_path> /t:PackageForAndroid /p:Configuration=${{ env.configuration }}
74+
75+
- name: build windows
76+
if: "contains(matrix.buildtype, 'windows')"
77+
run: dotnet build --configuration ${{ env.configuration }} --no-restore
78+
79+
# Execute all unit tests in the solution
80+
- name: Execute unit tests
81+
run: dotnet test --no-restore --verbosity normal
82+

xamarin-forms/Cinephile/Directory.build.props renamed to Directory.build.props

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,18 @@
33
<PropertyGroup>
44
<NoWarn>$(NoWarn);1591;1701;1702;1705;VSX1000</NoWarn>
55
<Platform>AnyCPU</Platform>
6-
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)../../../src/analyzers.ruleset</CodeAnalysisRuleSet>
76
<GenerateDocumentationFile>true</GenerateDocumentationFile>
87
</PropertyGroup>
98
<PropertyGroup>
109
<SolutionDir Condition="'$(SolutionDir)' == ''">$(MSBuildThisFileDirectory)</SolutionDir>
1110
</PropertyGroup>
1211
<ItemGroup>
13-
<None Include="$(MSBuildThisFileDirectory)../../../LICENSE" Pack="true" PackagePath="LICENSE" />
12+
<None Include="$(MSBuildThisFileDirectory)LICENSE" Pack="true" PackagePath="LICENSE" />
1413
</ItemGroup>
1514
<ItemGroup>
16-
<!--<PackageReference Include="stylecop.analyzers" Version="1.1.118" PrivateAssets="all" />-->
17-
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.2" PrivateAssets="all" />
15+
<!--<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.333" PrivateAssets="all" />-->
16+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3" PrivateAssets="all" />
1817
<PackageReference Include="Roslynator.Analyzers" Version="3.2.0" PrivateAssets="All" />
18+
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
1919
</ItemGroup>
20-
<!--<ItemGroup>
21-
<AdditionalFiles Include="$(MSBuildThisFileDirectory)../../../src/stylecop.json" Link="stylecop.json" />
22-
</ItemGroup>-->
2320
</Project>

LICENSE

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) .NET Foundation and Contributors
4+
5+
All rights reserved.
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.

xamarin-forms/MasterDetail/Android/Assets/AboutAssets.txt renamed to MasterDetail/MasterDetail.Android/Assets/AboutAssets.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Any raw assets you want to be deployed with your application can be placed in
22
this directory (and child directories) and given a Build Action of "AndroidAsset".
33

4-
These files will be deployed with you package and will be accessible using Android's
4+
These files will be deployed with your package and will be accessible using Android's
55
AssetManager, like this:
66

77
public class ReadAsset : Activity
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
3+
using Android.App;
4+
using Android.Content.PM;
5+
using Android.Runtime;
6+
using Android.OS;
7+
8+
namespace MasterDetail.Droid
9+
{
10+
[Activity(Label = "MasterDetail", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize )]
11+
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
12+
{
13+
protected override void OnCreate(Bundle savedInstanceState)
14+
{
15+
base.OnCreate(savedInstanceState);
16+
17+
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
18+
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
19+
LoadApplication(new App());
20+
}
21+
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
22+
{
23+
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
24+
25+
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
26+
}
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProjectGuid>{EF7E3BB3-C483-42DA-BBDE-92BDCB593DEF}</ProjectGuid>
6+
<ProjectGuid>{2F4DEAC8-645F-456B-97E5-0626DF9F2796}</ProjectGuid>
77
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
88
<TemplateGuid>{c9e5eea5-ca05-42a1-839b-61506e0a37df}</TemplateGuid>
99
<OutputType>Library</OutputType>
1010
<RootNamespace>MasterDetail.Droid</RootNamespace>
1111
<AssemblyName>MasterDetail.Android</AssemblyName>
12+
<Deterministic>True</Deterministic>
1213
<AndroidApplication>True</AndroidApplication>
1314
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
1415
<AndroidResgenClass>Resource</AndroidResgenClass>
1516
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
1617
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
1718
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
19+
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
1820
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
19-
<UseShortFileNames>True</UseShortFileNames>
21+
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
22+
<AndroidUseAapt2>true</AndroidUseAapt2>
2023
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
2124
<NuGetPackageImportStamp>
2225
</NuGetPackageImportStamp>
@@ -30,51 +33,33 @@
3033
<ErrorReport>prompt</ErrorReport>
3134
<WarningLevel>4</WarningLevel>
3235
<AndroidLinkMode>None</AndroidLinkMode>
33-
<LangVersion>latest</LangVersion>
3436
</PropertyGroup>
3537
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3638
<DebugSymbols>true</DebugSymbols>
37-
<DebugType>pdbonly</DebugType>
39+
<DebugType>portable</DebugType>
3840
<Optimize>true</Optimize>
3941
<OutputPath>bin\Release</OutputPath>
4042
<ErrorReport>prompt</ErrorReport>
4143
<WarningLevel>4</WarningLevel>
4244
<AndroidManagedSymbols>true</AndroidManagedSymbols>
4345
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
44-
<LangVersion>latest</LangVersion>
4546
</PropertyGroup>
4647
<ItemGroup>
4748
<Reference Include="Mono.Android" />
4849
<Reference Include="System" />
4950
<Reference Include="System.Core" />
5051
<Reference Include="System.Xml.Linq" />
5152
<Reference Include="System.Xml" />
53+
<Reference Include="System.Numerics" />
54+
<Reference Include="System.Numerics.Vectors" />
5255
</ItemGroup>
5356
<ItemGroup>
54-
<PackageReference Include="ReactiveUI" Version="14.1.1" />
5557
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
56-
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.4.0" />
57-
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.3.0" />
58-
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0.7" />
59-
<PackageReference Include="Xamarin.AndroidX.CardView" Version="1.0.0.8" />
60-
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.4" />
61-
<PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.8" />
62-
<PackageReference Include="Xamarin.AndroidX.Media">
63-
<Version>1.3.1</Version>
64-
</PackageReference>
65-
<PackageReference Include="Xamarin.AndroidX.Palette">
66-
<Version>1.0.0.7</Version>
67-
</PackageReference>
68-
<PackageReference Include="Xamarin.AndroidX.AppCompat.Resources">
69-
<Version>1.1.0</Version>
70-
</PackageReference>
71-
<PackageReference Include="Xamarin.AndroidX.AppCompat.AppCompatResources">
72-
<Version>1.3.0</Version>
73-
</PackageReference>
58+
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
7459
</ItemGroup>
7560
<ItemGroup>
7661
<Compile Include="MainActivity.cs" />
77-
<Compile Include="Resources\Resource.Designer.cs" />
62+
<Compile Include="Resources\Resource.designer.cs" />
7863
<Compile Include="Properties\AssemblyInfo.cs" />
7964
</ItemGroup>
8065
<ItemGroup>
@@ -83,46 +68,29 @@
8368
<None Include="Properties\AndroidManifest.xml" />
8469
</ItemGroup>
8570
<ItemGroup>
86-
<AndroidResource Include="Resources\layout\Tabbar.axml" />
87-
<AndroidResource Include="Resources\layout\Toolbar.axml" />
8871
<AndroidResource Include="Resources\values\styles.xml" />
8972
<AndroidResource Include="Resources\values\colors.xml" />
9073
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon.xml" />
9174
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon_round.xml" />
92-
<AndroidResource Include="Resources\mipmap-hdpi\Icon.png" />
75+
<AndroidResource Include="Resources\mipmap-hdpi\icon.png" />
9376
<AndroidResource Include="Resources\mipmap-hdpi\launcher_foreground.png" />
94-
<AndroidResource Include="Resources\mipmap-mdpi\Icon.png" />
77+
<AndroidResource Include="Resources\mipmap-mdpi\icon.png" />
9578
<AndroidResource Include="Resources\mipmap-mdpi\launcher_foreground.png" />
96-
<AndroidResource Include="Resources\mipmap-xhdpi\Icon.png" />
79+
<AndroidResource Include="Resources\mipmap-xhdpi\icon.png" />
9780
<AndroidResource Include="Resources\mipmap-xhdpi\launcher_foreground.png" />
98-
<AndroidResource Include="Resources\mipmap-xxhdpi\Icon.png" />
81+
<AndroidResource Include="Resources\mipmap-xxhdpi\icon.png" />
9982
<AndroidResource Include="Resources\mipmap-xxhdpi\launcher_foreground.png" />
100-
<AndroidResource Include="Resources\mipmap-xxxhdpi\Icon.png" />
83+
<AndroidResource Include="Resources\mipmap-xxxhdpi\icon.png" />
10184
<AndroidResource Include="Resources\mipmap-xxxhdpi\launcher_foreground.png" />
10285
</ItemGroup>
10386
<ItemGroup>
104-
<Folder Include="Resources\drawable-hdpi\" />
105-
<Folder Include="Resources\drawable-xhdpi\" />
106-
<Folder Include="Resources\drawable-xxhdpi\" />
107-
<Folder Include="Resources\drawable-xxxhdpi\" />
87+
<Folder Include="Resources\drawable\" />
10888
</ItemGroup>
10989
<ItemGroup>
11090
<ProjectReference Include="..\MasterDetail\MasterDetail.csproj">
111-
<Project>{CF80A4A1-D8CF-4B8F-A662-D16C82BC350E}</Project>
91+
<Project>{A50AB2C1-183F-424A-9DCD-3F57EBB55B86}</Project>
11292
<Name>MasterDetail</Name>
11393
</ProjectReference>
11494
</ItemGroup>
115-
<ItemGroup>
116-
<AndroidResource Include="Resources\drawable\contacts.png" />
117-
</ItemGroup>
118-
<ItemGroup>
119-
<AndroidResource Include="Resources\drawable\hamburger.png" />
120-
</ItemGroup>
121-
<ItemGroup>
122-
<AndroidResource Include="Resources\drawable\reminders.png" />
123-
</ItemGroup>
124-
<ItemGroup>
125-
<AndroidResource Include="Resources\drawable\todo.png" />
126-
</ItemGroup>
127-
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
128-
</Project>
95+
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
96+
</Project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.masterdetail">
3+
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />
4+
<application android:label="MasterDetail.Android" android:theme="@style/MainTheme"></application>
5+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
6+
</manifest>

xamarin-forms/MasterDetail/Android/Properties/AssemblyInfo.cs renamed to MasterDetail/MasterDetail.Android/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
// Minor Version
2323
// Build Number
2424
// Revision
25-
//
26-
// You can specify all the values or you can default the Build and Revision Numbers
27-
// by using the '*' as shown below:
28-
// [assembly: AssemblyVersion("1.0.*")]
2925
[assembly: AssemblyVersion("1.0.0.0")]
3026
[assembly: AssemblyFileVersion("1.0.0.0")]
3127

0 commit comments

Comments
 (0)