Skip to content

Commit dcd533d

Browse files
Merge pull request #19 from OmniSharp/ready-nuget
Ready nuget, setup travis and a few other things...
2 parents 4389c7b + 585416f commit dcd533d

File tree

406 files changed

+1032
-1035
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

406 files changed

+1032
-1035
lines changed

.appveyor.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
image: Visual Studio 2017
2+
environment:
3+
nuget_org_apikey:
4+
secure: lFaEHVRMsSWTveDH/DuLl4+hv+O0i4qLkbhW3aCgzq0oCrOuV+0TSEkqe6aiHuNX
5+
myget_apikey:
6+
secure: eoBrSWDtOXSxyUOoCSTyQCeDkvU18W67pE3w26viEUBRi1K4Tru0cTjUtDUB7l9V
27
build_script:
38
- ps: .\build.ps1
49
test: off
@@ -8,5 +13,31 @@ after_build:
813
- codecov -f "./artifacts/coverage/coverage.xml"
914
artifacts:
1015
- path: ./artifacts/nuget/*.nupkg
16+
cache:
17+
- tools -> tools/packages.config
1118
nuget:
1219
project_feed: true
20+
deploy:
21+
- provider: NuGet
22+
server: https://www.myget.org/F/omnisharp/api/v3/index.json
23+
api_key:
24+
secure: eoBrSWDtOXSxyUOoCSTyQCeDkvU18W67pE3w26viEUBRi1K4Tru0cTjUtDUB7l9V
25+
skip_symbols: true
26+
artifact: /.*\.nupkg/
27+
on:
28+
branch: master
29+
- provider: NuGet
30+
api_key:
31+
secure: lFaEHVRMsSWTveDH/DuLl4+hv+O0i4qLkbhW3aCgzq0oCrOuV+0TSEkqe6aiHuNX
32+
skip_symbols: false
33+
artifact: /.*\.nupkg/
34+
on:
35+
appveyor_repo_tag: true
36+
- provider: NuGet
37+
server: https://www.myget.org/F/omnisharp/api/v3/index.json
38+
api_key:
39+
secure: eoBrSWDtOXSxyUOoCSTyQCeDkvU18W67pE3w26viEUBRi1K4Tru0cTjUtDUB7l9V
40+
skip_symbols: true
41+
artifact: /.*\.nupkg/
42+
on:
43+
appveyor_repo_tag: true

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[*]
2-
end_of_line = crlf
32
charset = utf-8
43
indent_style = space
54
indent_size = 4

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ buildlog
3434

3535
# Build folder
3636
tools/*/
37-
tools/packages.config.md5sum
37+
/tools/packages.config.md5sum

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
language: csharp
2+
sudo: required
3+
dist: trusty
4+
mono: latest
5+
dotnet: 2.0.0
6+
os:
7+
- linux
8+
cache:
9+
directories:
10+
- tools
11+
git:
12+
depth: 1000
13+
script:
14+
- chmod 755 ./build.sh
15+
- ./build.sh

build.cake

Lines changed: 81 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -14,91 +14,87 @@ Task("Clean")
1414
CleanDirectory(artifacts);
1515
});
1616

17-
Task("Restore")
17+
Task("Restore (Unix)")
18+
.WithCriteria(IsRunningOnUnix)
1819
.Does(() =>
1920
{
20-
DotNetCoreRestore();
21+
MSBuild("./LSP.sln", settings => settings.SetConfiguration(configuration).WithTarget("Restore"));
2122
});
2223

23-
Task("Build")
24-
.IsDependentOn("Restore")
24+
Task("Restore (Windows)")
25+
.WithCriteria(IsRunningOnWindows)
2526
.Does(() =>
2627
{
27-
foreach (var project in GetFiles("src/*/*.csproj").Concat(GetFiles("test/*/*.csproj")))
28-
DotNetCoreBuild(project.FullPath, new DotNetCoreBuildSettings
29-
{
30-
Configuration = configuration,
31-
EnvironmentVariables = GitVersionEnvironmentVariables,
32-
});
28+
DotNetCoreRestore();
3329
});
3430

