-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f907665
commit efba30a
Showing
11 changed files
with
274 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\GoCommando\GoCommando.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using GoCommando; | ||
|
||
namespace Beverage.Commands | ||
{ | ||
[Command("black-russian", group: "duderino")] | ||
[Description("Mixes a White Russian, pouring in milk till full")] | ||
public class BlackRussian : ICommand | ||
{ | ||
[Parameter("vodka")] | ||
[Description("How many cl of vodka?")] | ||
public double Vodka { get; set; } | ||
|
||
[Parameter("kahlua")] | ||
[Description("How many cl of Kahlua?")] | ||
public double Kahlua { get; set; } | ||
|
||
[Parameter("lukewarm", optional: true)] | ||
[Description("Avoid refrigerated ingredients?")] | ||
public bool LukeWarm { get; set; } | ||
|
||
public void Run() | ||
{ | ||
Console.WriteLine($"Making a {(LukeWarm ? "luke-warm" : "")} beverage" + | ||
$" with {Vodka:0.#} cl of vodka" + | ||
$" and {Kahlua:0.#} cl of Kahlua"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using GoCommando; | ||
|
||
namespace Beverage.Commands | ||
{ | ||
[Command("martini", group: "simple")] | ||
[Description("It's just Martini.")] | ||
public class Martini : ICommand | ||
{ | ||
public void Run() | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using GoCommando; | ||
|
||
namespace Beverage.Commands | ||
{ | ||
[Command("white-russian", group: "duderino")] | ||
[Description("Mixes a White Russian, pouring in milk till full")] | ||
public class WhiteRussian : ICommand | ||
{ | ||
[Parameter("vodka")] | ||
[Description("How many cl of vodka?")] | ||
public double Vodka { get; set; } | ||
|
||
[Parameter("kahlua")] | ||
[Description("How many cl of Kahlua?")] | ||
public double Kahlua { get; set; } | ||
|
||
[Parameter("lukewarm", optional: true)] | ||
[Description("Avoid refrigerated ingredients?")] | ||
public bool LukeWarm { get; set; } | ||
|
||
public void Run() | ||
{ | ||
Console.WriteLine($"Making a {(LukeWarm ? "luke-warm" : "")} beverage" + | ||
$" with {Vodka:0.#} cl of vodka" + | ||
$" and {Kahlua:0.#} cl of Kahlua"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using GoCommando; | ||
|
||
namespace Beverage | ||
{ | ||
[Banner(@"------------------------------ | ||
Beverage Utility | ||
Copyright (c) 2015 El Duderino | ||
------------------------------")] | ||
[SupportImpersonation] | ||
class Program | ||
{ | ||
static void Main() | ||
{ | ||
Go.Run(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Changelog | ||
|
||
## 0.0.1 | ||
* Test release | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
@echo off | ||
|
||
set scriptsdir=%~dp0 | ||
set root=%scriptsdir%\.. | ||
set project=%1 | ||
set version=%2 | ||
|
||
if "%project%"=="" ( | ||
echo Please invoke the build script with a project name as its first argument. | ||
echo. | ||
goto exit_fail | ||
) | ||
|
||
if "%version%"=="" ( | ||
echo Please invoke the build script with a version as its second argument. | ||
echo. | ||
goto exit_fail | ||
) | ||
|
||
set Version=%version% | ||
|
||
pushd %root% | ||
|
||
dotnet restore | ||
if %ERRORLEVEL% neq 0 ( | ||
popd | ||
goto exit_fail | ||
) | ||
|
||
dotnet build "%root%\%project%" -c Release | ||
if %ERRORLEVEL% neq 0 ( | ||
popd | ||
goto exit_fail | ||
) | ||
|
||
popd | ||
|
||
|
||
|
||
|
||
|
||
|
||
goto exit_success | ||
:exit_fail | ||
exit /b 1 | ||
:exit_success |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@echo off | ||
|
||
set reporoot=%~dp0\.. | ||
set aversion=%reporoot%\tools\aversion\aversion | ||
set projectdir=%1 | ||
|
||
if "%version%"=="" ( | ||
"%aversion%" patch -ver 1.0.0 -in %projectdir%\Properties\AssemblyInfo.cs -out %projectdir%\Properties\AssemblyInfo_Patch.cs -token $version$ | ||
) else ( | ||
"%aversion%" patch -ver %version% -in %projectdir%\Properties\AssemblyInfo.cs -out %projectdir%\Properties\AssemblyInfo_Patch.cs -token $version$ | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
@echo off | ||
|
||
set version=%1 | ||
|
||
if "%version%"=="" ( | ||
echo Please remember to specify which version to push as an argument. | ||
goto exit_fail | ||
) | ||
|
||
set reporoot=%~dp0\.. | ||
set destination=%reporoot%\deploy | ||
|
||
if not exist "%destination%" ( | ||
echo Could not find %destination% | ||
echo. | ||
echo Did you remember to build the packages before running this script? | ||
) | ||
|
||
set nuget=%reporoot%\tools\NuGet\NuGet.exe | ||
|
||
if not exist "%nuget%" ( | ||
echo Could not find NuGet here: | ||
echo. | ||
echo "%nuget%" | ||
echo. | ||
goto exit_fail | ||
) | ||
|
||
|
||
"%nuget%" push "%destination%\*.%version%.nupkg" -Source https://www.nuget.org/api/v2/package | ||
if %ERRORLEVEL% neq 0 ( | ||
echo NuGet push failed. | ||
goto exit_fail | ||
) | ||
|
||
|
||
|
||
|
||
|
||
|
||
goto exit_success | ||
:exit_fail | ||
exit /b 1 | ||
:exit_success |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
@echo off | ||
|
||
set scriptsdir=%~dp0 | ||
set root=%scriptsdir%\.. | ||
set deploydir=%root%\deploy | ||
set project=%1 | ||
set version=%2 | ||
|
||
if "%project%"=="" ( | ||
echo Please invoke the build script with a project name as its first argument. | ||
echo. | ||
goto exit_fail | ||
) | ||
|
||
if "%version%"=="" ( | ||
echo Please invoke the build script with a version as its second argument. | ||
echo. | ||
goto exit_fail | ||
) | ||
|
||
set Version=%version% | ||
|
||
if exist "%deploydir%" ( | ||
rd "%deploydir%" /s/q | ||
) | ||
|
||
pushd %root% | ||
|
||
dotnet restore | ||
if %ERRORLEVEL% neq 0 ( | ||
popd | ||
goto exit_fail | ||
) | ||
|
||
dotnet pack "%root%/%project%" -c Release -o "%deploydir%" /p:PackageVersion=%version% | ||
if %ERRORLEVEL% neq 0 ( | ||
popd | ||
goto exit_fail | ||
) | ||
|
||
call scripts\push.cmd "%version%" | ||
|
||
popd | ||
|
||
|
||
|
||
|
||
|
||
|
||
goto exit_success | ||
:exit_fail | ||
exit /b 1 | ||
:exit_success |