Skip to content

Commit

Permalink
* set TargetFramework = net472
Browse files Browse the repository at this point in the history
* update Vostok.Logging.Abstractions and other deps to the latest versions
* use Nerdbank.GitVersioning to automate generation of assembly and nuget package versions
* setup appveyor to publish packages to nuget.org and create github releases automatically when commit is tagged with "vX.Y-release"
  • Loading branch information
AndrewKostousov committed Sep 15, 2018
1 parent 4deaba4 commit ca10a72
Show file tree
Hide file tree
Showing 12 changed files with 111 additions and 21 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@
*.DotSettings text
*.yml text
*.cmd text
*.sh text
*.md text
*.json text
*.config text
*.props text
*.targets text
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

## v1.0 - 2018.09.15
- Set TargetFramework to net472.
- Switch to SDK-style project format and dotnet core build tooling.
- Use [Vostok.Logging.Abstractions](https://github.com/vostok/logging.abstractions) as a logging framework facade.
- Use [Nerdbank.GitVersioning](https://github.com/AArnott/Nerdbank.GitVersioning) to automate generation of assembly
and nuget package versions.
- Update [GroBuf](https://github.com/skbkontur/GroBuf) dependency to v1.4.2.
- Update [GrobExp.Compiler](https://github.com/skbkontur/GrobExp.Compiler) dependency to v1.2.1.
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="2.2.13" PrivateAssets="All" />
</ItemGroup>

</Project>
13 changes: 13 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,17 @@
</ItemGroup>
</Target>

<Target Name="SetNuSpecProperties" BeforeTargets="GenerateNuspec" DependsOnTargets="GetBuildVersion">
<PropertyGroup>
<PackageId>$(AssemblyName)</PackageId>
<Authors>Igor Chevdar, Michael Samoylenko, Anton Chaplygin</Authors>
<PackageTags>expression tree code generation</PackageTags>
<PackageDescription>Code generation mechanics for documents conversion and validation</PackageDescription>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/skbkontur/GrobExp.Mutators</RepositoryUrl>
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>
<PackageReleaseNotes>$(RepositoryUrl)/releases/tag/v$(MajorMinorVersion)-release</PackageReleaseNotes>
</PropertyGroup>
</Target>

</Project>
6 changes: 3 additions & 3 deletions Mutators.Tests/Mutators.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<IsPackable>false</IsPackable>
<TargetFramework>net471</TargetFramework>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="11.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<PackageReference Include="JetBrains.Annotations" Version="2018.2.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="NUnit" Version="3.10.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Mutators/ConverterCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private void LogConverterCompilation(MutatorsContext context, Stopwatch sw)
var mutatorsContextTypeName = context.GetType().Name;
foreach (var propertyInfo in context.GetType().GetProperties())
logProperties.Add($"{mutatorsContextTypeName}.{propertyInfo.Name}", propertyInfo.GetValue(context));
logger.Log(new LogEvent(LogLevel.Info, DateTimeOffset.UtcNow, "{ConverterCollectionName} was compiled in {CompilationTimeMilliseconds} ms", logProperties));
logger.Info("{ConverterCollectionName} was compiled in {CompilationTimeMilliseconds} ms", logProperties);
}

private static TypeCode GetTypeCode(Type type)
Expand Down
18 changes: 4 additions & 14 deletions Mutators/Mutators.csproj
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net471</TargetFramework>
<TargetFramework>net472</TargetFramework>
<AssemblyName>GrobExp.Mutators</AssemblyName>
<RootNamespace>GrobExp.Mutators</RootNamespace>
<PackageId>$(AssemblyName)</PackageId>
<VersionPrefix>1.0.0</VersionPrefix>
<Version>$(VersionPrefix)-rc-003</Version>
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
<Authors>Igor Chevdar, Michael Samoylenko, Anton Chaplygin</Authors>
<PackageTags>expression tree code generation</PackageTags>
<Description>Code generation mechanics for documents conversion and validation</Description>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/skbkontur/grobexp-mutators</RepositoryUrl>
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GroBuf" Version="1.3.2" />
<PackageReference Include="GrobExp.Compiler" Version="1.1.1" />
<PackageReference Include="Vostok.Logging.Abstractions" Version="0.0.1" />
<PackageReference Include="GroBuf" Version="1.4.2" />
<PackageReference Include="GrobExp.Compiler" Version="1.2.1" />
<PackageReference Include="Vostok.Logging.Abstractions" Version="0.1.0" />
</ItemGroup>

</Project>
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Code generation mechanics for documents conversion and validation

[![NuGet Status](https://img.shields.io/nuget/v/GrobExp.Mutators.svg)](https://www.nuget.org/packages/GrobExp.Mutators/)
[![Build status](https://ci.appveyor.com/api/projects/status/rqyf5ndta4770afq?svg=true)](https://ci.appveyor.com/project/vostok/grobexp-mutators)
[![Build status](https://ci.appveyor.com/api/projects/status/rqyf5ndta4770afq?svg=true)](https://ci.appveyor.com/project/skbkontur/grobexp-mutators)

## Release Notes

See [CHANGELOG](CHANGELOG.md).
44 changes: 44 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,58 @@
version: '{build}'

skip_commits:
files:
- '**/*.md'

image: Visual Studio 2017

init:
- cmd: git config --global core.autocrlf false
- ps: |
$ErrorActionPreference = "Stop"
$tagName = $env:APPVEYOR_REPO_TAG_NAME
if ($tagName -match '^v\d+\.\d+') # tag name starts with 'vX.Y'
{
$env:SHOULD_PUBLISH_NUGET_PACKAGE = "true"
Write-Host "Will publish nuget package for $tagName tag" -ForegroundColor "Green"
if ($tagName -match '^v\d+\.\d+-release$') # tag name matches 'vX.Y-release'
{
$env:SHOULD_CREATE_RELEASE = "true"
Write-Host "Will create release for $tagName tag" -ForegroundColor "Green"
}
}
nuget:
disable_publish_on_pr: true

before_build:
- cmd: dotnet --info
- cmd: dotnet restore ./GrobExp.Mutators.sln --verbosity minimal

build_script:
- cmd: dotnet build --configuration Release ./GrobExp.Mutators.sln
- cmd: dotnet pack --no-build --configuration Release ./GrobExp.Mutators.sln

test_script:
- cmd: dotnet test --no-build --verbosity normal --configuration Release --filter TestCategory!=Failing ./Mutators.Tests/Mutators.Tests.csproj

artifacts:
- path: './Mutators/bin/Release/*.nupkg'

deploy:
- provider: NuGet
server: https://nuget.org
api_key:
secure: dzTnT0xSlPrHnrG06cj354nTN4lXWhfh4ZCJ1910I3VnNdvbx0rQFLTyJ5l1+bgB
skip_symbols: true
on:
SHOULD_PUBLISH_NUGET_PACKAGE: true

- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
auth_token:
secure: y8dDOcAtq4U1MTDJFX8f23xsvyFU1u4bhwr9Lzbkf2revNWPPTifBkWghris9v8i
draft: false
prerelease: false
on:
SHOULD_CREATE_RELEASE: true
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "2.1.300"
"version": "2.1.400"
}
}
2 changes: 1 addition & 1 deletion nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3"/>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
20 changes: 20 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0",
"assemblyVersion": {
"precision": "build"
},
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/tags/v\\d+\\.\\d+"
],
"nugetPackageVersion": {
"semVer": 2
},
"cloudBuild": {
"setVersionVariables": true,
"buildNumber": {
"enabled": false
}
}
}

0 comments on commit ca10a72

Please sign in to comment.