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

Dev #7

Merged
merged 3 commits into from
Nov 14, 2017
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 77 additions & 12 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,77 @@
init:
- git config --global core.autocrlf true
version: 1.0.{build}
image: Visual Studio 2017
test: on
pull_requests:
do_not_increment_build_number: true
branches:
only:
- dev
build_script:
- ps: .\build.ps1


# master branch
-
branches:
only:
- master

init:
- git config --global core.autocrlf true

image: Visual Studio 2017

version: "{build}"

build_script:
- ps: .\build.ps1

test: off

artifacts:
- path: artifacts\output\*.nupkg
name: packages
- path: artifacts\logs
- path: artifacts\tests

# dev branch
-
branches:
only:
- dev

init:
- git config --global core.autocrlf true

image: Visual Studio 2017

version: "{build}"

build_script:
- SET VERSION_SUFFIX=-%APPVEYOR_REPO_BRANCH%%APPVEYOR_BUILD_NUMBER%
- ps: .\build.ps1

test: off

artifacts:
- path: artifacts\output\*.nupkg
name: packages
- path: artifacts\logs
- path: artifacts\tests

deploy:
- provider: NuGet
server: https://www.myget.org/F/0b0e5c5f92fe4ccbba32eec8c0bb4c22/
api_key:
secure: UAYBSvPmTiXAgAzxVTG1XcQKqD6gkGVT5Y7zpVycpw86vd7U+G1e47ufZVLEDobt
artifact: packages

# all other branches
-
init:
- git config --global core.autocrlf true

image: Visual Studio 2017

version: "{build}"

build_script:
- SET VERSION_SUFFIX=-%APPVEYOR_REPO_BRANCH%%APPVEYOR_BUILD_NUMBER%
- ps: .\build.ps1

test: off

artifacts:
- path: artifacts\output\*.nupkg
- path: artifacts\logs
- path: artifacts\tests
79 changes: 53 additions & 26 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Text.RegularExpressions;

#tool nuget:?package=NUnit.ConsoleRunner&version=3.4.0
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
Expand All @@ -7,64 +9,89 @@ var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var solution = "./Anywhere.ArcGIS.sln";

var version = "1.0.0";
var versionSuffix = Environment.GetEnvironmentVariable("VERSION_SUFFIX");

//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////

// Define directories.
var buildDir = Directory("./src/Anywhere.ArcGIS/bin") + Directory(configuration);
var artifactDir = Directory("./artifacts");
var outputDir = artifactDir + Directory("output");

//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////

Task("Build")
.IsDependentOn("Update-Version")
.Does(() =>
{
DotNetCoreBuild(
solution,
new DotNetCoreBuildSettings
{
Configuration = configuration,
ArgumentCustomization = args => args.Append($"/p:CI=true /v:n"),
OutputDirectory = outputDir
});
});


Task("Clean")
.Does(() =>
{
CleanDirectory(buildDir);
CleanDirectory(artifactDir);
});

Task("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
DotNetCoreRestore(solution);
});
{
DotNetCoreRestore(solution);
});

Task("Build")
.IsDependentOn("Restore")
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
DotNetCoreBuild(
solution,
new DotNetCoreBuildSettings
{
var projects = GetFiles("./tests/**/*.csproj");
foreach(var project in projects)
{
Configuration = configuration,
ArgumentCustomization = args => args.Append($"/p:CI=true /v:n")
});
});
DotNetCoreTool(
projectPath: project.FullPath,
command: "xunit",
arguments: $"-configuration {configuration} -diagnostics -stoponfail"
);
}
});

Task("Test")
.IsDependentOn("Build")
Task("Update-Version")
.IsDependentOn("Restore")
.Does(() =>
{
var projects = GetFiles("./tests/**/*.csproj");
foreach(var project in projects)
{
DotNetCoreTool(
projectPath: project.FullPath,
command: "xunit",
arguments: $"-configuration {configuration} -diagnostics -stoponfail"
);
}
});
Information("Setting version to " + version + versionSuffix);

var file = GetFiles("./src/Anywhere.ArcGIS/Anywhere.ArcGIS.csproj").First();

var project = System.IO.File.ReadAllText(file.FullPath, Encoding.UTF8);

var projectVersion = new Regex(@"<Version>.+<\/Version>");

project = projectVersion.Replace(project, string.Concat("<Version>", version + versionSuffix, "</Version>"));

System.IO.File.WriteAllText(file.FullPath, project, Encoding.UTF8);
});

//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////

Task("Default")
.IsDependentOn("Test");
.IsDependentOn("Build");

//////////////////////////////////////////////////////////////////////
// EXECUTION
Expand Down
6 changes: 4 additions & 2 deletions src/Anywhere.ArcGIS/Anywhere.ArcGIS.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>Dave Timmins</Authors>
<Company>Dave Timmins</Company>
<Title>Anywhere.ArcGIS</Title>
<Description>Operations and data types used with the ArcGIS Server REST API.</Description>
<Summary>Operations and data types used with the ArcGIS Server REST API.</Summary>
<Copyright>Copyright Dave Timmins (c) 2017. All rights reserved.</Copyright>
<PackageLicenseUrl>https://raw.githubusercontent.com/davetimmins/Anywhere.ArcGIS/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/davetimmins/Anywhere.ArcGIS</PackageProjectUrl>
Expand All @@ -14,7 +16,7 @@
<RepositoryType>git</RepositoryType>
<PackageTags>ArcGIS ArcGISServer ArcGISOnline Esri REST netstandard anywhere GIS Mapping Map Location GeoLocation OAuth</PackageTags>
<PackageReleaseNotes>Initial port of ArcGIS.PCL to netstandard</PackageReleaseNotes>
<Version>1.0.0-beta.4</Version>
<Version>1.0.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down