Skip to content

Commit

Permalink
Migrate from project.json to csproj. (#19)
Browse files Browse the repository at this point in the history
* Upgrade to latest dotnet SDK and migrate from project.json to csproj.
  • Loading branch information
Choc13 committed Oct 7, 2017
1 parent 9d18887 commit fdf4608
Show file tree
Hide file tree
Showing 32 changed files with 340 additions and 390 deletions.
30 changes: 9 additions & 21 deletions .travis.yml
@@ -1,36 +1,24 @@
language: csharp
sudo: required
branches:
except:
- /^[0-9]/
addons:
apt:
packages:
- gettext
- libcurl4-openssl-dev
- libicu-dev
- libssl-dev
- libunwind8
- zlib1g
services:
- docker
env:
global:
- CLI_VERSION: latest
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
mono:
- 4.0.5
dotnet: 1.0.0-preview2-003121
os:
- linux
- osx
osx_image: xcode7.3
before_install:
- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s -f /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s -f /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/; fi
matrix:
include:
- os: linux
sudo: required
dotnet: 2.0.0
- os: osx
osx_image: xcode9 # OSX 10.12
dotnet: 2.0.0
script:
- git fetch --unshallow
- if test "$TRAVIS_PULL_REQUEST" == "false"; then ./build.sh -v; else ./build.sh; fi
- ./build.sh
notifications:
on_success: always
on_failure: always
Expand Down
26 changes: 17 additions & 9 deletions GitVersion.yml → GitVersionConfig.yaml
@@ -1,42 +1,50 @@
assembly-versioning-scheme: MajorMinorPatch
mode: ContinuousDeployment

# It would be better to use smarter regexes instead of duplicating everything for local and remote cases.
# However, GitVersion has some built-in patterns which cannot be removed and these would cause clashes.
branches:

# These branch patterns cover all local cases
master:
regex: master
tag: master
increment: Minor
prevent-increment-of-merged-branch-version: true
feature[/-]:
feature:
regex: feature[/-]
tag: a{BranchName}
increment: Minor
prevent-increment-of-merged-branch-version: false
patch[/-]:
patch:
regex: patch[/-]
tag: useBranchName
increment: Patch
prevent-increment-of-merged-branch-version: false
release[/-]:
release:
regex: release[/-]
tag: rc
increment: None
prevent-increment-of-merged-branch-version: false

# These branch patterns cover all remote cases
origin/master:
regex: origin/master
tag: master
increment: Minor
prevent-increment-of-merged-branch-version: true
origin/feature[/-]:
origin/feature:
regex: origin/feature[/-]
tag: a{BranchName}
increment: Minor
prevent-increment-of-merged-branch-version: false
origin/patch[/-]:
origin/patch:
regex: origin/patch[/-]
tag: useBranchName
increment: Patch
prevent-increment-of-merged-branch-version: false
origin/release[/-]:
origin/release:
regex: origin/release[/-]
tag: rc
increment: None
prevent-increment-of-merged-branch-version: false
11 changes: 0 additions & 11 deletions RuleSet.xml

This file was deleted.

55 changes: 55 additions & 0 deletions Winton.Extensions.Configuration.Consul.sln
@@ -0,0 +1,55 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{92E73150-9357-4AA6-8C7D-E43709B27A6D}"
ProjectSection(SolutionItems) = preProject
.travis.yml = .travis.yml
appveyor.yml = appveyor.yml
build.sh = build.sh
CONTRIBUTING.md = CONTRIBUTING.md
GitVersionConfig.yaml = GitVersionConfig.yaml
LICENSE = LICENSE
README.md = README.md
stylecop.json = stylecop.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{03739F78-2460-4F1E-92F2-807CBD8C8AB5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{972A51CA-2686-4B9B-8BBB-503B2A1BA630}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Winton.Extensions.Configuration.Consul", "src\Winton.Extensions.Configuration.Consul\Winton.Extensions.Configuration.Consul.csproj", "{B5C08CE5-B60B-485F-B78F-A119B8AA8508}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Winton.Extensions.Configuration.Consul.Test", "test\Winton.Extensions.Configuration.Consul.Test\Winton.Extensions.Configuration.Consul.Test.csproj", "{6A8821FC-BE1A-4EC8-8A51-73105458CC85}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Website", "test\Website\Website.csproj", "{44386D3A-3926-410D-AAD6-3820E17D712A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B5C08CE5-B60B-485F-B78F-A119B8AA8508}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B5C08CE5-B60B-485F-B78F-A119B8AA8508}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B5C08CE5-B60B-485F-B78F-A119B8AA8508}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B5C08CE5-B60B-485F-B78F-A119B8AA8508}.Release|Any CPU.Build.0 = Release|Any CPU
{6A8821FC-BE1A-4EC8-8A51-73105458CC85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6A8821FC-BE1A-4EC8-8A51-73105458CC85}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6A8821FC-BE1A-4EC8-8A51-73105458CC85}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6A8821FC-BE1A-4EC8-8A51-73105458CC85}.Release|Any CPU.Build.0 = Release|Any CPU
{44386D3A-3926-410D-AAD6-3820E17D712A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{44386D3A-3926-410D-AAD6-3820E17D712A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{44386D3A-3926-410D-AAD6-3820E17D712A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{44386D3A-3926-410D-AAD6-3820E17D712A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{B5C08CE5-B60B-485F-B78F-A119B8AA8508} = {03739F78-2460-4F1E-92F2-807CBD8C8AB5}
{6A8821FC-BE1A-4EC8-8A51-73105458CC85} = {972A51CA-2686-4B9B-8BBB-503B2A1BA630}
{44386D3A-3926-410D-AAD6-3820E17D712A} = {972A51CA-2686-4B9B-8BBB-503B2A1BA630}
EndGlobalSection
EndGlobal
16 changes: 11 additions & 5 deletions appveyor.yml
Expand Up @@ -3,20 +3,26 @@ environment:
CLI_VERSION: latest
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
image: Visual Studio 2017
configuration:
- Release
skip_tags: true
before_build:
- dotnet restore
build_script:
- ps: .\build.ps1 -VersionAndPublish (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER)
test: off
- msbuild /p:GetVersion=True /p:WriteVersionInfoToBuildLog=True
test_script:
- dotnet test test/Winton.Extensions.Configuration.Consul.Test/ --no-build --configuration Release
artifacts:
- path: .\**\*.nupkg
name: NuGet
nuget:
disable_publish_on_pr: true
deploy:
deploy:
- provider: NuGet
api_key:
secure: CxMH3k6k/Rpz1zjToGDAelLWDT/gDqRo08iEUAQsRnL+WRo+4TL5gLiNEUy/GfUy
on:
branch:
branch:
- master
- /release\/[0-9]\.[0-9]/
- /release\/[0-9]\.[0-9]/
41 changes: 0 additions & 41 deletions build.ps1

This file was deleted.

25 changes: 4 additions & 21 deletions build.sh
@@ -1,34 +1,17 @@
set -e
#! /bin/bash

while getopts v option
do
case "${option}"
in
v) VERSION_AND_PUBLISH="true";;
esac
done
set -e

# Restore packages
dotnet restore

# Set version numbers
if [[ $VERSION_AND_PUBLISH ]]; then
echo "Versioning..."
(cd src/Winton.Extensions.Configuration.Consul && dotnet gitversion)
else
echo "WARN: Skipping versioning."
fi

# Build
dotnet build src/Winton.Extensions.Configuration.Consul/project.json test/Winton.Extensions.Configuration.Consul.Test/project.json --configuration Release
dotnet build --configuration Release

# Unit Test
dotnet test --no-build --configuration Release -f netcoreapp1.0 test/Winton.Extensions.Configuration.Consul.Test/project.json
dotnet test test/Winton.Extensions.Configuration.Consul.Test/ --no-build --configuration Release

# Integration test
if hash docker 2>/dev/null; then
./test/Website/IntegrationTests/run.sh
fi

# Package
dotnet pack --no-build src/*/project.json --configuration Release
6 changes: 0 additions & 6 deletions global.json

This file was deleted.

Expand Up @@ -3,6 +3,5 @@

using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("Winton.Extensions.Configuration.Consul.Test")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
[assembly: InternalsVisibleTo("Website")]
[assembly: InternalsVisibleTo("Winton.Extensions.Configuration.Consul.Test")]
@@ -0,0 +1,38 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Copyright>Copyright (c) Winton</Copyright>
<Description>Provides support for configuring .Net Core applications with Consul</Description>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<GetVersion>False</GetVersion>
<NoWarn>$(NoWarn);SA1101;SA1309;SA1413</NoWarn>
<PackageId>Winton.Extensions.Configuration.Consul</PackageId>
<PackageLicenseUrl>https://github.com/wintoncode/Winton.Extensions.Configuration.Consul/blob/master/LICENSE</PackageLicenseUrl>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<PackageTags>.Net;.Net Core;dotnetcore;Asp.Net;Asp.Net Core;aspnetcore;configuration;consul;winton;wintoncode</PackageTags>
<PackageVersion>$(NuGetVersion)</PackageVersion>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/wintoncode/Winton.Extensions.Configuration.Consul</RepositoryUrl>
<TargetFrameworks>netstandard1.3</TargetFrameworks>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<WriteVersionInfoToBuildLog>False</WriteVersionInfoToBuildLog>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="../../stylecop.json" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Consul" Version="0.7.0.3" />
<PackageReference Include="GitVersionTask" Version="4.0.0-beta0011" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="1.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" PrivateAssets="All" />
</ItemGroup>

</Project>

This file was deleted.

0 comments on commit fdf4608

Please sign in to comment.