Skip to content

Commit

Permalink
SLOMNI-15 Bring back changes from Sonar patch
Browse files Browse the repository at this point in the history
  • Loading branch information
jblievremont committed Aug 27, 2024
1 parent 2bd9929 commit dcdb117
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 91 deletions.
96 changes: 9 additions & 87 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -504,76 +504,25 @@ Task("PublishNet6Builds")
{
foreach (var project in buildPlan.HostProjects)
{
if (publishAll)
{
if (Platform.Current.IsWindows)
{
PublishBuild(project, env, buildPlan, configuration, "win7-x86", "net6.0");
PublishBuild(project, env, buildPlan, configuration, "win7-x64", "net6.0");
PublishBuild(project, env, buildPlan, configuration, "win10-arm64", "net6.0");
}
else if (Platform.Current.IsMacOS)
{
PublishBuild(project, env, buildPlan, configuration, "osx-x64", "net6.0");
PublishBuild(project, env, buildPlan, configuration, "osx-arm64", "net6.0");
}
else
{
PublishBuild(project, env, buildPlan, configuration, "linux-x64", "net6.0");
PublishBuild(project, env, buildPlan, configuration, "linux-arm64", "net6.0");
PublishBuild(project, env, buildPlan, configuration, "linux-musl-x64", "net6.0");
PublishBuild(project, env, buildPlan, configuration, "linux-musl-arm64", "net6.0");
}
}
else if (Platform.Current.IsWindows)
{
if (Platform.Current.IsX86)
{
PublishBuild(project, env, buildPlan, configuration, "win7-x86", "net6.0");
}
else if (Platform.Current.IsX64)
{
PublishBuild(project, env, buildPlan, configuration, "win7-x64", "net6.0");
}
else
{
PublishBuild(project, env, buildPlan, configuration, "win10-arm64", "net6.0");
}
}
else
{
if (Platform.Current.IsMacOS)
{
PublishBuild(project, env, buildPlan, configuration, "osx-x64", "net6.0");
PublishBuild(project, env, buildPlan, configuration, "osx-arm64", "net6.0");
}
else
{
PublishBuild(project, env, buildPlan, configuration, "linux-x64", "net6.0");
PublishBuild(project, env, buildPlan, configuration, "linux-arm64", "net6.0");
PublishBuild(project, env, buildPlan, configuration, "linux-musl-x64", "net6.0");
PublishBuild(project, env, buildPlan, configuration, "linux-musl-arm64", "net6.0");
}
}
PublishBuild(project, env, buildPlan, configuration, "net6.0");
}
});

