Skip to content

Commit b3a6b6e

Browse files
committed
Initial commit
0 parents  commit b3a6b6e

15 files changed

+786
-0
lines changed

.gitignore

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.suo
6+
*.user
7+
*.sln.docstates
8+
9+
# Build results
10+
11+
[Dd]ebug/
12+
[Rr]elease/
13+
x64/
14+
build/
15+
[Bb]in/
16+
[Oo]bj/
17+
18+
# MSTest test Results
19+
[Tt]est[Rr]esult*/
20+
[Bb]uild[Ll]og.*
21+
22+
*_i.c
23+
*_p.c
24+
*.ilk
25+
*.meta
26+
*.obj
27+
*.pch
28+
*.pdb
29+
*.pgc
30+
*.pgd
31+
*.rsp
32+
*.sbr
33+
*.tlb
34+
*.tli
35+
*.tlh
36+
*.tmp
37+
*.tmp_proj
38+
*.log
39+
*.vspscc
40+
*.vssscc
41+
.builds
42+
*.pidb
43+
*.log
44+
*.scc
45+
46+
# Visual Studio profiler
47+
*.psess
48+
*.vsp
49+
*.vspx
50+
51+
# ReSharper is a .NET coding add-in
52+
_ReSharper*/
53+
*.[Rr]e[Ss]harper
54+
55+
56+
# Click-Once directory
57+
publish/
58+
59+
# Publish Web Output
60+
*.Publish.xml
61+
*.pubxml
62+
63+
# NuGet Packages Directory
64+
packages/
65+
66+
# Windows Azure Build Output
67+
csx
68+
*.build.csdef
69+
70+
# Others
71+
~$*
72+
*~
73+
*.dbmdl
74+
*.[Pp]ublish.xml
75+
*.pfx
76+
*.publishsettings
77+
78+
# Backup & report files from converting an old project file to a newer
79+
# Visual Studio version. Backup files are not needed, because we have git ;-)
80+
_UpgradeReport_Files/
81+
Backup*/
82+
UpgradeLog*.XML
83+
UpgradeLog*.htm
84+
85+
# =========================
86+
# Windows detritus
87+
# =========================
88+
89+
# Windows image file caches
90+
Thumbs.db
91+
ehthumbs.db
92+
93+
# Folder config file
94+
Desktop.ini
95+
96+
# Mac crap
97+
.DS_Store
98+
99+
src/.vs
100+
.vscode
101+
102+
# Cake Build
103+
/tools
104+
/artifacts

