Skip to content

Commit af35280

Browse files
authored
Update build stuff (henkmollema#167)
* Multi-target tests * Update/simplify build scripts
1 parent 2cf1a53 commit af35280

13 files changed

+24
-28
lines changed

.travis.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,4 @@ branches:
1616
script:
1717
- dotnet restore
1818
- dotnet build
19-
- dotnet test test/Dommel.Tests
20-
- dotnet test test/Dommel.IntegrationTests
21-
- dotnet test test/Dommel.Json.Tests
22-
- dotnet test test/Dommel.Json.IntegrationTests
23-
script:
24-
- ./build.sh
19+
- dotnet test --no-build

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016 Henk Mollema
3+
Copyright (c) 2019 Henk Mollema
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

NuGet.Config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
4-
<add key="NuGet" value="https://nuget.org/api/v2" />
4+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
55
</packageSources>
66
</configuration>

build.ps1

-11
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,7 @@ echo "build: Build version suffix is $buildSuffix"
2525
exec { & dotnet build Dommel.sln -c Release --version-suffix=$buildSuffix /p:CI=true }
2626

2727
echo "build: Executing tests"
28-
Push-Location -Path .\test\Dommel.Tests
2928
exec { & dotnet test -c Release --no-build }
30-
Pop-Location
31-
Push-Location -Path .\test\Dommel.IntegrationTests
32-
exec { & dotnet test -c Release --no-build }
33-
Pop-Location
34-
Push-Location -Path .\test\Dommel.Json.Tests
35-
exec { & dotnet test -c Release --no-build }
36-
Pop-Location
37-
Push-Location -Path .\test\Dommel.Json.IntegrationTests
38-
exec { & dotnet test -c Release --no-build }
39-
Pop-Location
4029

4130
if ($env:APPVEYOR_BUILD_NUMBER) {
4231
$versionSuffix = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10)

build.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
dotnet build
2-
dotnet test test/Dommel.Tests
3-
dotnet test test/Dommel.IntegrationTests
2+
dotnet test

src/Dommel/Dommel.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1515
<RepositoryType>git</RepositoryType>
1616
<RepositoryUrl>https://github.com/henkmollema/Dommel</RepositoryUrl>
17+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
1718
<DebugSymbols>true</DebugSymbols>
1819
<DebugType>embedded</DebugType>
1920
</PropertyGroup>

test/Dommel.IntegrationTests/Dommel.IntegrationTests.csproj

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netcoreapp3.0</TargetFrameworks>
3+
<TargetFrameworks>net461;netcoreapp2.1;netcoreapp3.0</TargetFrameworks>
4+
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp3.0</TargetFrameworks>
45
<IsPackable>false</IsPackable>
56
<LangVersion>latest</LangVersion>
67
</PropertyGroup>

test/Dommel.Json.IntegrationTests/Databases/JsonMySqlDatabaseDriver.cs

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ namespace Dommel.Json.IntegrationTests
66
{
77
public class JsonMySqlDatabaseDriver : MySqlDatabaseDriver
88
{
9+
public override string DefaultDatabaseName => "dommeljsontests";
10+
911
protected override async Task<bool> CreateTables()
1012
{
1113
using (var con = GetConnection(DefaultDatabaseName))

test/Dommel.Json.IntegrationTests/Databases/JsonPostgresDatabaseDriver.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ namespace Dommel.Json.IntegrationTests
66
{
77
public class JsonPostgresDatabaseDriver : PostgresDatabaseDriver
88
{
9+
public override string DefaultDatabaseName => "dommeljsontests";
10+
911
protected override async Task<bool> CreateTables()
1012
{
1113
using (var con = GetConnection(DefaultDatabaseName))
1214
{
1315
var sql = @"
1416
create table if not exists ""Leads"" (
15-
""Id"" serial primary key,
16-
""DateCreated"" timestamp,
17-
""Email"" varchar(255),
17+
""Id"" serial primary key,
18+
""DateCreated"" timestamp,
19+
""Email"" varchar(255),
1820
""Data"" json,
1921
""Metadata"" json
2022
);";

test/Dommel.Json.IntegrationTests/Databases/JsonSqlServerDatabaseDriver.cs

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ namespace Dommel.Json.IntegrationTests
66
{
77
public class JsonSqlServerDatabaseDriver : SqlServerDatabaseDriver
88
{
9+
public override string DefaultDatabaseName => "dommeljsontests";
10+
911
protected override async Task<bool> CreateTables()
1012
{
1113
using (var con = GetConnection(DefaultDatabaseName))

test/Dommel.Json.IntegrationTests/Dommel.Json.IntegrationTests.csproj

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp3.0</TargetFramework>
3+
<TargetFrameworks>net461;netcoreapp2.1;netcoreapp3.0</TargetFrameworks>
4+
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp3.0</TargetFrameworks>
45
<IsPackable>false</IsPackable>
56
<LangVersion>latest</LangVersion>
67
</PropertyGroup>

test/Dommel.Json.Tests/Dommel.Json.Tests.csproj

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp3.0</TargetFramework>
3+
<TargetFrameworks>net461;netcoreapp2.1;netcoreapp3.0</TargetFrameworks>
4+
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp3.0</TargetFrameworks>
45
<IsPackable>false</IsPackable>
6+
<LangVersion>latest</LangVersion>
57
</PropertyGroup>
68
<ItemGroup>
79
<ProjectReference Include="..\..\src\Dommel.Json\Dommel.Json.csproj" />

test/Dommel.Tests/Dommel.Tests.csproj

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netcoreapp3.0</TargetFrameworks>
3+
<TargetFrameworks>net461;netcoreapp2.1;netcoreapp3.0</TargetFrameworks>
4+
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp3.0</TargetFrameworks>
45
<IsPackable>false</IsPackable>
6+
<LangVersion>latest</LangVersion>
57
</PropertyGroup>
68
<ItemGroup>
79
<PackageReference Include="coverlet.msbuild" Version="2.7.0">

0 commit comments

Comments
 (0)