Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump .NET version to 7.0 #807

Merged
merged 30 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
482c5bf
Updated projects, removed MonoPInvokeCallback
stephen-hawley Dec 6, 2023
7076692
remove ios cruft
stephen-hawley Dec 6, 2023
4f19295
remove nint/IntPtr conflicts
stephen-hawley Dec 6, 2023
df4240c
dependency issues
stephen-hawley Dec 7, 2023
bdb3129
rebuild macOS runtime library
stephen-hawley Dec 7, 2023
8bd8643
rebuild ios runtime project
stephen-hawley Dec 11, 2023
0312bb2
type-o-matic changes
stephen-hawley Dec 11, 2023
c5e534d
update solution
stephen-hawley Dec 12, 2023
8b5e496
incorrectly linked file
stephen-hawley Dec 12, 2023
6e5acf2
fix tests
stephen-hawley Dec 12, 2023
31c8f28
get tests to run - not pass - run
stephen-hawley Dec 19, 2023
e2bfc9d
changes to make unit tests run
stephen-hawley Jan 8, 2024
ebece01
changed protocol vtable implementation to use delegate *unmanaged<>
stephen-hawley Jan 10, 2024
65c20df
protocol type change
stephen-hawley Jan 10, 2024
085434e
protocol list fixes
stephen-hawley Jan 10, 2024
e966721
more protocol list types
stephen-hawley Jan 10, 2024
d2bd0e3
nint/nuint IntPtr UIntPtr aliasing
stephen-hawley Jan 10, 2024
41f893e
closure handlind
stephen-hawley Jan 11, 2024
237b2b9
fixed flow control issue with type codes for IntPtr and UIntPtr, ensu…
stephen-hawley Jan 11, 2024
245c2ee
exception text changed
stephen-hawley Jan 11, 2024
302be41
restore MakeDelegateFromBlindClosure
stephen-hawley Jan 12, 2024
54ec94d
clean up test running code for nullability
stephen-hawley Jan 22, 2024
2e3f312
get that comment committed, thanks.
stephen-hawley Jan 22, 2024
9f0c2a7
remove default elements
stephen-hawley Jan 23, 2024
16646d3
factor out common properties, remove defaults
stephen-hawley Jan 23, 2024
ccb5f15
removing defaults etc
stephen-hawley Jan 23, 2024
e46ed01
clean up swiftreflector csproj
stephen-hawley Jan 23, 2024
db6c826
minor updates
stephen-hawley Jan 23, 2024
42aa91e
removed redundant property group item
stephen-hawley Jan 23, 2024
16f90dd
remove dead makefile rule, cleanup up csproj files
stephen-hawley Jan 23, 2024
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
114 changes: 22 additions & 92 deletions DylibBinder/DylibBinder.csproj
Original file line number Diff line number Diff line change
@@ -1,92 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{2BB83AA6-D9DB-432F-8FC1-7AC83E7FE97B}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>DylibBinder</RootNamespace>
<AssemblyName>DylibBinder</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ExternalConsole>true</ExternalConsole>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ExternalConsole>true</ExternalConsole>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Mono.Options">
<HintPath>..\packages\Mono.Options.6.6.0.161\lib\net40\Mono.Options.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
<Reference Include="mscorlib" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="CheckInventory.cs" />
<Compile Include="DylibBinderOptions.cs" />
<Compile Include="InnerX.cs" />
<Compile Include="StringExtensions.cs" />
<Compile Include="DBTopLevel.cs" />
<Compile Include="DBTypeDeclaration.cs" />
<Compile Include="DBFunc.cs" />
<Compile Include="DBProperty.cs" />
<Compile Include="DBParameter.cs" />
<Compile Include="DBGenericParameter.cs" />
<Compile Include="DBAssociatedType.cs" />
<Compile Include="SwiftTypeToString.cs" />
<Compile Include="DBInnerTypes.cs" />
<Compile Include="XmlGenerator.cs" />
<Compile Include="Enums.cs" />
<Compile Include="SortedSetExtensions.cs" />
<Compile Include="DylibBinderReflector.cs" />
<Compile Include="DBModule.cs" />
</ItemGroup>
<ItemGroup>
<None Include="README.md" />
<None Include="packages.config" />
<None Include="Makefile" />
<None Include="IgnoreList.txt" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dynamo\Dynamo.csproj">
<Project>{D0E2964B-34C9-4FEE-A638-A10E2E4A0917}</Project>
<Name>Dynamo</Name>
</ProjectReference>
<ProjectReference Include="..\SwiftReflector\SwiftReflector.csproj">
<Project>{65E8BE11-4D82-4EA5-9D14-3CA044D443EF}</Project>
<Name>SwiftReflector</Name>
</ProjectReference>
<ProjectReference Include="..\SwiftRuntimeLibrary\SwiftRuntimeLibrary.csproj">
<Project>{B7E6CF5A-B836-41CF-988C-A83607AF5445}</Project>
<Name>SwiftRuntimeLibrary</Name>
</ProjectReference>
<ProjectReference Include="..\tom-swifty\tom-swifty.csproj">
<Project>{8CAC7366-9650-440D-A3C5-36D880285DD5}</Project>
<Name>tom-swifty</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the "net7.0" to a variable defined in a root Directory.Build.props Then use that variable to set the TargetFramework in every project. i.e:
<TargetFramework>$(DOTNET_TFM)</TargetFramework>
or
<TargetFramework>$(DOTNET_TFM)-ios</TargetFramework>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is big enough that I feel it should be its own issue: #809