GitVersion.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
mode: ContinuousDeployment
2+
branches: {}
3+
ignore:
4+
sha: []

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2010-2017 Uber Creative Ltd
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Cofoundry.Plugins.Mail.SendGrid
2+
3+
[![Build status](https://ci.appveyor.com/api/projects/status/wquf931go22ibjg6?svg=true)](https://ci.appveyor.com/project/Cofoundry/cofoundry-plugins-mail-sendgrid)
4+
[![NuGet](https://img.shields.io/nuget/v/Cofoundry.Plugins.Mail.SendGrid.svg)](https://www.nuget.org/packages/Cofoundry.Plugins.Mail.SendGrid/)
5+
[![Gitter](https://img.shields.io/gitter/room/cofoundry-cms/cofoundry.svg)](https://gitter.im/cofoundry-cms/cofoundry)
6+
7+
8+
This library is a plugin for [Cofoundry](https://www.cofoundry.org/). For more information on getting started with Cofoundry check out the [Cofoundry repository](https://github.com/cofoundry-cms/cofoundry).
9+
10+
## Overview
11+
12+
Unfinished
13+
14+
15+
16+
17+
18+

appveyor.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '{build}'
2+
image: Visual Studio 2017
3+
environment:
4+
NUGET_API_KEY:
5+
secure: KBgtBksw79Z4kFehSqUePYoknzeWB8Tq8eAzSFPxDysRJCjJT3iUiCzk7OweTp0K
6+
MYGET_API_KEY:
7+
secure: JNkkCPfd2fNbhiTek4Hg4lP3Gf1IvB9xFf/Gv0pJGbw4+h8inQBaKZ6XlxpgRO44
8+
9+
build_script:
10+
- cmd: PowerShell -Version 2.0 .\build.ps1 -PushPackages true
11+
test: off

build.cake

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
#tool "nuget:?package=GitVersion.CommandLine"
2+
3+
using System.Text.RegularExpressions;
4+
5+
//////////////////////////////////////////////////////////////////////
6+
// ARGUMENTS
7+
//////////////////////////////////////////////////////////////////////
8+
9+
var target = Argument("target", "Default");
10+
var configuration = Argument("configuration", "Release");
11+
var pushPackages = Argument("PushPackages", "false") == "true";
12+
bool isPrerelease = false;
13+
GitVersion versionInfo = null;
14+
15+
var projectsToBuild = new string[]{
16+
"./src/Cofoundry.Plugins.Mail.SendGrid/Cofoundry.Plugins.Mail.SendGrid.csproj",
17+
};
18+
19+
20+
//////////////////////////////////////////////////////////////////////
21+
// PREPARATION
22+
//////////////////////////////////////////////////////////////////////
23+
24+
//GitVersion versionInfo = null;
25+
var nugetPackageDir = Directory("./artifacts");
26+
27+
//////////////////////////////////////////////////////////////////////
28+
// TASKS
29+
//////////////////////////////////////////////////////////////////////
30+
31+
Task("Clean")
32+
.Does(() =>
33+
{
34+
CleanDirectory(nugetPackageDir);
35+
CleanDirectories("./src/**/bin/" + configuration);
36+
CleanDirectories("./src/**/obj/" + configuration);
37+
});
38+
39+
40+
Task("Patch-Assembly-Version")
41+
.IsDependentOn("Clean")
42+
.Does(() =>
43+
{
44+
versionInfo = GitVersion(new GitVersionSettings{
45+
UpdateAssemblyInfo = false
46+
});
47+
48+
Information("Building version {0} of Cofoundry.", versionInfo.InformationalVersion);
49+
50+
isPrerelease = !string.IsNullOrEmpty(versionInfo.PreReleaseNumber);
51+
52+
// Patch the version number so it's picked up when dependent projects are references
53+
// as nuget dependencies. Can't find a better way to do this.
54+
// Also this needs to run before DotNetCoreRestore for some reason (cached?)
55+
var file = MakeAbsolute(File("./src/Directory.Build.props"));
56+
var xml = System.IO.File.ReadAllText(file.FullPath, Encoding.UTF8);
57+
xml = Regex.Replace(xml, @"(<Version>)(.+)(<\/Version>)", "${1}" + versionInfo.NuGetVersion +"${3}");
58+
System.IO.File.WriteAllText(file.FullPath, xml, Encoding.UTF8);
59+
});
60+
61+
Task("Restore-NuGet-Packages")
62+
.IsDependentOn("Patch-Assembly-Version")
63+
.Does(() =>
64+
{
65+
foreach (var projectToBuild in projectsToBuild)
66+
{
67+
DotNetCoreRestore(projectToBuild);
68+
}
69+
});
70+
71+
Task("Build")
72+
.IsDependentOn("Restore-NuGet-Packages")
73+
.Does(() =>
74+
{
75+
76+
var settings = new DotNetCoreBuildSettings
77+
{
78+
Configuration = configuration,
79+
ArgumentCustomization = args => args
80+
.Append("/p:NuGetVersion=" + versionInfo.NuGetVersion)
81+
.Append("/p:AssemblyVersion=" + versionInfo.AssemblySemVer)
82+
.Append("/p:FileVersion=" + versionInfo.MajorMinorPatch + ".0")
83+
.Append("/p:InformationalVersion=" + versionInfo.InformationalVersion)
84+
.Append("/p:Copyright=" + "\"Copyright © Cofoundry.org " + DateTime.Now.Year + "\"")
85+
};
86+
87+
foreach (var projectToBuild in projectsToBuild)
88+
{
89+
DotNetCoreBuild(projectToBuild, settings);
90+
}
91+
});
92+
93+
Task("Pack")
94+
.IsDependentOn("Build")
95+
.Does(() =>
96+
{
97+
var settings = new DotNetCorePackSettings
98+
{
99+
Configuration = configuration,
100+
OutputDirectory = "./artifacts/",
101+
NoBuild = true
102+
};
103+
104+
foreach (var projectToBuild in projectsToBuild)
105+
{
106+
DotNetCorePack(projectToBuild, settings);
107+
}
108+
});
109+
110+
Task("PushNuGetPackage")
111+
.IsDependentOn("Pack")
112+
.Does(() =>
113+
{
114+
var nugets = GetFiles("./artifacts/*.nupkg");
115+
116+
if (pushPackages)
117+
{
118+
Information("Pushing packages");
119+
120+
if (isPrerelease)
121+
{
122+
NuGetPush(nugets, new NuGetPushSettings {
123+
Source = "https://www.myget.org/F/cofoundry/api/v2/package",
124+
ApiKey = EnvironmentVariable("MYGET_API_KEY")
125+
});
126+
}
127+
else
128+
{
129+
NuGetPush(nugets, new NuGetPushSettings {
130+
Source = "https://nuget.org/",
131+
ApiKey = EnvironmentVariable("NUGET_API_KEY")
132+
});
133+
}
134+
}
135+
});
136+
137+
//////////////////////////////////////////////////////////////////////
138+
// TASK TARGETS
139+
//////////////////////////////////////////////////////////////////////
140+
141+
Task("Default").IsDependentOn("PushNuGetPackage");
142+
143+
//////////////////////////////////////////////////////////////////////
144+
// EXECUTION
145+
//////////////////////////////////////////////////////////////////////
146+
147+
RunTarget(target);

0 commit comments

Comments
 (0)