diff --git a/.travis.yml b/.travis.yml index bbcb8c496d..c1ced7cb87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ deploy: api_key: secure: N9hansErZKHl7G5Ed/hcBgwcvLuRjB7YAskAvSAYB+luacV6rSK7Vlm/4NyjaZCwWv5wOdBphle2S4yZLRDTdMwLrdQWwWYeZI60kE22c1amKJaf6j5ai2u/P3bt55klQ2yO2U/LacwHVoRtJlVdwSAXuDQ3zMd88VbBModQyxE= file_glob: true - file: artifacts/package/*${TRAVIS_OS_NAME}*.tar.gz + file: artifacts/package/*.tar.gz skip_cleanup: true on: repo: OmniSharp/omnisharp-roslyn diff --git a/build.cake b/build.cake index c27be6791b..e37d7c06b5 100644 --- a/build.cake +++ b/build.cake @@ -423,13 +423,13 @@ Task("OnlyPublish") } var buildIdentifier = $"{runtimeShort}-{framework}"; - // Linux + net451 is renamed to Mono - if (runtimeShort.Contains("ubuntu-") && framework.Equals("net451")) + // Travis/Linux + default + net451 is renamed to Mono + if (string.Equals(EnvironmentVariable("TRAVIS_OS_NAME"), "linux") && runtime.Equals("default") && framework.Equals("net451")) { buildIdentifier ="linux-mono"; } - // No need to package for + net451 - else if (!runtimeShort.Contains("win7-") && framework.Equals("net451")) + // No need to archive for other Travis + net451 combinations + else if (EnvironmentVariable("TRAVIS_OS_NAME") != null && framework.Equals("net451")) { continue; } diff --git a/src/OmniSharp.MSBuild/MSBuildLogForwarder.cs b/src/OmniSharp.MSBuild/MSBuildLogForwarder.cs index 79966351c1..e34ba84943 100644 --- a/src/OmniSharp.MSBuild/MSBuildLogForwarder.cs +++ b/src/OmniSharp.MSBuild/MSBuildLogForwarder.cs @@ -1,4 +1,3 @@ -#if DNX451 using System; using System.Collections.Generic; using Microsoft.Extensions.Logging; @@ -72,5 +71,4 @@ private void OnWarning(object sender, Microsoft.Build.Framework.BuildWarningEven }); } } -} -#endif +} \ No newline at end of file diff --git a/src/OmniSharp.MSBuild/MSBuildProjectSystem.cs b/src/OmniSharp.MSBuild/MSBuildProjectSystem.cs index bdd9304ff5..3ebdeb90be 100644 --- a/src/OmniSharp.MSBuild/MSBuildProjectSystem.cs +++ b/src/OmniSharp.MSBuild/MSBuildProjectSystem.cs @@ -127,9 +127,7 @@ public void Initalize(IConfiguration configuration) } var compilationOptions = new CSharpCompilationOptions(projectFileInfo.OutputKind); -#if DNX451 compilationOptions = compilationOptions.WithAssemblyIdentityComparer(DesktopAssemblyIdentityComparer.Default); -#endif if (projectFileInfo.AllowUnsafe) { @@ -317,10 +315,8 @@ private void UpdateProject(ProjectFileInfo projectFileInfo) { continue; } -#if DNX451 var analyzerReference = new AnalyzerFileReference(analyzerPath, new SimpleAnalyzerAssemblyLoader()); project.AddAnalyzerReference(analyzerReference); -#endif } } diff --git a/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs b/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs index dca3053878..1d1f3a62b7 100644 --- a/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs +++ b/src/OmniSharp.MSBuild/ProjectFile/ProjectFileInfo.cs @@ -3,10 +3,8 @@ using System.IO; using System.Linq; using System.Runtime.Versioning; -#if DNX451 using Microsoft.Build.BuildEngine; using Microsoft.Build.Evaluation; -#endif using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.Extensions.Logging; @@ -54,7 +52,6 @@ public static ProjectFileInfo Create(MSBuildOptions options, ILogger logger, str var projectFileInfo = new ProjectFileInfo(); projectFileInfo.ProjectFilePath = projectFilePath; -#if DNX451 if (!PlatformHelper.IsMono) { var properties = new Dictionary @@ -215,9 +212,6 @@ public static ProjectFileInfo Create(MSBuildOptions options, ILogger logger, str projectFileInfo.DefineConstants = defineConstants.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries).Distinct().ToList(); } } -#else - // TODO: Shell out to msbuild/xbuild here? -#endif return projectFileInfo; } @@ -240,7 +234,6 @@ public static ProjectFileInfo Create(MSBuildOptions options, ILogger logger, str } } - #if DNX451 static class DictionaryExt { public static string GetPropertyValue(this Dictionary dict, string key) @@ -250,5 +243,4 @@ public static string GetPropertyValue(this Dictionary dic : null; } } - #endif } diff --git a/src/OmniSharp.Nuget/OmniSharpSourceRepositoryProvider.cs b/src/OmniSharp.Nuget/OmniSharpSourceRepositoryProvider.cs index 879febba9c..bfdae5efea 100644 --- a/src/OmniSharp.Nuget/OmniSharpSourceRepositoryProvider.cs +++ b/src/OmniSharp.Nuget/OmniSharpSourceRepositoryProvider.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis; -#if DNX451 +#if NET451 using NuGet.Protocol.Core.Types; using NuGet.Configuration; using NuGet.Protocol.Core.v2; @@ -11,7 +11,7 @@ namespace OmniSharp.NuGet { -#if DNX451 +#if NET451 public class OmniSharpSourceRepositoryProvider : ISourceRepositoryProvider { private static PackageSource[] DefaultPrimarySources = { diff --git a/src/OmniSharp.Nuget/Services/PackageSearchService.cs b/src/OmniSharp.Nuget/Services/PackageSearchService.cs index 5d3aebd49c..fac6e1a25e 100644 --- a/src/OmniSharp.Nuget/Services/PackageSearchService.cs +++ b/src/OmniSharp.Nuget/Services/PackageSearchService.cs @@ -7,7 +7,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Recommendations; using Microsoft.CodeAnalysis.Text; -#if DNX451 +#if NET451 using NuGet.Logging; using NuGet.Packaging.Core; using NuGet.Protocol.Core.Types; @@ -20,7 +20,7 @@ namespace OmniSharp { -#if DNX451 +#if NET451 [OmniSharpHandler(OmnisharpEndpoints.PackageSearch, "NuGet")] public class PackageSearchService : RequestHandler { diff --git a/src/OmniSharp.Nuget/Services/PackageSourceService.cs b/src/OmniSharp.Nuget/Services/PackageSourceService.cs index 6cd709712d..210b869681 100644 --- a/src/OmniSharp.Nuget/Services/PackageSourceService.cs +++ b/src/OmniSharp.Nuget/Services/PackageSourceService.cs @@ -7,7 +7,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Recommendations; using Microsoft.CodeAnalysis.Text; -#if DNX451 +#if NET451 using NuGet.Logging; using NuGet.Packaging.Core; using NuGet.Protocol.Core.Types; @@ -20,7 +20,7 @@ namespace OmniSharp { -#if DNX451 +#if NET451 [OmniSharpHandler(OmnisharpEndpoints.PackageSource, "NuGet")] public class PackageSourceService : RequestHandler { diff --git a/src/OmniSharp.Nuget/Services/PackageVersionService.cs b/src/OmniSharp.Nuget/Services/PackageVersionService.cs index adc92c609e..92bc7272a5 100644 --- a/src/OmniSharp.Nuget/Services/PackageVersionService.cs +++ b/src/OmniSharp.Nuget/Services/PackageVersionService.cs @@ -7,7 +7,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Recommendations; using Microsoft.CodeAnalysis.Text; -#if DNX451 +#if NET451 using NuGet.Logging; using NuGet.Packaging.Core; using NuGet.Protocol.Core.Types; @@ -20,7 +20,7 @@ namespace OmniSharp { -#if DNX451 +#if NET451 [OmniSharpHandler(OmnisharpEndpoints.PackageVersion, "NuGet")] public class PackageVersionService : RequestHandler { diff --git a/src/OmniSharp.Roslyn.CSharp/Workers/Refactoring/FixUsings.cs b/src/OmniSharp.Roslyn.CSharp/Workers/Refactoring/FixUsings.cs index 9aa0c20acf..3e6a9d42de 100644 --- a/src/OmniSharp.Roslyn.CSharp/Workers/Refactoring/FixUsings.cs +++ b/src/OmniSharp.Roslyn.CSharp/Workers/Refactoring/FixUsings.cs @@ -39,7 +39,7 @@ public async Task FixUsings(OmnisharpWorkspace workspace, IEn _semanticModel = await document.GetSemanticModelAsync(); await AddMissingUsings(codeActionProviders); await RemoveUsings(codeActionProviders); -#if DNX451 +#if NET451 await SortUsings(); #endif await TryAddLinqQuerySyntax(); @@ -167,7 +167,7 @@ private async Task RemoveUsings(IEnumerable codeActionProvi return; } -#if DNX451 +#if NET451 private async Task SortUsings() { // Sort usings