<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<OutputType>Exe</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Platforms>x86;AnyCPU</Platforms>
<ExternalConsole>true</ExternalConsole>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Dynamo\Dynamo.csproj" />
<ProjectReference Include="..\SwiftReflector\SwiftReflector.csproj" />
<ProjectReference Include="..\SwiftRuntimeLibrary\SwiftRuntimeLibrary.csproj" />
<ProjectReference Include="..\tom-swifty\tom-swifty.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Mono.Options" Version="6.6.0.161" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Central Package Management to keep all the package versions in sync: https://learn.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened an issue for this.

</ItemGroup>
<PropertyGroup>
<LangVersion>latest</LangVersion>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setting is duplicated in the two condition PropertyGroups above, remove the prior ones.

</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion DylibBinder/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion ("1.0.*")]
[assembly: AssemblyVersion ("1.0.0")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
Expand Down
4 changes: 0 additions & 4 deletions DylibBinder/packages.config

This file was deleted.

6 changes: 5 additions & 1 deletion Dynamo/Dynamo.CSLang/CSDelegateTypeDecl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,27 @@

namespace Dynamo.CSLang {
public class CSDelegateTypeDecl : DelegatedSimpleElement, ICSStatement {
public CSDelegateTypeDecl (CSVisibility vis, CSType type, CSIdentifier name, CSParameterList parms)
public CSDelegateTypeDecl (CSVisibility vis, CSType type, CSIdentifier name, CSParameterList parms, bool isUnsafe = false)
{
Visibility = vis;
Type = type != null ? type : CSSimpleType.Void;
Name = Exceptions.ThrowOnNull (name, "name");
Parameters = parms;
IsUnsafe = isUnsafe;
}

public CSVisibility Visibility { get; private set; }
public CSType Type { get; private set; }
public CSIdentifier Name { get; private set; }
public CSParameterList Parameters { get; private set; }
public bool IsUnsafe { get; private set; }

protected override void LLWrite (ICodeWriter writer, object o)
{
writer.BeginNewLine (true);
writer.Write (CSMethod.VisibilityToString (Visibility), false);
if (IsUnsafe)
writer.Write (" unsafe", true);
writer.Write (" delegate ", true);
Type.WriteAll (writer);
writer.Write (' ', true);
Expand Down
16 changes: 11 additions & 5 deletions Dynamo/Dynamo.CSLang/CSFieldDeclaration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,20 @@ public static CSLine VarLine (CSIdentifier name, ICSExpression value)
}

public class CSFieldDeclaration : CSVariableDeclaration {
public CSFieldDeclaration (CSType type, IEnumerable<CSBinding> bindings, CSVisibility vis = CSVisibility.None, bool isStatic = false, bool isReadonly = false)
public CSFieldDeclaration (CSType type, IEnumerable<CSBinding> bindings, CSVisibility vis = CSVisibility.None, bool isStatic = false, bool isReadonly = false, bool isUnsafe = false)
: base (type, bindings)
{
Visibilty = vis;
IsStatic = isStatic;
IsUnsafe = isUnsafe;
if (isReadonly) {
this.Insert (0, new SimpleElement ("readonly"));
this.Insert (1, SimpleElement.Spacer);
}
if (IsUnsafe) {
this.Insert (0, new SimpleElement ("unsafe"));
this.Insert (1, SimpleElement.Spacer);
}
if (isStatic) {
this.Insert (0, new SimpleElement ("static"));
this.Insert (1, SimpleElement.Spacer);
Expand All @@ -72,19 +77,20 @@ public CSFieldDeclaration (CSType type, IEnumerable<CSBinding> bindings, CSVisib
}
}

public CSFieldDeclaration (CSType type, string name, ICSExpression value = null, CSVisibility vis = CSVisibility.None, bool isSatic = false, bool isReadonly = false)
: this (type, new CSIdentifier (name), value, vis, isSatic, isReadonly)
public CSFieldDeclaration (CSType type, string name, ICSExpression value = null, CSVisibility vis = CSVisibility.None, bool isStatic = false, bool isReadonly = false, bool isUnsafe = false)
: this (type, new CSIdentifier (name), value, vis, isStatic, isReadonly, isUnsafe)
{
}

public CSFieldDeclaration (CSType type, CSIdentifier name, ICSExpression value = null, CSVisibility vis = CSVisibility.None, bool isStatic = false, bool isReadOnly = false)
: this (type, new CSBinding [] { new CSBinding (name, value) }, vis, isStatic, isReadOnly)
public CSFieldDeclaration (CSType type, CSIdentifier name, ICSExpression value = null, CSVisibility vis = CSVisibility.None, bool isStatic = false, bool isReadOnly = false, bool isUnsafe = false)
: this (type, new CSBinding [] { new CSBinding (name, value) }, vis, isStatic, isReadOnly, isUnsafe)
{
}


public CSVisibility Visibilty { get; private set; }
public bool IsStatic { get; private set; }
public bool IsUnsafe { get; private set; }

public static CSLine FieldLine (CSType type, CSIdentifier name, ICSExpression value = null, CSVisibility vis = CSVisibility.None, bool isStatic = false)
{
Expand Down
7 changes: 5 additions & 2 deletions Dynamo/Dynamo.CSLang/CSType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public string Name {
public string GenericTypeName { get; private set; }
public CSType [] GenericTypes { get; private set; }
public bool IsArray { get; private set; }
public bool IsPointer { get; private set; }

string GenerateName ()
{
Expand Down Expand Up @@ -145,7 +146,7 @@ static CSSimpleType
tObject = new CSSimpleType ("object"),
tIntPtr = new CSSimpleType ("IntPtr"),
tVoid = new CSSimpleType ("void"),
tByteStar = new CSSimpleType ("byte *"),
tByteStar = new CSSimpleType ("byte").Star,
tType = new CSSimpleType ("Type"),
tVar = new CSSimpleType ("var"),
tNfloat = new CSSimpleType ("nfloat"),
Expand All @@ -158,7 +159,9 @@ public CSSimpleType Star {
if (Name.EndsWith ("[]")) {
throw new NotImplementedException ("Blindly making an array a pointer doesn't do what you think.");
} else {
return new CSSimpleType (Name + " *", false);
var ptrType = new CSSimpleType (Name + " *", false);
ptrType.IsPointer = true;
return ptrType;
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions Dynamo/Dynamo.CSLang/CSUnaryExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ static string OperatorToString (CSUnaryOperator op)
}
}

public static CSUnaryExpression AddressOf (ICSExpression expr)
{
return new CSUnaryExpression (CSUnaryOperator.AddressOf, expr);
}

public static CSUnaryExpression Star (ICSExpression expr)
{
return new CSUnaryExpression (CSUnaryOperator.Indirection, expr);
}

public static CSUnaryExpression Out (CSIdentifier id)
{
return new CSUnaryExpression (CSUnaryOperator.Out, id);
Expand Down
Loading