Skip to content

Commit cb54877

Browse files
Martin LercherMartin Lercher
authored andcommitted
merge
2 parents abc2780 + 443f50a commit cb54877

18 files changed

+384
-156
lines changed

.appveyor.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
image: Visual Studio 2017
22
build_script:
3-
- ps: .\build.ps1
3+
- ps: .\build.ps1
44
test: off
5-
environment:
6-
coveralls_repo_token:
7-
secure: 8AAVbI/45PFVPmrdybK6jSt1I5Yt4nJithGWK4ARTBJZHf6pozIK7ucWMOkwG/4d
5+
after_build:
6+
- "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%"
7+
- pip install codecov
8+
- codecov -f "./artifacts/coverage/coverage.xml"
9+
artifacts:
10+
- path: ./artifacts/nuget/*.nupkg

.codecov.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
coverage:
2+
range: 70..100
3+
round: down
4+
precision: 2

.coveralls.yml

Whitespace-only changes.

.vscode/launch.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
// Use IntelliSense to find out which attributes exist for C# debugging
3+
// Use hover for the description of the existing attributes
4+
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": ".NET Core Launch (console)",
9+
"type": "coreclr",
10+
"request": "launch",
11+
"preLaunchTask": "build",
12+
// If you have changed target frameworks, make sure to update the program path.
13+
"program": "${workspaceRoot}/sample/SampleServer/bin/Debug/netcoreapp1.1/SampleServer.dll",
14+
"args": [],
15+
"cwd": "${workspaceRoot}/sample/SampleServer",
16+
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
17+
"console": "internalConsole",
18+
"stopAtEntry": false,
19+
"internalConsoleOptions": "openOnSessionStart"
20+
},
21+
{
22+
"name": ".NET Core Attach",
23+
"type": "coreclr",
24+
"request": "attach",
25+
"processId": "${command:pickProcess}"
26+
}
27+
]
28+
}

.vscode/tasks.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"version": "0.1.0",
3+
"command": "dotnet",
4+
"isShellCommand": true,
5+
"args": [],
6+
"tasks": [
7+
{
8+
"taskName": "build",
9+
"args": [
10+
"${workspaceRoot}/sample/SampleServer/SampleServer.csproj"
11+
],
12+
"isBuildCommand": true,
13+
"problemMatcher": "$msCompile"
14+
}
15+
]
16+
}

GitVersion.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
assembly-versioning-scheme: MajorMinorPatch
2+
mode: ContinuousDeployment
3+
branches:
4+
master:
5+
tag: alpha

LSP.sln

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{2F323ED5-E
99
EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".config", ".config", "{AE4D7807-6F78-428C-A0D9-914BA583A104}"
1111
ProjectSection(SolutionItems) = preProject
12+
.appveyor.yml = .appveyor.yml
13+
.coveralls.yml = .coveralls.yml
1214
.editorconfig = .editorconfig
15+
.gitattributes = .gitattributes
16+
.gitignore = .gitignore
17+
build.cake = build.cake
18+
build.ps1 = build.ps1
19+
build.sh = build.sh
20+
nuget.config = nuget.config
1321
EndProjectSection
1422
EndProject
1523
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonRpc", "src\JsonRpc\JsonRpc.csproj", "{9AF43FA2-EF35-435E-B59E-724877E44DDA}"

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[![codecov](https://codecov.io/gh/OmniSharp/csharp-language-server-protocol/branch/master/graph/badge.svg)](https://codecov.io/gh/OmniSharp/csharp-language-server-protocol)
2+
3+
4+
## C# Language Server Protocol
5+
This is an implementation of the [Language Server Protocol](https://github.com/Microsoft/language-server-protocol) written entirely in C# for .NET.
6+
7+
This is currently under heavy development and the API's are subject to change.

build.cake

Lines changed: 80 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#tool "nuget:?package=GitVersion.CommandLine"
22
#tool "nuget:?package=xunit.runner.console"
3-
#tool "nuget:?package=OpenCover"
4-
#tool "nuget:?package=coveralls.net"
5-
#addin "Cake.Coveralls";
3+
#tool "nuget:?package=JetBrains.dotCover.CommandLineTools"
4+
#load "tasks/variables.cake";
65

76
var target = Argument("target", "Default");
87
var configuration = Argument("configuration", "Release");
@@ -26,7 +25,11 @@ Task("Build")
2625
.Does(() =>
2726
{
2827
foreach (var project in GetFiles("src/*/*.csproj").Concat(GetFiles("test/*/*.csproj")))
29-
DotNetCoreBuild(project.FullPath);
28+
DotNetCoreBuild(project.FullPath, new DotNetCoreBuildSettings
29+
{
30+
Configuration = configuration,
31+
EnvironmentVariables = GitVersionEnvironmentVariables,
32+
});
3033
});
3134

3235
Task("Test")
@@ -39,90 +42,115 @@ Task("Test")
3942
foreach (var testProject in GetFiles("test/*/*.csproj")) {
4043
StartProcess("dotnet", new ProcessSettings() {
4144
WorkingDirectory = testProject.GetDirectory(),
45+
EnvironmentVariables = GitVersionEnvironmentVariables,
4246
Arguments = new ProcessArgumentBuilder()
4347
.Append("xunit")
4448
.Append("-noshadow")
49+
.AppendSwitch("-configuration", configuration)
4550
.AppendSwitchQuotedSecret("-xml", string.Format("{0}/tests/{1}.xml", artifacts, testProject.GetFilenameWithoutExtension()))
4651
.AppendSwitchQuotedSecret("-html", string.Format("{0}/tests/{1}.html", artifacts, testProject.GetFilenameWithoutExtension()))
4752
});
4853
}
4954
});
5055

