Skip to content

Commit b481dd0

Browse files
committed
Fixing bug with TryParse and updating build
1 parent 0d4832d commit b481dd0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+283
-148
lines changed

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Dockerfile*
2+
docker-compose*
3+
.dockerignore
4+
.vscode
5+
.idea
6+
.vs
7+
**/artifacts/
8+
**/bin/
9+
**/obj/
10+
**/TestResult/
11+
**/out/

.vscode/tasks.json

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "shell",
8+
"args": [
9+
"build",
10+
"/property:GenerateFullPaths=true",
11+
"/consoleloggerparameters:NoSummary"
12+
],
13+
"group": {
14+
"isDefault": true,
15+
"kind": "build"
16+
},
17+
"presentation": {
18+
"reveal": "silent"
19+
},
20+
"problemMatcher": "$msCompile"
21+
},
22+
{
23+
"label": "test",
24+
"command": "dotnet",
25+
"type": "shell",
26+
"group": {
27+
"kind": "test",
28+
"isDefault": true
29+
},
30+
"args": [
31+
"test",
32+
"/p:GenerateFullPaths=true"
33+
],
34+
"problemMatcher": "$msCompile"
35+
},
36+
{
37+
"label": "pack",
38+
"command": "dotnet pack -c Release -o ${workspaceFolder}/artifacts",
39+
"type": "shell",
40+
"problemMatcher": []
41+
},
42+
{
43+
"label": "docker: build",
44+
"command": "docker build --target build -t exceptionless:build .",
45+
"type": "shell",
46+
"group": "build",
47+
"problemMatcher": "$msCompile"
48+
},
49+
{
50+
"label": "docker: test",
51+
"command": "docker build --target testrunner -t exceptionless:test . && docker run -v $(pwd)/artifacts:/app/artifacts exceptionless:test",
52+
"windows": {
53+
"command": "docker build --target testrunner -t exceptionless:test . ; docker run -it --net host exceptionless:test"
54+
},
55+
"type": "shell",
56+
"group": "build",
57+
"problemMatcher": "$msCompile"
58+
},
59+
{
60+
"label": "docker: pack",
61+
"command": "docker build --target pack -t exceptionless:pack . && docker run -v $(pwd)/artifacts:/app/artifacts exceptionless:pack",
62+
"windows": {
63+
"command": "docker build --target pack -t exceptionless:pack . ; docker run -it --net host exceptionless:pack"
64+
},
65+
"type": "shell",
66+
"group": "build",
67+
"problemMatcher": "$msCompile"
68+
}
69+
]
70+
}

Dockerfile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build
2+
3+
WORKDIR /app
4+
5+
ARG VERSION_SUFFIX=0-dev
6+
ENV VERSION_SUFFIX=$VERSION_SUFFIX
7+
8+
COPY ./*.sln ./
9+
COPY ./*/*.props ./
10+
COPY ./LICENSE.txt ./LICENSE.txt
11+
12+
# Copy the main source project files
13+
COPY src/*/*.csproj ./
14+
RUN for file in $(ls *.csproj); do mkdir -p src/${file%.*}/ && mv $file src/${file%.*}/; done
15+
16+
# Copy the test project files
17+
COPY tests/*/*.csproj ./
18+
RUN for file in $(ls *.csproj); do mkdir -p tests/${file%.*}/ && mv $file tests/${file%.*}/; done
19+
20+
#RUN dotnet restore
21+
22+
# Copy everything else and build
23+
#COPY . .
24+
#RUN dotnet build --version-suffix $VERSION_SUFFIX -c Release
25+
26+
# testrunner
27+
28+
FROM build AS testrunner
29+
WORKDIR /app/tests/Exceptionless.DateTimeExtensions.Tests
30+
ENTRYPOINT dotnet test --results-directory /app/artifacts --logger:trx
31+
32+
# pack
33+
34+
FROM build AS pack
35+
WORKDIR /app/
36+
37+
ARG VERSION_SUFFIX=0-dev
38+
ENV VERSION_SUFFIX=$VERSION_SUFFIX
39+
40+
ENTRYPOINT dotnet pack --version-suffix $VERSION_SUFFIX -c Release -o /app/artifacts
41+
42+
# publish
43+
44+
FROM pack AS publish
45+
WORKDIR /app/
46+
47+
ENTRYPOINT [ "dotnet", "nuget", "push", "/app/artifacts/*.nupkg" ]
48+
49+
# docker build --target testrunner -t exceptionless:testrunner --build-arg VERSION_SUFFIX=123-dev .
50+
# docker run -it -v $(pwd)/artifacts:/app/artifacts exceptionless:testrunner
51+
# docker run -it -v $(pwd):/app mcr.microsoft.com/dotnet/core/sdk:2.2
52+
53+
# docker build --target publish -t exceptionless:publish --build-arg VERSION_SUFFIX=123-dev .
54+
# export NUGET_SOURCE=https://api.nuget.org/v3/index.json
55+
# export NUGET_KEY=MY_SECRET_NUGET_KEY
56+
# docker run -it exceptionless:publish -k $NUGET_KEY -s ${NUGET_SOURCE:-https://api.nuget.org/v3/index.json}

