Skip to content

Commit

Permalink
.NET 6.0 port (WIP)
Browse files Browse the repository at this point in the history
Work in progress port to .NET 6.0 and Visual Studio 2022.

* Update .NET projects, solutions and assemblies

* Reimport IKVM.Reflection (with modifications) from [ikvm-revived]

* Rewrite obsolete code and fix other fallouts

[ikvm-revived]: https://github.com/ikvm-revived/ikvm/tree/a91e31b6ded415d42c52b87cb8e30a83e1d9588d/src/IKVM.Reflection
  • Loading branch information
mortend committed Sep 23, 2022
1 parent b6da86f commit 57e6e9f
Show file tree
Hide file tree
Showing 136 changed files with 6,281 additions and 9,470 deletions.
5 changes: 1 addition & 4 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: '{build}'
image: Visual Studio 2019
image: Visual Studio 2022

environment:
matrix:
Expand Down Expand Up @@ -44,7 +44,4 @@ before_test:
}
test_script:
- nunit3-console
src\test\tests\bin\Release\Uno.TestRunner.Tests.dll
src\ux\tests\bin\Release\Uno.UX.Markup.Tests.dll
- npm test %TARGET%
13 changes: 6 additions & 7 deletions .unoconfig
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// Core config
AppLoader.Mac: bin/mac
AppLoader.Windows: bin/win
Uno.Exe: bin/uno.exe
AppLoader.Mac: bin/mac/net6.0
AppLoader.Windows: bin/win/net6.0-windows

if WIN32 {
AppLoader.Exe: bin/win/uno-app.exe
Uno.Command: bin/uno.exe
AppLoader.Assembly: bin/win/net6.0-windows/uno-app.dll
Uno.Command: bin/net6.0/uno.exe
} else if MAC {
AppLoader.Exe: bin/mac/uno-app.exe
AppLoader.Assembly: bin/mac/net6.0/uno-app.dll
Uno.Command: bin/uno.js
} else {
AppLoader.Exe: bin/generic/uno-app.exe
AppLoader.Assembly: bin/generic/net6.0/uno-app.dll
Uno.Command: bin/uno.js
}

Expand Down
2 changes: 1 addition & 1 deletion disasm.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30002.166
VisualStudioVersion = 25.0.1703.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "disasm-wpf", "src\disasm\wpf\disasm-wpf.csproj", "{E9E95DD1-03F6-45A3-945F-E1CC82E6B8D4}"
EndProject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,64 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9AA47731-A7CE-4113-9A78-C8FAD8862D90}</ProjectGuid>
<TargetFramework>net6.0</TargetFramework>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Uno.Net.Http.Implementation.Test</RootNamespace>
<AssemblyName>Uno.Net.Http.Implementation.Test</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Uno.Net.Http.Implementation\Uno.Net.Http.Implementation.csproj">
<Project>{d20c6ce2-b067-4911-acb1-3ee928c297a6}</Project>
<Name>Uno.Net.Http.Implementation</Name>
</ProjectReference>
<ProjectReference Include="..\Uno.Net.Http.Implementation\Uno.Net.Http.Implementation.csproj" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- 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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
5 changes: 2 additions & 3 deletions lib/Uno.Net.Http/cil/Uno.Net.Http.Implementation.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30324.0
# Visual Studio Version 16
VisualStudioVersion = 25.0.1703.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Uno.Net.Http.Implementation", "Uno.Net.Http.Implementation\Uno.Net.Http.Implementation.csproj", "{D20C6CE2-B067-4911-ACB1-3EE928C297A6}"
EndProject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,58 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D20C6CE2-B067-4911-ACB1-3EE928C297A6}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Uno.Net.Http.Implementation</RootNamespace>
<AssemblyName>Uno.Net.Http.Implementation</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="HttpClientImpl.cs" />
<Compile Include="MyHttpLib\HttpHelper.cs" />
<Compile Include="MyHttpLib\HttpRequest.cs" />
<Compile Include="MyHttpLib\HttpResponse.cs" />
<Compile Include="MyHttpLib\StreamExtensions.cs" />
<Compile Include="MyHttpLib\TaskAsyncHelper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- 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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

</Project>
4 changes: 4 additions & 0 deletions lib/UnoCore/cil/config.cil.uxl
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@
<!-- Core assemblies -->
<Require Assembly="System" />
<Require Assembly="System.Core" />
<Require Assembly="System.Collections" />
<Require Assembly="System.Console" />
<Require Assembly="System.Runtime" />
<Require Assembly="System.Threading" />

</Extensions>
6 changes: 3 additions & 3 deletions lib/UnoCore/cil/exe.cil.uxl
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

<Set AppDirectory="@(Project.Name).app" Condition="HOST_MAC" />
<Set AssemblyDirectory="@(HOST_MAC:Defined:Test('@(AppDirectory)/Contents/MonoBundle', '.'))" />
<Set Product="@(AssemblyDirectory)/@(Project.Name).exe" />
<Set Product="@(AssemblyDirectory)/@(Project.Name).dll" />

<Set Commands.Run="@('@(AppDirectory)/Contents/MacOS/@(Project.Name)':QuoteSpace)" Condition="HOST_MAC" />
<Set Commands.Run="@(Product:QuoteSpace)" />

<!-- AppLoader & dependencies -->
<Set AppLoader.Assembly="@(Config.AppLoader.Exe:Path)" />
<Set AppLoader.Assembly="@(Config.AppLoader.Assembly:Path)" />
<Set AppLoader.Class="Uno.AppLoader.Program" />
<Set AppLoader.Method="UnoGenerated" />

