Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Commit

Permalink
Merge pull request #58 from xamarin/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
mattleibow authored Mar 31, 2017
2 parents c901389 + ca7bc90 commit b637f7e
Show file tree
Hide file tree
Showing 104 changed files with 2,586 additions and 10,490 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Repo-specific files
tools/
output/
**/Resources/Resource.Designer.cs

# User-specific files
*.suo
Expand Down
33 changes: 28 additions & 5 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#tool nuget:?package=XamarinComponent&version=1.1.0.40
#tool nuget:?package=XamarinComponent&version=1.1.0.49

#addin nuget:?package=Cake.Xamarin.Build&version=1.0.14.0
#addin nuget:?package=Cake.Xamarin
Expand Down Expand Up @@ -69,28 +69,51 @@ buildSpec = new BuildSpec () {
FromFile = "./src/SignaturePad.Forms.WindowsPhone/bin/Release/SignaturePad.Forms.WindowsPhone.dll",
ToDirectory = "output/wp8",
},
new OutputFileCopy {
FromFile = "./src/SignaturePad.UWP/bin/Release/SignaturePad.dll",
ToDirectory = "output/uwp",
},
new OutputFileCopy {
FromFile = "./src/SignaturePad.UWP/bin/Release/SignaturePad.pri",
ToDirectory = "output/uwp",
},
new OutputFileCopy {
FromFile = "./src/SignaturePad.UWP/bin/Release/SignaturePad.xr.xml",
ToDirectory = "output/uwp",
},
new OutputFileCopy {
FromFile = "./src/SignaturePad.Forms.UWP/bin/Release/SignaturePad.Forms.UWP.dll",
ToDirectory = "output/uwp",
},
}
}
},

Samples = new ISolutionBuilder [] {
new DefaultSolutionBuilder { SolutionPath = "./samples/Sample.Android/Sample.Android.sln", BuildsOn = BuildPlatforms.Mac | BuildPlatforms.Windows},
new DefaultSolutionBuilder { SolutionPath = "./samples/Sample.Android/Sample.Android.sln", BuildsOn = BuildPlatforms.Mac | BuildPlatforms.Windows },
new IOSSolutionBuilder { SolutionPath = "./samples/Sample.iOS/Sample.iOS.sln", BuildsOn = BuildPlatforms.Mac },
new IOSSolutionBuilder { SolutionPath = "./samples/Sample.Forms/Sample.Forms.Mac.sln", BuildsOn = BuildPlatforms.Mac },
new WpSolutionBuilder { SolutionPath = "./samples/Sample.WP8/Sample.WP8.sln", BuildsOn = BuildPlatforms.Windows },
new WpSolutionBuilder { SolutionPath = "./samples/Sample.UWP/Sample.UWP.sln", BuildsOn = BuildPlatforms.Windows },
new WpSolutionBuilder { SolutionPath = "./samples/Sample.Forms/Sample.Forms.Win.sln", BuildsOn = BuildPlatforms.Windows },
},

NuGets = new [] {
new NuGetInfo { NuSpec = "./nuget/Xamarin.Controls.SignaturePad.nuspec", BuildsOn = BuildPlatforms.Mac },
new NuGetInfo { NuSpec = "./nuget/Xamarin.Controls.SignaturePad.Forms.nuspec", BuildsOn = BuildPlatforms.Mac },
new NuGetInfo { NuSpec = "./nuget/Xamarin.Controls.SignaturePad.nuspec", BuildsOn = BuildPlatforms.Mac | BuildPlatforms.Windows },
new NuGetInfo { NuSpec = "./nuget/Xamarin.Controls.SignaturePad.Forms.nuspec", BuildsOn = BuildPlatforms.Mac | BuildPlatforms.Windows },
},

Components = new [] {
new Component {ManifestDirectory = "./component", BuildsOn = BuildPlatforms.Mac },
new Component { ManifestDirectory = "./component", BuildsOn = BuildPlatforms.Mac | BuildPlatforms.Windows },
},
};

SetupXamarinBuildTasks (buildSpec, Tasks, Task);

Task ("CI")
.IsDependentOn ("libs")
.IsDependentOn ("nuget")
.IsDependentOn ("component")
.IsDependentOn ("samples");