Exceptionless.DateTimeExtensions.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1111
EndProject
1212
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exceptionless.DateTimeExtensions", "src\Exceptionless.DateTimeExtensions\Exceptionless.DateTimeExtensions.csproj", "{2734AB9C-28B7-47E2-96BE-580B48105F41}"
1313
EndProject
14-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exceptionless.DateTimeExtensions.Tests", "test\Exceptionless.DateTimeExtensions.Tests\Exceptionless.DateTimeExtensions.Tests.csproj", "{54BC6486-752C-4B9F-864A-FFCB7568A8E4}"
14+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exceptionless.DateTimeExtensions.Tests", "tests\Exceptionless.DateTimeExtensions.Tests\Exceptionless.DateTimeExtensions.Tests.csproj", "{54BC6486-752C-4B9F-864A-FFCB7568A8E4}"
1515
EndProject
1616
Global
1717
GlobalSection(SolutionConfigurationPlatforms) = preSolution

LICENSE renamed to LICENSE.txt

File renamed without changes.

appveyor.yml

Lines changed: 45 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,72 @@
1-
version: 3.3.{build}
2-
os: Visual Studio 2017
1+
version: '{build}'
2+
image: ubuntu
33
clone_depth: 2
4-
configuration: Release
4+
5+
services:
6+
- docker
57

68
pull_requests:
79
do_not_increment_build_number: true
8-
9-
init:
10-
- git config --global core.autocrlf input
11-
- ps: $env:GIT_HASH=$env:APPVEYOR_REPO_COMMIT.Substring(0, 10)
12-
- ps: If ("$env:APPVEYOR_REPO_TAG" -ne "true") { $env:VERSION_SUFFIX="pre" }
13-
- ps: 'Write-Output "Version: $($env:APPVEYOR_BUILD_VERSION)-$($env:VERSION_SUFFIX)"'
1410

15-
install:
16-
- cmd: curl -O https://download.microsoft.com/download/0/F/D/0FD852A4-7EA1-4E2A-983A-0484AC19B92C/dotnet-sdk-2.0.0-win-x64.exe
17-
- cmd: dotnet-sdk-2.0.0-win-x64.exe /install /quiet /norestart /log install.log
18-
19-
before_build:
20-
- ps: .\build\Set-BuildVersion -Version $env:APPVEYOR_BUILD_VERSION -Suffix $env:VERSION_SUFFIX
21-
- nuget sources add -name Exceptionless -source https://www.myget.org/F/exceptionless/api/v3/index.json
22-
- appveyor-retry dotnet restore -v Minimal
11+
environment:
12+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
13+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
2314

24-
build_script:
25-
- dotnet build -c Release
15+
init:
16+
- git config --global core.autocrlf input
2617

