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

Task upgrade frameworks #42

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
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
30 changes: 23 additions & 7 deletions NAME.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2006
# Visual Studio Version 17
VisualStudioVersion = 17.2.32519.379
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{858DAD45-2D69-4C8F-8E51-A726A7C0532D}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -12,10 +12,19 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8375C21F-81D2-495F-8393-9E72AF053A74}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
.travis.yml = .travis.yml
appveyor.yml = appveyor.yml
build.cake = build.cake
build.ps1 = build.ps1
build.sh = build.sh
CHANGELOG.md = CHANGELOG.md
CONTRIBUTING.md = CONTRIBUTING.md
global.json = global.json
LICENSE = LICENSE
name.dependencies.v1.jschema = name.dependencies.v1.jschema
README.md = README.md
stylecop.json = stylecop.json
stylecop.ruleset = stylecop.ruleset
EndProjectSection
Expand Down Expand Up @@ -62,11 +71,6 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NAME.Hosting.Shared.Tests", "unit-tests\NAME.Hosting.Shared.Tests\NAME.Hosting.Shared.Tests.csproj", "{7BF3496C-1E0F-4AC3-9497-2C526132894A}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\NAME.Hosting.Shared\NAME.Hosting.Shared.projitems*{1b69400b-f2b5-417a-9234-5f12114554a8}*SharedItemsImports = 13
src\NAME.Core\NAME.Core.projitems*{6bed7e20-a9a1-41e1-9a74-fd1c9211d181}*SharedItemsImports = 13
src\NAME.SelfHost.Shared\NAME.SelfHost.Shared.projitems*{b7f1edf7-131e-494d-a7ce-f6d3d994a8b2}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Expand Down Expand Up @@ -155,4 +159,16 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FB1598D2-F306-4060-B4C8-90DCF74C8C93}
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\NAME.Hosting.Shared\NAME.Hosting.Shared.projitems*{1b69400b-f2b5-417a-9234-5f12114554a8}*SharedItemsImports = 13
src\NAME.Hosting.Shared\NAME.Hosting.Shared.projitems*{23b5dafc-d49f-41b5-ab84-b9bae9578cc4}*SharedItemsImports = 5
src\NAME.Core\NAME.Core.projitems*{50ab471c-4769-4c65-a219-dbd9d8389c6c}*SharedItemsImports = 5
src\NAME.Core\NAME.Core.projitems*{6bed7e20-a9a1-41e1-9a74-fd1c9211d181}*SharedItemsImports = 13
src\NAME.Hosting.Shared\NAME.Hosting.Shared.projitems*{7bf3496c-1e0f-4ac3-9497-2c526132894a}*SharedItemsImports = 5
src\NAME.SelfHost.Shared\NAME.SelfHost.Shared.projitems*{b7f1edf7-131e-494d-a7ce-f6d3d994a8b2}*SharedItemsImports = 13
src\NAME.SelfHost.Shared\NAME.SelfHost.Shared.projitems*{bd5d9f86-bf08-4d53-a3be-99e3f9f06db4}*SharedItemsImports = 5
src\NAME.Hosting.Shared\NAME.Hosting.Shared.projitems*{eabdc739-41ab-493f-a3a7-60bcd5be9c7a}*SharedItemsImports = 5
src\NAME.SelfHost.Shared\NAME.SelfHost.Shared.projitems*{eabdc739-41ab-493f-a3a7-60bcd5be9c7a}*SharedItemsImports = 5
src\NAME.Hosting.Shared\NAME.Hosting.Shared.projitems*{f5d256a5-56df-45f1-a2aa-1b366e6bc5ea}*SharedItemsImports = 5
EndGlobalSection
EndGlobal
23 changes: 11 additions & 12 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,20 @@ Task("Build")
Configuration = configuration,
MSBuildSettings = new DotNetCoreMSBuildSettings()
};

dotNetBuildConfig.MSBuildSettings.TreatAllWarningsAs = MSBuildTreatAllWarningsAs.Error;

DotNetCoreBuild("NAME.sln", dotNetBuildConfig);
});

Task("Nuget-Pack")
.Does(()=>{
EnsureDirectoryExists(preReleaseNugetPackagesDir);
EnsureDirectoryExists(releaseNugetPackagesDir);

CleanDirectory(preReleaseNugetPackagesDir);
CleanDirectory(releaseNugetPackagesDir);

var preReleaseSettings = new DotNetCorePackSettings{
Configuration = configuration,
OutputDirectory = preReleaseNugetPackagesDir,
Expand All @@ -101,7 +101,7 @@ Task("Nuget-Pack")
{ "VersionSuffix", settings.VersionSuffix }
};
}

foreach(var project in PROJECTS_TO_PACK){
var projectFolder = "./src/" + project;
DotNetCoreRestore(projectFolder, dotnetCoreRestoreSettings);
Expand All @@ -112,22 +112,21 @@ Task("Nuget-Pack")
packProjects(preReleaseSettings);
packProjects(releaseSettings);
});

