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

Modernize the entire repo again and add .NET MAUI #111

Merged
merged 18 commits into from
Jun 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interesting projects:

- [SkiaSharp][skiasharp] _(the engine)_
- [SkiaSharp.Extended][extended] _(additional APIs)_
- [SkiaSharp.Extended.UI][ui] _(additional Xamarin.Forms controls)_
- [SkiaSharp.Extended.UI.Forms][ui] _(additional Xamarin.Forms controls)_

**Deprecated / Unmaintained Libraries**

Expand Down
10 changes: 10 additions & 0 deletions SkiaSharp.Extended-Pack.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"solution": {
"path": "SkiaSharp.Extended.sln",
"projects": [
"source\\SkiaSharp.Extended.UI.Forms.WPF\\SkiaSharp.Extended.UI.Forms.WPF.csproj",
"source\\SkiaSharp.Extended.UI.Forms\\SkiaSharp.Extended.UI.Forms.csproj",
"source\\SkiaSharp.Extended\\SkiaSharp.Extended.csproj"
]
}
}
593 changes: 0 additions & 593 deletions SkiaSharp.Extended.Unix.sln

This file was deleted.

677 changes: 213 additions & 464 deletions SkiaSharp.Extended.sln

Large diffs are not rendered by default.

129 changes: 86 additions & 43 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,51 +19,94 @@ resources:
name: xamarin/yaml-templates
endpoint: xamarin
ref: refs/heads/main
- repository: components
type: github
name: xamarin/XamarinComponents
endpoint: xamarin

jobs:
- job: prepare
stages:

- stage: prepare
displayName: Prepare Build
pool:
vmImage: ubuntu-latest
steps:
- checkout: none
- pwsh: |
$pr = "pr." + $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER
Write-Host "Preview label: $pr"
Write-Host "##vso[task.setvariable variable=PREVIEW_LABEL]$pr"
displayName: Use a special preview label for PRs
condition: eq(variables['Build.Reason'], 'PullRequest')
- pwsh: |
$label = ""
if ($env:BUILD_REASON -ne "PullRequest") {
$label = "+" + $env:BUILD_SOURCEBRANCHNAME
}
$label = "$env:BASE_VERSION-$env:PREVIEW_LABEL.$env:BUILD_NUMBER$label"
Write-Host "Build label: $label"
Write-Host "##vso[build.updatebuildnumber]$label"
displayName: Update the build number with a more readable one
jobs:
- job: prepare
displayName: Prepare Build
pool:
vmImage: ubuntu-latest
steps:
- checkout: none
- pwsh: |
$pr = "pr." + $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER
Write-Host "Preview label: $pr"
Write-Host "##vso[task.setvariable variable=PREVIEW_LABEL]$pr"
displayName: Use a special preview label for PRs
condition: eq(variables['Build.Reason'], 'PullRequest')
- pwsh: |
$label = ""
if ($env:BUILD_REASON -ne "PullRequest") {
$label = "+" + $env:BUILD_SOURCEBRANCHNAME
}
$label = "$env:BASE_VERSION-$env:PREVIEW_LABEL.$env:BUILD_NUMBER$label"
Write-Host "Build label: $label"
Write-Host "##vso[build.updatebuildnumber]$label"
displayName: Update the build number with a more readable one

- template: .ci/build.yml@components
parameters:
areaPath: 'DevDiv\Xamarin SDK\SkiaSharp'
linuxImage: 'ubuntu-latest'
publishJob: 'windows'
validPackagePrefixes:
- SkiaSharp
preBuildSteps:
- bash: |
cd /opt/hostedtoolcache/dotnet/sdk/3.1.302/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets && \
mv Microsoft.WinFx.props Microsoft.WinFX.props && \
mv Microsoft.WinFx.targets Microsoft.WinFX.targets
condition: eq(variables['System.JobName'], 'linux')
displayName: Fix the casing bug for files in .NET Core SDK on Linux
# Only build the samples and run tests on the public pipeline
# - ${{ if ne(variables['System.TeamProject'], 'devdiv') }}:
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
- stage: build
displayName: Build
dependsOn: prepare
jobs:
- job: build
displayName: Build
pool:
vmImage: windows-latest
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: 3.1.x
displayName: Install .NET Core 3.1.x
- pwsh: dotnet tool update -g cake.tool
displayName: Install the Cake .NET tool
- pwsh: dotnet cake
displayName: Build everything
- task: PublishTestResults@2
inputs:
testResultsFormat: VSTest
testResultsFiles: ./output/test-results/**/*.trx
- publish: output
artifact: windows
displayName: Upload Logs

