Skip to content

Commit

Permalink
Merge pull request #6 from kappy/build-appveyour
Browse files Browse the repository at this point in the history
Build appveyour
  • Loading branch information
joaomatossilva authored Sep 20, 2016
2 parents 8be0755 + 4be1593 commit 4fab80f
Show file tree
Hide file tree
Showing 11 changed files with 7,814 additions and 1,810 deletions.
3 changes: 3 additions & 0 deletions .vs/restore.dg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#:C:\JMS\Repository\FlatMapper\src\FlatMapper\FlatMapper.xproj
#:C:\JMS\Repository\FlatMapper\tests\FlatMapper.Tests\FlatMapper.Tests.xproj
C:\JMS\Repository\FlatMapper\tests\FlatMapper.Tests\FlatMapper.Tests.xproj|C:\JMS\Repository\FlatMapper\src\FlatMapper\FlatMapper.xproj
65 changes: 65 additions & 0 deletions Build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<#
.SYNOPSIS
You can add this to you build script to ensure that psbuild is available before calling
Invoke-MSBuild. If psbuild is not available locally it will be downloaded automatically.
#>
function EnsurePsbuildInstalled{
[cmdletbinding()]
param(
[string]$psbuildInstallUri = 'https://raw.githubusercontent.com/ligershark/psbuild/master/src/GetPSBuild.ps1'
)
process{
if(-not (Get-Command "Invoke-MsBuild" -errorAction SilentlyContinue)){
'Installing psbuild from [{0}]' -f $psbuildInstallUri | Write-Verbose
(new-object Net.WebClient).DownloadString($psbuildInstallUri) | iex
}
else{
'psbuild already loaded, skipping download' | Write-Verbose
}

# make sure it's loaded and throw if not
if(-not (Get-Command "Invoke-MsBuild" -errorAction SilentlyContinue)){
throw ('Unable to install/load psbuild from [{0}]' -f $psbuildInstallUri)
}
}
}

# Taken from psake https://github.com/psake/psake

<#
.SYNOPSIS
This is a helper function that runs a scriptblock and checks the PS variable $lastexitcode
to see if an error occcured. If an error is detected then an exception is thrown.
This function allows you to run command-line programs without having to
explicitly check the $lastexitcode variable.
.EXAMPLE
exec { svn info $repository_trunk } "Error executing SVN. Please verify SVN command-line client is installed"
#>
function Exec
{
[CmdletBinding()]
param(
[Parameter(Position=0,Mandatory=1)][scriptblock]$cmd,
[Parameter(Position=1,Mandatory=0)][string]$errorMessage = ($msgs.error_bad_command -f $cmd)
)
& $cmd
if ($lastexitcode -ne 0) {
throw ("Exec: " + $errorMessage)
}
}

if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }

EnsurePsbuildInstalled

exec { & dotnet restore }

Invoke-MSBuild

$revision = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
$revision = "{0:D4}" -f [convert]::ToInt32($revision, 10)

exec { & dotnet test .\tests\FlatMapper.Tests -c Release }

exec { & dotnet pack .\src\FlatMapper -c Release -o .\artifacts --version-suffix=$revision }

3 changes: 2 additions & 1 deletion FlatMapper.sln
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{1D94E1E7-100E-450E-B38B-31AF7C20B3E9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E3BAA65D-617A-4A20-A48C-CC75562FB788}"
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
Build.ps1 = Build.ps1
global.json = global.json
LICENSE.txt = LICENSE.txt
README.md = README.md
Expand Down
42 changes: 18 additions & 24 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
version: 0.7.0-{build}
os: Visual Studio 2015
install:
- cmd: set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
- cmd: dnvm install 1.0.0-rc1-update1
- cmd: dnu restore
- cmd: IF DEFINED APPVEYOR_BUILD_NUMBER SET DNX_BUILD_VERSION=%APPVEYOR_BUILD_NUMBER%
version: '{build}'
pull_requests:
do_not_increment_build_number: true
branches:
only:
- master
configuration: Release
assembly_info:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: '{version}'
assembly_file_version: '{version}'
assembly_informational_version: '{version}'
build:
publish_nuget: true
publish_nuget_symbols: false
include_nuget_references: true
verbosity: minimal
test_script:
- cmd: dnx -p .\tests\FlatMapper.Tests test
build_script:
- ps: .\Build.ps1
test: off
nuget:
disable_publish_on_pr: true
artifacts:
- path: artifacts\bin\FlatMapper\$(configuration)\*.nupkg
- path: artifacts\**\*.nupkg
name: NuGet
deploy:
provider: NuGet
skip_symbols: true
- provider: NuGet
name: production
api_key:
secure: c18PmLObjM4XzNKNj8/LzYty11gya98+IerJXipzMmL9wgmHS6cGAJWYpJkDxmU2
artifact: /.*\.nupkg/
on:
branch: master
appveyor_repo_tag: true
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-rc1-update1"
"version": "1.0.0-preview2-003121"
}
}
6 changes: 2 additions & 4 deletions src/FlatMapper/FlatMapper.xproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>

<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>0ab68e69-7e06-40e1-9679-4757d62170ac</ProjectGuid>
<RootNamespace>FlatMapper</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>

<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
</Project>
17 changes: 9 additions & 8 deletions src/FlatMapper/project.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"version": "0.7.0-*",
"version": "0.7.0",
"description": "A library to import and export data from plain text files in a Linq compatible way",
"authors": [ "kappy" ],
"tags": [ "Flat", "Files", "Import", "Export", "Tab", "Comma", "CSV", "Linq", "Delimited", "FixedWidth", "Mapper" ],
"projectUrl": "https://github.com/kappy/FlatMapper",
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0",

"packOptions": {
"tags": [ "Flat", "Files", "Import", "Export", "Tab", "Comma", "CSV", "Linq", "Delimited", "FixedWidth", "Mapper" ],
"projectUrl": "https://github.com/kappy/FlatMapper",
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0"
},
"frameworks": {
"net45": {
"dependencies": {
Expand All @@ -22,11 +23,11 @@
"dotnet5.1": {
"dependencies": {
"Microsoft.CSharp": "4.0.0",
"System.Collections": "4.0.0",
"System.Collections": "4.0.10",
"System.Linq": "4.0.0",
"System.Runtime": "4.0.20",
"System.Threading": "4.0.0",
"System.Runtime.Extensions": "4.0.0",
"System.Threading": "4.0.10",
"System.Runtime.Extensions": "4.0.10",
"System.Reflection.TypeExtensions": "4.0.0",
"System.Reflection.Emit.ILGeneration": "4.0.0",
"System.Reflection.Emit.Lightweight": "4.0.0"
Expand Down
Loading

0 comments on commit 4fab80f

Please sign in to comment.