Task("Run-Unit-Tests")
.IsDependentOn("Restore-NuGet-Packages")
.Does(() =>
{

var files = GetFiles("./unit-tests/**/*.csproj");

int highestExitCode = 0;

foreach (var file in files){
// While https://github.com/cake-build/cake/pull/1578 is not merged,
// While https://github.com/cake-build/cake/pull/1578 is not merged,
// we need to start our own process to run dotnet xunit.
// Related: https://github.com/cake-build/cake/issues/1577

var processSettings = new ProcessSettings {
var processSettings = new ProcessSettings {
Arguments = "xunit -trait \"TestCategory=\"Unit\"\"",
WorkingDirectory = file.GetDirectory()
};
Expand All @@ -140,15 +139,15 @@ Task("Run-Unit-Tests")
if (frameworks == null || frameworks.Contains("netcoreapp") == false) {
continue;
}
processSettings.Arguments.Append("-framework netcoreapp1.0");
processSettings.Arguments.Append("-framework netcoreapp2.2");
}

var exitCode = StartProcess("dotnet", processSettings);

if(exitCode > highestExitCode)
highestExitCode = exitCode;
}

// Means there was an error
if(highestExitCode > 0 )
throw new Exception("Some tests failed.");
Expand Down Expand Up @@ -200,7 +199,7 @@ Task("TravisCI")

Task("Default")
.IsDependentOn("Build-AND-Test");

//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "1.0.4"
"version": "2.2.207"
}
}
5 changes: 3 additions & 2 deletions integration-tests/NAME.DummyConsole.Kestrel/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
FROM microsoft/dotnet:1.1.1-sdk
FROM mcr.microsoft.com/dotnet/core/sdk:2.2

COPY . /service

WORKDIR /service

RUN chmod +x ./docker_init.sh
RUN sed -i -e 's/\r$//' ./docker_init.sh \
&& chmod +x ./docker_init.sh

EXPOSE 40500/tcp

Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>NAME.DummyConsole.Kestrel</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>NAME.DummyConsole.Kestrel</PackageId>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>NAME.DummyConsole.Kestrel</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>NAME.DummyConsole.Kestrel</PackageId>
</PropertyGroup>

<ItemGroup Condition="'$(RUNNING_ON_DOCKER)' != ''">
<PackageReference Include="NAME.SelfHost.Kestrel" Version="*" />
</ItemGroup>
<ItemGroup Condition="'$(RUNNING_ON_DOCKER)' != ''">
<PackageReference Include="NAME.SelfHost.Kestrel" Version="*" />
</ItemGroup>

<ItemGroup Condition="'$(RUNNING_ON_DOCKER)' == ''">
<ProjectReference Include="..\..\src\NAME.SelfHost.Kestrel\NAME.SelfHost.Kestrel.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(RUNNING_ON_DOCKER)' == ''">
<ProjectReference Include="..\..\src\NAME.SelfHost.Kestrel\NAME.SelfHost.Kestrel.csproj" />
</ItemGroup>

<ItemGroup>
<Content Include="dependencies.json">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="dependencies.json">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>

</Project>
</Project>
3 changes: 2 additions & 1 deletion integration-tests/NAME.DummyConsole.Kestrel/docker_init.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
dotnet restore --source /service/nugets --source https://api.nuget.org/v3/index.json

# dotnet restore --source /service/nugets --source https://api.nuget.org/v3/index.json
# Compile before the tests so that the CI reports the build as failed if the tests compilation fails
dotnet build -c Release

Expand Down
5 changes: 3 additions & 2 deletions integration-tests/NAME.DummyService/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
FROM microsoft/dotnet:1.1.1-sdk
FROM mcr.microsoft.com/dotnet/core/sdk:2.2

COPY . /service

WORKDIR /service

RUN chmod +x ./docker_init.sh
RUN sed -i -e 's/\r$//' ./docker_init.sh \
&& chmod +x ./docker_init.sh

EXPOSE 5000/tcp

Expand Down
60 changes: 29 additions & 31 deletions integration-tests/NAME.DummyService/NAME.DummyService.csproj
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>NAME.DummyService</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>NAME.DummyService</PackageId>
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>NAME.DummyService</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>NAME.DummyService</PackageId>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.0.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.0.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.0.6" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(RUNNING_ON_DOCKER)' != ''">
<PackageReference Include="NAME.AspNetCore" Version="*" />
</ItemGroup>
<ItemGroup Condition="'$(RUNNING_ON_DOCKER)' != ''">
<PackageReference Include="NAME.AspNetCore" Version="*" />
</ItemGroup>

<ItemGroup Condition="'$(RUNNING_ON_DOCKER)' == ''">
<ProjectReference Include="..\..\src\NAME.AspNetCore\NAME.AspNetCore.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(RUNNING_ON_DOCKER)' == ''">
<ProjectReference Include="..\..\src\NAME.AspNetCore\NAME.AspNetCore.csproj" />
</ItemGroup>

</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:1479/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "api/values",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"NAME.DummyService": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "http://localhost:5000/api/values",
"applicationUrl": "http://*:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
Expand Down
5 changes: 3 additions & 2 deletions integration-tests/NAME.DummyService/docker_init.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
dotnet restore --source /service/nugets --source https://api.nuget.org/v3/index.json

# dotnet restore --source /service/nugets --source https://api.nuget.org/v3/index.json
# Compile before the tests so that the CI reports the build as failed if the tests compilation fails
dotnet build -c Release

dotnet run --server.urls http://*:5000
dotnet run
12 changes: 7 additions & 5 deletions integration-tests/NAME.IntegrationTests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
FROM microsoft/dotnet:1.1.1-sdk
FROM mcr.microsoft.com/dotnet/core/sdk:2.2
WORKDIR /integration
COPY . ./
# COPY ../../Output/Artifacts/NuGets/Release ./nugets
# RUN dotnet restore
RUN chmod +x ./docker_init.sh
RUN chmod +x ./multi-wait-for-it.sh

RUN sed -i -e 's/\r$//' ./docker_init.sh \
&& chmod +x ./docker_init.sh \
&& sed -i -e 's/\r$//' ./multi-wait-for-it.sh \
&& chmod +x ./multi-wait-for-it.sh
ENV OPERATING_SYSTEM=debian

CMD ["./docker_init.sh"]
CMD ["./docker_init.sh"]
Loading