# Only build the NuGets on the release pipeline
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
- template: sign-artifacts/jobs/v1.yml@internal-templates
parameters:
dependsOn: [ 'build' ]
additionalConditions: eq(variables['Build.SourceBranch'], 'refs/heads/main')
- stage: pack
displayName: Pack NuGets
dependsOn: prepare
jobs:
- job: pack
displayName: Pack NuGets
pool:
vmImage: windows-latest
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: 3.1.x
displayName: Install .NET Core 3.1.x
- pwsh: dotnet tool update -g cake.tool
displayName: Install the Cake .NET tool
- pwsh: dotnet cake --target=pack
displayName: Pack NuGets
- publish: output
artifact: nuget
displayName: Upload NuGets
- stage: signing
displayName: Sign NuGets
dependsOn: pack
jobs:
- template: sign-artifacts/jobs/v2.yml@internal-templates
parameters:
usePipelineArtifactTasks: true
${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}:
signType: 'Real'
${{ if not(eq(variables['Build.SourceBranch'], 'refs/heads/main')) }}:
signType: 'Test'
60 changes: 16 additions & 44 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,36 +1,25 @@
var TARGET = Argument("t", Argument("target", "ci"));

var TARGET = Argument("t", Argument("target", "Default"));
var PREVIEW_LABEL = Argument ("previewLabel", EnvironmentVariable ("PREVIEW_LABEL") ?? "preview");
var BUILD_NUMBER = EnvironmentVariable ("BUILD_NUMBER") ?? "0";
var GIT_SHA = Argument ("gitSha", EnvironmentVariable ("GIT_SHA") ?? "");
var GIT_BRANCH_NAME = Argument ("gitBranch", EnvironmentVariable ("GIT_BRANCH_NAME") ?? "");

Task("libs")
.WithCriteria(Context.Environment.Platform.Family != PlatformFamily.Linux)
Task("build")
.Does(() =>
{
var settings = new MSBuildSettings()
.EnableBinaryLogger("./output/binlogs/libs.binlog")
.EnableBinaryLogger("./output/binlogs/build.binlog")
.SetConfiguration("Release")
.WithRestore();

var sln = IsRunningOnWindows()
? "./SkiaSharp.Extended.sln"
: "./SkiaSharp.Extended.Unix.sln";

MSBuild(sln, settings);
MSBuild("./SkiaSharp.Extended.sln", settings);
});

Task("nugets")
.IsDependentOn("libs")
Task("pack")
.Does(() =>
{
var sln = IsRunningOnWindows()
? "./source/Source.sln"
: "./source/Source.Unix.sln";

MSBuild(sln, new MSBuildSettings()
.EnableBinaryLogger("./output/binlogs/nugets.binlog")
MSBuild("./SkiaSharp.Extended-Pack.slnf", new MSBuildSettings()
.EnableBinaryLogger("./output/binlogs/pack.binlog")
.SetConfiguration("Release")
.WithRestore()
.WithProperty("PackageOutputPath", MakeAbsolute(new FilePath("./output/")).FullPath)
Expand All @@ -41,17 +30,18 @@ Task("nugets")
preview += $".{BUILD_NUMBER}";
}

MSBuild(sln, new MSBuildSettings()
.EnableBinaryLogger("./output/binlogs/nugets-preview.binlog")
MSBuild("./SkiaSharp.Extended-Pack.slnf", new MSBuildSettings()
.EnableBinaryLogger("./output/binlogs/pack-preview.binlog")
.SetConfiguration("Release")
.WithRestore()
.WithProperty("PackageOutputPath", MakeAbsolute(new FilePath("./output/")).FullPath)
.WithProperty("VersionSuffix", preview)
.WithTarget("Pack"));

CopyFileToDirectory("./source/SignList.xml", "./output/");
});

Task("tests")
.IsDependentOn("libs")
Task("test")
.Does(() =>
{
var failed = 0;
Expand Down Expand Up @@ -79,27 +69,9 @@ Task("tests")
throw new Exception($"{failed} tests have failed.");
});

Task("samples")
.WithCriteria(Context.Environment.Platform.Family != PlatformFamily.Linux)
.IsDependentOn("nugets")
.Does(() =>
{
var settings = new MSBuildSettings()
.EnableBinaryLogger("./output/binlogs/samples.binlog")
.SetConfiguration("Release")
.WithRestore();

var sln = IsRunningOnWindows()
? "./SkiaSharp.Extended.sln"
: "./SkiaSharp.Extended.Unix.sln";

MSBuild(sln, settings);
});

Task("ci")
.IsDependentOn("libs")
.IsDependentOn("nugets")
.IsDependentOn("tests")
.IsDependentOn("samples");
Task("Default")
.IsDependentOn("build")
.IsDependentOn("pack")
.IsDependentOn("test");

RunTarget(TARGET);
14 changes: 0 additions & 14 deletions docs/api/deprecated.md

This file was deleted.

125 changes: 0 additions & 125 deletions docs/api/iconify/iconify.md

This file was deleted.

Loading