27-
#on_failure:
28-
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
18+
before_build:
19+
- |
20+
VERSION_PREFIX=$(sed -n 's/.*<VersionPrefix>\([^<]*\)<\/VersionPrefix>.*/\1/p' <<< cat ./build/common.props)
21+
if [ $APPVEYOR_REPO_TAG != "true" ]; then
22+
VERSION_SUFFIX="$APPVEYOR_BUILD_NUMBER-pre"
23+
VERSION="$VERSION_PREFIX.$VERSION_SUFFIX"
24+
echo "Version: $VERSION"
25+
else
26+
VERSION_SUFFIX=$APPVEYOR_BUILD_NUMBER
27+
VERSION="$VERSION_PREFIX.$VERSION_SUFFIX"
28+
echo "Version: $VERSION Tag: $APPVEYOR_REPO_TAG_NAME"
29+
fi
30+
if [ -z $APPVEYOR_PULL_REQUEST_NUMBER ]; then
31+
appveyor UpdateBuild -Version $VERSION
32+
fi
2933
30-
test_script:
31-
- ps: Push-Location .\test\Exceptionless.DateTimeExtensions.Tests
32-
- ps: dotnet xunit -configuration Release
33-
- ps: Pop-Location
34+
build_script:
35+
- docker build --target testrunner -t exceptionless:test --build-arg VERSION_SUFFIX=${VERSION_SUFFIX} .
36+
- docker run -e APPVEYOR_API_URL --net=host -v $(pwd)/artifacts:/app/artifacts exceptionless:test
3437

35-
after_test:
36-
- dotnet pack -c Release
38+
after_build:
39+
- docker build --target pack -t exceptionless:pack --build-arg VERSION_SUFFIX=${VERSION_SUFFIX} .
40+
- docker run --rm -v $(pwd)/artifacts:/app/artifacts exceptionless:pack
3741