RunTarget (TARGET);
71 changes: 60 additions & 11 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
##########################################################################
# This is the Cake bootstrapper script for PowerShell.
# This file was downloaded from https://github.com/cake-build/resources
# Feel free to change this file to fit your needs.
##########################################################################

<#
.SYNOPSIS
Expand All @@ -22,6 +28,10 @@ Performs a dry run of the build script.
No tasks will be executed.
.PARAMETER Mono
Tells Cake to use the Mono scripting engine.
.PARAMETER SkipToolPackageRestore
Skips restoring of packages.
.PARAMETER ScriptArgs
Remaining arguments are added here.
.LINK
http://cakebuild.net
Expand All @@ -32,6 +42,7 @@ http://cakebuild.net
Param(
[string]$Script = "build.cake",
[string]$Target = "Default",
[ValidateSet("Release", "Debug")]
[string]$Configuration = "Release",
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
[string]$Verbosity = "Verbose",
Expand All @@ -44,14 +55,43 @@ Param(
[string[]]$ScriptArgs
)

[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null
function MD5HashFile([string] $filePath)
{
if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf))
{
return $null
}

[System.IO.Stream] $file = $null;
[System.Security.Cryptography.MD5] $md5 = $null;
try
{
$md5 = [System.Security.Cryptography.MD5]::Create()
$file = [System.IO.File]::OpenRead($filePath)
return [System.BitConverter]::ToString($md5.ComputeHash($file))
}
finally
{
if ($file -ne $null)
{
$file.Dispose()
}
}
}

Write-Host "Preparing to run build script..."

$PS_SCRIPT_ROOT = split-path -parent $MyInvocation.MyCommand.Definition;
if(!$PSScriptRoot){
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
}

$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
$NUGET_URL = "http://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe"
$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config"
$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum"

