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

Minor updates to build and configuration to be consistent with my other open source projects #38

Merged
merged 8 commits into from
Feb 13, 2018
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
**/obj
**/bin
.vs
*.sh
.git
.gitignore
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ dotnet_sort_system_directives_first = true
[*.cs]

# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#newline
csharp_new_line_before_open_brace = methods, properties, control_blocks, types
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
Expand Down
15 changes: 0 additions & 15 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,17 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
47 changes: 41 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ bld/
[Oo]bj/
[Ll]og/

# Visual Studio 2015 cache/options directory
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# Visual Studio 2017 auto generated files
Generated\ Files/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
Expand All @@ -42,12 +45,19 @@ TestResult.xml
[Rr]eleasePS/
dlldata.c

# Benchmark Results
BenchmarkDotNet.Artifacts/

# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json

# StyleCop
StyleCopReport.xml

# Files built by Visual Studio
*_i.c
*_p.c
*_i.h
Expand Down Expand Up @@ -93,6 +103,9 @@ ipch/
*.vspx
*.sap

# Visual Studio Trace Files
*.e2e

# TFS 2012 Local Workspace
$tf/

Expand All @@ -113,6 +126,10 @@ _TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover

# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json

# Visual Studio code coverage results
*.coverage
*.coveragexml
Expand Down Expand Up @@ -148,7 +165,7 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
Expand All @@ -161,11 +178,11 @@ PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
Expand All @@ -183,6 +200,7 @@ AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx

# Visual Studio cache files
# files ending in .cache can be ignored
Expand All @@ -201,6 +219,10 @@ ClientBin/
*.publishsettings
orleans.codegen.cs

# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk

# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
Expand All @@ -215,6 +237,7 @@ _UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/

# SQL Server files
*.mdf
Expand All @@ -236,7 +259,7 @@ FakesAssemblies/
.ntvs_analysis.dat
node_modules/

# Typescript v1 declaration files
# TypeScript v1 declaration files
typings/

# Visual Studio 6 build log
Expand Down Expand Up @@ -278,6 +301,9 @@ __pycache__/
# tools/**
# !tools/packages.config

# Tabs Studio
*.tss

# Telerik's JustMock configuration file
*.jmconfig

Expand All @@ -287,6 +313,15 @@ __pycache__/
*.odx.cs
*.xsd.cs

# OpenCover UI analysis results
OpenCover/

# Azure Stream Analytics local run output
ASALocalRun/

# MSBuild Binary and Structured Log
*.binlog

# =========================
# Operating System Files
# =========================
Expand Down
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ matrix:

include:
- os: linux
dist: trusty
dotnet: 2.0.0
mono: none
- os: osx
osx_image: xcode8.2
dotnet: 2.0.0
mono: none

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ RUN dotnet restore

COPY . .

# Run restore again, this ensures any temporary files from the local file system don't break the build.
RUN dotnet restore && dotnet build -f netcoreapp2.0 -c Debug ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj
# Build to ensure the tests are their own distinct step
RUN dotnet build --no-restore -f netcoreapp2.0 -c Debug ./test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj

# Run unit tests
RUN dotnet test --no-restore --no-build -c Debug -f netcoreapp2.0 test/Castle.Core.AsyncInterceptor.Tests/Castle.Core.AsyncInterceptor.Tests.csproj
8 changes: 8 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ branches:
# Operating system (build VM template)
image: Visual Studio 2017

environment:
COVERALLS_REPO_TOKEN:
secure: wlbvgdxuXKnICUGjPqGoQF35j+AKryMfPyUg+YC44hcF72KnOL+ON4WkPMSvedBb

# scripts that are called at very beginning, before repo cloning
init:
# This gives the login details for the build instance so you can RDP to it.
Expand Down Expand Up @@ -66,6 +70,10 @@ test_script:
- pip install codecov
- codecov -f "test\TestResults\Test.Coverage.xml"

after_test: |
FOR /r %%F IN (*coveralls.net.exe) DO SET coveralls_exe=%%F
%coveralls_exe% --opencover test\TestResults\Test.Coverage.xml

#---------------------------------#
# deployment configuration #
#---------------------------------#
Expand Down
19 changes: 10 additions & 9 deletions coverage.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,26 @@

@IF NOT EXIST "%results_path%" MD "%results_path%"

@echo dotnet restore "%~dp0test\Castle.Core.AsyncInterceptor.Tests\Castle.Core.AsyncInterceptor.Tests.csproj"
@dotnet restore "%~dp0test\Castle.Core.AsyncInterceptor.Tests\Castle.Core.AsyncInterceptor.Tests.csproj"
@echo dotnet build --configuration %config% "%~dp0test\Castle.Core.AsyncInterceptor.Tests\Castle.Core.AsyncInterceptor.Tests.csproj"
@dotnet build --configuration %config% "%~dp0test\Castle.Core.AsyncInterceptor.Tests\Castle.Core.AsyncInterceptor.Tests.csproj"
@IF ERRORLEVEL 1 (
echo Error building the test project
EXIT /B 2
)

cd "%~dp0test\Castle.Core.AsyncInterceptor.Tests"

::@echo dotnet.exe xunit -configuration %config% -noshadow -html %xunit_results%
::@dotnet.exe xunit -configuration %config% -noshadow -html %xunit_results%
::@echo dotnet.exe xunit -framework net47 -configuration %config% -nobuild -noshadow -html %xunit_results%
::@dotnet.exe xunit -framework net47 -configuration %config% -nobuild -noshadow -html %xunit_results%

@echo "%cover_exe%" -register:user "-target:dotnet.exe" "-targetargs:xunit -configuration %config% -noshadow -html %xunit_results%" -returntargetcode -filter:^"%coverage_filter%^" "-output:%coverage_results%"
@"%cover_exe%" -register:user "-target:dotnet.exe" "-targetargs:xunit -configuration %config% -noshadow -html %xunit_results%" -returntargetcode -filter:^"%coverage_filter%^" "-output:%coverage_results%"
@echo "%cover_exe%" -register:user "-target:dotnet.exe" "-targetargs:xunit -framework net47 -configuration %config% -nobuild -noshadow -html %xunit_results%" -returntargetcode -filter:^"%coverage_filter%^" "-output:%coverage_results%"
@"%cover_exe%" -register:user "-target:dotnet.exe" "-targetargs:xunit -framework net47 -configuration %config% -nobuild -noshadow -html %xunit_results%" -returntargetcode -filter:^"%coverage_filter%^" "-output:%coverage_results%"
@IF ERRORLEVEL 1 (
echo Error executing the xunit tests
EXIT /B 2
)

cd "%~dp0"

@echo "%report_exe%" -verbosity:Error "-reports:%coverage_results%" "-targetdir:%results_path%" -reporttypes:XmlSummary
@"%report_exe%" -verbosity:Error "-reports:%coverage_results%" "-targetdir:%results_path%" -reporttypes:XmlSummary

@echo "%report_exe%" -verbosity:Error "-reports:%coverage_results%" "-targetdir:%results_path%\Report" -reporttypes:Html
@"%report_exe%" -verbosity:Error "-reports:%coverage_results%" "-targetdir:%results_path%\Report" -reporttypes:Html
3 changes: 2 additions & 1 deletion test/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="coveralls.io" version="1.3.4" />
<package id="OpenCover" version="4.6.519" />
<package id="ReportGenerator" version="3.0.1" />
<package id="ReportGenerator" version="3.1.2" />
</packages>