Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit 59c9113

Browse files
Merge pull request #1 from SubPointSolutions/dev
build test
2 parents e36b250 + 1bc9d77 commit 59c9113

File tree

8 files changed

+405
-20
lines changed

8 files changed

+405
-20
lines changed

Build/Build.csproj

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{3692FD4D-5AB2-4A39-9E70-5A1BB1812A88}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>Build</RootNamespace>
11+
<AssemblyName>Build</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>DEBUG;TRACE</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="System" />
34+
<Reference Include="System.Core" />
35+
<Reference Include="System.Xml.Linq" />
36+
<Reference Include="System.Data.DataSetExtensions" />
37+
<Reference Include="Microsoft.CSharp" />
38+
<Reference Include="System.Data" />
39+
<Reference Include="System.Xml" />
40+
</ItemGroup>
41+
<ItemGroup>
42+
<Compile Include="Properties\AssemblyInfo.cs" />
43+
</ItemGroup>
44+
<ItemGroup>
45+
<None Include="build.cake" />
46+
<None Include="build.json" />
47+
<None Include="build.ps1" />
48+
</ItemGroup>
49+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
50+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
51+
Other similar extension points exist, see Microsoft.Common.targets.
52+
<Target Name="BeforeBuild">
53+
</Target>
54+
<Target Name="AfterBuild">
55+
</Target>
56+
-->
57+
</Project>

Build/Properties/AssemblyInfo.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Build")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("Vagrant")]
12+
[assembly: AssemblyProduct("Build")]
13+
[assembly: AssemblyCopyright("Copyright © Vagrant 2017")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("a3865a29-4808-4494-a39b-6bfb5e8bbfb5")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

Build/build.cake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// load up common tools
2+
#load ..\SubPointSolutions.CakeBuildTools\scripts\SubPointSolutions.CakeBuild.Core.cake
3+
4+
// default targets
5+
RunTarget(target);

Build/build.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"defaultSolutionDirectory": "./../",
3+
"defaultSolutionFilePath": "./../SubPointSolutions.CakeBuildTools.sln",
4+
"defaultNuGetPackagesDirectory": "./build-artifact-nuget-packages",
5+
"defaultChocolateyPackagesDirectory": "./build-artifact-cli-packages",
6+
"defaultNuspecVersion": "0.1.0",
7+
8+
"defaultDocsBuildEnabled" : false,
9+
"defaultDocsViewFolder" : "",
10+
"defaultDocsRepoFolder" : "",
11+
"defaultDocsBranch" : "",
12+
"defaultDocsFileExtensions" : [
13+
"*.md",
14+
"*.cs",
15+
"*.cshtml"
16+
],
17+
18+
"defaultTestCategories": [
19+
"CI.Core"
20+
],
21+
"customNuspecs": [
22+
{
23+
"Id": "SubPointSolutions.CakeBuildTools",
24+
"Version": "0.1.0-beta1",
25+
"Dependencies": [ ],
26+
"LicenseUrl": "https://github.com/SubPointSolutions/CakeBuildTools/licence",
27+
"ProjectUrl": "https://github.com/SubPointSolutions/CakeBuildTools",
28+
"IconUrl": "https://raw.githubusercontent.com/SubPointSolutions/spmeta2/dev/SPMeta2/SPMeta2.Dependencies/Images/SPMeta2_64_64.png",
29+
"Description": "Provides common build tasks for all SubPoint Solution projects.",
30+
"Copyright": "Copyright 2016",
31+
"Tags": [
32+
33+
],
34+
35+
"Files": [
36+
{
37+
"Target": "lib/net45",
38+
"TargetFiles": [
39+
"bin/debug/SubPointSolutions.CakeBuildTools.dll",
40+
"bin/debug/SubPointSolutions.CakeBuildTools.xml"
41+
]
42+
},
43+
{
44+
"Target": "scripts",
45+
"TargetFiles": [
46+
"bin/debug/scripts/SubPointSolutions.CakeBuild.Core.cake"
47+
]
48+
}
49+
]
50+
}
51+
],
52+
"customChocolateySpecs": [
53+
54+
],
55+
"defaultTestAssemblyPaths": [
56+
57+
],
58+
"defaultBuildDirs": [ ],
59+
"defaultEnvironmentVariables": [ ]
60+
}

