Unverified Commit 663588f9 authored by Nick Craver's avatar Nick Craver Committed by GitHub

AppVeyor: Build tweaks & misc fixes (#1450)

Simplifying and improve build speed.

- Decreases builds from 8-13 minutes down to ~2 minutes (while running more tests)
- Moves to SQL Server 2019 on AppVeyor
- Moves the 2 longest running tests with params to `[FactLongRunning]`
- Bumps tests up to `netcoreapp3.1`
- Also fixes .Contrib tests
- Moves to `Build.csproj`
- Simplifies `build.ps1`
- Removed defunct `build.sh`
- Nukes `IsAppveyor` (moves to environmental variable overloads)
- Builds now work in Linux/macOS
parent 5c87dc97
<Project Sdk="Microsoft.Build.Traversal/2.0.24">
<ItemGroup>
<ProjectReference Include="*\*.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Dapper.ProviderTools.Internal; using Dapper.ProviderTools.Internal;
#nullable enable
namespace Dapper.ProviderTools namespace Dapper.ProviderTools
{ {
/// <summary> /// <summary>
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks> <TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
<SignAssembly>true</SignAssembly> <SignAssembly>true</SignAssembly>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<LangVersion>8.0</LangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" /> <PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
using System.Data.Common; using System.Data.Common;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Reflection; using System.Reflection;
#nullable enable
namespace Dapper.ProviderTools namespace Dapper.ProviderTools
{ {
/// <summary> /// <summary>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
using System.Data.Common; using System.Data.Common;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Reflection; using System.Reflection;
#nullable enable
namespace Dapper.ProviderTools namespace Dapper.ProviderTools
{ {
/// <summary> /// <summary>
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
<AssemblyName>Dapper.Tests.Contrib</AssemblyName> <AssemblyName>Dapper.Tests.Contrib</AssemblyName>
<Description>Dapper Contrib Test Suite</Description> <Description>Dapper Contrib Test Suite</Description>
<GenerateDocumentationFile>false</GenerateDocumentationFile> <GenerateDocumentationFile>false</GenerateDocumentationFile>
<TargetFrameworks>netcoreapp2.1;net462</TargetFrameworks> <TargetFrameworks>netcoreapp3.1;net462</TargetFrameworks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Dapper.Tests\Helpers\XunitSkippable.cs;..\Dapper\TypeExtensions.cs" /> <Compile Include="..\Dapper.Tests\Helpers\XunitSkippable.cs" Link="Helpers\XunitSkippable.cs" />
<None Remove="Test.DB.sdf" /> <None Remove="Test.DB.sdf" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
...@@ -25,5 +25,4 @@ ...@@ -25,5 +25,4 @@
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' "> <ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
</ItemGroup> </ItemGroup>
<!-- note: define SQLCE if SQL CE is available -->
</Project> </Project>
using System;
using Xunit.Sdk;
namespace Dapper.Tests
{
/// <summary>
/// <para>Override for <see cref="Xunit.FactAttribute"/> that truncates our DisplayName down.</para>
/// <para>
/// Attribute that is applied to a method to indicate that it is a fact that should
/// be run by the test runner. It can also be extended to support a customized definition
/// of a test method.
/// </para>
/// </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
[XunitTestCaseDiscoverer("Dapper.Tests.FactDiscoverer", "Dapper.Tests.Contrib")]
public class FactAttribute : Xunit.FactAttribute
{
}
/// <summary>
/// <para>Override for <see cref="Xunit.TheoryAttribute"/> that truncates our DisplayName down.</para>
/// <para>
/// Marks a test method as being a data theory. Data theories are tests which are
/// fed various bits of data from a data source, mapping to parameters on the test
/// method. If the data source contains multiple rows, then the test method is executed
/// multiple times (once with each data row). Data is provided by attributes which
/// derive from Xunit.Sdk.DataAttribute (notably, Xunit.InlineDataAttribute and Xunit.MemberDataAttribute).
/// </para>
/// </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
[XunitTestCaseDiscoverer("Dapper.Tests.TheoryDiscoverer", "Dapper.Tests.Contrib")]
public class TheoryAttribute : Xunit.TheoryAttribute { }
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public sealed class FactLongRunningAttribute : FactAttribute
{
public FactLongRunningAttribute()
{
#if !LONG_RUNNING
Skip = "Long running";
#endif
}
public string Url { get; private set; }
}
}
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Linq; using System.Linq;
using System.Transactions;
using Dapper.Contrib.Extensions; using Dapper.Contrib.Extensions;
using Xunit; using Xunit;
...@@ -104,10 +103,11 @@ public class GenericType<T> ...@@ -104,10 +103,11 @@ public class GenericType<T>
public abstract partial class TestSuite public abstract partial class TestSuite
{ {
protected static readonly bool IsAppVeyor = Environment.GetEnvironmentVariable("Appveyor")?.ToUpperInvariant() == "TRUE";
public abstract IDbConnection GetConnection(); public abstract IDbConnection GetConnection();
protected static string GetConnectionString(string name, string defaultConnectionString) =>
Environment.GetEnvironmentVariable(name) ?? defaultConnectionString;
private IDbConnection GetOpenConnection() private IDbConnection GetOpenConnection()
{ {
var connection = GetConnection(); var connection = GetConnection();
......
...@@ -23,9 +23,8 @@ public class SqlServerTestSuite : TestSuite ...@@ -23,9 +23,8 @@ public class SqlServerTestSuite : TestSuite
{ {
private const string DbName = "tempdb"; private const string DbName = "tempdb";
public static string ConnectionString => public static string ConnectionString =>
IsAppVeyor GetConnectionString("SqlServerConnectionString", $"Data Source=.;Initial Catalog={DbName};Integrated Security=True");
? @"Server=(local)\SQL2016;Database=tempdb;User ID=sa;Password=Password12!"
: $"Data Source=.;Initial Catalog={DbName};Integrated Security=True";
public override IDbConnection GetConnection() => new SqlConnection(ConnectionString); public override IDbConnection GetConnection() => new SqlConnection(ConnectionString);
static SqlServerTestSuite() static SqlServerTestSuite()
...@@ -62,9 +61,7 @@ static SqlServerTestSuite() ...@@ -62,9 +61,7 @@ static SqlServerTestSuite()
public class MySqlServerTestSuite : TestSuite public class MySqlServerTestSuite : TestSuite
{ {
public static string ConnectionString { get; } = public static string ConnectionString { get; } =
IsAppVeyor GetConnectionString("MySqlConnectionString", "Server=localhost;Database=tests;Uid=test;Pwd=pass;UseAffectedRows=false;");
? "Server=localhost;Database=test;Uid=root;Pwd=Password12!;UseAffectedRows=false;"
: "Server=localhost;Database=tests;Uid=test;Pwd=pass;UseAffectedRows=false;";
public override IDbConnection GetConnection() public override IDbConnection GetConnection()
{ {
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
<Description>Dapper Core Performance Suite</Description> <Description>Dapper Core Performance Suite</Description>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<GenerateDocumentationFile>false</GenerateDocumentationFile> <GenerateDocumentationFile>false</GenerateDocumentationFile>
<TargetFrameworks>net462;netcoreapp3.0</TargetFrameworks> <TargetFrameworks>net462;netcoreapp3.1</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Dapper\Dapper.csproj" /> <ProjectReference Include="..\Dapper\Dapper.csproj" />
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<AssemblyName>Dapper.Tests</AssemblyName> <AssemblyName>Dapper.Tests</AssemblyName>
<Description>Dapper Core Test Suite</Description> <Description>Dapper Core Test Suite</Description>
<GenerateDocumentationFile>false</GenerateDocumentationFile> <GenerateDocumentationFile>false</GenerateDocumentationFile>
<TargetFrameworks>netcoreapp2.1;net462;net472</TargetFrameworks> <TargetFrameworks>netcoreapp3.1;net462;net472</TargetFrameworks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<DefineConstants>$(DefineConstants);MSSQLCLIENT</DefineConstants> <DefineConstants>$(DefineConstants);MSSQLCLIENT</DefineConstants>
</PropertyGroup> </PropertyGroup>
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Dapper.SqlBuilder\Dapper.SqlBuilder.csproj" />
<ProjectReference Include="..\Dapper\Dapper.csproj" /> <ProjectReference Include="..\Dapper\Dapper.csproj" />
<ProjectReference Include="..\Dapper.Contrib\Dapper.Contrib.csproj" /> <ProjectReference Include="..\Dapper.Contrib\Dapper.Contrib.csproj" />
<ProjectReference Include="..\Dapper.ProviderTools\Dapper.ProviderTools.csproj" /> <ProjectReference Include="..\Dapper.ProviderTools\Dapper.ProviderTools.csproj" />
<ProjectReference Include="..\Dapper.SqlBuilder\Dapper.SqlBuilder.csproj" />
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="7.0.0" /> <PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="7.0.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="1.1.1" /> <PackageReference Include="Microsoft.Data.SqlClient" Version="1.1.1" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.6" /> <PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.6" />
......
...@@ -1442,10 +1442,10 @@ public void Issue601_InternationalParameterNamesWork() ...@@ -1442,10 +1442,10 @@ public void Issue601_InternationalParameterNamesWork()
Assert.Equal(42, result); Assert.Equal(42, result);
} }
[Fact] [FactLongRunning]
public void TestListExpansionPadding_Enabled() => TestListExpansionPadding(true); public void TestListExpansionPadding_Enabled() => TestListExpansionPadding(true);
[Fact] [FactLongRunning]
public void TestListExpansionPadding_Disabled() => TestListExpansionPadding(false); public void TestListExpansionPadding_Disabled() => TestListExpansionPadding(false);
private void TestListExpansionPadding(bool enabled) private void TestListExpansionPadding(bool enabled)
......
...@@ -10,9 +10,8 @@ namespace Dapper.Tests ...@@ -10,9 +10,8 @@ namespace Dapper.Tests
public sealed class MySqlProvider : DatabaseProvider public sealed class MySqlProvider : DatabaseProvider
{ {
public override DbProviderFactory Factory => MySql.Data.MySqlClient.MySqlClientFactory.Instance; public override DbProviderFactory Factory => MySql.Data.MySqlClient.MySqlClientFactory.Instance;
public override string GetConnectionString() => IsAppVeyor public override string GetConnectionString() =>
? "Server=localhost;Database=test;Uid=root;Pwd=Password12!;" GetConnectionString("MySqlConnectionString", "Server=localhost;Database=tests;Uid=test;Pwd=pass;");
: "Server=localhost;Database=tests;Uid=test;Pwd=pass;";
public DbConnection GetMySqlConnection(bool open = true, public DbConnection GetMySqlConnection(bool open = true,
bool convertZeroDatetime = false, bool allowZeroDatetime = false) bool convertZeroDatetime = false, bool allowZeroDatetime = false)
......
...@@ -11,9 +11,7 @@ public class OLEDBProvider : DatabaseProvider ...@@ -11,9 +11,7 @@ public class OLEDBProvider : DatabaseProvider
{ {
public override DbProviderFactory Factory => OleDbFactory.Instance; public override DbProviderFactory Factory => OleDbFactory.Instance;
public override string GetConnectionString() => public override string GetConnectionString() =>
IsAppVeyor GetConnectionString("OLEDBConnectionString", "Provider=SQLOLEDB;Data Source=.;Initial Catalog=tempdb;Integrated Security=SSPI");
? @"Provider=SQLOLEDB;Data Source=(local)\SQL2016;Initial Catalog=tempdb;User Id=sa;Password=Password12!"
: "Provider=SQLOLEDB;Data Source=.;Initial Catalog=tempdb;Integrated Security=SSPI";
} }
public class OLDEBTests : TestBase<OLEDBProvider> public class OLDEBTests : TestBase<OLEDBProvider>
......
...@@ -9,9 +9,8 @@ namespace Dapper.Tests ...@@ -9,9 +9,8 @@ namespace Dapper.Tests
public class PostgresProvider : DatabaseProvider public class PostgresProvider : DatabaseProvider
{ {
public override DbProviderFactory Factory => Npgsql.NpgsqlFactory.Instance; public override DbProviderFactory Factory => Npgsql.NpgsqlFactory.Instance;
public override string GetConnectionString() => IsAppVeyor public override string GetConnectionString() =>
? "Server=localhost;Port=5432;User Id=postgres;Password=Password12!;Database=test" GetConnectionString("PostgesConnectionString", "Server=localhost;Port=5432;User Id=dappertest;Password=dapperpass;Database=dappertest");
: "Server=localhost;Port=5432;User Id=dappertest;Password=dapperpass;Database=dappertest"; // ;Encoding = UNICODE
} }
public class PostgresqlTests : TestBase<PostgresProvider> public class PostgresqlTests : TestBase<PostgresProvider>
{ {
......
...@@ -15,10 +15,12 @@ public abstract class DatabaseProvider ...@@ -15,10 +15,12 @@ public abstract class DatabaseProvider
{ {
public abstract DbProviderFactory Factory { get; } public abstract DbProviderFactory Factory { get; }
public static bool IsAppVeyor { get; } = Environment.GetEnvironmentVariable("Appveyor")?.ToUpperInvariant() == "TRUE";
public virtual void Dispose() { } public virtual void Dispose() { }
public abstract string GetConnectionString(); public abstract string GetConnectionString();
protected string GetConnectionString(string name, string defaultConnectionString) =>
Environment.GetEnvironmentVariable(name) ?? defaultConnectionString;
public DbConnection GetOpenConnection() public DbConnection GetOpenConnection()
{ {
var conn = Factory.CreateConnection(); var conn = Factory.CreateConnection();
...@@ -47,10 +49,8 @@ public DbParameter CreateRawParameter(string name, object value) ...@@ -47,10 +49,8 @@ public DbParameter CreateRawParameter(string name, object value)
public abstract class SqlServerDatabaseProvider : DatabaseProvider public abstract class SqlServerDatabaseProvider : DatabaseProvider
{ {
public override string GetConnectionString() => public override string GetConnectionString() =>
IsAppVeyor GetConnectionString("SqlServerConnectionString", "Data Source=.;Initial Catalog=tempdb;Integrated Security=True");
? @"Server=(local)\SQL2016;Database=tempdb;User ID=sa;Password=Password12!"
: "Data Source=.;Initial Catalog=tempdb;Integrated Security=True";
public DbConnection GetOpenConnection(bool mars) public DbConnection GetOpenConnection(bool mars)
{ {
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
<IncludeSymbols>false</IncludeSymbols> <IncludeSymbols>false</IncludeSymbols>
<PublishRepositoryUrl>true</PublishRepositoryUrl> <PublishRepositoryUrl>true</PublishRepositoryUrl>
<LangVersion>8.0</LangVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'"> <PropertyGroup Condition="'$(Configuration)' == 'Release'">
...@@ -32,7 +34,8 @@ ...@@ -32,7 +34,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.74" PrivateAssets="all" /> <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.74" PrivateAssets="all" />
</ItemGroup> </ItemGroup>
</Project> </Project>
\ No newline at end of file
...@@ -114,9 +114,9 @@ Performance ...@@ -114,9 +114,9 @@ Performance
A key feature of Dapper is performance. The following metrics show how long it takes to execute a `SELECT` statement against a DB (in various config, each labeled) and map the data returned to objects. A key feature of Dapper is performance. The following metrics show how long it takes to execute a `SELECT` statement against a DB (in various config, each labeled) and map the data returned to objects.
The benchmarks can be found in [Dapper.Tests.Performance](https://github.com/StackExchange/Dapper/tree/master/Dapper.Tests.Performance) (contributions welcome!) and can be run once compiled via: The benchmarks can be found in [Dapper.Tests.Performance](https://github.com/StackExchange/Dapper/tree/master/Dapper.Tests.Performance) (contributions welcome!) and can be run via:
``` ```bash
Dapper.Tests.Performance.exe -f * --join dotnet run -p .\Dapper.Tests.Performance\ -c Release -f netcoreapp3.1 -- -f * --join
``` ```
Output from the latest run is: Output from the latest run is:
``` ini ``` ini
......
image: Visual Studio 2017 image: Visual Studio 2019
skip_branch_with_pr: true skip_branch_with_pr: true
skip_tags: true skip_tags: true
...@@ -6,9 +6,6 @@ skip_commits: ...@@ -6,9 +6,6 @@ skip_commits:
files: files:
- '**/*.md' - '**/*.md'
install:
- choco install dotnetcore-sdk --version 3.0.100
environment: environment:
Appveyor: true Appveyor: true
# Postgres # Postgres
...@@ -24,14 +21,20 @@ environment: ...@@ -24,14 +21,20 @@ environment:
MYSQL_ENV_MYSQL_USER: root MYSQL_ENV_MYSQL_USER: root
MYSQL_ENV_MYSQL_PASSWORD: Password12! MYSQL_ENV_MYSQL_PASSWORD: Password12!
MYSQL_ENV_MYSQL_DATABASE: test MYSQL_ENV_MYSQL_DATABASE: test
# Connection strings for tests:
MySqlConnectionString: Server=localhost;Database=test;Uid=root;Pwd=Password12!
OLEDBConnectionString: Provider=SQLOLEDB;Data Source=(local)\SQL2019;Initial Catalog=tempdb;User Id=sa;Password=Password12!
PostgesConnectionString: Server=localhost;Port=5432;User Id=postgres;Password=Password12!;Database=test
SqlServerConnectionString: Server=(local)\SQL2019;Database=tempdb;User ID=sa;Password=Password12!
services: services:
- mssql2016
- mysql - mysql
- postgresql - postgresql
init: init:
- git config --global core.autocrlf input - git config --global core.autocrlf input
- SET PATH=%POSTGRES_PATH%\bin;%MYSQL_PATH%\bin;%PATH% - SET PATH=%POSTGRES_PATH%\bin;%MYSQL_PATH%\bin;%PATH%
- net start MSSQL$SQL2019
nuget: nuget:
disable_publish_on_pr: true disable_publish_on_pr: true
......
...@@ -11,61 +11,33 @@ Write-Host " RunTests: $RunTests" ...@@ -11,61 +11,33 @@ Write-Host " RunTests: $RunTests"
Write-Host " dotnet --version:" (dotnet --version) Write-Host " dotnet --version:" (dotnet --version)
$packageOutputFolder = "$PSScriptRoot\.nupkgs" $packageOutputFolder = "$PSScriptRoot\.nupkgs"
$projectsToBuild =
'Dapper',
'Dapper.StrongName',
'Dapper.Contrib',
'Dapper.EntityFramework',
'Dapper.EntityFramework.StrongName',
'Dapper.Rainbow',
'Dapper.SqlBuilder'
$testsToRun =
'Dapper.Tests',
'Dapper.Tests.Contrib'
if ($PullRequestNumber) { if ($PullRequestNumber) {
Write-Host "Building for a pull request (#$PullRequestNumber), skipping packaging." -ForegroundColor Yellow Write-Host "Building for a pull request (#$PullRequestNumber), skipping packaging." -ForegroundColor Yellow
$CreatePackages = $false $CreatePackages = $false
} }
Write-Host "Restoring all projects..." -ForegroundColor "Magenta" Write-Host "Building all projects (Build.csproj traversal)..." -ForegroundColor "Magenta"
dotnet restore dotnet build ".\Build.csproj" -c Release /p:CI=true
Write-Host "Done restoring." -ForegroundColor "Green"
Write-Host "Building all projects..." -ForegroundColor "Magenta"
dotnet build -c Release --no-restore /p:CI=true
Write-Host "Done building." -ForegroundColor "Green" Write-Host "Done building." -ForegroundColor "Green"
if ($RunTests) { if ($RunTests) {
foreach ($project in $testsToRun) { Write-Host "Running tests: Build.csproj traversal (all frameworks)" -ForegroundColor "Magenta"
Write-Host "Running tests: $project (all frameworks)" -ForegroundColor "Magenta" dotnet test ".\Build.csproj" -c Release --no-build
Push-Location ".\$project" if ($LastExitCode -ne 0) {
Write-Host "Error with tests, aborting build." -Foreground "Red"
dotnet test -c Release Exit 1
if ($LastExitCode -ne 0) {
Write-Host "Error with tests, aborting build." -Foreground "Red"
Pop-Location
Exit 1
}
Write-Host "Tests passed!" -ForegroundColor "Green"
Pop-Location
} }
Write-Host "Tests passed!" -ForegroundColor "Green"
} }
if ($CreatePackages) { if ($CreatePackages) {
mkdir -Force $packageOutputFolder | Out-Null New-Item -ItemType Directory -Path $packageOutputFolder -Force | Out-Null
Write-Host "Clearing existing $packageOutputFolder..." -NoNewline Write-Host "Clearing existing $packageOutputFolder..." -NoNewline
Get-ChildItem $packageOutputFolder | Remove-Item Get-ChildItem $packageOutputFolder | Remove-Item
Write-Host "done." -ForegroundColor "Green" Write-Host "done." -ForegroundColor "Green"
Write-Host "Building all packages" -ForegroundColor "Green" Write-Host "Building all packages" -ForegroundColor "Green"
dotnet pack ".\Build.csproj" --no-build -c Release /p:PackageOutputPath=$packageOutputFolder /p:CI=true
foreach ($project in $projectsToBuild) {
Write-Host "Packing $project (dotnet pack)..." -ForegroundColor "Magenta"
dotnet pack ".\$project\$project.csproj" --no-build -c Release /p:PackageOutputPath=$packageOutputFolder /p:NoPackageAnalysis=true /p:CI=true
Write-Host ""
}
} }
Write-Host "Build Complete." -ForegroundColor "Green" Write-Host "Build Complete." -ForegroundColor "Green"
#!/bin/bash
echo ""
echo "Installing dotnet cli..."
echo ""
export DOTNET_INSTALL_DIR="./.dotnet/"
tools/install.sh
origPath=$PATH
export PATH="./dotnet/bin/:$PATH"
if [ $? -ne 0 ]; then
echo >&2 ".NET Execution Environment installation has failed."
exit 1
fi
export DOTNET_HOME="$DOTNET_INSTALL_DIR/cli"
export PATH="$DOTNET_HOME/bin:$PATH"
export autoGeneratedVersion=false
# Generate version number if not set
if [[ -z "$BuildSemanticVersion" ]]; then
autoVersion="$((($(date +%s) - 1451606400)/60))-$(date +%S)"
export BuildSemanticVersion="rc2-$autoVersion"
autoGeneratedVersion=true
echo "Set version to $BuildSemanticVersion"
fi
sed -i '' "s/99.99.99-rc2/1.0.0-$BuildSemanticVersion/g" */*/project.json
# Restore packages and build product
dotnet restore -v Minimal # Restore all packages
# Build all
# Note the exclude: https://github.com/dotnet/cli/issues/1342
for d in Dapper*/; do
if [ "$d" != "*.EntityFramework.StrongName" ]; then
echo "Building $d"
pushd "$d"
dotnet build -f netstandard1.3
popd
fi
done
# Run tests
for d in *.Tests*/; do
echo "Testing $d"
pushd "$d"
dotnet test -f netcoreapp1.0
popd
done
sed -i '' "s/1.0.0-$BuildSemanticVersion/99.99.99-rc2/g" */*/project.json
if [ $autoGeneratedVersion ]; then
unset BuildSemanticVersion
fi
export PATH=$origPath
\ No newline at end of file
It's <insert new hire>'s fault!
\ No newline at end of file
{ {
"sdk": { "sdk": {
"version": "3.0.100", "version": "3.1.100",
"rollForward": "latestMajor", "rollForward": "latestMajor",
"allowPrerelease": false "allowPrerelease": false
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment