This commit is contained in:
Родитель
d254a89917
Коммит
2a40120d00
10
appveyor.yml
10
appveyor.yml
|
@ -7,11 +7,19 @@ init:
|
|||
- ps: $env:TestSqlServerDefaultConnectionString = "Server=(local)\SQL2012SP1;Database=master;Integrated Security=true"
|
||||
|
||||
environment:
|
||||
nugetVersion: 2.0.0
|
||||
packageVersion: 2.0.0
|
||||
|
||||
version: $(nugetVersion).{build}
|
||||
|
||||
build_script:
|
||||
- ps: |
|
||||
$env:packageVersion = $env:assemblyVersion
|
||||
if ($env:APPVEYOR_REPO_BRANCH -ne "release")
|
||||
{
|
||||
$env:packageVersion = "$env:assemblyVersion-rc$env:appveyor_build_number"
|
||||
}
|
||||
|
||||
.\build\CodeJam.AppVeyor.FixVersionProps.ps1 -path src\LinqToDB.Identity\LinqToDB.Identity.csproj -buildVersion $env:assemblyVersion -nugetVersion $env:packageVersion
|
||||
- ps: .\build.ps1
|
||||
|
||||
test: off
|
||||
|
|
31
build.cake
31
build.cake
|
@ -1,5 +1,3 @@
|
|||
#addin "MagicChunks"
|
||||
|
||||
var target = Argument("target", "Default");
|
||||
var configuration = Argument<string>("configuration", "Release");
|
||||
|
||||
|
@ -25,35 +23,6 @@ Task("Build")
|
|||
.IsDependentOn("Restore")
|
||||
.Does(() =>
|
||||
{
|
||||
|
||||
// Patch Version for CI builds
|
||||
if (!isLocalBuild || envPackageVersion != null)
|
||||
{
|
||||
packageVersion = envPackageVersion;
|
||||
var assemblyVersion = packageVersion + ".0";
|
||||
|
||||
if (AppVeyor.Environment.Repository.Branch.ToLower() != "release" && argRelease == null)
|
||||
{
|
||||
packageSuffix = "rc" + AppVeyor.Environment.Build.Number.ToString();
|
||||
fullPackageVersion = packageVersion + "-" + packageSuffix;
|
||||
}
|
||||
|
||||
Console.WriteLine("Package Version: {0}", packageVersion);
|
||||
Console.WriteLine("Package Suffix : {0}", packageSuffix);
|
||||
Console.WriteLine("Assembly Version: {0}", assemblyVersion);
|
||||
|
||||
|
||||
TransformConfig(nugetProject, nugetProject,
|
||||
new TransformationCollection {
|
||||
{ "Project/PropertyGroup/Version", fullPackageVersion },
|
||||
{ "Project/PropertyGroup/VersionPrefix", packageVersion },
|
||||
{ "Project/PropertyGroup/VersionSuffix", packageSuffix },
|
||||
{ "Project/PropertyGroup/AssemblyVersion", assemblyVersion },
|
||||
{ "Project/PropertyGroup/FileVersion", assemblyVersion },
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
var settings = new DotNetCoreBuildSettings
|
||||
{
|
||||
Configuration = configuration
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
Param(
|
||||
[Parameter(Mandatory=$true)][string]$path,
|
||||
[Parameter(Mandatory=$true)][string]$buildVersion,
|
||||
[Parameter(Mandatory=$true)][string]$nugetVersion
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
Set-StrictMode -Version Latest
|
||||
|
||||
if ($buildVersion -or $nugetVersion) {
|
||||
|
||||
$xmlPath = Resolve-Path "$path"
|
||||
|
||||
$xml = [XML](Get-Content "$xmlPath")
|
||||
$xml.PreserveWhitespace = $true
|
||||
$save = $false
|
||||
|
||||
if ($buildVersion) {
|
||||
$xPath = "//PropertyGroup/Version"
|
||||
$nodes = $xml.SelectNodes($xPath)
|
||||
foreach($node in $nodes) {
|
||||
$node.InnerXml = $buildVersion
|
||||
$save = $true
|
||||
}
|
||||
}
|
||||
|
||||
if ($nugetVersion) {
|
||||
$xPath = "//PropertyGroup/PackageVersion"
|
||||
$nodes = $xml.SelectNodes($xPath)
|
||||
foreach($node in $nodes) {
|
||||
$node.InnerXml = $nugetVersion
|
||||
$save = $true
|
||||
}
|
||||
}
|
||||
|
||||
if ($save) {
|
||||
Write-Host "Patched $xmlPath"
|
||||
$xml.Save($xmlPath)
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@
|
|||
<Description>ASP.NET Core Identity provider that uses LinqToDB.</Description>
|
||||
<VersionPrefix>2.0.0</VersionPrefix>
|
||||
<Version>2.0.0</Version>
|
||||
<PackageVersion>2.0.0</PackageVersion>
|
||||
|
||||
<Authors>Ilya Chudin</Authors>
|
||||
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace ClassLibrary1
|
||||
{
|
||||
public class Class1
|
||||
{
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
Загрузка…
Ссылка в новой задаче