Build/build.ps1

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
##########################################################################
2+
# This is the Cake bootstrapper script for PowerShell.
3+
# This file was downloaded from https://github.com/cake-build/resources
4+
# Feel free to change this file to fit your needs.
5+
##########################################################################
6+
7+
<#
8+
9+
.SYNOPSIS
10+
This is a Powershell script to bootstrap a Cake build.
11+
12+
.DESCRIPTION
13+
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
14+
and execute your Cake build script with the parameters you provide.
15+
16+
.PARAMETER Script
17+
The build script to execute.
18+
.PARAMETER Target
19+
The build script target to run.
20+
.PARAMETER Configuration
21+
The build configuration to use.
22+
.PARAMETER Verbosity
23+
Specifies the amount of information to be displayed.
24+
.PARAMETER Experimental
25+
Tells Cake to use the latest Roslyn release.
26+
.PARAMETER WhatIf
27+
Performs a dry run of the build script.
28+
No tasks will be executed.
29+
.PARAMETER Mono
30+
Tells Cake to use the Mono scripting engine.
31+
.PARAMETER SkipToolPackageRestore
32+
Skips restoring of packages.
33+
.PARAMETER ScriptArgs
34+
Remaining arguments are added here.
35+
36+
.LINK
37+
http://cakebuild.net
38+
39+
#>
40+
41+
[CmdletBinding()]
42+
Param(
43+
[string]$Script = "build.cake",
44+
[string]$Target = "Default",
45+
[ValidateSet("Release", "Debug")]
46+
[string]$Configuration = "Debug",
47+
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
48+
[string]$Verbosity = "Verbose",
49+
[switch]$Experimental,
50+
[Alias("DryRun","Noop")]
51+
[switch]$WhatIf,
52+
[switch]$Mono,
53+
[switch]$SkipToolPackageRestore,
54+
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
55+
[string[]]$ScriptArgs
56+
)
57+
58+
[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null
59+
function MD5HashFile([string] $filePath)
60+
{
61+
if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf))
62+
{
63+
return $null
64+
}
65+
66+
[System.IO.Stream] $file = $null;
67+
[System.Security.Cryptography.MD5] $md5 = $null;
68+
try
69+
{
70+
$md5 = [System.Security.Cryptography.MD5]::Create()
71+
$file = [System.IO.File]::OpenRead($filePath)
72+
return [System.BitConverter]::ToString($md5.ComputeHash($file))
73+
}
74+
finally
75+
{
76+
if ($file -ne $null)
77+
{
78+
$file.Dispose()
79+
}
80+
}
81+
}
82+
83+
Write-Host "Preparing to run build script..."
84+
85+
if(!$PSScriptRoot){
86+
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
87+
}
88+
89+
cd $PSScriptRoot
90+
91+
$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
92+
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
93+
$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe"
94+
$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
95+
$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config"
96+
$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum"
97+
98+
# Should we use mono?
99+
$UseMono = "";
100+
if($Mono.IsPresent) {
101+
Write-Verbose -Message "Using the Mono based scripting engine."
102+
$UseMono = "-mono"
103+
}
104+
105+
# Should we use the new Roslyn?
106+
$UseExperimental = "";
107+
if($Experimental.IsPresent -and !($Mono.IsPresent)) {
108+
Write-Verbose -Message "Using experimental version of Roslyn."
109+
$UseExperimental = "-experimental"
110+
}
111+
112+
# Is this a dry run?
113+
$UseDryRun = "";
114+
if($WhatIf.IsPresent) {
115+
$UseDryRun = "-dryrun"
116+
}
117+
118+
# Make sure tools folder exists
119+
if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
120+
Write-Verbose -Message "Creating tools directory..."
121+
New-Item -Path $TOOLS_DIR -Type directory | out-null
122+
}
123+
124+
# Make sure that packages.config exist.
125+
if (!(Test-Path $PACKAGES_CONFIG)) {
126+
Write-Verbose -Message "Downloading packages.config..."
127+
try { (New-Object System.Net.WebClient).DownloadFile("http://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch {
128+
Throw "Could not download packages.config."
129+
}
130+
}
131+
132+
# Try find NuGet.exe in path if not exists
133+
if (!(Test-Path $NUGET_EXE)) {
134+
Write-Verbose -Message "Trying to find nuget.exe in PATH..."
135+
$existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_) }
136+
$NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1
137+
if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) {
138+
Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)."
139+
$NUGET_EXE = $NUGET_EXE_IN_PATH.FullName
140+
}
141+
}
142+
143+
# Try download NuGet.exe if not exists
144+
if (!(Test-Path $NUGET_EXE)) {
145+
Write-Verbose -Message "Downloading NuGet.exe..."
146+
try {
147+
(New-Object System.Net.WebClient).DownloadFile($NUGET_URL, $NUGET_EXE)
148+
} catch {
149+
Throw "Could not download NuGet.exe."
150+
}
151+
}
152+
153+
# Save nuget.exe path to environment to be available to child processed
154+
$ENV:NUGET_EXE = $NUGET_EXE
155+
156+
# Restore tools from NuGet?
157+
if(-Not $SkipToolPackageRestore.IsPresent) {
158+
Push-Location
159+
Set-Location $TOOLS_DIR
160+
161+
# Check for changes in packages.config and remove installed tools if true.
162+
[string] $md5Hash = MD5HashFile($PACKAGES_CONFIG)
163+
if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or
164+
($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) {
165+
Write-Verbose -Message "Missing or changed package.config hash..."
166+
Remove-Item * -Recurse -Exclude packages.config,nuget.exe
167+
}
168+
169+
Write-Verbose -Message "Restoring tools from NuGet..."
170+
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""
171+
172+
if ($LASTEXITCODE -ne 0) {
173+
Throw "An error occured while restoring NuGet tools."
174+
}
175+
else
176+
{
177+
$md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII"
178+
}
179+
Write-Verbose -Message ($NuGetOutput | out-string)
180+
Pop-Location
181+
}
182+
183+
# Make sure that Cake has been installed.
184+
if (!(Test-Path $CAKE_EXE)) {
185+
Throw "Could not find Cake.exe at $CAKE_EXE"
186+
}
187+
188+
# Start Cake
189+
Write-Host "Running build script..."
190+
Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs"
191+
exit $LASTEXITCODE

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ Common cake build tools for SubPoint Solution projects.
44
### Build status
55
| Branch | Status |
66
| ------------- | ------------- |
7-
| dev | [![Build status](https://ci.appveyor.com/api/projects/status/h1raft6g5en5dwbi/branch/dev?svg=true)](https://ci.appveyor.com/project/SubPointSupport/spmeta2-vsixextensions/branch/dev) |
8-
| beta | [![Build status](https://ci.appveyor.com/api/projects/status/h1raft6g5en5dwbi/branch/beta?svg=true)](https://ci.appveyor.com/project/SubPointSupport/spmeta2-vsixextensions/branch/beta) |
9-
| master| [![Build status](https://ci.appveyor.com/api/projects/status/h1raft6g5en5dwbi/branch/master?svg=true)](https://ci.appveyor.com/project/SubPointSupport/spmeta2-vsixextensions/branch/master) |
7+
| dev | [![Build status](https://ci.appveyor.com/api/projects/status/54i4q9hrktdhj0je/branch/dev?svg=true)](https://ci.appveyor.com/project/SubPointSupport/cakebuildtools/branch/dev) |
8+
| beta | [![Build status](https://ci.appveyor.com/api/projects/status/54i4q9hrktdhj0je/branch/beta?svg=true)](https://ci.appveyor.com/project/SubPointSupport/cakebuildtools/branch/beta) |
9+
| master| [![Build status](https://ci.appveyor.com/api/projects/status/54i4q9hrktdhj0je/branch/master?svg=true)](https://ci.appveyor.com/project/SubPointSupport/cakebuildtools/branch/master) |

0 commit comments

Comments
 (0)