Skip to content

Commit

Permalink
Merge pull request #56 from JSkimming/single-project
Browse files Browse the repository at this point in the history
Migrate to a single project
  • Loading branch information
JSkimming authored Oct 11, 2017
2 parents ab721f4 + 0001e0a commit d30fceb
Show file tree
Hide file tree
Showing 17 changed files with 114 additions and 481 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
language: csharp

matrix:
fast_finish: true
allow_failures:
- os: osx

include:
- os: linux
dist: trusty
Expand All @@ -15,4 +19,4 @@ branches:
only:
- master
script:
- dotnet test -c Release test/Abioc.Tests/Abioc.TestsCore.csproj
- dotnet test -c Release -f netcoreapp2.0 test/Abioc.Tests/Abioc.Tests.csproj
12 changes: 0 additions & 12 deletions RestorePackages.cmd

This file was deleted.

36 changes: 0 additions & 36 deletions abioc.core.sln

This file was deleted.

27 changes: 15 additions & 12 deletions abioc.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{EC112844-9
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Abioc", "src\Abioc\Abioc.csproj", "{934CC730-8E23-4EF8-9BC5-3806FF3B490A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Abioc.Tests", "test\Abioc.Tests\Abioc.Tests.csproj", "{64CA9BA9-374A-4BFF-B7E0-80B5629A101E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Abioc.Tests", "test\Abioc.Tests\Abioc.Tests.csproj", "{EB8049D9-821D-44A1-8D6F-609609A94FE8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Abioc.Tests.Internal", "test\Abioc.Tests.Internal\Abioc.Tests.Internal.csproj", "{A74E1815-0141-4377-9455-E5521ED8BFA8}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Abioc.Tests.Internal", "test\Abioc.Tests.Internal\Abioc.Tests.Internal.csproj", "{6121F45D-D6FA-4535-B572-E4CCAC657BE4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -23,21 +23,24 @@ Global
{934CC730-8E23-4EF8-9BC5-3806FF3B490A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{934CC730-8E23-4EF8-9BC5-3806FF3B490A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{934CC730-8E23-4EF8-9BC5-3806FF3B490A}.Release|Any CPU.Build.0 = Release|Any CPU
{64CA9BA9-374A-4BFF-B7E0-80B5629A101E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{64CA9BA9-374A-4BFF-B7E0-80B5629A101E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{64CA9BA9-374A-4BFF-B7E0-80B5629A101E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{64CA9BA9-374A-4BFF-B7E0-80B5629A101E}.Release|Any CPU.Build.0 = Release|Any CPU
{A74E1815-0141-4377-9455-E5521ED8BFA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A74E1815-0141-4377-9455-E5521ED8BFA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A74E1815-0141-4377-9455-E5521ED8BFA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A74E1815-0141-4377-9455-E5521ED8BFA8}.Release|Any CPU.Build.0 = Release|Any CPU
{EB8049D9-821D-44A1-8D6F-609609A94FE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB8049D9-821D-44A1-8D6F-609609A94FE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB8049D9-821D-44A1-8D6F-609609A94FE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB8049D9-821D-44A1-8D6F-609609A94FE8}.Release|Any CPU.Build.0 = Release|Any CPU
{6121F45D-D6FA-4535-B572-E4CCAC657BE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6121F45D-D6FA-4535-B572-E4CCAC657BE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6121F45D-D6FA-4535-B572-E4CCAC657BE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6121F45D-D6FA-4535-B572-E4CCAC657BE4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{934CC730-8E23-4EF8-9BC5-3806FF3B490A} = {FC9BAFCA-F5CD-4679-A983-A40C8F028812}
{64CA9BA9-374A-4BFF-B7E0-80B5629A101E} = {EC112844-927D-4AE6-95AF-99CB853E8359}
{A74E1815-0141-4377-9455-E5521ED8BFA8} = {EC112844-927D-4AE6-95AF-99CB853E8359}
{EB8049D9-821D-44A1-8D6F-609609A94FE8} = {EC112844-927D-4AE6-95AF-99CB853E8359}
{6121F45D-D6FA-4535-B572-E4CCAC657BE4} = {EC112844-927D-4AE6-95AF-99CB853E8359}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D35DB1C0-3A9F-4FF1-AE52-DD86B1240288}
EndGlobalSection
EndGlobal
11 changes: 2 additions & 9 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,8 @@ assembly_info:
# build configuration #
#---------------------------------#

before_build:
- NuGet restore abioc.sln

build:
project: abioc.sln
verbosity: minimal

after_build:
- msbuild src\Abioc\Abioc.csproj /nologo /verbosity:minimal /t:pack /p:Configuration=%CONFIGURATION%;PackageVersion=%APPVEYOR_BUILD_VERSION%;IncludeSource=true /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
build_script:
- dotnet pack -c %CONFIGURATION% --include-source /p:PackageVersion=%APPVEYOR_BUILD_VERSION%

#---------------------------------#
# artifacts configuration #
Expand Down
58 changes: 45 additions & 13 deletions coverage.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
@SETLOCAL

@SET NUGET_EXE=NuGet
@SET CACHED_NUGET="%USERPROFILE%\.nuget\NuGet.exe"

@IF ["%APPVEYOR%"] == [""] (
SET NUGET_EXE=%CACHED_NUGET%

IF NOT EXIST %CACHED_NUGET% (
echo Downloading latest version of NuGet.exe...
IF NOT EXIST "%USERPROFILE%\.nuget" md "%USERPROFILE%\.nuget"
powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' -OutFile %CACHED_NUGET:"='%"
)
)

::@echo %NUGET_EXE%

@echo %NUGET_EXE% restore "%~dp0test\packages.config" -PackagesDirectory "%~dp0test\packages"
@call %NUGET_EXE% restore "%~dp0test\packages.config" -PackagesDirectory "%~dp0test\packages"

@SET config=%1
@IF ["%config%"] == [""] (
SET config=Debug
Expand All @@ -19,31 +37,45 @@
)
::@echo %report_exe%

@FOR /r %%F IN (*xunit.console.exe) DO @SET xunit_exe=%%F
@IF NOT EXIST "%xunit_exe%" (
echo Unable to find xUnit console runner.
EXIT /B 2
)
::@echo %xunit_exe%

@SET results_path=%~dp0test\TestResults
@SET test_assemblies=%~dp0test\Abioc.Tests\bin\%config%\Abioc.Tests.dll
@SET test_assemblies=%test_assemblies% %~dp0test\Abioc.Tests.Internal\bin\%config%\Abioc.Tests.Internal.dll
@SET xunit_results=%results_path%\Xunit.Tests.html
@SET coverage_filter=+[abioc*]* -[*.Tests]* -[Abioc.Tests.Internal]*
@SET coverage_results=%results_path%\Test.Coverage.xml

@IF NOT EXIST "%results_path%" MD "%results_path%"
::@echo "%xunit_exe%" %test_assemblies% -noshadow -html "%xunit_results%"
::@"%xunit_exe%" %test_assemblies% -noshadow -html "%xunit_results%"

@echo "%cover_exe%" -register:user "-target:%xunit_exe%" "-targetargs:%test_assemblies% -parallel none -noshadow -html %xunit_results%" -returntargetcode -filter:^"%coverage_filter%^" "-output:%coverage_results%"
@"%cover_exe%" -register:user "-target:%xunit_exe%" "-targetargs:%test_assemblies% -parallel none -noshadow -html %xunit_results%" -returntargetcode -filter:^"%coverage_filter%^" "-output:%coverage_results%"
@echo dotnet restore "%~dp0test\Abioc.Tests\Abioc.Tests.csproj"
@dotnet restore "%~dp0test\Abioc.Tests\Abioc.Tests.csproj"

@echo dotnet restore "%~dp0test\Abioc.Tests.Internal\Abioc.Tests.Internal.csproj"
@dotnet restore "%~dp0test\Abioc.Tests.Internal\Abioc.Tests.Internal.csproj"

cd "%~dp0test\Abioc.Tests"

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

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

cd "%~dp0test\Abioc.Tests.Internal"

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

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

cd "%~dp0"

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

Expand Down
2 changes: 2 additions & 0 deletions src/Abioc/Compilation/CodeCompilation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ private static Assembly CompileCode(string code, Assembly[] srcAssemblies)
}
}

#if NETSTANDARD1_5 || NETSTANDARD2_0
// Workaround https://github.com/dotnet/roslyn/issues/12393#issuecomment-277933006
// using this blog post
// http://code.fitness/post/2017/02/using-csharpscript-with-netstandard.html
Expand All @@ -242,6 +243,7 @@ private static string GetSystemAssemblyPathByName(string assemblyName)
string path = Path.Combine(root, assemblyName);
return path;
}
#endif

private static void ProcessDiagnostics(SyntaxTree tree)
{
Expand Down
Loading

0 comments on commit d30fceb

Please sign in to comment.