mirror of https://github.com/AMT-Cheif/Stylet.git
Fix up the Rakefile
We no longer generate test code coverage, as that's hard on .net core Also remove GitLink
This commit is contained in:
parent
b3064171c1
commit
9b5da1f82e
Binary file not shown.
BIN
NuGet/NuGet.exe
BIN
NuGet/NuGet.exe
Binary file not shown.
|
@ -6,7 +6,7 @@
|
||||||
<title>Stylet.Start</title>
|
<title>Stylet.Start</title>
|
||||||
<authors>Antony Male</authors>
|
<authors>Antony Male</authors>
|
||||||
<owners>Antony Male</owners>
|
<owners>Antony Male</owners>
|
||||||
<licenseUrl>http://github.com/canton7/Stylet/blob/master/LICENSE.txt</licenseUrl>
|
<license type="expression">MIT</license>
|
||||||
<projectUrl>http://github.com/canton7/Stylet</projectUrl>
|
<projectUrl>http://github.com/canton7/Stylet</projectUrl>
|
||||||
<iconUrl>https://raw.githubusercontent.com/canton7/Stylet/master/StyletIcon.png</iconUrl>
|
<iconUrl>https://raw.githubusercontent.com/canton7/Stylet/master/StyletIcon.png</iconUrl>
|
||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<title>Stylet</title>
|
<title>Stylet</title>
|
||||||
<authors>Antony Male</authors>
|
<authors>Antony Male</authors>
|
||||||
<owners>Antony Male</owners>
|
<owners>Antony Male</owners>
|
||||||
<licenseUrl>http://github.com/canton7/Stylet/blob/master/LICENSE.txt</licenseUrl>
|
<license type="expression">MIT</license>
|
||||||
<projectUrl>http://github.com/canton7/Stylet</projectUrl>
|
<projectUrl>http://github.com/canton7/Stylet</projectUrl>
|
||||||
<iconUrl>https://raw.githubusercontent.com/canton7/Stylet/master/StyletIcon.png</iconUrl>
|
<iconUrl>https://raw.githubusercontent.com/canton7/Stylet/master/StyletIcon.png</iconUrl>
|
||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
|
@ -16,10 +16,10 @@
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|
||||||
<files>
|
<files>
|
||||||
<file src="..\Stylet\bin\Release\Stylet.dll" target="lib\net45"/>
|
<file src="..\Stylet\bin\Release\net45\Stylet.dll" target="lib\net45"/>
|
||||||
<file src="..\Stylet\bin\Release\Stylet.pdb" target="lib\net45"/>
|
<file src="..\Stylet\bin\Stylet.xml" target="lib\net45"/>
|
||||||
<file src="..\Stylet\bin\Release\Stylet.pdb.srcsrv" target="lib\net45"/>
|
<file src="..\Stylet\bin\Release\netcoreapp3.0\Stylet.dll" target="lib\netcoreapp3.0"/>
|
||||||
<file src="..\Stylet\bin\Release\Stylet.xml" target="lib\net45"/>
|
<file src="..\Stylet\bin\Stylet.xml" target="lib\netcoreapp3.0"/>
|
||||||
<file src="readme.txt" target=""/>
|
<file src="readme.txt" target=""/>
|
||||||
</files>
|
</files>
|
||||||
</package>
|
</package>
|
||||||
|
|
90
Rakefile
90
Rakefile
|
@ -10,100 +10,24 @@ NUSPEC_START = 'NuGet/Stylet.start.nuspec'
|
||||||
ASSEMBLY_INFO = 'Stylet/Properties/AssemblyInfo.cs'
|
ASSEMBLY_INFO = 'Stylet/Properties/AssemblyInfo.cs'
|
||||||
|
|
||||||
CSPROJ = 'Stylet/Stylet.csproj'
|
CSPROJ = 'Stylet/Stylet.csproj'
|
||||||
MSBUILD = %q{C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe}
|
UNIT_TESTS = 'StyletUnitTests/StyletUnitTests.csproj'
|
||||||
|
|
||||||
directory COVERAGE_DIR
|
directory COVERAGE_DIR
|
||||||
|
|
||||||
desc "Build the project for release"
|
desc "Build the project using the current CONFIG (or Debug)"
|
||||||
task :build do
|
task :build do
|
||||||
sh MSBUILD, CSPROJ, "/t:Clean;Rebuild", "/p:Configuration=Release", "/verbosity:normal"
|
sh 'dotnet', 'build', '-c', CONFIG, CSPROJ
|
||||||
end
|
|
||||||
|
|
||||||
task :test_environment => [:build] do
|
|
||||||
NUNIT_TOOLS = 'packages/NUnit.Runners.*/tools'
|
|
||||||
NUNIT_CONSOLE = Dir[File.join(NUNIT_TOOLS, 'nunit-console.exe')].first
|
|
||||||
NUNIT_EXE = Dir[File.join(NUNIT_TOOLS, 'nunit.exe')].first
|
|
||||||
|
|
||||||
OPENCOVER_CONSOLE = Dir['packages/OpenCover.*/tools/OpenCover.Console.exe'].first
|
|
||||||
REPORT_GENERATOR = Dir['packages/ReportGenerator.*/tools/ReportGenerator.exe'].first
|
|
||||||
|
|
||||||
UNIT_TESTS_DLL = "StyletUnitTests/bin/#{CONFIG}/StyletUnitTests.dll"
|
|
||||||
INTEGRATION_TESTS_EXE = "StyletIntegrationTests/bin/#{CONFIG}/StyletIntegrationTests.exe"
|
|
||||||
|
|
||||||
raise "NUnit.Runners not found. Restore NuGet packages" unless NUNIT_CONSOLE && NUNIT_EXE
|
|
||||||
raise "OpenCover not found. Restore NuGet packages" unless OPENCOVER_CONSOLE
|
|
||||||
raise "ReportGenerator not found. Restore NuGet packages" unless REPORT_GENERATOR
|
|
||||||
end
|
|
||||||
|
|
||||||
task :nunit_test_runner => [:test_environment] do
|
|
||||||
sh NUNIT_CONSOLE, UNIT_TESTS_DLL
|
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Run unit tests using the current CONFIG (or Debug)"
|
desc "Run unit tests using the current CONFIG (or Debug)"
|
||||||
task :test => [:nunit_test_runner] do |t|
|
task :test do
|
||||||
rm 'TestResult.xml', :force => true
|
sh 'dotnet', 'test', '-c', CONFIG, UNIT_TESTS
|
||||||
end
|
|
||||||
|
|
||||||
desc "Launch the NUnit gui pointing at the correct DLL for CONFIG (or Debug)"
|
|
||||||
task :nunit => [:test_environment] do |t|
|
|
||||||
sh NUNIT_EXE, UNIT_TESTS_DLL
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
namespace :cover do
|
|
||||||
|
|
||||||
desc "Generate unit test code coverage reports for CONFIG (or Debug)"
|
|
||||||
task :unit => [:test_environment, COVERAGE_DIR] do |t|
|
|
||||||
coverage(instrument(:nunit, UNIT_TESTS_DLL))
|
|
||||||
end
|
|
||||||
|
|
||||||
desc "Create integration test code coverage reports for CONFIG (or Debug)"
|
|
||||||
task :integration => [:test_environment, COVERAGE_DIR] do |t|
|
|
||||||
coverage(instrument(:exe, INTEGRATION_TESTS_EXE))
|
|
||||||
end
|
|
||||||
|
|
||||||
desc "Create test code coverage for everything for CONFIG (or Debug)"
|
|
||||||
task :all => [:test_environment, COVERAGE_DIR] do |t|
|
|
||||||
coverage([instrument(:nunit, UNIT_TESTS_DLL), instrument(:exe, INTEGRATION_TESTS_EXE)])
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
def instrument(runner, target)
|
|
||||||
case runner
|
|
||||||
when :nunit
|
|
||||||
opttarget = NUNIT_CONSOLE
|
|
||||||
opttargetargs = target
|
|
||||||
when :exe
|
|
||||||
opttarget = target
|
|
||||||
opttargetargs = ''
|
|
||||||
else
|
|
||||||
raise "Unknown runner #{runner}"
|
|
||||||
end
|
|
||||||
|
|
||||||
coverage_file = File.join(COVERAGE_DIR, File.basename(target).ext('xml'))
|
|
||||||
sh OPENCOVER_CONSOLE, '-register:user', "-target:#{opttarget}", "-filter:+[Stylet]* -[Stylet]XamlGeneratedNamespace.*", "-targetargs:#{opttargetargs} /noshadow", "-output:#{coverage_file}"
|
|
||||||
|
|
||||||
rm('TestResult.xml', :force => true) if runner == :nunit
|
|
||||||
|
|
||||||
coverage_file
|
|
||||||
end
|
|
||||||
|
|
||||||
def coverage(coverage_files)
|
|
||||||
coverage_files = [*coverage_files]
|
|
||||||
sh REPORT_GENERATOR, "-reports:#{coverage_files.join(';')}", "-targetdir:#{COVERAGE_DIR}"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Create NuGet package"
|
desc "Create NuGet package"
|
||||||
task :package do
|
task :package do
|
||||||
local_hash = `git rev-parse HEAD`.chomp
|
sh 'dotnet', 'pack', '-c', CONFIG, CSPROJ, "-p:NuSpecFile=../#{NUSPEC}"
|
||||||
sh "NuGet/GitLink.exe . -s #{local_hash} -u #{GITLINK_REMOTE} -f Stylet.sln -ignore StyletUnitTests,StyletIntegrationTests"
|
sh 'dotnet', 'pack', '-c', CONFIG, CSPROJ, "-p:NuSpecFile=../#{NUSPEC_START}"
|
||||||
Dir.chdir(File.dirname(NUSPEC)) do
|
|
||||||
sh "nuget.exe pack #{File.basename(NUSPEC)}"
|
|
||||||
end
|
|
||||||
Dir.chdir(File.dirname(NUSPEC_START)) do
|
|
||||||
sh "nuget.exe pack #{File.basename(NUSPEC_START)}"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Bump version number"
|
desc "Bump version number"
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<AssemblyName>Stylet</AssemblyName>
|
<AssemblyName>Stylet</AssemblyName>
|
||||||
<CodeAnalysisRuleSet />
|
<CodeAnalysisRuleSet />
|
||||||
<EnableDefaultItems>false</EnableDefaultItems>
|
<EnableDefaultItems>false</EnableDefaultItems>
|
||||||
|
<DocumentationFile>bin\Stylet.xml</DocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
Loading…
Reference in New Issue