* Improved the groovy script a good bit
* Updated some docs
This commit is contained in:
Matthew Leibowitz 2018-08-15 17:35:05 +02:00 коммит произвёл GitHub
Родитель 9025fddd35
Коммит e7a0fbdc20
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 208 добавлений и 99 удалений

Просмотреть файл

@ -2,9 +2,7 @@
#addin nuget:?package=Cake.XCode&version=4.0.0
#addin nuget:?package=Cake.FileHelpers&version=3.0.0
#addin nuget:?package=SharpCompress&version=0.22.0
#addin nuget:?package=Newtonsoft.Json&version=11.0.2
#addin nuget:https://ci.appveyor.com/nuget/cake-monoapitools-gunq9ba46ljl?package=Cake.MonoApiTools&version=2.0.0-preview2
#addin nuget:https://ci.appveyor.com/nuget/nugetcomparer-mmjynpq6dcr9?package=Mono.ApiTools.NuGetDiff&version=1.0.0-preview-20&loaddependencies=true
#addin nuget:?package=Mono.ApiTools.NuGetDiff&version=1.0.0&loaddependencies=true
#tool "nuget:?package=xunit.runner.console&version=2.4.0"
#tool "nuget:?package=mdoc&version=5.7.2.3"
@ -18,8 +16,6 @@ using System.Xml;
using System.Xml.Linq;
using SharpCompress.Common;
using SharpCompress.Readers;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Mono.ApiTools;
using NuGet.Packaging;
using NuGet.Versioning;

Просмотреть файл