<Require UnmanagedLibrary="@(Config.AppLoader.Mac:Path)/OpenTK.dll" Condition="HOST_MAC" />
<Require UnmanagedLibrary="@(Config.AppLoader.Mac:Path)/System.Drawing.Common.dll" Condition="HOST_MAC" />
<Require UnmanagedLibrary="@(Config.AppLoader.Mac:Path)/Xamarin.Mac.dll" Condition="HOST_MAC" />
<Require UnmanagedLibrary="@(Config.AppLoader.Mac:Path)/libxammac.dylib" Condition="HOST_MAC" />

<Require UnmanagedLibrary="@(Config.AppLoader.Windows:Path)/OpenTK.dll" Condition="HOST_WIN32" />
<Require UnmanagedLibrary="@(Config.AppLoader.Windows:Path)/libEGL.dll" Condition="HOST_WIN32" />
<Require UnmanagedLibrary="@(Config.AppLoader.Windows:Path)/libGLESv2.dll" Condition="HOST_WIN32" />
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@fuse-open/uno",
"version": "2.4.1",
"version": "3.0.0-beta.0",
"description": "Extremely fast, native C#-dialect and powerful tooling for mobile and desktop developers.",
"dependencies": {
"@fuse-open/opentk": "^3.2.0",
"@fuse-open/transpiler": "^1.17.3",
"@fuse-open/xamarin-mac": "^8.8.0",
"dotnet-run": "^1.5.0"
"dotnet-run": "^2.0.0-beta.0"
},
"devDependencies": {
"filecompare": "^1.0.4",
Expand All @@ -19,7 +19,7 @@
"prepack": "bash scripts/pack.sh",
"test": "bash scripts/test.sh",
"version": "bash scripts/version.sh",
"uno": "dotnet-run bin/uno.exe"
"uno": "dotnet-run bin/net6.0/uno.dll"
},
"bin": {
"uno": "bin/uno.js"
Expand Down
2 changes: 1 addition & 1 deletion runtime.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30002.166
VisualStudioVersion = 25.0.1703.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "app-win", "src\runtime\win\app-win.csproj", "{21D956DB-8735-4EE6-BA7E-1D6CD77521F4}"
EndProject
Expand Down
17 changes: 9 additions & 8 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,25 @@ if [ -z "$CONFIGURATION" ]; then
CONFIGURATION="Debug"
fi

if [ ! -d packages/ ]; then
INSTALL=1
elif [ ! -d node_modules/ ]; then
if [ -z "$VERBOSITY" ]; then
VERBOSITY="minimal"
fi

if [ ! -d node_modules/ ]; then
INSTALL=1
fi

if [ "$INSTALL" = 1 ]; then
h1 "Installing dependencies"
nuget restore uno.sln
h1 "Installing modules"
npm install
fi

h1 "Building uno"
csharp-build uno.sln
dotnet build --configuration $CONFIGURATION --verbosity $VERBOSITY uno.sln

h1 "Building runtime"
uno build lib/UnoCore -DLIBRARY
csharp-build runtime.sln
uno build lib/UnoCore -DLIBRARY --trace
dotnet build --configuration $CONFIGURATION --verbosity $VERBOSITY runtime.sln

h1 "Building lib"
uno doctor -ec$CONFIGURATION lib "$@"
8 changes: 5 additions & 3 deletions scripts/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ done
# Clean tests
uno clean --recursive tests

# Clean C# solutions
csharp-clean runtime.sln 1> /dev/null
csharp-clean uno.sln 1> /dev/null
# Clean .NET solutions
dotnet clean --configuration Debug runtime.sln 1> /dev/null
dotnet clean --configuration Release runtime.sln 1> /dev/null
dotnet clean --configuration Debug uno.sln 1> /dev/null
dotnet clean --configuration Release uno.sln 1> /dev/null

# Clean other artifacts
rm -rf bin packages
40 changes: 1 addition & 39 deletions scripts/common.sh
Original file line number Diff line number Diff line change
@@ -1,46 +1,8 @@
#!/bin/bash
set -e

function find-msbuild {
powershell -ExecutionPolicy ByPass -File scripts/find-msbuild.ps1
}

function csharp-build {
if [ -z "$CONFIGURATION" ]; then
CONFIGURATION="Debug"
fi

if [ "$OSTYPE" = msys ]; then
msbuild=`find-msbuild`
if [ $? != 0 ]; then
exit $?
fi
"$msbuild" //m //p:Configuration=$CONFIGURATION //v:minimal "$@"
else
msbuild /m /property:Configuration=$CONFIGURATION /verbosity:minimal "$@"
fi
}

function csharp-clean {
if [ "$OSTYPE" = msys ]; then
msbuild=`find-msbuild`
if [ $? != 0 ]; then
exit $?
fi
"$msbuild" //m //t:Clean //p:Configuration=Debug "$@"
"$msbuild" //m //t:Clean //p:Configuration=Release "$@"
else
msbuild /m /target:Clean /property:Configuration=Debug "$@"
msbuild /m /target:Clean /property:Configuration=Release "$@"
fi
}

function dotnet-run {
node_modules/.bin/dotnet-run "$@"
}

function uno {
dotnet-run bin/uno.exe "$@"
dotnet bin/net6.0/uno.dll "$@"
}

function h1 {
Expand Down
Loading

0 comments on commit 57e6e9f

Please sign in to comment.