35-
Task("Test")
31+
Task("Restore")
32+
.IsDependentOn("Restore (Unix)")
33+
.IsDependentOn("Restore (Windows)");
34+
35+
Task("Build")
36+
.IsDependentOn("Restore")
37+
.DoesForEach(GetFiles("src/**/*.csproj").Concat(GetFiles("test/**/*.csproj")), (project) =>
38+
{
39+
MSBuild(project, settings =>
40+
settings
41+
.SetConfiguration(configuration)
42+
.WithTarget("Build"));
43+
});
44+
45+
Task("TestSetup")
46+
.Does(() => {
47+
CleanDirectory(artifacts + "/tests");
48+
CleanDirectory(artifacts + "/coverage");
49+
EnsureDirectoryExists(artifacts + "/tests");
50+
EnsureDirectoryExists(artifacts + "/coverage");
51+
});
52+
53+
Task("Test (No Coverage)")
54+
.WithCriteria(IsRunningOnUnix)
55+
.WithCriteria(false) // TODO: Make work on travis
56+
.IsDependentOn("TestSetup")
3657
.IsDependentOn("Build")
37-
.Does(() =>
58+
.DoesForEach(GetFiles("test/*/*.csproj"), (testProject) =>
3859
{
39-
EnsureDirectoryExists(artifacts + "/tests");
40-
EnsureDirectoryExists(artifacts + "/coverage");
41-
42-
foreach (var testProject in GetFiles("test/*/*.csproj")) {
43-
StartProcess("dotnet", new ProcessSettings() {
44-
WorkingDirectory = testProject.GetDirectory(),
60+
DotNetCoreTest(
61+
testProject.GetDirectory().FullPath,
62+
new DotNetCoreTestSettings() {
63+
NoBuild = true,
64+
Framework = "netcoreapp2.0",
4565
EnvironmentVariables = GitVersionEnvironmentVariables,
46-
Arguments = new ProcessArgumentBuilder()
47-
.Append("xunit")
48-
.Append("-noshadow")
49-
.AppendSwitch("-configuration", configuration)
50-
.AppendSwitchQuotedSecret("-xml", string.Format("{0}/tests/{1}.xml", artifacts, testProject.GetFilenameWithoutExtension()))
51-
.AppendSwitchQuotedSecret("-html", string.Format("{0}/tests/{1}.html", artifacts, testProject.GetFilenameWithoutExtension()))
52-
});
53-
}
66+
});
5467
});
5568

56-
Task("Coverage")
57-
//.IsDependentOn("Build")
58-
.Does(() =>
69+
Task("Test (Coverage)")
70+
.WithCriteria(IsRunningOnWindows)
71+
.IsDependentOn("TestSetup")
72+
.IsDependentOn("Build")
73+
.DoesForEach(GetFiles("test/*/*.csproj"), (testProject) =>
5974
{
60-
CleanDirectory(artifacts + "/coverage");
61-
EnsureDirectoryExists(artifacts + "/coverage");
62-
63-
foreach (var testProject in GetFiles("test/*/*.csproj")) {
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-
// });
74-
tool.StartProcess(Context.Tools.Resolve("dotnet.exe"), new ProcessSettings() {
75-
WorkingDirectory = testProject.GetDirectory(),
76-
EnvironmentVariables = GitVersionEnvironmentVariables,
77-
Arguments = new ProcessArgumentBuilder()
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()))
86-
});
87-
},
88-
artifacts + "/coverage/coverage-"+ testProject.GetFilenameWithoutExtension() + ".dcvr",
89-
new DotCoverCoverSettings() {
90-
// Register = "user",
91-
// MergeOutput = true,
92-
// OldStyle = true,
93-
TargetWorkingDir = testProject.GetDirectory(),
94-
WorkingDirectory = testProject.GetDirectory(),
95-
// ReportType = DotCoverReportType.XML
96-
}
97-
.WithFilter("+:JsonRpc")
98-
.WithFilter("+:Lsp")
99-
);
100-
}
101-
75+
DotCoverCover(tool => {
76+
tool.DotNetCoreTool(
77+
testProject.GetDirectory().FullPath,
78+
"xunit",
79+
new ProcessArgumentBuilder()
80+
.AppendSwitchQuoted("-xml", string.Format("{0}/tests/{1}.xml", artifacts, testProject.GetFilenameWithoutExtension()))
81+
.AppendSwitch("-configuration", configuration)
82+
.Append("-noshadow"),
83+
new DotNetCoreToolSettings() {
84+
EnvironmentVariables = GitVersionEnvironmentVariables,
85+
});
86+
},
87+
artifacts + "/coverage/coverage-"+ testProject.GetFilenameWithoutExtension() + ".dcvr",
88+
new DotCoverCoverSettings() {
89+
TargetWorkingDir = testProject.GetDirectory(),
90+
WorkingDirectory = testProject.GetDirectory(),
91+
EnvironmentVariables = GitVersionEnvironmentVariables,
92+
}
93+
.WithFilter("+:JsonRpc")
94+
.WithFilter("+:Lsp")
95+
);
96+
})
97+
.Finally(() => {
10298
DotCoverMerge(
10399
GetFiles(artifacts + "/coverage/*.dcvr"),
104100
artifacts + "/coverage/coverage.dcvr"
@@ -124,18 +120,22 @@ Task("Coverage")
124120
System.IO.File.WriteAllText(artifacts + "/coverage/coverage.xml", withBom.Replace(_byteOrderMarkUtf8, ""));
125121
});
126122

123+
Task("Test")
124+
.IsDependentOn("Test (Coverage)")
125+
.IsDependentOn("Test (No Coverage)");
126+
127127
Task("Pack")
128+
.WithCriteria(IsRunningOnWindows) // TODO: Make work on travis
128129
.IsDependentOn("Build")
129-
.Does(() => {
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-
});
130+
.Does(() => EnsureDirectoryExists(artifacts + "/nuget"))
131+
.DoesForEach(GetFiles("src/*/*.csproj"), (project) => {
132+
DotNetCorePack(project.FullPath, new DotNetCorePackSettings
133+
{
134+
NoBuild = true,
135+
Configuration = configuration,
136+
EnvironmentVariables = GitVersionEnvironmentVariables,
137+
OutputDirectory = artifacts + "/nuget"
138+
});
139139
});
140140

141141
Task("GitVersion")
@@ -150,7 +150,6 @@ Task("Default")
150150
.IsDependentOn("Clean")
151151
.IsDependentOn("Build")
152152
.IsDependentOn("Test")
153-
.IsDependentOn("Coverage")
154153
.IsDependentOn("Pack");
155154

156155
RunTarget(target);

build.ps1

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,9 @@ The build script target to run.
2121
The build configuration to use.
2222
.PARAMETER Verbosity
2323
Specifies the amount of information to be displayed.
24-
.PARAMETER Experimental
25-
Tells Cake to use the latest Roslyn release.
2624
.PARAMETER WhatIf
2725
Performs a dry run of the build script.
2826
No tasks will be executed.
29-
.PARAMETER Mono
30-
Tells Cake to use the Mono scripting engine.
3127
.PARAMETER SkipToolPackageRestore
3228
Skips restoring of packages.
3329
.PARAMETER ScriptArgs
@@ -47,10 +43,8 @@ Param(
4743
[string]$Configuration = "Release",
4844
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
4945
[string]$Verbosity = "Verbose",
50-
[switch]$Experimental = $true,
5146
[Alias("DryRun","Noop")]
5247
[switch]$WhatIf,
53-
[switch]$Mono,
5448
[switch]$SkipToolPackageRestore,
5549
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
5650
[string[]]$ScriptArgs
@@ -94,20 +88,6 @@ $NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
9488
$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config"
9589
$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum"
9690

97-
# Should we use mono?
98-
$UseMono = "";
99-
if($Mono.IsPresent) {
100-
Write-Verbose -Message "Using the Mono based scripting engine."
101-
$UseMono = "-mono"
102-
}
103-
104-
# Should we use the new Roslyn?
105-
$UseExperimental = "";
106-
if($Experimental.IsPresent -and !($Mono.IsPresent)) {
107-
Write-Verbose -Message "Using experimental version of Roslyn."
108-
$UseExperimental = "-experimental"
109-
}
110-
11191
# Is this a dry run?
11292
$UseDryRun = "";
11393
if($WhatIf.IsPresent) {
@@ -186,5 +166,5 @@ if (!(Test-Path $CAKE_EXE)) {
186166

187167
# Start Cake
188168
Write-Host "Running build script..."
189-
Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs"
169+
Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseDryRun $ScriptArgs"
190170
exit $LASTEXITCODE

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fi
5454
# Make sure that packages.config exist.
5555
if [ ! -f "$TOOLS_DIR/packages.config" ]; then
5656
echo "Downloading packages.config..."
57-
curl -Lsfo "$TOOLS_DIR/packages.config" http://cakebuild.net/download/bootstrapper/packages
57+
curl -Lsfo "$TOOLS_DIR/packages.config" https://cakebuild.net/download/bootstrapper/packages
5858
if [ $? -ne 0 ]; then
5959
echo "An error occured while downloading packages.config."
6060
exit 1

cake.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[Paths]
2+
Tools=./tools
3+
Addins=./tools
4+
[Nuget]
5+
UseInprocessClient=true
6+
LoadDependencies=true

sample/SampleServer/Program.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
using System;
1+
using System;
22
using System.Diagnostics;
33
using System.Threading.Tasks;
4-
using JsonRpc;
5-
using Lsp;
6-
using Lsp.Capabilities.Client;
7-
using Lsp.Capabilities.Server;
8-
using Lsp.Models;
9-
using Lsp.Protocol;
4+
using OmniSharp.Extensions.LanguageServer;
5+
using OmniSharp.Extensions.LanguageServer.Abstractions;
6+
using OmniSharp.Extensions.LanguageServer.Capabilities.Client;
7+
using OmniSharp.Extensions.LanguageServer.Capabilities.Server;
8+
using OmniSharp.Extensions.LanguageServer.Models;
9+
using OmniSharp.Extensions.LanguageServer.Protocol;
10+
using OmniSharp.Extensions.LanguageServer.Protocol.Document;
1011

1112
namespace SampleServer
1213
{
@@ -120,4 +121,4 @@ public TextDocumentAttributes GetTextDocumentAttributes(Uri uri)
120121
return new TextDocumentAttributes(uri, "csharp");
121122
}
122123
}
123-
}
124+
}

sample/SampleServer/SampleServer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp1.1</TargetFramework>
5+
<TargetFramework>netcoreapp2.0</TargetFramework>
66
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
77
</PropertyGroup>
88

0 commit comments

Comments
 (0)