Skip to content

Commit 48f73d0

Browse files
committed
Get build working on linux via dotnet CLI
This required upgrading NB.GV and CodeGeneration.Roslyn to their CoreCLR-compatible latest versions.
1 parent 920e596 commit 48f73d0

File tree

6 files changed

+21
-9
lines changed

6 files changed

+21
-9
lines changed

CodeGeneration/CodeGeneration.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="CodeGeneration.Roslyn" Version="0.2.10" />
10-
<PackageReference Include="Nerdbank.GitVersioning" Version="1.6.19-beta" />
9+
<PackageReference Include="CodeGeneration.Roslyn" Version="$(CodeGenerationRoslynVersion)" />
1110
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.1.548" />
1211
</ItemGroup>
1312
</Project>

CodeGeneration/OfferFriendlyInteropOverloadsGenerator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public OfferFriendlyInteropOverloadsGenerator(AttributeData data)
3030
{
3131
}
3232

33-
public async Task<SyntaxList<MemberDeclarationSyntax>> GenerateAsync(MemberDeclarationSyntax applyTo, Document document, IProgress<Diagnostic> progress, CancellationToken cancellationToken)
33+
public Task<SyntaxList<MemberDeclarationSyntax>> GenerateAsync(MemberDeclarationSyntax applyTo, CSharpCompilation compilation, IProgress<Diagnostic> progress, CancellationToken cancellationToken)
3434
{
3535
Func<ParameterSyntax, AttributeListSyntax, MarshaledParameter> findMarshalAttribute = (p, al) =>
3636
{
@@ -47,7 +47,7 @@ public async Task<SyntaxList<MemberDeclarationSyntax>> GenerateAsync(MemberDecla
4747
return new MarshaledParameter(p, customMarshaler, friendlyType);
4848
};
4949

50-
var semanticModel = await document.GetSemanticModelAsync(cancellationToken);
50+
var semanticModel = compilation.GetSemanticModel(applyTo.SyntaxTree);
5151
var type = (ClassDeclarationSyntax)applyTo;
5252
var generatedType = type
5353
.WithMembers(SyntaxFactory.List<MemberDeclarationSyntax>())
@@ -87,7 +87,7 @@ from al in p.AttributeLists
8787
}
8888
}
8989

90-
return SyntaxFactory.List<MemberDeclarationSyntax>().Add(generatedType);
90+
return Task.FromResult(SyntaxFactory.List<MemberDeclarationSyntax>().Add(generatedType));
9191
}
9292

9393
private static SyntaxTokenList RemoveModifier(SyntaxTokenList list, params SyntaxKind[] modifiers)

CodeGenerationAttributes/CodeGenerationAttributes.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="CodeGeneration.Roslyn.Attributes" Version="0.2.10" />
11-
<PackageReference Include="Nerdbank.GitVersioning" Version="1.6.19-beta" />
10+
<PackageReference Include="CodeGeneration.Roslyn.Attributes" Version="$(CodeGenerationRoslynVersion)" />
1211
</ItemGroup>
1312
</Project>

Directory.Build.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project>
2+
<PropertyGroup>
3+
<CodeGenerationRoslynVersion>0.3.4</CodeGenerationRoslynVersion>
4+
</PropertyGroup>
5+
6+
<ItemGroup>
7+
<PackageReference Include="Nerdbank.GitVersioning" Version="1.6.25" PrivateAssets="all" />
8+
</ItemGroup>
9+
</Project>

Directory.Build.targets

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project>
2+
<PropertyGroup>
3+
<PublicSign Condition=" '$(AssemblyOriginatorKeyFile)' != '' and '$(MSBuildRuntimeType)' == 'Core' ">true</PublicSign>
4+
</PropertyGroup>
5+
</Project>
6+

LibGit2Sharp/LibGit2Sharp.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
</ItemGroup>
3333
<ItemGroup>
3434
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="[1.0.165]" />
35-
<PackageReference Include="Nerdbank.GitVersioning" Version="1.6.19-beta" PrivateAssets="all" />
36-
<PackageReference Include="CodeGeneration.Roslyn.BuildTime" Version="0.2.10" PrivateAssets="all" />
35+
<PackageReference Include="CodeGeneration.Roslyn.BuildTime" Version="$(CodeGenerationRoslynVersion)" PrivateAssets="all" />
3736
<PackageReference Include="System.Security.SecureString" Version="4.0.0" Condition=" '$(TargetFramework)' == 'netstandard1.3' " />
3837
<PackageReference Include="System.IO.UnmanagedMemoryStream" Version="4.0.1" Condition=" '$(TargetFramework)' == 'netstandard1.3' " />
3938
<PackageReference Include="System.Diagnostics.TraceSource" Version="4.0.0" Condition=" '$(TargetFramework)' == 'netstandard1.3' " />

0 commit comments

Comments
 (0)