Skip to content
This repository was archived by the owner on Nov 29, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,26 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.0.x'
dotnet-version: '6.0.x'

- name: Generate avalonia-native.h
run: |
export PATH="`pwd`/sdk:$PATH"
cd src/tools/MicroComGenerator; dotnet run -f net6.0 -c Release -i ../../avn.idl --cpp ../../../inc/avalonia-native.h

- name: Build with XCode
run: xcodebuild -sdk macosx -configuration Release -workspace src/OSX/Avalonia.Native.OSX.xcodeproj/project.xcworkspace -scheme Avalonia.Native.OSX build -derivedDataPath ./
run: xcodebuild -sdk macosx -configuration Release -workspace src/native/Avalonia.Native.OSX.xcodeproj/project.xcworkspace -scheme Avalonia.Native.OSX build -derivedDataPath ./

- name: Copy dylib
run: cp Build/Products/Release/libAvalonia.Native.OSX.dylib lib/libAvaloniaNative.dylib

- name: Install CastXML
run: brew install castxml
run: |
mkdir lib
cp Build/Products/Release/libAvalonia.Native.OSX.dylib lib/libAvaloniaNative.dylib

- name: Create global.json
run: dotnet new globaljson --sdk-version "3.0.103"
- name: Upload dylib
uses: actions/upload-artifact@v1.0.0
with:
name: dylib
path: lib/libAvaloniaNative.dylib

- name: Build with dotnet
run: dotnet build Modern.Forms.Mac.Backend.sln -c Release
Expand All @@ -35,4 +42,4 @@ jobs:
uses: actions/upload-artifact@v1.0.0
with:
name: NuGet Package
path: bin/Release/
path: src/Modern.Forms.Mac.Backend/bin/Release/
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

Generated/
src/Modern.Forms.Mac.Backend/Interop.Generated.cs

# User-specific files
*.suo
Expand Down
23 changes: 0 additions & 23 deletions Mappings.xml

This file was deleted.

38 changes: 0 additions & 38 deletions Modern.Forms.Mac.Backend.csproj

This file was deleted.

25 changes: 22 additions & 3 deletions Modern.Forms.Mac.Backend.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Modern.Forms.Mac.Backend", "Modern.Forms.Mac.Backend.csproj", "{13915EA9-EA30-4ED3-8979-3B76EDEB3332}"
# Visual Studio Version 17
VisualStudioVersion = 17.0.31912.275
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Modern.Forms.Mac.Backend", "src\Modern.Forms.Mac.Backend\Modern.Forms.Mac.Backend.csproj", "{13915EA9-EA30-4ED3-8979-3B76EDEB3332}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicroComPatcher", "src\tools\MicroComPatcher\MicroComPatcher.csproj", "{E1127977-2BE4-4E6D-841B-421C800F307F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicroComGenerator", "src\tools\MicroComGenerator\MicroComGenerator.csproj", "{E54F7D37-6480-4498-9E33-89900AACEC41}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -13,5 +18,19 @@ Global
{13915EA9-EA30-4ED3-8979-3B76EDEB3332}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13915EA9-EA30-4ED3-8979-3B76EDEB3332}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13915EA9-EA30-4ED3-8979-3B76EDEB3332}.Release|Any CPU.Build.0 = Release|Any CPU
{E1127977-2BE4-4E6D-841B-421C800F307F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E1127977-2BE4-4E6D-841B-421C800F307F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1127977-2BE4-4E6D-841B-421C800F307F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1127977-2BE4-4E6D-841B-421C800F307F}.Release|Any CPU.Build.0 = Release|Any CPU
{E54F7D37-6480-4498-9E33-89900AACEC41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E54F7D37-6480-4498-9E33-89900AACEC41}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E54F7D37-6480-4498-9E33-89900AACEC41}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E54F7D37-6480-4498-9E33-89900AACEC41}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {80B38386-1B3D-4570-B638-CE8DA2F6E1AF}
EndGlobalSection
EndGlobal
4 changes: 0 additions & 4 deletions Properties.cs

This file was deleted.

44 changes: 44 additions & 0 deletions build/MicroCom.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- Ensure that code generator is actually built -->
<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\src\tools\MicroComGenerator\MicroComGenerator.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<ExcludeAssets>all</ExcludeAssets>
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<SetTargetFramework>TargetFramework=net6.0</SetTargetFramework>
</ProjectReference>
</ItemGroup>

<Target Name="GenerateAvaloniaNativeComInterop"
BeforeTargets="CoreCompile"
DependsOnTargets="ResolveReferences"
Inputs="@(AvnComIdl);$(MSBuildThisFileDirectory)../src/tools/MicroComGenerator/**/*.cs"
Outputs="%(AvnComIdl.OutputFile)">
<Message Importance="high" Text="Generating file %(AvnComIdl.OutputFile) from @(AvnComIdl)" />
<Exec Command="dotnet &quot;$(MSBuildThisFileDirectory)../src/tools/MicroComGenerator/bin/$(Configuration)/net6.0/MicroComGenerator.dll&quot; -i @(AvnComIdl) --cs %(AvnComIdl.OutputFile)"
LogStandardErrorAsError="true" />
<ItemGroup>
<!-- Remove and re-add generated file, this is needed for the clean build -->
<Compile Remove="%(AvnComIdl.OutputFile)"/>
<Compile Include="%(AvnComIdl.OutputFile)"/>
</ItemGroup>
</Target>
<ItemGroup>
<UpToDateCheckInput Include="@(AvnComIdl)"/>
<UpToDateCheckInput Include="$(MSBuildThisFileDirectory)/../src/tools/MicroComGenerator/**/*.cs"/>
</ItemGroup>
<PropertyGroup>
<_AvaloniaPatchComInterop>true</_AvaloniaPatchComInterop>
</PropertyGroup>

<Target Name="PatchMicroComAssembly"
AfterTargets="CoreCompile">

<Message Importance="high" Text="Patching MicroCom assembly $(IntermediateOutputPath)Modern.Forms.Mac.Backend.dll" />

<Exec Command="dotnet &quot;$(MSBuildThisFileDirectory)../src/tools/MicroComPatcher/bin/$(Configuration)/net6.0/MicroComPatcher.dll&quot; &quot;$(IntermediateOutputPath)Modern.Forms.Mac.Backend.dll&quot;"
LogStandardErrorAsError="true" />
</Target>

</Project>
3 changes: 0 additions & 3 deletions inc/avalonia-native-guids.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.

#define COM_GUIDS_MATERIALIZE
#include "avalonia-native.h"
Loading