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

Update libClangSharp to 10.0.2-beta and improve some codegen handling #162

Merged
merged 13 commits into from
Jul 23, 2020
Merged
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
8 changes: 8 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,12 @@
<UseSharedCompilation>true</UseSharedCompilation>
</PropertyGroup>

<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" IsImplicitlyDefined="true" PrivateAssets="all" />
</ItemGroup>

</Project>
3 changes: 2 additions & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
<!-- Package versions for package references across all projects -->
<ItemGroup>
<PackageReference Update="libClang" Version="10.0.0" />
<PackageReference Update="libClangSharp" Version="10.0.1-beta2" />
<PackageReference Update="libClangSharp" Version="10.0.2-beta2" />
<PackageReference Update="Microsoft.Bcl.HashCode" Version="1.1.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
<PackageReference Update="System.CommandLine" Version="2.0.0-beta1.20253.1" />
<PackageReference Update="System.Memory" Version="4.5.4" />
<PackageReference Update="xunit" Version="2.4.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.freebsd.11-x64</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.freebsd.11-x86</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.linux-arm</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.linux-arm64</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.osx-x64</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.sles-x64</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.ubuntu.16.04-x64</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.ubuntu.18.04-x64</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.ubuntu.20.04-x64</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.win-x64</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp.runtime.win-x86</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
2 changes: 1 addition & 1 deletion packages/libClangSharp/libClangSharp/libClangSharp.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.12">
<id>libClangSharp</id>
<version>10.0.1-beta2</version>
<version>10.0.2-beta2</version>
<authors>Microsoft and Contributors</authors>
<owners>Microsoft and Contributors</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
Expand Down
22 changes: 11 additions & 11 deletions packages/libClangSharp/libClangSharp/runtime.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,57 @@
"runtimes": {
"freebsd.11-x64": {
"libClangSharp": {
"libClangSharp.runtime.freebsd.11-x64": "10.0.1-beta2"
"libClangSharp.runtime.freebsd.11-x64": "10.0.2-beta2"
}
},
"freebsd.11-x86": {
"libClangSharp": {
"libClangSharp.runtime.freebsd.11-x86": "10.0.1-beta2"
"libClangSharp.runtime.freebsd.11-x86": "10.0.2-beta2"
}
},
"linux-arm": {
"libClangSharp": {
"libClangSharp.runtime.linux-arm": "10.0.1-beta2"
"libClangSharp.runtime.linux-arm": "10.0.2-beta2"
}
},
"linux-arm64": {
"libClangSharp": {
"libClangSharp.runtime.linux-arm64": "10.0.1-beta2"
"libClangSharp.runtime.linux-arm64": "10.0.2-beta2"
}
},
"osx-x64": {
"libClangSharp": {
"libClangSharp.runtime.osx-x64": "10.0.1-beta2"
"libClangSharp.runtime.osx-x64": "10.0.2-beta2"
}
},
"sles-x64": {
"libClangSharp": {
"libClangSharp.runtime.sles-x64": "10.0.1-beta2"
"libClangSharp.runtime.sles-x64": "10.0.2-beta2"
}
},
"ubuntu.16.04-x64": {
"libClangSharp": {
"libClangSharp.runtime.ubuntu.16.04-x64": "10.0.1-beta2"
"libClangSharp.runtime.ubuntu.16.04-x64": "10.0.2-beta2"
}
},
"ubuntu.18.04-x64": {
"libClangSharp": {
"libClangSharp.runtime.ubuntu.18.04-x64": "10.0.1-beta2"
"libClangSharp.runtime.ubuntu.18.04-x64": "10.0.2-beta2"
}
},
"ubuntu.20.04-x64": {
"libClangSharp": {
"libClangSharp.runtime.ubuntu.20.04-x64": "10.0.1-beta2"
"libClangSharp.runtime.ubuntu.20.04-x64": "10.0.2-beta2"
}
},
"win-x64": {
"libClangSharp": {
"libClangSharp.runtime.win-x64": "10.0.1-beta2"
"libClangSharp.runtime.win-x64": "10.0.2-beta2"
}
},
"win-x86": {
"libClangSharp": {
"libClangSharp.runtime.win-x86": "10.0.1-beta2"
"libClangSharp.runtime.win-x86": "10.0.2-beta2"
}
}
}
Expand Down
26 changes: 16 additions & 10 deletions sources/ClangSharp.PInvokeGenerator/OutputBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,34 +119,40 @@ public void WriteIndentedLine<T>(T value)
WriteLine(value);
}

public void WriteLine()
public void WriteLine<T>(T value)
{
_contents.Add(_currentLine.ToString());
_currentLine.Clear();
Write(value);
WriteNewline();
}

public void WriteLine<T>(T value)
public void WriteNewline()
{
Write(value);
WriteLine();
_contents.Add(_currentLine.ToString());
_currentLine.Clear();
NeedsNewline = false;
}

public void WriteNewlineIfNeeded()
{
if (NeedsNewline)
{
WriteLine();
WriteNewline();
}
NeedsNewline = false;
}

public void WriteSemicolon()
{
Write(';');
NeedsSemicolon = false;
NeedsNewline = true;
}

public void WriteSemicolonIfNeeded()
{
if (NeedsSemicolon)
{
WriteLine(';');
WriteSemicolon();
}
NeedsSemicolon = true;
}
}
}
Loading