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

Initial working #11

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions Source/chocolatey-language-server/Engine/TextPositions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
using System;
using System.Collections.Generic;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
using Range = OmniSharp.Extensions.LanguageServer.Protocol.Models.Range;

namespace Chocolatey.Language.Server.Engine
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

Expand Down
21 changes: 21 additions & 0 deletions nuspec/nuget/chocolatey-lsp.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>chocolatey-lsp-win64</id>
<version>$version$</version>
<title>Codecov</title>
<authors>Larz White, Kim J. Nordmo</authors>
<owners>Larz White, Kim J. Nordmo</owners>
<license type="expression">MIT</license>
<projectUrl>https://github.com/codecov/codecov-exe</projectUrl>
<iconUrl>https://cdn.jsdelivr.net/gh/codecov/media@0953f4e0d5315fb6d526a248bc88e1bc16506a37/logos/pink.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<summary>Codecov global executable uploader.</summary>
<description>
Codecov global executable uploader for PowerShell and .NET applications/libraries. Supports Windows, Linux and OSX.
</description>
<copyright>Copyright (c) 2017-Present Larz White, Kim J. Nordmo</copyright>
<releaseNotes>All release notes for Codecov can be found on the GitHub site - https://github.com/codecov/codecov-exe/releases/tag/$version$</releaseNotes>
<tags>coverage codecov</tags>
</metadata>
</package>
78 changes: 78 additions & 0 deletions recipe.cake
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,82 @@ ToolSettings.SetToolSettings(context: Context,
testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*",
testCoverageExcludeByFile: "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs");

var NativeRuntimes = new Dictionary<PlatformFamily, string>
{
[PlatformFamily.Windows] = "win-x64",
[PlatformFamily.Linux] = "linux-x64",
[PlatformFamily.OSX] = "osx-x64",
};

Task("DotNetCore-Publish")
.IsDependeeOf("Create-NuGet-Packages")
.IsDependentOn("DotNetCore-Test")
.Does(() =>
{
foreach(var runtime in NativeRuntimes)
{
var runtimeName = runtime.Value;

var settings = new DotNetCorePublishSettings
{
Framework = "netcoreapp3.1",
Runtime = runtimeName,
NoRestore = false,
Configuration = BuildParameters.Configuration,
OutputDirectory = BuildParameters.Paths.Directories.TempBuild.Combine("Native").Combine(runtimeName),
MSBuildSettings = new DotNetCoreMSBuildSettings()
.WithProperty("Version", BuildParameters.Version.SemVersion)
.WithProperty("AssemblyVersion", BuildParameters.Version.Version)
.WithProperty("FileVersion", BuildParameters.Version.Version)
.WithProperty("AssemblyInformationalVersion", BuildParameters.Version.InformationalVersion)
};

settings.ArgumentCustomization =
arg => arg
.Append("/p:PublishTrimmed=true");

DotNetCorePublish(BuildParameters.SolutionFilePath.FullPath, settings);
}
});

((CakeTask)BuildParameters.Tasks.CreateNuGetPackagesTask.Task).Actions.Clear();

BuildParameters.Tasks.CreateNuGetPackagesTask.Does(() =>
{
var nuspecFiles = GetFiles(BuildParameters.Paths.Directories.NugetNuspecDirectory + "/**/*.nuspec");

EnsureDirectoryExists(BuildParameters.Paths.Directories.NuGetPackages);

foreach (var nuspecFile in nuspecFiles)
{
foreach (var runtime in NativeRuntimes)
{
var runtimeName = runtime.Value;
var baseDirectory = BuildParameters.Paths.Directories.TempBuild.Combine("Native").Combine(runtimeName);
if (!DirectoryExists(baseDirectory))
{
Warning("Published directory for " + runtimeName + "Does not exist");
continue;
}

NuGetPack(nuspecFile, new NuGetPackSettings
{
Id = nuspecFile.GetFilenameWithoutExtension() + ".Runtime." + runtimeName,
Version = BuildParameters.Version.SemVersion,
BasePath = baseDirectory,
OutputDirectory = BuildParameters.Paths.Directories.NuGetPackages,
Symbols = false,
NoPackageAnalysis = true,
Files = GetFiles(baseDirectory + "/*").Select(f => new NuSpecContent
{
Source = f.FullPath,
Target = string.Format("tools/{0}/{1}", runtimeName, f.GetFilename())
}).ToList()
});
}
}
});



Build.RunDotNetCore();