string PublishBuild(string project, BuildEnvironment env, BuildPlan plan, string configuration, string rid, string framework)
string PublishBuild(string project, BuildEnvironment env, BuildPlan plan, string configuration, string framework)
{
var projectName = project + ".csproj";
var projectFileName = CombinePaths(env.Folders.Source, project, projectName);
var outputFolder = CombinePaths(env.Folders.ArtifactsPublish, project, rid, framework);
var outputFolder = CombinePaths(env.Folders.ArtifactsPublish, project, framework);

Information("Publishing {0} for {1}...", projectName, rid);
Information("Publishing {0} for {1}...", projectName, framework);

try
{
var publishSettings = new DotNetPublishSettings()
{
Framework = framework,
Runtime = rid, // TODO: With everything today do we need to publish this with a rid? This appears to be legacy bit when we used to push for all supported dotnet core rids.
PublishReadyToRun = true, // Improve startup performance by applying some AOT compilation
PublishReadyToRun = false, // Decrease size by NOT applying some AOT compilation
PublishTrimmed = false, // FIXME would be great to manage to trim
SelfContained = false, // Since we are specifying a runtime identifier this defaults to true. We don't need to ship a runtime for net6 because we require the .NET SDK to be installed.
Configuration = configuration,
OutputDirectory = outputFolder,
Expand All @@ -592,14 +541,14 @@ string PublishBuild(string project, BuildEnvironment env, BuildPlan plan, string
}
catch
{
Error($"Failed to publish {project} for {rid}");
Error($"Failed to publish {project} for {framework}");
throw;
}

CopyExtraDependencies(env, outputFolder);
AddOmniSharpBindingRedirects(outputFolder);

var platformFolder = framework != "net472" ? $"{rid}-{framework}" : rid;
var platformFolder = $"{framework}";
Package(project, platformFolder, outputFolder, env.Folders.ArtifactsPackage, env.Folders.DeploymentPackage);

return outputFolder;
Expand All @@ -612,34 +561,7 @@ Task("PublishWindowsBuilds")
{
foreach (var project in buildPlan.HostProjects)
{
string outputFolder;
if (publishAll)
{
var outputFolderX86 = PublishBuild(project, env, buildPlan, configuration, "win7-x86", "net472");
var outputFolderX64 = PublishBuild(project, env, buildPlan, configuration, "win7-x64", "net472");
var outputFolderArm64 = PublishBuild(project, env, buildPlan, configuration, "win10-arm64", "net472");
outputFolder = Platform.Current.IsX86
? outputFolderX86
: Platform.Current.IsX64
? outputFolderX64
: outputFolderArm64;
}
else if (Platform.Current.IsX86)
{
outputFolder = PublishBuild(project, env, buildPlan, configuration, "win7-x86", "net472");
}
else if (Platform.Current.IsX64)
{
outputFolder = PublishBuild(project, env, buildPlan, configuration, "win7-x64", "net472");
}
else
{
outputFolder = PublishBuild(project, env, buildPlan, configuration, "win10-arm64", "net472");
}
CreateRunScript(project, outputFolder, env.Folders.ArtifactsScripts);
string outputFolder = PublishBuild(project, env, buildPlan, configuration, "net472");
}
});

Expand Down
8 changes: 4 additions & 4 deletions scripts/common.cake
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,10 @@ public class BuildEnvironment

return new GitVersion
{
NuGetVersion = "0.0.1-local",
AssemblySemVer = "0.0.1.0",
InformationalVersion = "0.0.1-local",
SemVer = "0.0.1-local"
NuGetVersion = "1.39.10",
AssemblySemVer = "1.39.10.0",
InformationalVersion = "1.39.10",
SemVer = "1.39.10"
};
}
}
Expand Down
1 change: 1 addition & 0 deletions src/OmniSharp.Benchmarks/OmniSharp.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<TargetFramework>net472</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>9.0</LangVersion>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/OmniSharp.Cake/OmniSharp.Cake.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/OmniSharp.DotNetTest/OmniSharp.DotNetTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/OmniSharp.Host/OmniSharp.Host.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<RootNamespace>OmniSharp</RootNamespace>
<IsPackable>true</IsPackable>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/OmniSharp.Http.Driver/OmniSharp.Http.Driver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<RuntimeFrameworkVersion>6.0.0-preview.7.21317.1</RuntimeFrameworkVersion>
<RollForward>LatestMajor</RollForward>
<SkipHostDlls Condition="'$(TargetFramework)' != 'net472'">true</SkipHostDlls>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/OmniSharp.Http/OmniSharp.Http.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net472'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<!-- Always run on the latest runtime installed. -->
<RuntimeFrameworkVersion>6.0.0-preview.7.21317.1</RuntimeFrameworkVersion>
<RollForward>LatestMajor</RollForward>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/OmniSharp.MSBuild/OmniSharp.MSBuild.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<IsPackable>true</IsPackable>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/OmniSharp.Plugins/OmniSharp.Plugins.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/OmniSharp.Roslyn.CSharp/OmniSharp.Roslyn.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<IsPackable>true</IsPackable>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/OmniSharp.Roslyn/OmniSharp.Roslyn.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<IsPackable>true</IsPackable>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/OmniSharp.Script/OmniSharp.Script.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/OmniSharp.Shared/OmniSharp.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<RootNamespace>OmniSharp</RootNamespace>
<IsPackable>true</IsPackable>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/OmniSharp.Stdio.Driver/OmniSharp.Stdio.Driver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<RuntimeFrameworkVersion>6.0.0-preview.7.21317.1</RuntimeFrameworkVersion>
<RollForward>LatestMajor</RollForward>
<SkipHostDlls Condition="'$(TargetFramework)' != 'net472'">true</SkipHostDlls>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/OmniSharp.Stdio/OmniSharp.Stdio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<PlatformTarget>AnyCPU</PlatformTarget>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit dcdb117

Please sign in to comment.