# Should we use mono?
$UseMono = "";
Expand Down Expand Up @@ -82,15 +122,15 @@ if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
# Make sure that packages.config exist.
if (!(Test-Path $PACKAGES_CONFIG)) {
Write-Verbose -Message "Downloading packages.config..."
try { Invoke-WebRequest -Uri http://cakebuild.net/bootstrapper/packages -OutFile $PACKAGES_CONFIG } catch {
try { (New-Object System.Net.WebClient).DownloadFile("http://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch {
Throw "Could not download packages.config."
}
}

# Try find NuGet.exe in path if not exists
if (!(Test-Path $NUGET_EXE)) {
Write-Verbose -Message "Trying to find nuget.exe in PATH..."
$existingPaths = $Env:Path -Split ';' | Where-Object { Test-Path $_ }
$existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_ -PathType Container) }
$NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1
if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) {
Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)."
Expand All @@ -112,21 +152,30 @@ if (!(Test-Path $NUGET_EXE)) {
$ENV:NUGET_EXE = $NUGET_EXE

# Restore tools from NuGet?
if(-Not $SkipToolPackageRestore.IsPresent)
{
# Restore packages from NuGet.
if(-Not $SkipToolPackageRestore.IsPresent) {
Push-Location
Set-Location $TOOLS_DIR

# Check for changes in packages.config and remove installed tools if true.
[string] $md5Hash = MD5HashFile($PACKAGES_CONFIG)
if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or
($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) {
Write-Verbose -Message "Missing or changed package.config hash..."
Remove-Item * -Recurse -Exclude packages.config,nuget.exe
}

Write-Verbose -Message "Restoring tools from NuGet..."
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""
Write-Verbose -Message ($NuGetOutput | out-string)

Pop-Location
if ($LASTEXITCODE -ne 0)
if ($LASTEXITCODE -ne 0) {
Throw "An error occured while restoring NuGet tools."
}
else
{
exit $LASTEXITCODE
$md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII"
}
Write-Verbose -Message ($NuGetOutput | out-string)
Pop-Location
}

# Make sure that Cake has been installed.
Expand Down
31 changes: 25 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
#!/usr/bin/env bash
###############################################################
# This is the Cake bootstrapper script that is responsible for
# downloading Cake and all specified tools from NuGet.
###############################################################

##########################################################################
# This is the Cake bootstrapper script for Linux and OS X.
# This file was downloaded from https://github.com/cake-build/resources
# Feel free to change this file to fit your needs.
##########################################################################

# Define directories.
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
TOOLS_DIR=$SCRIPT_DIR/tools
export NUGET_EXE=$TOOLS_DIR/nuget.exe
NUGET_EXE=$TOOLS_DIR/nuget.exe
CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe
PACKAGES_CONFIG=$TOOLS_DIR/packages.config
PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum

# BEGIN TEMP WORKAROUND
SYSIOCOMP=$TOOLS_DIR/System.IO.Compression.dll
# END TEMP WORKAROUND

# Define md5sum or md5 depending on Linux/OSX
MD5_EXE=
if [[ "$(uname -s)" == "Darwin" ]]; then
MD5_EXE="md5 -r"
else
MD5_EXE="md5sum"
fi

# Define default arguments.
SCRIPT="build.cake"
TARGET="Default"
Expand Down Expand Up @@ -56,7 +68,7 @@ fi
# Download NuGet if it does not exist.
if [ ! -f "$NUGET_EXE" ]; then
echo "Downloading NuGet..."
curl -Lsfo "$NUGET_EXE" https://dist.nuget.org/win-x86-commandline/v3.4.4/NuGet.exe
curl -Lsfo "$NUGET_EXE" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
if [ $? -ne 0 ]; then
echo "An error occured while downloading nuget.exe."
exit 1
Expand All @@ -79,11 +91,18 @@ fi

# Restore tools from NuGet.
pushd "$TOOLS_DIR" >/dev/null
if [ ! -f $PACKAGES_CONFIG_MD5 ] || [ "$( cat $PACKAGES_CONFIG_MD5 | sed 's/\r$//' )" != "$( $MD5_EXE $PACKAGES_CONFIG | awk '{ print $1 }' )" ]; then
find . -type d ! -name . | xargs rm -rf
fi

mono "$NUGET_EXE" install -ExcludeVersion
if [ $? -ne 0 ]; then
echo "Could not restore NuGet packages."
exit 1
fi

$MD5_EXE $PACKAGES_CONFIG | awk '{ print $1 }' >| $PACKAGES_CONFIG_MD5

popd >/dev/null

# Make sure that Cake has been installed.
Expand Down
27 changes: 23 additions & 4 deletions component/component.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

id: signature-pad
name: Signature Pad for Xamarin and Windows
version: 1.4.0.0
version: "1.5.0"
summary: Makes capturing, saving, and displaying signatures extremely simple.
publisher: Xamarin, Inc.
publisher-url: http://xamarin.com/
Expand All @@ -25,10 +25,17 @@ libraries:
android: ../output/android/SignaturePad.dll
ios-unified: ../output/ios-unified/SignaturePad.dll
wp8: ../output/wp8/SignaturePad.dll
uwp: ../output/uwp/SignaturePad.dll
packages:
android: Xamarin.Controls.SignaturePad, Version=1.4.0
ios-unified: Xamarin.Controls.SignaturePad, Version=1.4.0
wp8: Xamarin.Controls.SignaturePad, Version=1.4.0
android: Xamarin.Controls.SignaturePad, Version=1.5.0
ios-unified: Xamarin.Controls.SignaturePad, Version=1.5.0
wp8: Xamarin.Controls.SignaturePad, Version=1.5.0
uwp: Xamarin.Controls.SignaturePad, Version=1.5.0
additional-files:
- src: "../output/uwp/SignaturePad.pri"
dst: "lib/uwp/SignaturePad.pri"
- src: "../output/uwp/SignaturePad.xr.xml"
dst: "lib/uwp/SignaturePad/SignaturePad.xr.xml"

samples:
- name: "Android Sample"
Expand All @@ -55,6 +62,14 @@ samples:
- project: Sample.WP8
packages:
- Xamarin.Controls.SignaturePad
- name: "UWP Sample"
path: ../samples/Sample.UWP/Sample.UWP.sln
removeProjects:
- SignaturePad.UWP
installNuGets:
- project: Sample.UWP
packages:
- Xamarin.Controls.SignaturePad
- name: "Xamarin.Forms Sample"
path: ../samples/Sample.Forms/Sample.Forms.sln
removeProjects:
Expand Down Expand Up @@ -82,5 +97,9 @@ samples:
packages:
- Xamarin.Controls.SignaturePad
- Xamarin.Controls.SignaturePad.Forms
- project: Samples.UWP
packages:
- Xamarin.Controls.SignaturePad
- Xamarin.Controls.SignaturePad.Forms

...
29 changes: 18 additions & 11 deletions nuget/Xamarin.Controls.SignaturePad.Forms.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,38 @@
<metadata>
<id>Xamarin.Controls.SignaturePad.Forms</id>
<title>SignaturePad for Xamarin.Forms</title>
<version>1.4.0.0</version>
<version>1.5.0</version>
<authors>Xamarin, Inc.</authors>
<owners>Xamarin, Inc.</owners>
<licenseUrl>https://components.xamarin.com/license/signature-pad</licenseUrl>
<projectUrl>https://components.xamarin.com/view/signature-pad</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Makes capturing, saving, and displaying signatures extremely simple.</description>
<copyright>Copyright (c) Xamarin Inc. 2016</copyright>
<tags>xamarin,signature,handwriting,windows,ios,android,windows phone</tags>
<copyright>Copyright (c) Xamarin Inc. 2017</copyright>
<tags>xamarin,signature,handwriting,windows,ios,android,windows phone,uwp</tags>
<dependencies>
<group targetFramework="MonoAndroid">
<dependency id="Xamarin.Forms" version="2.2.0" />
<dependency id="Xamarin.Controls.SignaturePad" version="1.4.0.0" />
<dependency id="Xamarin.Forms" version="2.3.3" />
<dependency id="Xamarin.Controls.SignaturePad" version="1.5.0" />
</group>
<group targetFramework="Xamarin.iOS">
<dependency id="Xamarin.Forms" version="2.2.0" />
<dependency id="Xamarin.Controls.SignaturePad" version="1.4.0.0" />
<dependency id="Xamarin.Forms" version="2.3.3" />
<dependency id="Xamarin.Controls.SignaturePad" version="1.5.0" />
</group>
<group targetFramework="wp8">
<dependency id="Xamarin.Forms" version="2.2.0" />
<dependency id="Xamarin.Controls.SignaturePad" version="1.4.0.0" />
<dependency id="Xamarin.Forms" version="2.3.3" />
<dependency id="Xamarin.Controls.SignaturePad" version="1.5.0" />
<dependency id="ImageTools" version="0.3.1" />
</group>
<group targetFramework="uap10.0">
<dependency id="Xamarin.Forms" version="2.3.3" />
<dependency id="Xamarin.Controls.SignaturePad" version="1.5.0" />
</group>
<group targetFramework="portable-net45+win8+wp8">
<dependency id="Xamarin.Forms" version="2.2.0" />
<dependency id="Xamarin.Forms" version="2.3.3" />
</group>
<group targetFramework="portable-net45+win+wp8+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10">
<dependency id="Xamarin.Forms" version="2.2.0" />
<dependency id="Xamarin.Forms" version="2.3.3" />
</group>
</dependencies>
</metadata>
Expand All @@ -44,6 +48,9 @@
<file src="output/pcl/SignaturePad.Forms.dll" target="lib/wp8/SignaturePad.Forms.dll" />
<file src="output/wp8/SignaturePad.Forms.WindowsPhone.dll" target="lib/wp8/SignaturePad.Forms.WindowsPhone.dll" />

<file src="output/pcl/SignaturePad.Forms.dll" target="lib/uap10.0/SignaturePad.Forms.dll" />
<file src="output/uwp/SignaturePad.Forms.UWP.dll" target="lib/uap10.0/SignaturePad.Forms.UWP.dll" />

<file src="output/pcl/SignaturePad.Forms.dll" target="lib/portable-net45+win8+wp8/SignaturePad.Forms.dll" />
<file src="output/pcl/SignaturePad.Forms.dll" target="lib/portable-net45+win+wp8+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10/SignaturePad.Forms.dll" />
</files>
Expand Down
Loading

0 comments on commit b637f7e

Please sign in to comment.