Skip to content

Commit

Permalink
Merge pull request #807 from xamarin/cs-version
Browse files Browse the repository at this point in the history
Bump .NET version to 7.0
  • Loading branch information
stephen-hawley authored Jan 29, 2024
2 parents 2c1aef0 + 16f90dd commit 3b06585
Show file tree
Hide file tree
Showing 96 changed files with 3,962 additions and 5,387 deletions.
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>
<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" />
</ItemGroup>
<PropertyGroup>
<LangVersion>latest</LangVersion>
</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

0 comments on commit 3b06585

Please sign in to comment.