@ -149,10 +149,19 @@
<param name="e">The event arguments that contain the drawing surface and information.</param>
<summary>Implement this to draw on the canvas.</summary>
<remarks>
<para>There are two ways to draw on this surface: by overriding the <see cref="M:SkiaSharp.Views.Desktop.SKControl.OnPaintSurface(SkiaSharp.Views.Desktop.SKPaintSurfaceEventArgs)" /> method, or by attaching a handler to the <see cref="E:SkiaSharp.Views.Desktop.SKControl.PaintSurface" /> event. If the method is overridden, then the base must be called.</para>
<para></para>
<example>
<code lang="C#"><![CDATA[protected override void OnPaintSurface (SKPaintSurfaceEventArgs e)
<format type="text/markdown"><![CDATA[
## Remarks
There are two ways to draw on this surface: by overriding the
<xref:SkiaSharp.Views.Desktop.SKControl.OnPaintSurface(SkiaSharp.Views.Desktop.SKPaintSurfaceEventArgs)>
method, or by attaching a handler to the
<xref:SkiaSharp.Views.Desktop.SKControl.PaintSurface>
event. If the method is overridden, then the base must be called.
## Examples
```csharp
protected override void OnPaintSurface (SKPaintSurfaceEventArgs e)
{
// call the base method
base.OnPaintSurface (e);
@ -165,8 +174,9 @@
// draw on the canvas
canvas.Flush ();
}]]></code>
</example>
}
```
]]></format>
</remarks>
</Docs>
</Member>
@ -193,10 +203,19 @@
<Docs>
<summary>Occurs when the the canvas needs to be redrawn.</summary>
<remarks>
<para>There are two ways to draw on this surface: by overriding the <see cref="M:SkiaSharp.Views.Desktop.SKControl.OnPaintSurface(SkiaSharp.Views.Desktop.SKPaintSurfaceEventArgs)" /> method, or by attaching a handler to the <see cref="E:SkiaSharp.Views.Desktop.SKControl.PaintSurface" /> event.</para>
<para></para>
<example>
<code lang="C#"><![CDATA[SKControl myView = ...;
<format type="text/markdown"><![CDATA[
## Remarks
There are two ways to draw on this surface: by overriding the
<xref:SkiaSharp.Views.Desktop.SKControl.OnPaintSurface(SkiaSharp.Views.Desktop.SKPaintSurfaceEventArgs)>
method, or by attaching a handler to the
<xref:SkiaSharp.Views.Desktop.SKControl.PaintSurface>
event.
## Examples
```csharp
SKControl myView = ...;
myView.PaintSurface += (sender, e) => {
var surface = e.Surface;
@ -207,8 +226,9 @@ myView.PaintSurface += (sender, e) => {
// draw on the canvas
canvas.Flush ();
};]]></code>
</example>
};
```
]]></format>
</remarks>
</Docs>
</Member>

Просмотреть файл

@ -224,10 +224,19 @@
<param name="e">The event arguments that contain the drawing surface and information.</param>
<summary>Implement this to draw on the canvas.</summary>
<remarks>
<para>There are two ways to draw on this surface: by overriding the <see cref="M:SkiaSharp.Views.Desktop.SKGLControl.OnPaintSurface(SkiaSharp.Views.Desktop.SKPaintGLSurfaceEventArgs)" /> method, or by attaching a handler to the <see cref="E:SkiaSharp.Views.Desktop.SKGLControl.PaintSurface" /> event. If the method is overridden, then the base must be called.</para>
<para></para>
<example>
<code lang="C#"><![CDATA[protected override void OnPaintSurface (SKPaintGLSurfaceEventArgs e)
<format type="text/markdown"><![CDATA[
## Remarks
There are two ways to draw on this surface: by overriding the
<xref:SkiaSharp.Views.Desktop.SKGLControl.OnPaintSurface(SkiaSharp.Views.Desktop.SKPaintGLSurfaceEventArgs)>
method, or by attaching a handler to the
<xref:SkiaSharp.Views.Desktop.SKGLControl.PaintSurface>
event. If the method is overridden, then the base must be called.
## Examples
```csharp
protected override void OnPaintSurface (SKPaintGLSurfaceEventArgs e)
{
// call the base method
base.OnPaintSurface (e);
@ -240,8 +249,9 @@
// draw on the canvas
canvas.Flush ();
}]]></code>
</example>
}
```
]]></format>
</remarks>
</Docs>
</Member>
@ -268,10 +278,19 @@
<Docs>
<summary>Occurs when the surface needs to be redrawn.</summary>
<remarks>
<para>There are two ways to draw on this surface: by overriding the <see cref="M:SkiaSharp.Views.Desktop.SKGLControl.OnPaintSurface(SkiaSharp.Views.Desktop.SKPaintGLSurfaceEventArgs)" /> method, or by attaching a handler to the <see cref="E:SkiaSharp.Views.Desktop.SKGLControl.PaintSurface" /> event.</para>
<para></para>
<example>
<code lang="C#"><![CDATA[SKGLControl myView = ...;
<format type="text/markdown"><![CDATA[
## Remarks
There are two ways to draw on this surface: by overriding the
<xref:SkiaSharp.Views.Desktop.SKGLControl.OnPaintSurface(SkiaSharp.Views.Desktop.SKPaintGLSurfaceEventArgs)>
method, or by attaching a handler to the
<xref:SkiaSharp.Views.Desktop.SKGLControl.PaintSurface>
event.
## Examples
```csharp
SKGLControl myView = ...;
myView.PaintSurface += (sender, e) => {
var surface = e.Surface;
@ -282,8 +301,9 @@ myView.PaintSurface += (sender, e) => {
// draw on the canvas
canvas.Flush ();
};]]></code>
</example>
};
```
]]></format>
</remarks>
</Docs>
</Member>

Просмотреть файл

@ -219,10 +219,19 @@
<param name="e">The event arguments that contain the drawing surface and information.</param>
<summary>Implement this to draw on the canvas.</summary>
<remarks>
<para>There are two ways to draw on this surface: by overriding the <see cref="M:SkiaSharp.Views.Forms.SKCanvasView.OnPaintSurface(SkiaSharp.Views.Forms.SKPaintSurfaceEventArgs)" /> method, or by attaching a handler to the <see cref="E:SkiaSharp.Views.Forms.SKCanvasView.PaintSurface" /> event. If the method is overridden, then the base must be called.</para>
<para></para>
<example>
<code lang="C#"><![CDATA[protected override void OnPaintSurface (SKPaintSurfaceEventArgs e)
<format type="text/markdown"><![CDATA[
## Remarks
There are two ways to draw on this surface: by overriding the
<xref:SkiaSharp.Views.Forms.SKCanvasView.OnPaintSurface(SkiaSharp.Views.Forms.SKPaintSurfaceEventArgs)>
method, or by attaching a handler to the
<xref:SkiaSharp.Views.Forms.SKCanvasView.PaintSurface>
event. If the method is overridden, then the base must be called.
## Examples
```csharp
protected override void OnPaintSurface (SKPaintSurfaceEventArgs e)
{
// call the base method
base.OnPaintSurface (e);
@ -235,9 +244,9 @@
// draw on the canvas
canvas.Flush ();
}]]></code>
</example>
<para></para>
}
```
]]></format>
</remarks>
</Docs>
</Member>
@ -285,11 +294,19 @@
<Docs>
<summary>Occurs when the the canvas needs to be redrawn.</summary>
<remarks>
<para>There are two ways to draw on this surface: by overriding the <see cref="M:SkiaSharp.Views.Forms.SKCanvasView.OnPaintSurface(SkiaSharp.Views.Forms.SKPaintSurfaceEventArgs)" /> method, or by attaching a handler to the <see cref="E:SkiaSharp.Views.Forms.SKCanvasView.PaintSurface" /> event.
</para>
<para></para>
<example>
<code lang="C#"><![CDATA[SKCanvasView myView = ...;
<format type="text/markdown"><![CDATA[
## Remarks
There are two ways to draw on this surface: by overriding the
<xref:SkiaSharp.Views.Forms.SKCanvasView.OnPaintSurface(SkiaSharp.Views.Forms.SKPaintSurfaceEventArgs)>
method, or by attaching a handler to the
<xref:SkiaSharp.Views.Forms.SKCanvasView.PaintSurface>
event.
## Examples
```csharp
SKCanvasView myView = ...;
myView.PaintSurface += (sender, e) => {
var surface = e.Surface;
@ -300,9 +317,9 @@ myView.PaintSurface += (sender, e) => {
// draw on the canvas
canvas.Flush ();
};]]></code>
</example>
<para></para>
};
```
]]></format>
</remarks>
</Docs>
</Member>

Просмотреть файл

@ -234,10 +234,19 @@
<param name="e">The event arguments that contain the drawing surface and information.</param>
<summary>Implement this to draw on the surface.</summary>
<remarks>
<para>There are two ways to draw on this surface: by overriding the <see cref="M:SkiaSharp.Views.Forms.SKGLView.OnPaintSurface(SkiaSharp.Views.Forms.SKPaintGLSurfaceEventArgs)" /> method, or by attaching a handler to the <see cref="E:SkiaSharp.Views.Forms.SKGLView.PaintSurface" /> event. If the method is overridden, then the base must be called.</para>
<para></para>
<example>
<code lang="C#"><![CDATA[protected override void OnPaintSurface (SKPaintGLSurfaceEventArgs e)
<format type="text/markdown"><![CDATA[
## Remarks
There are two ways to draw on this surface: by overriding the
<xref:SkiaSharp.Views.Forms.SKGLView.OnPaintSurface(SkiaSharp.Views.Forms.SKPaintGLSurfaceEventArgs)>
method, or by attaching a handler to the
<xref:SkiaSharp.Views.Forms.SKGLView.PaintSurface>
event. If the method is overridden, then the base must be called.
## Examples
```csharp
protected override void OnPaintSurface (SKPaintGLSurfaceEventArgs e)
{
// call the base method
base.OnPaintSurface (e);
@ -250,9 +259,9 @@
// draw on the canvas
canvas.Flush ();
}]]></code>
</example>
<para></para>
}
```
]]></format>
</remarks>
</Docs>
</Member>
@ -300,10 +309,19 @@
<Docs>
<summary>Occurs when the surface needs to be redrawn.</summary>
<remarks>
<para>There are two ways to draw on this surface: by overriding the <see cref="M:SkiaSharp.Views.Forms.SKGLView.OnPaintSurface(SkiaSharp.Views.Forms.SKPaintGLSurfaceEventArgs)" /> method, or by attaching a handler to the <see cref="E:SkiaSharp.Views.Forms.SKGLView.PaintSurface" /> event.</para>
<para></para>
<example>
<code lang="C#"><![CDATA[SKGLView myView = ...;
<format type="text/markdown"><![CDATA[
## Remarks
There are two ways to draw on this surface: by overriding the
<xref:SkiaSharp.Views.Forms.SKGLView.OnPaintSurface(SkiaSharp.Views.Forms.SKPaintGLSurfaceEventArgs)>
method, or by attaching a handler to the
<xref:SkiaSharp.Views.Forms.SKGLView.PaintSurface>
event.
## Examples
```csharp
SKGLView myView = ...;
myView.PaintSurface += (sender, e) => {
var surface = e.Surface;
@ -311,12 +329,12 @@ myView.PaintSurface += (sender, e) => {
var surfaceHeight = e.RenderTarget.Height;
var canvas = surface.Canvas;
// draw on the canvas
canvas.Flush ();
};]]></code>
</example>
<para></para>
};
```
]]></format>
</remarks>
</Docs>
</Member>

Просмотреть файл

@ -20,10 +20,19 @@
<Docs>
<summary>Convenience class used to restore the canvas state in a using statement.</summary>
<remarks>
<para>This class can be used in a using statement to save the state of the canvas (matrix, clip and draw filter) allowing you to change these components and have them automatically undone by virtue of having the <see cref="M:SkiaSharp.SKAutoCanvasRestore.Dispose" /> method restore the canvas state to the state it was when this instance was created.</para>
<para></para>
<example>
<code lang="C#"><![CDATA[SKCanvas canvas = ...;
<format type="text/markdown"><![CDATA[
## Remarks
This class can be used in a using statement to save the state of the canvas
(matrix, clip and draw filter) allowing you to change these components and have
them automatically undone by virtue of having the
<xref:SkiaSharp.SKAutoCanvasRestore.Dispose> method restore the canvas state to
the state it was when this instance was created.
## Examples
```csharp
SKCanvas canvas = ...;
using (new SKAutoCanvasRestore(canvas)) {
// perform some transform
@ -34,9 +43,9 @@ using (new SKAutoCanvasRestore(canvas)) {
canavs.DrawRect (10, 10, 100, 100, paint);
// automatically restore to original transform
}]]></code>
</example>
<para></para>
}
```
]]></format>
</remarks>
</Docs>
<Members>

Просмотреть файл

@ -19,10 +19,18 @@
<Docs>
<summary>Convenience class used to lock and unlock the bitmap pixels in a using statement.</summary>
<remarks>
<para>This class can be used in a using statement to lock the pixels of the bitmap allowing you to read those pixels. The pixels are automatically unlocked by virtue of having the <see cref="M:SkiaSharp.SKAutoLockPixels.Dispose" /> method unlock the bitmap pixels.</para>
<para></para>
<example>
<code lang="C#"><![CDATA[SKBitmap bitmap = ...;
<format type="text/markdown"><![CDATA[
## Remarks
This class can be used in a using statement to lock the pixels of the bitmap
allowing you to read those pixels. The pixels are automatically unlocked by
virtue of having the <xref:SkiaSharp.SKAutoLockPixels.Dispose> method unlock
the bitmap pixels.
## Examples
```csharp
SKBitmap bitmap = ...;
using (new SKAutoLockPixels(bitmap)) {
// get a pointer to the pixels
@ -31,9 +39,9 @@ using (new SKAutoLockPixels(bitmap)) {
// use the pointer
// automatically unlock the pixels
}]]></code>
</example>
<para></para>
}
```
]]></format>
</remarks>
</Docs>
<Members>

Просмотреть файл

@ -20,10 +20,17 @@
<Docs>
<summary>Convenience class used to automatically free the image data for a mask in a using statement.</summary>
<remarks>
<para>This class can be used in a using statement to automatically free the image data of a mask by virtue of having the <see cref="M:SkiaSharp.SKAutoMaskFreeImage.Dispose" /> method.</para>
<para></para>
<example>
<code lang="C#"><![CDATA[// some buffer
<format type="text/markdown"><![CDATA[
## Remarks
This class can be used in a using statement to automatically free the image
data of a mask by virtue of having the
<xref:SkiaSharp.SKAutoMaskFreeImage.Dispose> method.
## Examples
```csharp
// some buffer
byte[] buffer = ...;
// create the mask, allocating the image
@ -32,8 +39,9 @@ using (new SKAutoMaskFreeImage(mask.Image)) {
// use the mask
// automatically release the image data
}]]></code>
</example>
}
```
]]></format>
</remarks>
</Docs>
<Members>

Просмотреть файл

@ -17,11 +17,17 @@
<Docs>
<summary>Wraps a <see cref="T:System.IO.Stream" /> into a <see cref="T:SkiaSharp.SKStreamAsset" /> (a seekable, rewindable Skia stream)</summary>
<remarks>
<para>The following example shows how to wrap a <see cref="T:System.IO.Stream" /> that represents a stream into an embedded resource in an assembly and use it with Skia APIs that use resources:</para>
<para></para>
<para></para>
<example>
<code lang="C#"><![CDATA[public static void BitmapShader (SKCanvas canvas, int width, int height)
<format type="text/markdown"><![CDATA[
## Remarks
The following example shows how to wrap a <xref:System.IO.Stream> that
represents a stream into an embedded resource in an assembly and use it with
SkiaSharp APIs that use resources:
## Examples
```csharp
public static void BitmapShader (SKCanvas canvas, int width, int height)
{
var assembly = typeof(Demos).GetTypeInfo ().Assembly;
@ -40,8 +46,9 @@
canvas.DrawPaint (paint);
}
}
}]]></code>
</example>
}
```
]]></format>
</remarks>
</Docs>
<Members>

Просмотреть файл

@ -1,8 +1,9 @@
import groovy.transform.Field
@Field def isPr = (env.ghprbPullId && !env.ghprbPullId.empty ? true : false)
@Field def branchName = (isPr ? "pr" : env.BRANCH_NAME)
@Field def isPr = false
@Field def branchName = null
@Field def commitHash = null
@Field def githubStatusSha = null
@Field def linuxPackages = "xvfb xauth libfontconfig1-dev libglu1-mesa-dev g++ mono-complete msbuild curl ca-certificates-mono unzip python git referenceassemblies-pcl dotnet-sdk-2.0.0 ttf-ancient-fonts openjdk-8-jdk zip gettext openvpn acl libxcb-render-util0 libv4l-0 libsdl1.2debian libxcb-image0 bridge-utils rpm2cpio libxcb-icccm4 libwebkitgtk-1.0-0 cpio"
@Field def customEnv = [
@ -29,13 +30,20 @@ node("ubuntu-1604-amd64") {
timestamps {
checkout scm
commitHash = cmdResult("git rev-parse HEAD").trim()
isPr = env.ghprbPullId && !env.ghprbPullId.empty
branchName = isPr ? "pr" : env.BRANCH_NAME
githubStatusSha = isPr ? env.ghprbActualCommit : commitHash
echo "Building SHA1: ${commitHash}..."
echo " - PR: ${isPr}..."
echo " - Branch Name: ${branchName}..."
echo " - GitHub Status SHA1: ${githubStatusSha}..."
}
}
stage("Native Builds") {
parallel([
failFast: true,
// windows
win32: createNativeBuilder("Windows", "Windows", "components-windows"),
uwp: createNativeBuilder("UWP", "Windows", "components-windows"),
@ -58,8 +66,6 @@ node("ubuntu-1604-amd64") {
stage("Managed Builds") {
parallel([
failFast: true,
windows: createManagedBuilder("Windows", "components-windows"),
macos: createManagedBuilder("macOS", "components"),
linux: createManagedBuilder("Linux", "ubuntu-1604-amd64"),
@ -68,15 +74,13 @@ node("ubuntu-1604-amd64") {
stage("Packaging") {
parallel([
failFast: true,
package: createPackagingBuilder(),
])
}
stage("Clean Up") {
timestamps {
cleanWs()
}
}
}
@ -109,6 +113,7 @@ def createNativeBuilder(platform, host, label) {
uploadBlobs("native-${platform}_${host}")
cleanWs()
reportGitHubStatus(githubContext, "SUCCESS", "Build complete.")
} catch (Exception e) {
reportGitHubStatus(githubContext, "FAILURE", "Build failed.")
@ -169,6 +174,7 @@ def createManagedBuilder(host, label) {
uploadBlobs("managed-${host}")
cleanWs()
reportGitHubStatus(githubContext, "SUCCESS", "Build complete.")
} catch (Exception e) {
reportGitHubStatus(githubContext, "FAILURE", "Build failed.")
@ -203,6 +209,7 @@ def createPackagingBuilder() {
uploadBlobs("packing-${host}")
cleanWs()
reportGitHubStatus(githubContext, "SUCCESS", "Pack complete.")
} catch (Exception e) {
reportGitHubStatus(githubContext, "FAILURE", "Pack failed.")
@ -282,11 +289,11 @@ def reportGitHubStatus(context, statusResult, statusResultMessage) {
$class: "GitHubCommitStatusSetter",
commitShaSource: [
$class: "ManuallyEnteredShaSource",
sha: isPr ? env.ghprbActualCommit : commitHash
sha: githubStatusSha
],
contextSource: [
$class: "ManuallyEnteredCommitContextSource",
context: context
context: context + (isPr ? " (PR)" : "")
],
statusBackrefSource: [
$class: "ManuallyEnteredBackrefSource",
@ -322,6 +329,5 @@ def cmdResult(script) {
def getWSRoot() {
def cleanBranch = branchName.replace("/", "_").replace("\\", "_")
def wsRoot = isUnix() ? "workspace" : "C:/bld"
def pr = isPr ? "-PR" : ""
return "${wsRoot}/SkiaSharp${pr}/${cleanBranch}"
return "${wsRoot}/SkiaSharp/${cleanBranch}"
}