diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
index b4a194bc5..825c1f1ca 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -1,116 +1,98 @@
name: Build
-on:
- push:
- branches:
- - master
- tags:
- - 'v*'
- pull_request:
- branches:
- - master
-
+on:
+ push:
+ branches:
+ - master
+ tags:
+ - "v*"
+ pull_request:
+ branches:
+ - master
+
jobs:
- Coverage:
- runs-on: windows-latest
- needs: [Build]
- steps:
- - uses: actions/checkout@v1
-
- - name: Enable long file paths
- run: git config --global core.longpaths true
-
- - name: Update submodules
- run: git submodule -q update --init
-
- - name: Generate Test Coverage
- shell: pwsh
- run: ./tests/CodeCoverage/CodeCoverage.ps1
- env:
- CI : True
-
- - name: Update codecov
- uses: iansu/codecov-action-node@v1.0.0
- with:
- token: ${{secrets.CODECOV_TOKEN}}
- file: "ImageSharp.Coverage.xml"
- flags: unittests
-
- Build:
- strategy:
- matrix:
- options:
- - os : ubuntu-latest
- framework: netcoreapp2.1
- is32Bit: False
- - os : windows-latest
- framework: netcoreapp2.1
- is32Bit: False
- - os : windows-latest
- framework: net472
- is32Bit: False
- - os : windows-latest
- framework: net472
- is32Bit: True
-
- runs-on: ${{ matrix.options.os }}
-
- steps:
- - uses: actions/checkout@v1
-
- - name: Enable long file paths
- run: |
- git config --global core.autocrlf false
- git config --global core.longpaths true
-
- - name: Update submodules
- run: git submodule -q update --init
-
- - name: Build
- shell: pwsh
- run: |
- $DebugPreference = "Continue"
- ./build.ps1 "${{matrix.options.framework}}"
-
- - name: Test
- shell: pwsh
- run: ./run-tests.ps1 "${{matrix.options.framework}}" "${{matrix.options.is32Bit}}" true
- env:
- CI : True
-
- Publish:
- runs-on: windows-latest
- needs: [Build]
- if : github.event_name == 'push'
- steps:
- - uses: actions/checkout@v1
-
- - name: Enable long file paths
- run: git config --global core.longpaths true
-
- - name: Update submodules
- run: git submodule -q update --init
-
- - name: Build
- shell: pwsh
- run: |
- $DebugPreference = "Continue"
- ./build.ps1
-
- - name : install nuget
- if: success()
- uses: warrenbuckley/Setup-Nuget@v1
-
- - name: Configure feed
- if: success()
- run: nuget.exe source Add -Name "GitHub" -Source "https://nuget.pkg.github.com/sixlabors/index.json" -UserName ${{github.actor}} -Password ${{ secrets.GITHUB_TOKEN }}
-
- - name: Publish to nightly feed - github
- if: success()
- run: nuget.exe push -Source "GitHub" .\artifacts\*.nupkg
-
- - name: Publish to nightly feed -myget
- if: success()
- run: nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package
-
- # todo if github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org
\ No newline at end of file
+ Build:
+ strategy:
+ matrix:
+ opts:
+ - os: ubuntu-latest
+ framework: netcoreapp2.1
+ runtime: linux-x64
+ cover: False
+ - os: windows-latest
+ framework: netcoreapp2.1
+ runtime: win-x64
+ cover: True
+ - os: windows-latest
+ framework: net472
+ runtime: win-x64
+ cover: False
+ - os: windows-latest
+ framework: net472
+ runtime: win-x86
+ cover: False
+
+ runs-on: ${{ matrix.opts.os }}
+
+ steps:
+ - uses: actions/checkout@v1
+
+ - name: Install nuget
+ uses: NuGet/setup-nuget@v1
+
+ - name: Enable long file paths
+ run: |
+ git config --global core.autocrlf false
+ git config --global core.longpaths true
+
+ - name: Update Submodules
+ run: git submodule -q update --init --recursive
+
+ - name: Build
+ shell: pwsh
+ run: |
+ $DebugPreference = "Continue"
+ ./build.ps1 "${{matrix.opts.framework}}"
+
+ - name: Test no Coverage
+ if: matrix.opts.cover != 'True'
+ run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opt.framework}}" -r "${{matrix.opt.runtime}}" --no-build --filter Sandbox
+
+ - name: Test with Coverage
+ if: matrix.opts.cover == 'True'
+ run: dotnet test **/*tests/*.csproj -c Release -f "${{matrix.opt.framework}}" -r "${{matrix.opt.runtime}}" --no-build --filter Sandbox /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
+
+ - name: Update Codecov
+ uses: iansu/codecov-action-node@v1.0.0
+ if: matrix.opts.cover == 'True'
+ with:
+ token: ${{secrets.CODECOV_TOKEN}}
+ file: "coverage.xml"
+ flags: unittests
+
+ # Publish:
+ runs-on: windows-latest
+ needs: [Build]
+ if: github.event_name == 'push'
+ steps:
+ - uses: actions/checkout@v1
+
+ - name: install nuget
+ uses: NuGet/setup-nuget@v1
+
+ - name: Enable long file paths
+ run: git config --global core.longpaths true
+
+ - name: Update submodules
+ run: git submodule -q update --init --recursive
+
+ - name: Build
+ shell: pwsh
+ run: |
+ $DebugPreference = "Continue"
+ ./build.ps1
+
+ - name: Publish to nightly feed -myget
+ if: success()
+ run: nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package
+ # TODO: if github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org
diff --git a/.github/workflows/build-and-test.yml.bak b/.github/workflows/build-and-test.yml.bak
new file mode 100644
index 000000000..7d7d2ad26
--- /dev/null
+++ b/.github/workflows/build-and-test.yml.bak
@@ -0,0 +1,116 @@
+name: Build
+
+on:
+ push:
+ branches:
+ - master
+ tags:
+ - "v*"
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ Coverage:
+ runs-on: windows-latest
+ needs: [Build]
+ steps:
+ - uses: actions/checkout@v1
+
+ - name: Install nuget
+ uses: NuGet/setup-nuget@v1
+
+ - name: Enable long file paths
+ run: git config --global core.longpaths true
+
+ - name: Update submodules
+ run: git submodule -q update --init --recursive
+
+ - name: Generate Test Coverage
+ shell: pwsh
+ run: ./tests/CodeCoverage/CodeCoverage.ps1
+ env:
+ CI: True
+
+ - name: Update codecov
+ uses: iansu/codecov-action-node@v1.0.0
+ with:
+ token: ${{secrets.CODECOV_TOKEN}}
+ file: "ImageSharp.Coverage.xml"
+ flags: unittests
+
+ Build:
+ strategy:
+ matrix:
+ opts:
+ - os: ubuntu-latest
+ framework: netcoreapp2.1
+ is32Bit: False
+ doCoverage: False
+ - os: windows-latest
+ framework: netcoreapp2.1
+ is32Bit: False
+ doCoverage: True
+ - os: windows-latest
+ framework: net472
+ is32Bit: False
+ doCoverage: False
+ - os: windows-latest
+ framework: net472
+ is32Bit: True
+ doCoverage: False
+
+ runs-on: ${{ matrix.opts.os }}
+
+ steps:
+ - uses: actions/checkout@v1
+
+ - name: install nuget
+ uses: NuGet/setup-nuget@v1
+
+ - name: Enable long file paths
+ run: |
+ git config --global core.autocrlf false
+ git config --global core.longpaths true
+
+ - name: Update submodules
+ run: git submodule -q update --init
+
+ - name: Build
+ shell: pwsh
+ run: |
+ $DebugPreference = "Continue"
+ ./build.ps1 "${{matrix.opts.framework}}"
+
+ - name: Test
+ shell: pwsh
+ run: ./run-tests.ps1 "${{ matrix.opts.os }}" "${{matrix.opts.framework}}" "${{matrix.opts.is32Bit}}" "${{matrix.opts.doCoverage}}"
+ env:
+ CI: True
+
+ Publish:
+ runs-on: windows-latest
+ needs: [Build]
+ if: github.event_name == 'push'
+ steps:
+ - uses: actions/checkout@v1
+
+ - name: install nuget
+ uses: NuGet/setup-nuget@v1
+
+ - name: Enable long file paths
+ run: git config --global core.longpaths true
+
+ - name: Update submodules
+ run: git submodule -q update --init --recursive
+
+ - name: Build
+ shell: pwsh
+ run: |
+ $DebugPreference = "Continue"
+ ./build.ps1
+
+ - name: Publish to nightly feed -myget
+ if: success()
+ run: nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package
+ # TODO: if github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org
diff --git a/.vscode/launch.json b/.vscode/launch.json
deleted file mode 100644
index c772e647c..000000000
--- a/.vscode/launch.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- // Use IntelliSense to find out which attributes exist for C# debugging
- // Use hover for the description of the existing attributes
- // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
- "version": "0.2.0",
- "configurations": [
- {
- "name": ".NET Core Launch (console)",
- "type": "coreclr",
- "request": "launch",
- "preLaunchTask": "build",
- // If you have changed target frameworks, make sure to update the program path.
- "program": "${workspaceRoot}/tests/ImageSharp.Benchmarks/bin/Debug/netcoreapp2.0/ImageSharp.Benchmarks.dll",
- "args": [],
- "cwd": "${workspaceRoot}/samples/AvatarWithRoundedCorner",
- // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
- "console": "internalConsole",
- "stopAtEntry": false,
- "internalConsoleOptions": "openOnSessionStart"
- },
- {
- "name": ".NET Core Attach",
- "type": "coreclr",
- "request": "attach",
- "processId": "${command:pickProcess}"
- }
- ]
-}
\ No newline at end of file
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
deleted file mode 100644
index 82aaa2f8d..000000000
--- a/.vscode/tasks.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- // See https://go.microsoft.com/fwlink/?LinkId=733558
- // for the documentation about the tasks.json format
- "version": "0.1.0",
- "command": "dotnet",
- "isShellCommand": true,
- "args": [],
- "tasks": [
- {
- "taskName": "build",
- "args": [ "ImageSharp.sln" ],
- "isBuildCommand": true,
- "showOutput": "always",
- "problemMatcher": "$msCompile"
- },
- {
- "taskName": "build benchmark",
- "suppressTaskName": true,
- "args": [ "build", "tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj", "-f", "netcoreapp2.0", "-c", "Release" ],
- "showOutput": "always",
- "problemMatcher": "$msCompile"
- },
- {
- "taskName": "test",
- "args": ["tests/ImageSharp.Tests/ImageSharp.Tests.csproj", "-c", "release", "-f", "netcoreapp2.0"],
- "isTestCommand": true,
- "showOutput": "always",
- "problemMatcher": "$msCompile"
- }
- ]
-}
\ No newline at end of file
diff --git a/Directory.Build.targets b/Directory.Build.targets
index f6523fee0..71dd9ab99 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -15,33 +15,34 @@
$(DefineConstants);$(OS)
-
-
-
-
-
-
-
-
+
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
-
diff --git a/ImageSharp.sln b/ImageSharp.sln
index 227512cd1..6a80589d8 100644
--- a/ImageSharp.sln
+++ b/ImageSharp.sln
@@ -36,25 +36,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEM
.github\ISSUE_TEMPLATE\feature-request.md = .github\ISSUE_TEMPLATE\feature-request.md
EndProjectSection
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".vscode", ".vscode", "{0274D4CF-9932-47CC-8E89-54DC05B8F06E}"
- ProjectSection(SolutionItems) = preProject
- .vscode\launch.json = .vscode\launch.json
- .vscode\tasks.json = .vscode\tasks.json
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{E919DF0B-2607-4462-8FC0-5C98FE50F8C9}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "icons", "icons", "{2B02E303-7CC6-4E15-97EE-DBE86B287553}"
- ProjectSection(SolutionItems) = preProject
- build\icons\imagesharp-logo-128.png = build\icons\imagesharp-logo-128.png
- build\icons\imagesharp-logo-256.png = build\icons\imagesharp-logo-256.png
- build\icons\imagesharp-logo-32.png = build\icons\imagesharp-logo-32.png
- build\icons\imagesharp-logo-512.png = build\icons\imagesharp-logo-512.png
- build\icons\imagesharp-logo-64.png = build\icons\imagesharp-logo-64.png
- build\icons\imagesharp-logo.png = build\icons\imagesharp-logo.png
- build\icons\imagesharp-logo.svg = build\icons\imagesharp-logo.svg
- EndProjectSection
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{815C0625-CD3D-440F-9F80-2D83856AB7AE}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
@@ -354,6 +335,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Benchmarks", "te
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Sandbox46", "tests\ImageSharp.Sandbox46\ImageSharp.Sandbox46.csproj", "{561B880A-D9EE-44EF-90F5-817C54A9D9AB}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{C0D7754B-5277-438E-ABEB-2BA34401B5A7}"
+ ProjectSection(SolutionItems) = preProject
+ .github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -418,7 +404,6 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{FBE8C1AD-5AEC-4514-9B64-091D8E145865} = {1799C43E-5C54-4A8F-8D64-B1475241DB0D}
- {2B02E303-7CC6-4E15-97EE-DBE86B287553} = {E919DF0B-2607-4462-8FC0-5C98FE50F8C9}
{2AA31A1F-142C-43F4-8687-09ABCA4B3A26} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
{D4C5EC58-F8E6-4636-B9EE-C99D2578E5C6} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
{FA55F5DE-11A6-487D-ABA4-BC93A02717DD} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
@@ -438,6 +423,7 @@ Global
{EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
{2BF743D8-2A06-412D-96D7-F448F00C5EA5} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
{561B880A-D9EE-44EF-90F5-817C54A9D9AB} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
+ {C0D7754B-5277-438E-ABEB-2BA34401B5A7} = {1799C43E-5C54-4A8F-8D64-B1475241DB0D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5F8B9D1F-CD8B-4CC5-8216-D531E25BD795}
diff --git a/build.ps1 b/build.ps1
index e726fc30f..e2c62c3d3 100644
--- a/build.ps1
+++ b/build.ps1
@@ -2,7 +2,7 @@ param(
[string]$targetFramework = 'ALL'
)
-# lets calulat the correct version here
+# Lets calculate the correct version here
$fallbackVersion = "1.0.0";
$version = ''
@@ -10,13 +10,14 @@ $tagRegex = '^v?(\d+\.\d+\.\d+)(?:-([a-zA-Z]+)\.?(\d*))?$'
$skipFullFramework = 'false'
-# if we are trying to build only netcoreapp versions for testings then skip building the full framework targets
+# If we are trying to build only netcoreapp versions for testings then skip building the full framework targets
if ("$targetFramework".StartsWith("netcoreapp")) {
$skipFullFramework = 'true'
}
function ToBuildNumber {
param( $date )
+
if ("$date" -eq "") {
$date = [System.DateTime]::Now
}
@@ -25,32 +26,14 @@ function ToBuildNumber {
$date = [System.DateTime]::Parse($date)
}
-
return $date.ToString("yyyyMMddhhmmss")
}
-# if($IsWindows){
-# $skipFullFramework = 'true'
-# Write-Info "Building full framework targets - Running windows"
-# }else{
-# if (Get-Command "mono" -ErrorAction SilentlyContinue)
-# {
-# Write-Info "Building full framework targets - mono installed"
-# $skipFullFramework = 'true'
-# }
-# }
+# We are running on the build server
+$isVersionTag = "$env:GITHUB_REF".replace("refs/tags/", "") -match $tagRegex
-# we are running on the build server
-$isVersionTag = $env:APPVEYOR_REPO_TAG_NAME -match $tagRegex
-
-if ($isVersionTag -eq $false) {
- $isVersionTag = "$env:GITHUB_REF".replace("refs/tags/", "") -match $tagRegex
- if ($isVersionTag) {
- Write-Debug "Github tagged build"
- }
-}
-else {
- Write-Debug "Appveyor tagged build"
+if ($isVersionTag) {
+ Write-Debug "Github tagged build"
}
if ($isVersionTag -eq $false) {
@@ -75,13 +58,16 @@ if ($isVersionTag) {
$version = $matches[1]
$postTag = $matches[2]
$count = $matches[3]
- Write-Debug "version number: ${version} post tag: ${postTag} count: ${count}"
+
+ Write-Debug "Version number: ${version} post tag: ${postTag} count: ${count}"
+
if ("$postTag" -ne "") {
$version = "${version}-${postTag}"
}
+
if ("$count" -ne "") {
- # for consistancy with previous releases we pad the counter to only 4 places
- $padded = $count.Trim().Trim('0').PadLeft(4, "0");
+ # For consistancy with previous releases we pad the counter to only 4 places
+ $padded = $count.Trim().PadLeft(4, "0");
Write-Debug "count '$count', padded '${padded}'"
$version = "${version}${padded}"
@@ -94,10 +80,10 @@ else {
$list = $lastTag.Split("`n")
foreach ($tag in $list) {
- Write-Debug "testing ${tag}"
+ Write-Debug "Testing ${tag}"
$tag = $tag.Trim();
if ($tag -match $tagRegex) {
- Write-Debug "matched ${tag}"
+ Write-Debug "Matched ${tag}"
$version = $matches[1];
break;
}
@@ -112,71 +98,43 @@ else {
Write-Debug "Discovered base version from tags '${version}'"
}
- $buildNumber = $env:APPVEYOR_BUILD_NUMBER
+ # Create a build number based on the current time.
+ $buildNumber = ""
- if ("$buildNumber" -eq "") {
- # no counter availible in this environment
- # let make one up based on time
-
- if ( "$env:GITHUB_SHA" -ne '') {
- $buildNumber = ToBuildNumber (git show -s --format=%ci $env:GITHUB_SHA)
- }
- elseif ( "$(git diff --stat)" -eq '') {
- $buildNumber = ToBuildNumber (git show -s --format=%ci HEAD)
- }
- else {
- $buildNumber = ToBuildNumber
- }
- $buildNumber = "$buildNumber".Trim().Trim('0').PadLeft(12, "0");
+ if ( "$env:GITHUB_SHA" -ne '') {
+ $buildNumber = ToBuildNumber (git show -s --format=%ci $env:GITHUB_SHA)
}
- else {
- # build number replacement is padded to 6 places
- $buildNumber = "$buildNumber".Trim().Trim('0').PadLeft(6, "0");
- }
-
- if ("$env:APPVEYOR_PULL_REQUEST_NUMBER" -ne "") {
- Write-Debug "building a PR"
-
- $prNumber = "$env:APPVEYOR_PULL_REQUEST_NUMBER".Trim().Trim('0').PadLeft(5, "0");
- # this is a PR
- $version = "${version}-PullRequest${prNumber}${buildNumber}";
+ elseif ( "$(git diff --stat)" -eq '') {
+ $buildNumber = ToBuildNumber (git show -s --format=%ci HEAD)
}
else {
- Write-Debug "building a branch commit"
+ $buildNumber = ToBuildNumber
+ }
- # this is a general branch commit
- $branch = $env:APPVEYOR_REPO_BRANCH
+ $buildNumber = "$buildNumber".Trim().PadLeft(12, "0");
- if ("$branch" -eq "") {
- $branch = ((git rev-parse --abbrev-ref HEAD) | Out-String).Trim()
+ Write-Debug "Building a branch commit"
- if ("$branch" -eq "") {
- $branch = "unknown"
- }
- }
+ # This is a general branch commit
+ $branch = ((git rev-parse --abbrev-ref HEAD) | Out-String).Trim()
- $branch = $branch.Replace("/", "-").ToLower()
+ if ("$branch" -eq "") {
+ $branch = "unknown"
+ }
- if ($branch.ToLower() -eq "master" -or $branch.ToLower() -eq "head") {
- $branch = "dev"
- }
+ $branch = $branch.Replace("/", "-").ToLower()
- $version = "${version}-${branch}${buildNumber}";
+ if ($branch.ToLower() -eq "master" -or $branch.ToLower() -eq "head") {
+ $branch = "dev"
}
-}
-if ("$env:APPVEYOR_API_URL" -ne "") {
- # update appveyor build number for this build
- Invoke-RestMethod -Method "PUT" `
- -Uri "${env:APPVEYOR_API_URL}api/build" `
- -Body "{version:'${version}'}" `
- -ContentType "application/json"
+ $version = "${version}-${branch}${buildNumber}";
}
Write-Host "Building version '${version}'"
dotnet restore /p:packageversion=$version /p:DisableImplicitNuGetFallbackFolder=true /p:skipFullFramework=$skipFullFramework
-$repositoryUrl = "https://github.com/SixLabors/ImageSharp/"
+$repositoryUrl = "https://github.com/SixLabors/"
if ("$env:GITHUB_REPOSITORY" -ne "") {
$repositoryUrl = "https://github.com/$env:GITHUB_REPOSITORY"
@@ -187,19 +145,7 @@ dotnet build -c Release /p:packageversion=$version /p:skipFullFramework=$skipFul
if ($LASTEXITCODE ) { Exit $LASTEXITCODE }
-#
-# TODO: DO WE NEED TO RUN TESTS IMPLICITLY?
-#
-# if ( $env:CI -ne "True") {
-# cd ./tests/ImageSharp.Tests/
-# dotnet xunit -nobuild -c Release -f netcoreapp2.0 --fx-version 2.0.0
-# ./RunExtendedTests.cmd
-# cd ../..
-# }
-#
-
-if ($LASTEXITCODE ) { Exit $LASTEXITCODE }
-
Write-Host "Packaging projects"
-dotnet pack ./src/ImageSharp/ -c Release --output "$PSScriptRoot/artifacts" --no-build /p:packageversion=$version /p:skipFullFramework=$skipFullFramework /p:RepositoryUrl=$repositoryUrl
+
+dotnet pack -c Release --output "$PSScriptRoot/artifacts" --no-build /p:packageversion=$version /p:skipFullFramework=$skipFullFramework /p:RepositoryUrl=$repositoryUrl
if ($LASTEXITCODE ) { Exit $LASTEXITCODE }
diff --git a/build/icons/imagesharp-logo-128.png b/build/icons/imagesharp-logo-128.png
deleted file mode 100644
index 5c2079144..000000000
--- a/build/icons/imagesharp-logo-128.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:148a268c589b628f5d0b5af0e86911a0b393c35b8b25233c71553657c88e0b96
-size 7568
diff --git a/build/icons/imagesharp-logo-256.png b/build/icons/imagesharp-logo-256.png
deleted file mode 100644
index e38807ae1..000000000
--- a/build/icons/imagesharp-logo-256.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:7e4b2ff72aef1979500cd130c28490a00be116bb833bc96ca30c85dc0596099c
-size 15413
diff --git a/build/icons/imagesharp-logo-32.png b/build/icons/imagesharp-logo-32.png
deleted file mode 100644
index 273b171eb..000000000
--- a/build/icons/imagesharp-logo-32.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:021c12313afbdc65f58bfea8c7b436d5c2102513bb63d9e64ee2b61a1344c56a
-size 1799
diff --git a/build/icons/imagesharp-logo-512.png b/build/icons/imagesharp-logo-512.png
deleted file mode 100644
index 707dc9a35..000000000
--- a/build/icons/imagesharp-logo-512.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:3ae54ae0035df1f8f1459081e2f1d5cceda6f88cca6ec015d8c0209bf0d34edf
-size 32534
diff --git a/build/icons/imagesharp-logo-64.png b/build/icons/imagesharp-logo-64.png
deleted file mode 100644
index 17577772e..000000000
--- a/build/icons/imagesharp-logo-64.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:92896854265693f28f9a503b9093cb2c9a4a9b329f310732efdd9c6f6c3761bc
-size 3736
diff --git a/build/icons/imagesharp-logo.png b/build/icons/imagesharp-logo.png
deleted file mode 100644
index 707dc9a35..000000000
--- a/build/icons/imagesharp-logo.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:3ae54ae0035df1f8f1459081e2f1d5cceda6f88cca6ec015d8c0209bf0d34edf
-size 32534
diff --git a/build/icons/imagesharp-logo.svg b/build/icons/imagesharp-logo.svg
deleted file mode 100644
index 620287457..000000000
--- a/build/icons/imagesharp-logo.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/run-tests.ps1 b/run-tests.ps1
index 2d563c67e..c35649544 100644
--- a/run-tests.ps1
+++ b/run-tests.ps1
@@ -1,86 +1,71 @@
param(
- [string]$targetFramework,
- [string]$is32Bit = "False",
- [string]$skipCodeCov = $false
+ [string]$os,
+ [string]$targetFramework,
+ [string]$doCoverage = "False",
+ [string]$is32Bit = "False"
)
-if (!$targetFramework){
- Write-Host "run-tests.ps1 ERROR: targetFramework is undefined!"
- exit 1
+if (!$os) {
+ Write-Host "run-tests.ps1 ERROR: os is undefined!"
+ exit 1
+}
+
+if (!$targetFramework) {
+ Write-Host "run-tests.ps1 ERROR: targetFramework is undefined!"
+ exit 1
}
function VerifyPath($path, $errorMessage) {
- if (!(Test-Path -Path $path)) {
- Write-Host "run-tests.ps1 $errorMessage `n $xunitRunnerPath"
- exit 1
- }
+ if (!(Test-Path -Path $path)) {
+ Write-Host "run-tests.ps1 $errorMessage `n $xunitRunnerPath"
+ exit 1
+ }
}
function CheckSubmoduleStatus() {
- $submoduleStatus = (git submodule status) | Out-String
- # if the result string is empty, the command failed to run (we didn't capture the error stream)
- if ($submoduleStatus) {
- # git has been called successfully, what about the status?
- if (($submoduleStatus -match "\-") -or ($submoduleStatus -match "\(\(null\)\)"))
- {
- # submodule has not been initialized!
- return 2;
- }
- elseif ($submoduleStatus -match "\+")
- {
- # submodule is not synced:
- return 1;
- }
- else {
- # everything fine:
- return 0;
- }
- } else {
- # git call failed, so we should warn
- return 3;
+ $submoduleStatus = (git submodule status) | Out-String
+ # if the result string is empty, the command failed to run (we didn't capture the error stream)
+ if ($submoduleStatus) {
+ # git has been called successfully, what about the status?
+ if (($submoduleStatus -match "\-") -or ($submoduleStatus -match "\(\(null\)\)")) {
+ # submodule has not been initialized!
+ return 2;
}
-}
-
-
-if ( ($targetFramework -eq "netcoreapp2.1") -and ($env:CI -eq "True") -and ($is32Bit -ne "True") -and $skipCodeCov -ne $true) {
- # We execute CodeCoverage.cmd only for one specific job on CI (netcoreapp2.1 + 64bit )
- $testRunnerCmd = "./tests/CodeCoverage/CodeCoverage.ps1"
-}
-elseif ($targetFramework -eq "mono") {
- $testDllPath = "$PSScriptRoot\tests\ImageSharp.Tests\bin\Release\net462\SixLabors.ImageSharp.Tests.dll"
- VerifyPath($testDllPath, "test dll missing:")
-
- $xunitRunnerPath = "${env:HOMEPATH}\.nuget\packages\xunit.runner.console\2.3.1\tools\net452\"
-
- VerifyPath($xunitRunnerPath, "xunit console runner is missing on path:")
-
- cd "$xunitRunnerPath"
-
- if ($is32Bit -ne "True") {
- $monoPath = "${env:PROGRAMFILES}\Mono\bin\mono.exe"
+ elseif ($submoduleStatus -match "\+") {
+ # submodule is not synced:
+ return 1;
}
else {
- $monoPath = "${env:ProgramFiles(x86)}\Mono\bin\mono.exe"
+ # everything fine:
+ return 0;
}
+ }
+ else {
+ # git call failed, so we should warn
+ return 3;
+ }
+}
- VerifyPath($monoPath, "mono runtime missing:")
-
- $testRunnerCmd = "& `"${monoPath}`" .\xunit.console.exe `"${testDllPath}`""
+if (($os -eq "windows-latest") -and ($doCoverage -eq "True") -and ($env:CI -eq "True") -and ($is32Bit -ne "True")) {
+ # We execute CodeCoverage.cmd only for one specific job on CI (windows + coverageTargetFramework + 64bit )
+ $testRunnerCmd = ".\tests\CodeCoverage\CodeCoverage.cmd"
}
else {
- cd .\tests\ImageSharp.Tests
- $xunitArgs = "-nobuild -c Release -framework $targetFramework"
+ Set-Location .\tests
+ $xunitArgs = "-nobuild -c Release -framework $targetFramework"
- if ($targetFramework -eq "netcoreapp2.1") {
- # There were issues matching the correct installed runtime if we do not specify it explicitly:
- $xunitArgs += " --fx-version 2.1.0"
- }
+ $coreTargetFrameworkRegex = '^netcoreapp(\d+\.\d+)$'
+ if ($targetFramework -match $coreTargetFrameworkRegex) {
+ # There were issues matching the correct installed runtime if we do not specify it explicitly:
+ $fxVersion = $matches[1] + ".0"
+ $xunitArgs += " --fx-version $fxVersion"
+ }
- if ($is32Bit -eq "True") {
- $xunitArgs += " -x86"
- }
+ if ($is32Bit -eq "True") {
+ $xunitArgs += " -x86"
+ }
- $testRunnerCmd = "dotnet xunit $xunitArgs"
+ $testRunnerCmd = "dotnet xunit $xunitArgs"
}
Write-Host "running:"
@@ -89,25 +74,28 @@ Write-Host "..."
Invoke-Expression $testRunnerCmd
-cd $PSScriptRoot
+Set-Location $PSScriptRoot
$exitCodeOfTests = $LASTEXITCODE;
if (0 -ne ([int]$exitCodeOfTests)) {
- # check submodule status
- $submoduleStatus = CheckSubmoduleStatus
- if ([int]$submoduleStatus -eq 1) {
- # not synced
- Write-Host -ForegroundColor Yellow "Check if submodules are up to date. You can use 'git submodule update' to fix this";
- } elseif ($submoduleStatus -eq 2) {
- # not initialized
- Write-Host -ForegroundColor Yellow "Check if submodules are initialized. You can run 'git submodule init' to initialize them."
- } elseif ($submoduleStatus -eq 3) {
- # git not found, maybe submodules not synced?
- Write-Host -ForegroundColor Yellow "Could not check if submodules are initialized correctly. Maybe git is not installed?"
- } else {
- #Write-Host "Submodules are up to date";
- }
+ # check submodule status
+ $submoduleStatus = CheckSubmoduleStatus
+ if ([int]$submoduleStatus -eq 1) {
+ # not synced
+ Write-Host -ForegroundColor Yellow "Check if submodules are up to date. You can use 'git submodule update' to fix this";
+ }
+ elseif ($submoduleStatus -eq 2) {
+ # not initialized
+ Write-Host -ForegroundColor Yellow "Check if submodules are initialized. You can run 'git submodule init' to initialize them."
+ }
+ elseif ($submoduleStatus -eq 3) {
+ # git not found, maybe submodules not synced?
+ Write-Host -ForegroundColor Yellow "Could not check if submodules are initialized correctly. Maybe git is not installed?"
+ }
+ else {
+ #Write-Host "Submodules are up to date";
+ }
}
exit $exitCodeOfTests
diff --git a/src/ImageSharp/ImageSharp.csproj b/src/ImageSharp/ImageSharp.csproj
index 28343eaaa..8ca1f2ba5 100644
--- a/src/ImageSharp/ImageSharp.csproj
+++ b/src/ImageSharp/ImageSharp.csproj
@@ -118,10 +118,6 @@
-
-
-
-
TextTemplatingFileGenerator
diff --git a/tests/CodeCoverage/CodeCoverage.cmd b/tests/CodeCoverage/CodeCoverage.cmd
index 01e342b3d..9b14c163c 100644
--- a/tests/CodeCoverage/CodeCoverage.cmd
+++ b/tests/CodeCoverage/CodeCoverage.cmd
@@ -12,10 +12,10 @@ dotnet restore ImageSharp.sln
rem Clean the solution to force a rebuild with /p:codecov=true
dotnet clean ImageSharp.sln -c Release
rem The -threshold options prevents this taking ages...
-tests\CodeCoverage\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"dotnet.exe" -targetargs:"test tests\ImageSharp.Tests\ImageSharp.Tests.csproj -c Release -f netcoreapp2.1 /p:codecov=true" -register:user -threshold:10 -oldStyle -safemode:off -output:.\ImageSharp.Coverage.xml -hideskipped:All -returntargetcode -filter:"+[SixLabors.ImageSharp*]*"
+tests\CodeCoverage\OpenCover.4.7.922\tools\OpenCover.Console.exe -target:"dotnet.exe" -targetargs:"test tests\ImageSharp.Tests\ImageSharp.Tests.csproj -c Release -f netcoreapp2.1 /p:codecov=true" -register:user -threshold:10 -oldStyle -safemode:off -output:.\ImageSharp.Coverage.xml -hideskipped:All -returntargetcode -filter:"+[SixLabors.ImageSharp*]*"
if %errorlevel% neq 0 exit /b %errorlevel%
SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%
pip install codecov
-codecov -f "ImageSharp.Coverage.xml"
\ No newline at end of file
+codecov -f "ImageSharp.Coverage.xml"
diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props
index 97bd9b6e7..9c6fdae3d 100644
--- a/tests/Directory.Build.props
+++ b/tests/Directory.Build.props
@@ -13,6 +13,7 @@
$(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.props
tests
+ false
@@ -25,6 +26,11 @@
+
+
+
+
+
diff --git a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj
index 92c3d79ed..a25b548f2 100644
--- a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj
+++ b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj
@@ -7,7 +7,6 @@
SixLabors.ImageSharp.Benchmarks
netcoreapp2.1
$(TargetFrameworks);net472
- false
false
@@ -25,8 +24,4 @@
-
-
-
-
diff --git a/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj b/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj
index d340b2c84..f7959df6a 100644
--- a/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj
+++ b/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj
@@ -22,9 +22,5 @@
-
-
-
-
-
+
diff --git a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj
index d71f0958b..1c909faab 100644
--- a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj
+++ b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj
@@ -21,10 +21,6 @@
-
-
-
-
PreserveNewest
@@ -37,9 +33,5 @@
-
-
-
-