Skip to content

Commit 48af434

Browse files
Initial version of NaturalStringExtensions
1 parent 90b8bc8 commit 48af434

22 files changed

Lines changed: 893 additions & 0 deletions

.config/dotnet-tools.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"cake.tool": {
6+
"version": "0.38.5",
7+
"commands": [
8+
"dotnet-cake"
9+
]
10+
},
11+
"minver-cli": {
12+
"version": "2.4.0",
13+
"commands": [
14+
"minver"
15+
]
16+
}
17+
}
18+
}

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
end_of_line = unset
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
indent_style = space
11+
indent_size = 4
12+
13+
[*.{xml,config,nuspec,csproj,props,targets,ps1}]
14+
indent_size = 2
15+
16+
[*.{sh}]
17+
end_of_line = lf
18+
19+
[*.{dotsettings}]
20+
end_of_line = lf
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
on:
2+
schedule:
3+
# every Sunday at 6am
4+
- cron: '0 6 * * SUN'
5+
6+
workflow_dispatch:
7+
8+
jobs:
9+
dependabot-cake:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: check/update cake dependencies
13+
uses: augustoproiete-actions/nils-org--dependabot-cake-action@v1

NaturalStringExtensions.sln

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30804.86
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A40E4FCE-76C0-4203-A359-CE412A28ACD6}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A21F092D-AF88-49C9-BA29-9D3658106302}"
9+
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sample", "sample", "{4F24789D-F35D-4C2A-B744-70F2BA1B1299}"
11+
EndProject
12+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "asset", "asset", "{9EE2DA52-0EC6-4B67-BCAD-0A57AF0F95EC}"
13+
ProjectSection(SolutionItems) = preProject
14+
.editorconfig = .editorconfig
15+
.gitattributes = .gitattributes
16+
.gitignore = .gitignore
17+
build.cake = build.cake
18+
build.cmd = build.cmd
19+
build.ps1 = build.ps1
20+
build.sh = build.sh
21+
cake.config = cake.config
22+
CHANGES.md = CHANGES.md
23+
CODEOWNERS = CODEOWNERS
24+
global.json = global.json
25+
LICENSE = LICENSE
26+
README.md = README.md
27+
EndProjectSection
28+
EndProject
29+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleConsole", "sample\SampleConsole\SampleConsole.csproj", "{6D96EF45-C13A-4784-8BB6-48214B6FBE4B}"
30+
EndProject
31+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NaturalStringExtensions", "src\NaturalStringExtensions\NaturalStringExtensions.csproj", "{1D3AF11E-9062-4146-96E0-87EFEB6E75C8}"
32+
EndProject
33+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NaturalStringExtensions.Tests", "test\NaturalStringExtensions.Tests\NaturalStringExtensions.Tests.csproj", "{66B3A125-9518-41F3-A28B-F9AE45A49A3C}"
34+
EndProject
35+
Global
36+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
37+
Debug|Any CPU = Debug|Any CPU
38+
Release|Any CPU = Release|Any CPU
39+
EndGlobalSection
40+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
41+
{6D96EF45-C13A-4784-8BB6-48214B6FBE4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42+
{6D96EF45-C13A-4784-8BB6-48214B6FBE4B}.Debug|Any CPU.Build.0 = Debug|Any CPU
43+
{6D96EF45-C13A-4784-8BB6-48214B6FBE4B}.Release|Any CPU.ActiveCfg = Release|Any CPU
44+
{6D96EF45-C13A-4784-8BB6-48214B6FBE4B}.Release|Any CPU.Build.0 = Release|Any CPU
45+
{1D3AF11E-9062-4146-96E0-87EFEB6E75C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46+
{1D3AF11E-9062-4146-96E0-87EFEB6E75C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
47+
{1D3AF11E-9062-4146-96E0-87EFEB6E75C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
48+
{1D3AF11E-9062-4146-96E0-87EFEB6E75C8}.Release|Any CPU.Build.0 = Release|Any CPU
49+
{66B3A125-9518-41F3-A28B-F9AE45A49A3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50+
{66B3A125-9518-41F3-A28B-F9AE45A49A3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
51+
{66B3A125-9518-41F3-A28B-F9AE45A49A3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
52+
{66B3A125-9518-41F3-A28B-F9AE45A49A3C}.Release|Any CPU.Build.0 = Release|Any CPU
53+
EndGlobalSection
54+
GlobalSection(SolutionProperties) = preSolution
55+
HideSolutionNode = FALSE
56+
EndGlobalSection
57+
GlobalSection(NestedProjects) = preSolution
58+
{6D96EF45-C13A-4784-8BB6-48214B6FBE4B} = {4F24789D-F35D-4C2A-B744-70F2BA1B1299}
59+
{1D3AF11E-9062-4146-96E0-87EFEB6E75C8} = {A40E4FCE-76C0-4203-A359-CE412A28ACD6}
60+
{66B3A125-9518-41F3-A28B-F9AE45A49A3C} = {A21F092D-AF88-49C9-BA29-9D3658106302}
61+
EndGlobalSection
62+
GlobalSection(ExtensibilityGlobals) = postSolution
63+
SolutionGuid = {5C1C3FD9-FF97-46E3-926B-6A3ACC0650D9}
64+
EndGlobalSection
65+
EndGlobal
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArgumentsStyleLiteral/@EntryIndexedValue">DO_NOT_SHOW</s:String>
3+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeObjectCreationWhenTypeEvident/@EntryIndexedValue">DO_NOT_SHOW</s:String>
4+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeTrailingCommaInMultilineLists/@EntryIndexedValue">DO_NOT_SHOW</s:String>
5+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue">DO_NOT_SHOW</s:String>
6+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /&gt;</s:String></wpf:ResourceDictionary>
1.45 KB
Loading
596 Bytes
Binary file not shown.

build.cake

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
#addin "nuget:?package=Cake.MinVer&version=0.2.0"
2+
3+
var target = Argument<string>("target", "pack");
4+
var buildVersion = MinVer(s => s.WithTagPrefix("v").WithDefaultPreReleasePhase("preview"));
5+
6+
Task("clean")
7+
.Does(() =>
8+
{
9+
CleanDirectory("./build/artifacts");
10+
CleanDirectories("./src/**/bin");
11+
CleanDirectories("./src/**/obj");
12+
CleanDirectories("./test/**/bin");
13+
CleanDirectories("./test/**/obj");
14+
});
15+
16+
Task("restore")
17+
.IsDependentOn("clean")
18+
.Does(() =>
19+
{
20+
DotNetCoreRestore("./NaturalStringExtensions.sln", new DotNetCoreRestoreSettings
21+
{
22+
LockedMode = true,
23+
});
24+
});
25+
26+
Task("build")
27+
.IsDependentOn("restore")
28+
.Does(() =>
29+
{
30+
DotNetCoreBuild("./NaturalStringExtensions.sln", new DotNetCoreBuildSettings
31+
{
32+
Configuration = "Debug",
33+
NoRestore = true,
34+
NoIncremental = false,
35+
ArgumentCustomization = args =>
36+
args.AppendQuoted($"-p:Version={buildVersion.Version}")
37+
.AppendQuoted($"-p:AssemblyVersion={buildVersion.FileVersion}")
38+
.AppendQuoted($"-p:FileVersion={buildVersion.FileVersion}")
39+
.AppendQuoted($"-p:ContinuousIntegrationBuild=true")
40+
});
41+
42+
DotNetCoreBuild("./NaturalStringExtensions.sln", new DotNetCoreBuildSettings
43+
{
44+
Configuration = "Release",
45+
NoRestore = true,
46+
NoIncremental = false,
47+
ArgumentCustomization = args =>
48+
args.AppendQuoted($"-p:Version={buildVersion.Version}")
49+
.AppendQuoted($"-p:AssemblyVersion={buildVersion.FileVersion}")
50+
.AppendQuoted($"-p:FileVersion={buildVersion.FileVersion}")
51+
.AppendQuoted($"-p:ContinuousIntegrationBuild=true")
52+
});
53+
});
54+
55+
Task("test")
56+
.IsDependentOn("build")
57+
.Does(() =>
58+
{
59+
var settings = new DotNetCoreTestSettings
60+
{
61+
Configuration = "Release",
62+
NoRestore = true,
63+
NoBuild = true,
64+
};
65+
66+
var projectFiles = GetFiles("./test/**/*.csproj");
67+
foreach (var file in projectFiles)
68+
{
69+
DotNetCoreTest(file.FullPath, settings);
70+
}
71+
});
72+
73+
Task("pack")
74+
.IsDependentOn("test")
75+
.Does(() =>
76+
{
77+
var releaseNotes = $"https://github.com/augustoproiete/NaturalStringExtensions/releases/tag/v{buildVersion.Version}";
78+
79+
DotNetCorePack("./src/NaturalStringExtensions/NaturalStringExtensions.csproj", new DotNetCorePackSettings
80+
{
81+
Configuration = "Release",
82+
NoRestore = true,
83+
NoBuild = true,
84+
OutputDirectory = "./build/artifacts",
85+
ArgumentCustomization = args =>
86+
args.AppendQuoted($"-p:Version={buildVersion.Version}")
87+
.AppendQuoted($"-p:PackageReleaseNotes={releaseNotes}")
88+
});
89+
});
90+
91+
Task("publish")
92+
.IsDependentOn("pack")
93+
.Does(context =>
94+
{
95+
var url = context.EnvironmentVariable("NUGET_URL");
96+
if (string.IsNullOrWhiteSpace(url))
97+
{
98+
context.Information("No NuGet URL specified. Skipping publishing of NuGet packages");
99+
return;
100+
}
101+
102+
var apiKey = context.EnvironmentVariable("NUGET_API_KEY");
103+
if (string.IsNullOrWhiteSpace(apiKey))
104+
{
105+
context.Information("No NuGet API key specified. Skipping publishing of NuGet packages");
106+
return;
107+
}
108+
109+
var nugetPushSettings = new DotNetCoreNuGetPushSettings
110+
{
111+
Source = url,
112+
ApiKey = apiKey,
113+
};
114+
115+
foreach (var nugetPackageFile in GetFiles("./build/artifacts/*.nupkg"))
116+
{
117+
DotNetCoreNuGetPush(nugetPackageFile.FullPath, nugetPushSettings);
118+
}
119+
});
120+
121+
RunTarget(target);

build.cmd

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@echo on
2+
@cd %~dp0
3+
4+
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
5+
set DOTNET_CLI_TELEMETRY_OPTOUT=1
6+
set DOTNET_NOLOGO=1
7+
8+
dotnet tool restore
9+
@if %ERRORLEVEL% neq 0 goto :eof
10+
11+
dotnet cake %*

build.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
$ErrorActionPreference = 'Stop'
2+
3+
Set-Location -LiteralPath $PSScriptRoot
4+
5+
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = '1'
6+
$env:DOTNET_CLI_TELEMETRY_OPTOUT = '1'
7+
$env:DOTNET_NOLOGO = '1'
8+
9+
dotnet tool restore
10+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
11+
12+
dotnet cake @args
13+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

0 commit comments

Comments
 (0)