diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..d5860940 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +# ------------------------------------------------------------------------------ +# +# +# This code was generated. +# +# - To turn off auto-generation set: +# +# [GitHubActions (AutoGenerate = false)] +# +# - To trigger manual generation invoke: +# +# nuke --generate-configuration GitHubActions_ci --host GitHubActions +# +# +# ------------------------------------------------------------------------------ + +name: ci + +on: + push: + paths: + - 'Src/**' + - 'Build/**' + pull_request: + branches: + - main + +jobs: + ubuntu-latest: + name: ubuntu-latest + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: 'Cache: .nuke/temp, ~/.nuget/packages' + uses: actions/cache@v3 + with: + path: | + .nuke/temp + ~/.nuget/packages + key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }} + - name: 'Run: Compile, Pack, Push' + run: ./build.cmd Compile Pack Push + env: + NUGETAPIKEY: ${{ secrets.NUGETAPIKEY }} diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json new file mode 100644 index 00000000..32821b42 --- /dev/null +++ b/.nuke/build.schema.json @@ -0,0 +1,128 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/build", + "title": "Build Schema", + "definitions": { + "build": { + "type": "object", + "properties": { + "CI": { + "type": "boolean" + }, + "Configuration": { + "type": "string", + "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)", + "enum": [ + "Debug", + "Release" + ] + }, + "Continue": { + "type": "boolean", + "description": "Indicates to continue a previously failed build attempt" + }, + "Help": { + "type": "boolean", + "description": "Shows the help text for this build assembly" + }, + "Host": { + "type": "string", + "description": "Host for execution. Default is 'automatic'", + "enum": [ + "AppVeyor", + "AzurePipelines", + "Bamboo", + "Bitbucket", + "Bitrise", + "GitHubActions", + "GitLab", + "Jenkins", + "Rider", + "SpaceAutomation", + "TeamCity", + "Terminal", + "TravisCI", + "VisualStudio", + "VSCode" + ] + }, + "NoLogo": { + "type": "boolean", + "description": "Disables displaying the NUKE logo" + }, + "NUGETAPIKEY": { + "type": "string", + "default": "Secrets must be entered via 'nuke :secrets [profile]'" + }, + "NuGetApiUrl": { + "type": "string" + }, + "Partition": { + "type": "string", + "description": "Partition to use on CI" + }, + "Plan": { + "type": "boolean", + "description": "Shows the execution plan (HTML)" + }, + "Profile": { + "type": "array", + "description": "Defines the profiles to load", + "items": { + "type": "string" + } + }, + "Root": { + "type": "string", + "description": "Root directory during build execution" + }, + "Skip": { + "type": "array", + "description": "List of targets to be skipped. Empty list skips all dependencies", + "items": { + "type": "string", + "enum": [ + "Clean", + "Compile", + "Pack", + "Print", + "Print_Net_SDK", + "Push", + "Restore" + ] + } + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded" + }, + "Target": { + "type": "array", + "description": "List of targets to be invoked. Default is '{default_target}'", + "items": { + "type": "string", + "enum": [ + "Clean", + "Compile", + "Pack", + "Print", + "Print_Net_SDK", + "Push", + "Restore" + ] + } + }, + "Verbosity": { + "type": "string", + "description": "Logging verbosity during build execution. Default is 'Normal'", + "enum": [ + "Minimal", + "Normal", + "Quiet", + "Verbose" + ] + } + } + } + } +} diff --git a/.nuke/parameters.json b/.nuke/parameters.json new file mode 100644 index 00000000..970ccaee --- /dev/null +++ b/.nuke/parameters.json @@ -0,0 +1,5 @@ +{ + "$schema": "./build.schema.json", + "Solution": "Src/RCommon.sln", + "Configuration": "Release" +} diff --git a/Build/.editorconfig b/Build/.editorconfig new file mode 100644 index 00000000..31e43dcd --- /dev/null +++ b/Build/.editorconfig @@ -0,0 +1,11 @@ +[*.cs] +dotnet_style_qualification_for_field = false:warning +dotnet_style_qualification_for_property = false:warning +dotnet_style_qualification_for_method = false:warning +dotnet_style_qualification_for_event = false:warning +dotnet_style_require_accessibility_modifiers = never:warning + +csharp_style_expression_bodied_methods = true:silent +csharp_style_expression_bodied_properties = true:warning +csharp_style_expression_bodied_indexers = true:warning +csharp_style_expression_bodied_accessors = true:warning diff --git a/Build/Build.cs b/Build/Build.cs index 86cd5d21..389a67c0 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -3,7 +3,6 @@ using System.Linq; using GlobExpressions; using Microsoft.Build.Evaluation; -using NuGet.Versioning; using Nuke.Common; using Nuke.Common.CI; using Nuke.Common.CI.GitHubActions; @@ -52,11 +51,6 @@ class Build : NukeBuild [GitVersion] readonly GitVersion GitVersion; - [LatestNuGetVersion( - packageId: "RCommon.Core", - IncludePrerelease = true)] - readonly NuGetVersion NugetVersion; - [GitRepository] readonly GitRepository GitRepository; GitHubActions GitHubActions => GitHubActions.Instance; diff --git a/Build/Build.csproj b/Build/Build.csproj new file mode 100644 index 00000000..1bd56474 --- /dev/null +++ b/Build/Build.csproj @@ -0,0 +1,49 @@ + + + + Exe + net8.0 + + CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006 + .. + .. + 1 + false + 16854301-8bc7-4d72-a537-a9491bfca591 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Build/Build.csproj.DotSettings b/Build/Build.csproj.DotSettings new file mode 100644 index 00000000..a778f33d --- /dev/null +++ b/Build/Build.csproj.DotSettings @@ -0,0 +1,27 @@ + + DO_NOT_SHOW + DO_NOT_SHOW + DO_NOT_SHOW + DO_NOT_SHOW + DO_NOT_SHOW + Implicit + Implicit + ExpressionBody + 0 + NEXT_LINE + True + False + 120 + IF_OWNER_IS_SINGLE_LINE + WRAP_IF_LONG + False + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + True + True + True + True + True + True + True + True diff --git a/Build/Configuration.cs b/Build/Configuration.cs new file mode 100644 index 00000000..9c08b1ae --- /dev/null +++ b/Build/Configuration.cs @@ -0,0 +1,16 @@ +using System; +using System.ComponentModel; +using System.Linq; +using Nuke.Common.Tooling; + +[TypeConverter(typeof(TypeConverter))] +public class Configuration : Enumeration +{ + public static Configuration Debug = new Configuration { Value = nameof(Debug) }; + public static Configuration Release = new Configuration { Value = nameof(Release) }; + + public static implicit operator string(Configuration configuration) + { + return configuration.Value; + } +} diff --git a/Build/Directory.Build.props b/Build/Directory.Build.props new file mode 100644 index 00000000..e147d635 --- /dev/null +++ b/Build/Directory.Build.props @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Build/Directory.Build.targets b/Build/Directory.Build.targets new file mode 100644 index 00000000..25326095 --- /dev/null +++ b/Build/Directory.Build.targets @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Src/RCommon.ApplicationServices/RCommon.ApplicationServices.csproj b/Src/RCommon.ApplicationServices/RCommon.ApplicationServices.csproj index 017b1211..958c3c3c 100644 --- a/Src/RCommon.ApplicationServices/RCommon.ApplicationServices.csproj +++ b/Src/RCommon.ApplicationServices/RCommon.ApplicationServices.csproj @@ -2,18 +2,6 @@ net6.0;net7.0;net8.0; - true - rcommon-icon.png - - https://github.com/Reactor2Team/RCommon - https://github.com/Reactor2Team/RCommon - A cohesive set of infrastructure libraries for .NET 6, .NET 7, and .NET 8 that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more. - Jason Webb - RCommon - 2.0.0.8 - GitHub - RCommon, application services, CQRS, auto web api, commands, command handlers, queries, query handlers, command bus, query bus, c#, .NET - Apache-2.0 @@ -21,13 +9,6 @@ - - - True - - - - diff --git a/Src/RCommon.Authorization.Web/RCommon.Authorization.Web.csproj b/Src/RCommon.Authorization.Web/RCommon.Authorization.Web.csproj index ad688630..6a19fbba 100644 --- a/Src/RCommon.Authorization.Web/RCommon.Authorization.Web.csproj +++ b/Src/RCommon.Authorization.Web/RCommon.Authorization.Web.csproj @@ -2,29 +2,8 @@ net6.0;net7.0;net8.0; - 2.0.0.8 - Jason Webb - RCommon - A cohesive set of infrastructure libraries for .NET 6, .NET 7, and .NET 8 that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more. - - https://github.com/Reactor2Team/RCommon - https://github.com/Reactor2Team/RCommon - rcommon-icon.png - RCommon, web authorization, web security, web identity, bearer tokens, c#, .NET - true - 2.0.0.0 - 2.0.0.0 - - Apache-2.0 - - - True - \ - - - diff --git a/Src/RCommon.Core/RCommon.Core.csproj b/Src/RCommon.Core/RCommon.Core.csproj index 2fbe4965..78ba8c7c 100644 --- a/Src/RCommon.Core/RCommon.Core.csproj +++ b/Src/RCommon.Core/RCommon.Core.csproj @@ -2,20 +2,6 @@ net6.0;net7.0;net8.0; - 2.0.0.8 - Jason Webb - RCommon - A cohesive set of infrastructure libraries for .NET 6, .NET 7, and .NET 8 that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more. - - https://github.com/Reactor2Team/RCommon - https://github.com/Reactor2Team/RCommon - rcommon-icon.png - RCommon, language extensions, generic factories, abstractions, c#, .NET - true - 2.0.0.0 - 2.0.0.0 - - Apache-2.0 $(MSBuildProjectName.Replace(" ", "_").Replace(".Core", "")) @@ -44,12 +30,5 @@ - - - - True - - - diff --git a/Src/RCommon.Core/rcommon-icon.png b/Src/RCommon.Core/rcommon-icon.png deleted file mode 100644 index a68805cc..00000000 Binary files a/Src/RCommon.Core/rcommon-icon.png and /dev/null differ diff --git a/Src/RCommon.Dapper/RCommon.Dapper.csproj b/Src/RCommon.Dapper/RCommon.Dapper.csproj index f3df0455..da80940f 100644 --- a/Src/RCommon.Dapper/RCommon.Dapper.csproj +++ b/Src/RCommon.Dapper/RCommon.Dapper.csproj @@ -2,20 +2,6 @@ net6.0;net7.0;net8.0; - 2.0.0.8 - Jason Webb - RCommon - A cohesive set of infrastructure libraries for .NET 6, .NET 7, and .NET 8 that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more. - - https://github.com/Reactor2Team/RCommon - https://github.com/Reactor2Team/RCommon - rcommon-icon.png - RCommon, dapper, dapper repository, repository pattern, crud, dapper extensions, c#, .NET - true - 2.0.0.0 - 2.0.0.0 - - Apache-2.0 @@ -45,13 +31,6 @@ - - - True - - - - diff --git a/Src/RCommon.EfCore/RCommon.EFCore.csproj b/Src/RCommon.EfCore/RCommon.EFCore.csproj index 022aa86b..0098010b 100644 --- a/Src/RCommon.EfCore/RCommon.EFCore.csproj +++ b/Src/RCommon.EfCore/RCommon.EFCore.csproj @@ -3,20 +3,6 @@ enable net6.0;net7.0;net8.0; - 2.0.0.8 - Jason Webb - RCommon - A cohesive set of infrastructure libraries for .NET 6, .NET 7, and .NET 8 that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more. - - https://github.com/Reactor2Team/RCommon - https://github.com/Reactor2Team/RCommon - rcommon-icon.png - RCommon, entity framework, efcore, repository, crud, repository pattern, c#, .NET - true - 2.0.0.0 - 2.0.0.0 - - Apache-2.0 @@ -45,13 +31,6 @@ - - - True - - - - diff --git a/Src/RCommon.Emailing/RCommon.Emailing.csproj b/Src/RCommon.Emailing/RCommon.Emailing.csproj index 59f50743..8445a5e3 100644 --- a/Src/RCommon.Emailing/RCommon.Emailing.csproj +++ b/Src/RCommon.Emailing/RCommon.Emailing.csproj @@ -3,32 +3,12 @@ net6.0;net7.0;net8.0; enable - Jason Webb - RCommon - A cohesive set of infrastructure libraries for .NET 6, .NET 7, and .NET 8 that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more. - - https://github.com/Reactor2Team/RCommon - rcommon-icon.png - https://github.com/Reactor2Team/RCommon - RCommon, emailing, email abstractions, smtp - true - GitHub - 2.0.0.8 - - Apache-2.0 - - - True - - - - diff --git a/Src/RCommon.Entities/RCommon.Entities.csproj b/Src/RCommon.Entities/RCommon.Entities.csproj index fb2833a2..cc78e268 100644 --- a/Src/RCommon.Entities/RCommon.Entities.csproj +++ b/Src/RCommon.Entities/RCommon.Entities.csproj @@ -2,34 +2,11 @@ net6.0;net7.0;net8.0; - 2.0.0.8 - Jason Webb - RCommon - A cohesive set of infrastructure libraries for .NET 6, .NET 7, and .NET 8 that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more. - - https://github.com/Reactor2Team/RCommon - https://github.com/Reactor2Team/RCommon - rcommon-icon.png - RCommon, business entities, domain objects, domain model, ddd, domain events, event aware entities, entity helpers, c#, .NET - true - 2.0.0.0 - 2.0.0.0 - - Apache-2.0 - - - - - True - - - - - + diff --git a/Src/RCommon.Linq2Db/RCommon.Linq2Db.csproj b/Src/RCommon.Linq2Db/RCommon.Linq2Db.csproj index 35445652..c1882fca 100644 --- a/Src/RCommon.Linq2Db/RCommon.Linq2Db.csproj +++ b/Src/RCommon.Linq2Db/RCommon.Linq2Db.csproj @@ -2,31 +2,10 @@ net6.0;net7.0;net8.0; - 2.0.0.8 - Jason Webb - RCommon - A cohesive set of infrastructure libraries for .NET 6, .NET 7, and .NET 8 that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more. - - https://github.com/Reactor2Team/RCommon - https://github.com/Reactor2Team/RCommon - rcommon-icon.png - RCommon, linq2db, linqtosql, linqtodb, repository pattern, linq2db repository, c#, .NET - true - 2.0.0.0 - 2.0.0.0 - - Apache-2.0 enable enable - - - - True - - - diff --git a/Src/RCommon.MassTransit/RCommon.MassTransit.csproj b/Src/RCommon.MassTransit/RCommon.MassTransit.csproj index dd4a9b2f..14779471 100644 --- a/Src/RCommon.MassTransit/RCommon.MassTransit.csproj +++ b/Src/RCommon.MassTransit/RCommon.MassTransit.csproj @@ -2,31 +2,10 @@ net6.0;net7.0;net8.0; - 2.0.0.8 - Jason Webb - RCommon - A cohesive set of infrastructure libraries for .NET 6, .NET 7, and .NET 8 that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more. - - https://github.com/Reactor2Team/RCommon - https://github.com/Reactor2Team/RCommon - rcommon-icon.png - RCommon, masstransit, message bus, event bus, messaging, c#, .NET - true - 2.0.0.0 - 2.0.0.0 - - Apache-2.0 enable enable - - - - True - - - diff --git a/Src/RCommon.Mediator/RCommon.Mediator.csproj b/Src/RCommon.Mediator/RCommon.Mediator.csproj index a94dd7e3..f23078aa 100644 --- a/Src/RCommon.Mediator/RCommon.Mediator.csproj +++ b/Src/RCommon.Mediator/RCommon.Mediator.csproj @@ -2,31 +2,10 @@ net6.0;net7.0;net8.0; - 2.0.0.8 - Jason Webb - RCommon - A cohesive set of infrastructure libraries for .NET 6, .NET 7, and .NET 8 that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more. - - https://github.com/Reactor2Team/RCommon - https://github.com/Reactor2Team/RCommon - rcommon-icon.png - RCommon, language extensions, generic factories, abstractions, c#, .NET - true - 2.0.0.0 - 2.0.0.0 - - Apache-2.0 enable enable - - - - True - - - diff --git a/Src/RCommon.Mediatr/RCommon.MediatR.csproj b/Src/RCommon.Mediatr/RCommon.MediatR.csproj index 1c4257a1..f19e6374 100644 --- a/Src/RCommon.Mediatr/RCommon.MediatR.csproj +++ b/Src/RCommon.Mediatr/RCommon.MediatR.csproj @@ -2,31 +2,10 @@ net6.0;net7.0;net8.0; - 2.0.0.8 - Jason Webb - RCommon - A cohesive set of infrastructure libraries for .NET 6, .NET 7, and .NET 8 that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more. - - https://github.com/Reactor2Team/RCommon - https://github.com/Reactor2Team/RCommon - rcommon-icon.png - RCommon, language extensions, generic factories, abstractions, c#, .NET - true - 2.0.0.0 - 2.0.0.0 - - Apache-2.0 enable enable - - - - True - - - diff --git a/Src/RCommon.Models/RCommon.Models.csproj b/Src/RCommon.Models/RCommon.Models.csproj index a1088881..3e146d47 100644 --- a/Src/RCommon.Models/RCommon.Models.csproj +++ b/Src/RCommon.Models/RCommon.Models.csproj @@ -2,31 +2,8 @@ net6.0;net7.0;net8.0; - 2.0.0.8 - Jason Webb - RCommon - A cohesive set of infrastructure libraries for .NET 6, .NET 7, and .NET 8 that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more. - - https://github.com/Reactor2Team/RCommon - https://github.com/Reactor2Team/RCommon - rcommon-icon.png - RCommon, model helpers, dto, dto conversion, c#, .NET - true - 2.0.0.0 - 2.0.0.0 - - Apache-2.0 - - - - - True - - - - - + diff --git a/Src/RCommon.Persistence/RCommon.Persistence.csproj b/Src/RCommon.Persistence/RCommon.Persistence.csproj index 8dfa4b78..1744ad5d 100644 --- a/Src/RCommon.Persistence/RCommon.Persistence.csproj +++ b/Src/RCommon.Persistence/RCommon.Persistence.csproj @@ -2,20 +2,6 @@ net6.0;net7.0;net8.0; - 2.0.0.8 - Jason Webb - RCommon - A cohesive set of infrastructure libraries for .NET 6, .NET 7, and .NET 8 that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more. - - https://github.com/Reactor2Team/RCommon - https://github.com/Reactor2Team/RCommon - rcommon-icon.png - RCommon, persistence abstractions, repository pattern, crud, c#, .NET - true - 2.0.0.0 - 2.0.0.0 - - Apache-2.0 @@ -23,13 +9,6 @@ - - - True - - - - diff --git a/Src/RCommon.Security/RCommon.Security.csproj b/Src/RCommon.Security/RCommon.Security.csproj index 9c1c7607..f77be10d 100644 --- a/Src/RCommon.Security/RCommon.Security.csproj +++ b/Src/RCommon.Security/RCommon.Security.csproj @@ -2,34 +2,11 @@ net6.0;net7.0;net8.0; - 2.0.0.8 - Jason Webb - RCommon - A cohesive set of infrastructure libraries for .NET 6, .NET 7, and .NET 8 that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more. - - https://github.com/Reactor2Team/RCommon - https://github.com/Reactor2Team/RCommon - rcommon-icon.png - RCommon, security extensions, claims, identity, authorization, c#, .NET - true - 2.0.0.0 - 2.0.0.0 - - Apache-2.0 - - - - - True - - - - - + diff --git a/Src/RCommon.SendGrid/RCommon.SendGrid.csproj b/Src/RCommon.SendGrid/RCommon.SendGrid.csproj index 2f9fef49..53b8315b 100644 --- a/Src/RCommon.SendGrid/RCommon.SendGrid.csproj +++ b/Src/RCommon.SendGrid/RCommon.SendGrid.csproj @@ -4,19 +4,6 @@ net6.0;net7.0;net8.0; enable enable - Jason Webb - RCommon - A cohesive set of infrastructure libraries for .NET 6, .NET 7, and .NET 8 that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more. - - https://github.com/Reactor2Team/RCommon - rcommon-icon.png - https://github.com/Reactor2Team/RCommon - RCommon, emailing, sendgrid - true - GitHub - 2.0.0.8 - - Apache-2.0 @@ -28,11 +15,4 @@ - - - True - - - - diff --git a/Src/RCommon.SendGrid/reactor2-icon-darkbg-small.jpg b/Src/RCommon.SendGrid/reactor2-icon-darkbg-small.jpg deleted file mode 100644 index 81f7fe07..00000000 Binary files a/Src/RCommon.SendGrid/reactor2-icon-darkbg-small.jpg and /dev/null differ diff --git a/Src/RCommon.Web/RCommon.Web.csproj b/Src/RCommon.Web/RCommon.Web.csproj index 7fe23404..74b42579 100644 --- a/Src/RCommon.Web/RCommon.Web.csproj +++ b/Src/RCommon.Web/RCommon.Web.csproj @@ -2,30 +2,7 @@ net6.0;net7.0;net8.0; - 2.0.0.8 - Jason Webb - RCommon - A cohesive set of infrastructure libraries for .NET 6, .NET 7, and .NET 8 that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more. - - https://github.com/Reactor2Team/RCommon - https://github.com/Reactor2Team/RCommon - rcommon-icon.png - RCommon, web extensions, c#, .NET - true - 2.0.0.0 - 2.0.0.0 - - Apache-2.0 - - - - - True - - - - - + diff --git a/Src/RCommon.Wolverine/RCommon.Wolverine.csproj b/Src/RCommon.Wolverine/RCommon.Wolverine.csproj index e01887aa..cb171cec 100644 --- a/Src/RCommon.Wolverine/RCommon.Wolverine.csproj +++ b/Src/RCommon.Wolverine/RCommon.Wolverine.csproj @@ -2,31 +2,10 @@ net6.0;net7.0;net8.0; - 2.0.0.8 - Jason Webb - RCommon - A cohesive set of infrastructure libraries for .NET 6, .NET 7, and .NET 8 that utilizes abstractions for persistence, unit of work/transactions, distributed events, distributed transactions, and more. - - https://github.com/Reactor2Team/RCommon - https://github.com/Reactor2Team/RCommon - rcommon-icon.png - RCommon, Wolverine wrapper, messaging, message bus, event bus, c#, .NET - true - 2.0.0.0 - 2.0.0.0 - - Apache-2.0 enable enable - - - - True - - - diff --git a/Src/RCommon.sln b/Src/RCommon.sln index 7352d80f..aca6eeff 100644 --- a/Src/RCommon.sln +++ b/Src/RCommon.sln @@ -71,6 +71,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RCommon.Wolverine", "RCommo EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Event Handling", "Event Handling", "{6D73446A-6E32-4324-B524-E054334B394B}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "..\Build\Build.csproj", "{A83FB80E-2B41-403E-9529-FF0FA8E74045}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Build", "_Build", "{206A03B9-635F-4811-8519-8B02170B8CB3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -177,6 +181,8 @@ Global {397769BB-08F3-44DE-9BE6-90A73E0ABB76}.Debug|Any CPU.Build.0 = Debug|Any CPU {397769BB-08F3-44DE-9BE6-90A73E0ABB76}.Release|Any CPU.ActiveCfg = Release|Any CPU {397769BB-08F3-44DE-9BE6-90A73E0ABB76}.Release|Any CPU.Build.0 = Release|Any CPU + {A83FB80E-2B41-403E-9529-FF0FA8E74045}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A83FB80E-2B41-403E-9529-FF0FA8E74045}.Release|Any CPU.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -204,6 +210,7 @@ Global {CEDE1A60-3F6C-4F16-AC75-4477A646AD0D} = {EF78B8EE-80FF-45DE-9B82-352953B361A8} {FC484848-D719-4AAD-91B0-EDDC434F946E} = {EF78B8EE-80FF-45DE-9B82-352953B361A8} {397769BB-08F3-44DE-9BE6-90A73E0ABB76} = {6D73446A-6E32-4324-B524-E054334B394B} + {A83FB80E-2B41-403E-9529-FF0FA8E74045} = {206A03B9-635F-4811-8519-8B02170B8CB3} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {0B0CD26D-8067-4667-863E-6B0EE7EDAA42} diff --git a/build.cmd b/build.cmd new file mode 100755 index 00000000..b08cc590 --- /dev/null +++ b/build.cmd @@ -0,0 +1,7 @@ +:; set -eo pipefail +:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) +:; ${SCRIPT_DIR}/build.sh "$@" +:; exit $? + +@ECHO OFF +powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %* diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 00000000..c1d1bb70 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,74 @@ +[CmdletBinding()] +Param( + [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] + [string[]]$BuildArguments +) + +Write-Output "PowerShell $($PSVersionTable.PSEdition) version $($PSVersionTable.PSVersion)" + +Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { Write-Error $_ -ErrorAction Continue; exit 1 } +$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent + +########################################################################### +# CONFIGURATION +########################################################################### + +$BuildProjectFile = "$PSScriptRoot\Build\Build.csproj" +$TempDirectory = "$PSScriptRoot\\.nuke\temp" + +$DotNetGlobalFile = "$PSScriptRoot\\global.json" +$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1" +$DotNetChannel = "STS" + +$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1 +$env:DOTNET_NOLOGO = 1 + +########################################################################### +# EXECUTION +########################################################################### + +function ExecSafe([scriptblock] $cmd) { + & $cmd + if ($LASTEXITCODE) { exit $LASTEXITCODE } +} + +# If dotnet CLI is installed globally and it matches requested version, use for execution +if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and ` + $(dotnet --version) -and $LASTEXITCODE -eq 0) { + $env:DOTNET_EXE = (Get-Command "dotnet").Path +} +else { + # Download install script + $DotNetInstallFile = "$TempDirectory\dotnet-install.ps1" + New-Item -ItemType Directory -Path $TempDirectory -Force | Out-Null + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + (New-Object System.Net.WebClient).DownloadFile($DotNetInstallUrl, $DotNetInstallFile) + + # If global.json exists, load expected version + if (Test-Path $DotNetGlobalFile) { + $DotNetGlobal = $(Get-Content $DotNetGlobalFile | Out-String | ConvertFrom-Json) + if ($DotNetGlobal.PSObject.Properties["sdk"] -and $DotNetGlobal.sdk.PSObject.Properties["version"]) { + $DotNetVersion = $DotNetGlobal.sdk.version + } + } + + # Install by channel or version + $DotNetDirectory = "$TempDirectory\dotnet-win" + if (!(Test-Path variable:DotNetVersion)) { + ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath } + } else { + ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath } + } + $env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe" + $env:PATH = "$DotNetDirectory;$env:PATH" +} + +Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)" + +if (Test-Path env:NUKE_ENTERPRISE_TOKEN) { + & $env:DOTNET_EXE nuget remove source "nuke-enterprise" > $null + & $env:DOTNET_EXE nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password $env:NUKE_ENTERPRISE_TOKEN > $null +} + +ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet } +ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments } diff --git a/build.sh b/build.sh new file mode 100755 index 00000000..259142b1 --- /dev/null +++ b/build.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash + +bash --version 2>&1 | head -n 1 + +set -eo pipefail +SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) + +########################################################################### +# CONFIGURATION +########################################################################### + +BUILD_PROJECT_FILE="$SCRIPT_DIR/Build/Build.csproj" +TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp" + +DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json" +DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh" +DOTNET_CHANNEL="STS" + +export DOTNET_CLI_TELEMETRY_OPTOUT=1 +export DOTNET_NOLOGO=1 + +########################################################################### +# EXECUTION +########################################################################### + +function FirstJsonValue { + perl -nle 'print $1 if m{"'"$1"'": "([^"]+)",?}' <<< "${@:2}" +} + +# If dotnet CLI is installed globally and it matches requested version, use for execution +if [ -x "$(command -v dotnet)" ] && dotnet --version &>/dev/null; then + export DOTNET_EXE="$(command -v dotnet)" +else + # Download install script + DOTNET_INSTALL_FILE="$TEMP_DIRECTORY/dotnet-install.sh" + mkdir -p "$TEMP_DIRECTORY" + curl -Lsfo "$DOTNET_INSTALL_FILE" "$DOTNET_INSTALL_URL" + chmod +x "$DOTNET_INSTALL_FILE" + + # If global.json exists, load expected version + if [[ -f "$DOTNET_GLOBAL_FILE" ]]; then + DOTNET_VERSION=$(FirstJsonValue "version" "$(cat "$DOTNET_GLOBAL_FILE")") + if [[ "$DOTNET_VERSION" == "" ]]; then + unset DOTNET_VERSION + fi + fi + + # Install by channel or version + DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix" + if [[ -z ${DOTNET_VERSION+x} ]]; then + "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --channel "$DOTNET_CHANNEL" --no-path + else + "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path + fi + export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet" + export PATH="$DOTNET_DIRECTORY:$PATH" +fi + +echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)" + +if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "$NUKE_ENTERPRISE_TOKEN" != "" ]]; then + "$DOTNET_EXE" nuget remove source "nuke-enterprise" &>/dev/null || true + "$DOTNET_EXE" nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password "$NUKE_ENTERPRISE_TOKEN" --store-password-in-clear-text &>/dev/null || true +fi + +"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet +"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@"