3842
artifacts:
39-
- path: artifacts\*.nupkg
43+
- path: artifacts/*.nupkg
4044
name: NuGet
41-
45+
- path: artifacts/*.trx
46+
name: Test Results
47+
4248
deploy:
49+
- provider: Environment
50+
name: GitHub Packages
51+
on:
52+
APPVEYOR_REPO_TAG: false
4353
- provider: Environment
4454
name: MyGet
55+
on:
56+
APPVEYOR_REPO_TAG: false
4557
- provider: Environment
4658
name: NuGet
4759
on:
48-
appveyor_repo_tag: true
60+
APPVEYOR_REPO_TAG: true
4961
- provider: GitHub
5062
auth_token:
5163
secure: 0s81q7bweVLTFSOKxnIhan7el6bIFiN8HJ1kYJzOkeFXX7wgGSq9bs/rV53X9qpf
5264
draft: true
5365
on:
54-
appveyor_repo_tag: true
55-
66+
APPVEYOR_REPO_TAG: true
67+
5668
notifications:
5769
- provider: Slack
58-
channel: '#notifications'
5970
auth_token:
6071
secure: GniMpFE62HprSyQNQoej/VSBnxn2GNnTrca3BnF8+ikMdqduO4Ts4t297teZF6wDAmGwnOtXusctUla8+WxLFkIztvVCS2Z1RG/DvEDYoc0=
72+
channel: '#notifications'

build/Clean.ps1

Lines changed: 0 additions & 16 deletions
This file was deleted.
File renamed without changes.

build/Set-BuildVersion.ps1

Lines changed: 0 additions & 13 deletions
This file was deleted.

build/common.props

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<Project>
2+
3+
<PropertyGroup Label="Version">
4+
<VersionPrefix>3.3</VersionPrefix>
5+
<VersionSuffix>0-dev</VersionSuffix>
6+
<Version>$(VersionPrefix).$(VersionSuffix)</Version>
7+
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
8+
</PropertyGroup>
9+
10+
<PropertyGroup>
11+
<TargetFramework>netstandard2.0</TargetFramework>
12+
<Product>Exceptionless DateTime Extensions</Product>
13+
<Description>DateTimeRange and various DateTime and TimeSpan extension methods.</Description>
14+
<PackageProjectUrl>https://github.com/exceptionless/Exceptionless.DateTimeExtensions</PackageProjectUrl>
15+
<PackageReleaseNotes>https://github.com/exceptionless/Exceptionless.DateTimeExtensions/releases</PackageReleaseNotes>
16+
<PackageTags>Date;Time;Parsing</PackageTags>
17+
18+
<Copyright>Copyright (c) 2019 Exceptionless. All rights reserved.</Copyright>
19+
<Authors>Exceptionless</Authors>
20+
<NoWarn>$(NoWarn);CS1591;NU1701</NoWarn>
21+
<WarningsAsErrors>true</WarningsAsErrors>
22+
<LangVersion>latest</LangVersion>
23+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
24+
<PackageOutputPath>$(SolutionDir)artifacts</PackageOutputPath>
25+
<PackageIconUrl>https://be.exceptionless.io/img/exceptionless-32.png</PackageIconUrl>
26+
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
27+
<RepositoryUrl>$(PackageProjectUrl)</RepositoryUrl>
28+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
29+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
30+
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
31+
</PropertyGroup>
32+
33+
<PropertyGroup Label="Signing">
34+
<SignAssembly>true</SignAssembly>
35+
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Exceptionless.snk</AssemblyOriginatorKeyFile>
36+
</PropertyGroup>
37+
38+
<ItemGroup>
39+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19554-01" PrivateAssets="All"/>
40+
<PackageReference Include="AsyncFixer" Version="1.1.6" PrivateAssets="All" />
41+
</ItemGroup>
42+
43+
<ItemGroup>
44+
<None Include="../../LICENSE.txt" Pack="true" Visible="false" PackagePath="$(PackageLicenseFile)" />
45+
</ItemGroup>
46+
47+
</Project>

build/version.props

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,3 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="..\..\build\version.props" />
3-
4-
<PropertyGroup>
5-
<TargetFramework>netstandard2.0</TargetFramework>
6-
<DebugType>embedded</DebugType>
7-
<Product>Exceptionless DateTime Extensions</Product>
8-
<Description>DateTimeRange and various DateTime and TimeSpan extension methods.</Description>
9-
<Copyright>Copyright (c) 2017 Exceptionless. All rights reserved.</Copyright>
10-
<Authors>bniemyjski;ejsmith</Authors>
11-
<NoWarn>$(NoWarn);CS1591</NoWarn>
12-
<WarningsAsErrors>true</WarningsAsErrors>
13-
<DebugType>portable</DebugType>
14-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
15-
<PackageOutputPath>$(SolutionDir)artifacts\</PackageOutputPath>
16-
17-
<PackageReleaseNotes>https://github.com/exceptionless/Exceptionless.DateTimeExtensions/releases</PackageReleaseNotes>
18-
<PackageIconUrl>https://be.exceptionless.io/img/exceptionless-32.png</PackageIconUrl>
19-
<PackageProjectUrl>https://github.com/exceptionless/Exceptionless.DateTimeExtensions</PackageProjectUrl>
20-
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
21-
<RepositoryType>git</RepositoryType>
22-
<RepositoryUrl>https://github.com/exceptionless/Exceptionless.DateTimeExtensions</RepositoryUrl>
23-
<VersionSuffix Condition="'$(VersionSuffix)'!='' AND '$(BuildNumber)' != ''">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
24-
</PropertyGroup>
25-
26-
<PropertyGroup Label="Signing">
27-
<SignAssembly>true</SignAssembly>
28-
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
29-
<AssemblyOriginatorKeyFile>..\..\Exceptionless.snk</AssemblyOriginatorKeyFile>
30-
</PropertyGroup>
31-
32-
<ItemGroup>
33-
<PackageReference Include="SourceLink.Create.GitHub" Version="2.6.0" PrivateAssets="all" />
34-
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.6.0" />
35-
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.6.0" />
36-
</ItemGroup>
2+
<Import Project="..\..\build\common.props" />
373
</Project>

0 commit comments

Comments
 (0)