From 0ddc509cfbebdcfabdbb981bcc49a7c75a4e4f02 Mon Sep 17 00:00:00 2001 From: Renato Golia Date: Wed, 13 Feb 2019 13:10:47 +0100 Subject: [PATCH] Remove templates (#68) --- build.cake | 21 +--- templates/Nybus.Templates.nuspec | 21 ---- templates/Templates.sln | 30 ----- .../.template.config/template.json | 24 ---- templates/content/NetCoreRabbitMq/Dockerfile | 10 -- .../Handlers/TestCommandHandler.cs | 13 -- .../Handlers/TestEventHandler.cs | 13 -- .../NetCoreRabbitMq/NetCoreRabbitMq.csproj | 24 ---- templates/content/NetCoreRabbitMq/Program.cs | 115 ------------------ .../appsettings.Development.json | 18 --- .../appsettings.Production.json | 18 --- .../content/NetCoreRabbitMq/appsettings.json | 16 --- .../content/NetCoreRabbitMq/hostsettings.json | 3 - 13 files changed, 1 insertion(+), 325 deletions(-) delete mode 100644 templates/Nybus.Templates.nuspec delete mode 100644 templates/Templates.sln delete mode 100644 templates/content/NetCoreRabbitMq/.template.config/template.json delete mode 100644 templates/content/NetCoreRabbitMq/Dockerfile delete mode 100644 templates/content/NetCoreRabbitMq/Handlers/TestCommandHandler.cs delete mode 100644 templates/content/NetCoreRabbitMq/Handlers/TestEventHandler.cs delete mode 100644 templates/content/NetCoreRabbitMq/NetCoreRabbitMq.csproj delete mode 100644 templates/content/NetCoreRabbitMq/Program.cs delete mode 100644 templates/content/NetCoreRabbitMq/appsettings.Development.json delete mode 100644 templates/content/NetCoreRabbitMq/appsettings.Production.json delete mode 100644 templates/content/NetCoreRabbitMq/appsettings.json delete mode 100644 templates/content/NetCoreRabbitMq/hostsettings.json diff --git a/build.cake b/build.cake index a7a8285..e45a2c1 100644 --- a/build.cake +++ b/build.cake @@ -1,9 +1,7 @@ #tool "nuget:?package=ReportGenerator&version=4.0.5" #tool "nuget:?package=JetBrains.dotCover.CommandLineTools&version=2018.3.1" #tool "nuget:?package=GitVersion.CommandLine&version=4.0.0" -#tool "nuget:?package=NuGet.CommandLine&version=4.9.2" -#addin "Cake.FileHelpers" #load "./build/types.cake" @@ -191,28 +189,11 @@ Task("PackLibraries") DotNetCorePack(state.Paths.SolutionFile.ToString(), settings); }); -Task("PackTemplates") - .IsDependentOn("Version") - .Does(state => -{ - ReplaceRegexInFiles("./templates/content/**/*.csproj", @"", $@""); - - var settings = new NuGetPackSettings - { - Version = state.Version.PackageVersion, - OutputDirectory = state.Paths.OutputFolder - }; - - NuGetPack("./templates/Nybus.Templates.nuspec", settings); -}); - Task("Pack") - .IsDependentOn("PackLibraries") - .IsDependentOn("PackTemplates"); + .IsDependentOn("PackLibraries"); Task("UploadPackagesToAppVeyor") .IsDependentOn("Pack") - .IsDependentOn("PackTemplates") .WithCriteria(BuildSystem.IsRunningOnAppVeyor) .Does(state => { diff --git a/templates/Nybus.Templates.nuspec b/templates/Nybus.Templates.nuspec deleted file mode 100644 index e7055f2..0000000 --- a/templates/Nybus.Templates.nuspec +++ /dev/null @@ -1,21 +0,0 @@ - - - - Nybus.Templates - 1.0.0 - Renato Golia - Renato Golia - false - MIT - https://github.com/Nybus-project/Nybus - https://raw.githubusercontent.com/Nybus-project/Nybus/master/assets/nybus128x128.png - Nybus is an application framework that allows you to build message-based applications. This package contains templates that can be used to quickly create new applicaitons. - dotnet-standard dotnet-new template framework queue rx nybus - - - - - - - - \ No newline at end of file diff --git a/templates/Templates.sln b/templates/Templates.sln deleted file mode 100644 index cd7d819..0000000 --- a/templates/Templates.sln +++ /dev/null @@ -1,30 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26124.0 -MinimumVisualStudioVersion = 15.0.26124.0 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "content", "content", "{8F4CCB4E-CDEC-42F2-AB6D-831DBEE6CC70}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCoreRabbitMq", "content\NetCoreRabbitMq\NetCoreRabbitMq.csproj", "{34CABEDD-4ADE-4BC7-901A-B0B9EFF31F23}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {34CABEDD-4ADE-4BC7-901A-B0B9EFF31F23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {34CABEDD-4ADE-4BC7-901A-B0B9EFF31F23}.Debug|Any CPU.Build.0 = Debug|Any CPU - {34CABEDD-4ADE-4BC7-901A-B0B9EFF31F23}.Release|Any CPU.ActiveCfg = Release|Any CPU - {34CABEDD-4ADE-4BC7-901A-B0B9EFF31F23}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {34CABEDD-4ADE-4BC7-901A-B0B9EFF31F23} = {8F4CCB4E-CDEC-42F2-AB6D-831DBEE6CC70} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {91791A68-3320-45E8-B54C-C636DACBECF9} - EndGlobalSection -EndGlobal diff --git a/templates/content/NetCoreRabbitMq/.template.config/template.json b/templates/content/NetCoreRabbitMq/.template.config/template.json deleted file mode 100644 index 64b9ac3..0000000 --- a/templates/content/NetCoreRabbitMq/.template.config/template.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/template", - "author": "Renato Golia", - "classifications": [ - "Nybus", - "Console", - "RabbitMQ" - ], - "name": "Nybus Console App with RabbitMQ", - "identity": "Nybus.Templates.NetCoreApp.RabbitMQ.CSharp", - "groupIdentity": "Nybus.Templates.NetCoreApp.RabbitMQ", - "shortName": "nybus-rabbitmq-console", - "tags":{ - "language": "C#", - "type": "project" - }, - "sourceName": "NetCoreRabbitMq", - "preferNameDirectory": true, - "primaryOutputs": [ - { - "path": "./NetCoreRabbitMq.csproj" - } - ] -} \ No newline at end of file diff --git a/templates/content/NetCoreRabbitMq/Dockerfile b/templates/content/NetCoreRabbitMq/Dockerfile deleted file mode 100644 index 28282c6..0000000 --- a/templates/content/NetCoreRabbitMq/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM microsoft/dotnet:2.2-sdk AS build -WORKDIR /app -COPY * ./ -RUN dotnet publish -c Release -o out - -FROM microsoft/dotnet:2.2-runtime AS runtime -WORKDIR /app -COPY --from=build /app/out ./ -ENV NYBUS_ENVIRONMENT=Production -ENTRYPOINT [ "dotnet", "NetCoreRabbitMq.dll" ] \ No newline at end of file diff --git a/templates/content/NetCoreRabbitMq/Handlers/TestCommandHandler.cs b/templates/content/NetCoreRabbitMq/Handlers/TestCommandHandler.cs deleted file mode 100644 index ec3d9dc..0000000 --- a/templates/content/NetCoreRabbitMq/Handlers/TestCommandHandler.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Threading.Tasks; -using Nybus; - -namespace NetCoreRabbitMq.Handlers -{ - public class TestCommandHandler : ICommandHandler - { - public Task HandleAsync(IDispatcher dispatcher, ICommandContext incomingCommand) - { - return Task.CompletedTask; - } - } -} \ No newline at end of file diff --git a/templates/content/NetCoreRabbitMq/Handlers/TestEventHandler.cs b/templates/content/NetCoreRabbitMq/Handlers/TestEventHandler.cs deleted file mode 100644 index 747a376..0000000 --- a/templates/content/NetCoreRabbitMq/Handlers/TestEventHandler.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Threading.Tasks; -using Nybus; - -namespace NetCoreRabbitMq.Handlers -{ - public class TestEventHandler : IEventHandler - { - public Task HandleAsync(IDispatcher dispatcher, IEventContext incomingEvent) - { - return Task.CompletedTask; - } - } -} \ No newline at end of file diff --git a/templates/content/NetCoreRabbitMq/NetCoreRabbitMq.csproj b/templates/content/NetCoreRabbitMq/NetCoreRabbitMq.csproj deleted file mode 100644 index a90de93..0000000 --- a/templates/content/NetCoreRabbitMq/NetCoreRabbitMq.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - Exe - netcoreapp2.2 - latest - - - - - - - - - - - - - - - - - - diff --git a/templates/content/NetCoreRabbitMq/Program.cs b/templates/content/NetCoreRabbitMq/Program.cs deleted file mode 100644 index e410081..0000000 --- a/templates/content/NetCoreRabbitMq/Program.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using NetCoreRabbitMq.Handlers; -using Nybus; -using Nybus.Configuration; - -namespace NetCoreRabbitMq -{ - class Program - { - static async Task Main(string[] args) - { - var builder = new HostBuilder(); - - builder.ConfigureHostConfiguration(configuration => - { - configuration.SetBasePath(Directory.GetCurrentDirectory()); - - configuration.AddJsonFile("hostsettings.json", true); - configuration.AddEnvironmentVariables(prefix: "NYBUS_"); - configuration.AddCommandLine(args); - }); - - builder.ConfigureAppConfiguration((context, configuration) => - { - configuration.AddJsonFile("appsettings.json", true); - configuration.AddJsonFile($"appsettings.{context.HostingEnvironment.EnvironmentName}.json", true); - configuration.AddEnvironmentVariables(prefix: "NYBUS_"); - configuration.AddCommandLine(args); - }); - - builder.ConfigureServices((context, services) => - { - services.AddHostedService(); - - services.AddNybus(nybus => - { - nybus.UseConfiguration(context.Configuration); - - nybus.UseRabbitMqBusEngine(rabbitMq => - { - rabbitMq.UseConfiguration(); - - rabbitMq.Configure(configuration => configuration.CommandQueueFactory = new StaticQueueFactory("NetCoreRabbitMq")); - }); - - /* EVENTS */ - - /* This will subscribe the event TestEvent to any IEventHandler available */ - nybus.SubscribeToEvent(); - - /* This will subscribe the event TestEvent to an instance of TestEventHandler */ - // nybus.SubscribeToEvent(); - - /* This will subscribe the event TestEvent to the asynchronous delegate */ - // nybus.SubscribeToEvent(async (dispatcher, eventContext) => { await DoSomethingAsync(); }); - - /* This will subscribe the event TestEvent to the synchronous delegate */ - // nybus.SubscribeToEvent((dispatcher, eventContext) => { DoSomething(); }); - - - /* COMMANDS */ - - /* This will subscribe the command TestCommand to any ICommandHandler available */ - nybus.SubscribeToCommand(); - - /* This will subscribe the command TestCommand to an instance of TestCommandHandler */ - // nybus.SubscribeToCommand(); - - /* This will subscribe the command TestCommand to the asynchronous delegate */ - // nybus.SubscribeToCommand(async (dispatcher, commandContext) => { await DoSomethingAsync(); }); - - /* This will subscribe the command TestCommand to the synchronous delegate */ - // nybus.SubscribeToCommand((dispatcher, commandContext) => { DoSomething(); }); - }); - - /* EVENTS */ - - /* This will register the event handler TestEventHandler as a handler for TestEvent */ - // services.AddEventHandler(); - - /* This will register the event handler TestEventHandler as a handler for all supported events */ - services.AddEventHandler(); - - - /* COMMANDS */ - - /* This will register the command handler TestCommandHandler as a handler for TestCommand */ - // services.AddCommandHandler(); - - /* This will register the command handler TestCommandHandler as a handler for all supported Commands */ - services.AddCommandHandler(); - }); - - builder.ConfigureLogging((context, logging) => - { - logging.AddConsole(); - }); - - var host = builder.Build(); - - await host.RunAsync(); - } - } - - public class TestEvent : IEvent { } - - public class TestCommand : ICommand { } -} diff --git a/templates/content/NetCoreRabbitMq/appsettings.Development.json b/templates/content/NetCoreRabbitMq/appsettings.Development.json deleted file mode 100644 index 84a75c0..0000000 --- a/templates/content/NetCoreRabbitMq/appsettings.Development.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" - } - }, - "Nybus": { - "RabbitMq": { - "Connection": { - "Hostname": "localhost", - "Username": "guest", - "Password": "guest" - } - } - } -} \ No newline at end of file diff --git a/templates/content/NetCoreRabbitMq/appsettings.Production.json b/templates/content/NetCoreRabbitMq/appsettings.Production.json deleted file mode 100644 index 2587862..0000000 --- a/templates/content/NetCoreRabbitMq/appsettings.Production.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Error", - "System": "Information", - "Microsoft": "Information" - } - }, - "Nybus": { - "RabbitMq": { - // "Connection": { - // "Hostname": "localhost", - // "Username": "guest", - // "Password": "guest" - // } - } - } -} \ No newline at end of file diff --git a/templates/content/NetCoreRabbitMq/appsettings.json b/templates/content/NetCoreRabbitMq/appsettings.json deleted file mode 100644 index b0a522b..0000000 --- a/templates/content/NetCoreRabbitMq/appsettings.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Warning" - } - }, - "Nybus": { - "RabbitMq": { - "Connection": { - "Hostname": "host.docker.internal", - "Username": "guest", - "Password": "guest" - } - } - } -} diff --git a/templates/content/NetCoreRabbitMq/hostsettings.json b/templates/content/NetCoreRabbitMq/hostsettings.json deleted file mode 100644 index 79f14d3..0000000 --- a/templates/content/NetCoreRabbitMq/hostsettings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "environment": "Development" -} \ No newline at end of file