5156
Task("Coverage")
52-
.IsDependentOn("Build")
57+
//.IsDependentOn("Build")
5358
.Does(() =>
5459
{
60+
CleanDirectory(artifacts + "/coverage");
5561
EnsureDirectoryExists(artifacts + "/coverage");
5662

5763
foreach (var testProject in GetFiles("test/*/*.csproj")) {
58-
OpenCover(tool => {
64+
DotCoverCover(tool => {
65+
// tool.XUnit2()
66+
// tool.StartProcess(Context.Tools.Resolve("dotnet.exe"), new ProcessSettings() {
67+
// WorkingDirectory = testProject.GetDirectory(),
68+
// Arguments = new ProcessArgumentBuilder()
69+
// .Append("test")
70+
// .AppendSwitch("-c", configuration)
71+
// .Append("--no-build")
72+
// .Append("-f net46")
73+
// });
5974
tool.StartProcess(Context.Tools.Resolve("dotnet.exe"), new ProcessSettings() {
6075
WorkingDirectory = testProject.GetDirectory(),
76+
EnvironmentVariables = GitVersionEnvironmentVariables,
6177
Arguments = new ProcessArgumentBuilder()
62-
.Append("test")
63-
.Append("--no-build")
64-
.Append("-f net46")
65-
78+
.Append("xunit")
79+
.Append("-noshadow")
80+
.Append("-noautoreporters")
81+
// .AppendSwitch("-maxthreads", "1")
82+
.AppendSwitch("-configuration", configuration)
83+
.AppendSwitch("-framework", "net46")
84+
.AppendSwitchQuotedSecret("-xml", string.Format("{0}/tests/{1}.xml", artifacts, testProject.GetFilenameWithoutExtension()))
85+
.AppendSwitchQuotedSecret("-html", string.Format("{0}/tests/{1}.html", artifacts, testProject.GetFilenameWithoutExtension()))
6686
});
6787
},
68-
artifacts + "/coverage/coverage.opencover",
69-
new OpenCoverSettings() {
70-
Register = "user",
71-
MergeOutput = true,
72-
OldStyle = true,
88+
artifacts + "/coverage/coverage-"+ testProject.GetFilenameWithoutExtension() + ".dcvr",
89+
new DotCoverCoverSettings() {
90+
// Register = "user",
91+
// MergeOutput = true,
92+
// OldStyle = true,
93+
TargetWorkingDir = testProject.GetDirectory(),
7394
WorkingDirectory = testProject.GetDirectory(),
95+
// ReportType = DotCoverReportType.XML
7496
}
75-
.WithFilter("+[JsonRpc*]*")
76-
.WithFilter("+[Lsp*]*")
77-
.WithFilter("-[*.Tests]*")
97+
.WithFilter("+:JsonRpc")
98+
.WithFilter("+:Lsp")
7899
);
79100
}
101+
102+
DotCoverMerge(
103+
GetFiles(artifacts + "/coverage/*.dcvr"),
104+
artifacts + "/coverage/coverage.dcvr"
105+
);
106+
107+
DotCoverReport(
108+
artifacts + "/coverage/coverage.dcvr",
109+
new FilePath(artifacts + "/coverage/coverage.html"),
110+
new DotCoverReportSettings {
111+
ReportType = DotCoverReportType.HTML
112+
}
113+
);
114+
115+
DotCoverReport(
116+
artifacts + "/coverage/coverage.dcvr",
117+
new FilePath(artifacts + "/coverage/coverage.xml"),
118+
new DotCoverReportSettings {
119+
ReportType = DotCoverReportType.DetailedXML
120+
}
121+
);
122+
123+
var withBom = System.IO.File.ReadAllText(artifacts + "/coverage/coverage.xml");
124+
System.IO.File.WriteAllText(artifacts + "/coverage/coverage.xml", withBom.Replace(_byteOrderMarkUtf8, ""));
80125
});
81126

82-
Task("Coveralls [AppVeyor]")
83-
.IsDependentOn("Coverage")
84-
.WithCriteria(AppVeyor.IsRunningOnAppVeyor)
127+
Task("Pack")
128+
.IsDependentOn("Build")
85129
.Does(() => {
86-
CoverallsNet(artifacts + "/coverage/coverage.opencover", CoverallsNetReportType.OpenCover, new CoverallsNetSettings()
87-
{
88-
RepoToken = EnvironmentVariable("coveralls_repo_token"),
89-
UseRelativePaths = true,
90-
ServiceName = "Appveyor",
91-
CommitId = EnvironmentVariable("APPVEYOR_REPO_COMMIT"),
92-
CommitBranch = EnvironmentVariable("APPVEYOR_REPO_BRANCH"),
93-
CommitAuthor = EnvironmentVariable("APPVEYOR_REPO_COMMIT_AUTHOR"),
94-
CommitEmail = EnvironmentVariable("APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL"),
95-
CommitMessage = EnvironmentVariable("APPVEYOR_REPO_COMMIT_MESSAGE") + (EnvironmentVariable("APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED") ?? string.Empty),
96-
});
130+
EnsureDirectoryExists(artifacts + "/nuget");
131+
foreach (var project in GetFiles("src/*/*.csproj"))
132+
DotNetCorePack(project.FullPath, new DotNetCorePackSettings
133+
{
134+
NoBuild = true,
135+
Configuration = configuration,
136+
EnvironmentVariables = GitVersionEnvironmentVariables,
137+
OutputDirectory = artifacts + "/nuget"
138+
});
97139
});
98140

99-
Task("Coveralls [TravisCI]")
100-
.IsDependentOn("Coverage")
101-
.WithCriteria(TravisCI.IsRunningOnTravisCI)
141+
Task("GitVersion")
102142
.Does(() => {
103-
CoverallsNet(artifacts + "/coverage/coverage.opencover", CoverallsNetReportType.OpenCover, new CoverallsNetSettings()
104-
{
105-
RepoToken = EnvironmentVariable("coveralls_repo_token"),
106-
UseRelativePaths = true,
107-
ServiceName = "TravisCI",
108-
// CommitId = EnvironmentVariable("APPVEYOR_REPO_COMMIT"),
109-
// CommitBranch = EnvironmentVariable("APPVEYOR_REPO_BRANCH"),
110-
// CommitAuthor = EnvironmentVariable("APPVEYOR_REPO_COMMIT_AUTHOR"),
111-
// CommitEmail = EnvironmentVariable("APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL"),
112-
// CommitMessage = EnvironmentVariable("APPVEYOR_REPO_COMMIT_MESSAGE") + (EnvironmentVariable("APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED") ?? string.Empty),
143+
GitVersion(new GitVersionSettings() {
144+
OutputType = GitVersionOutput.BuildServer
113145
});
114146
});
115147

116-
Task("Coveralls")
117-
.IsDependentOn("Coverage")
118-
.IsDependentOn("Coveralls [TravisCI]")
119-
.IsDependentOn("Coveralls [AppVeyor]");
120-
121-
122148
Task("Default")
149+
.IsDependentOn("GitVersion")
123150
.IsDependentOn("Clean")
124151
.IsDependentOn("Build")
125152
.IsDependentOn("Test")
126-
.IsDependentOn("Coveralls");
153+
.IsDependentOn("Coverage")
154+
.IsDependentOn("Pack");
127155

128156
RunTarget(target);

nuget.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="Build Packages" value="https://www.myget.org/F/c037199d-41df-4567-b966-25ff65324688/api/v3/index.json" />
5+
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
6+
</packageSources>
7+
</configuration>

0 commit comments

Comments
 (0)