-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
15 changed files
with
106 additions
and
86 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
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 |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
*.cs text diff=csharp | ||
*.csproj text merge=union | ||
*.sln text merge=union | ||
|
||
*.g.cs linguist-generated=true |
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 |
---|---|---|
@@ -1,13 +1,14 @@ | ||
.vs/ | ||
bin/ | ||
obj/ | ||
release/ | ||
|
||
.vs/ | ||
Thumbs.db | ||
*.cache | ||
*.log | ||
*.user | ||
*.userprefs | ||
*.ncrunchproject | ||
*.ncrunchsolution | ||
*.user | ||
launchSettings.json | ||
nCrunchTemp* | ||
_ReSharper* | ||
.DS_Store | ||
launchSettings.json |
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
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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
# RepoTemplate | ||
|
||
Repository description. | ||
|
||
[](https://github.com/FacilityApi/RepoTemplate/actions?query=workflow%3ABuild) | ||
|
||
* [Documentation](https://facilityapi.github.io/) | ||
* [Release Notes](ReleaseNotes.md) |
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,16 @@ | ||
$ErrorActionPreference = 'Stop' | ||
Push-Location $PSScriptRoot | ||
try { | ||
if (-not (Test-Path ./tools/bin/Build) -or | ||
(Get-ChildItem ./tools/Build/* | Measure-Object LastWriteTime -Maximum).Maximum -gt | ||
(Get-ChildItem ./tools/bin/Build/* | Measure-Object LastWriteTime -Maximum).Maximum) { | ||
if (Test-Path ./tools/bin/Build) { Remove-Item ./tools/bin/Build -Recurse } | ||
dotnet publish ./tools/Build/Build.csproj --output ./tools/bin/Build --nologo --verbosity quiet | ||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | ||
} | ||
dotnet ./tools/bin/Build/Build.dll $args | ||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | ||
} | ||
finally { | ||
Pop-Location | ||
} |
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 |
---|---|---|
|
@@ -4,47 +4,51 @@ | |
using static Faithlife.Build.BuildUtility; | ||
using static Faithlife.Build.DotNetRunner; | ||
|
||
internal static class Build | ||
return BuildRunner.Execute(args, build => | ||
{ | ||
public static int Main(string[] args) => BuildRunner.Execute(args, build => | ||
{ | ||
var codegen = "fsdgen___"; | ||
var codegen = "fsdgen___"; | ||
|
||
var gitLogin = new GitLoginInfo("FacilityApiBot", Environment.GetEnvironmentVariable("BUILD_BOT_PASSWORD") ?? ""); | ||
|
||
var dotNetBuildSettings = new DotNetBuildSettings | ||
var dotNetBuildSettings = new DotNetBuildSettings | ||
{ | ||
NuGetApiKey = Environment.GetEnvironmentVariable("NUGET_API_KEY"), | ||
DocsSettings = new DotNetDocsSettings | ||
{ | ||
NuGetApiKey = Environment.GetEnvironmentVariable("NUGET_API_KEY"), | ||
DocsSettings = new DotNetDocsSettings | ||
{ | ||
GitLogin = new GitLoginInfo("FacilityApiBot", Environment.GetEnvironmentVariable("BUILD_BOT_PASSWORD") ?? ""), | ||
GitAuthor = new GitAuthorInfo("FacilityApiBot", "[email protected]"), | ||
SourceCodeUrl = "https://github.com/FacilityApi/RepoTemplate/tree/master/src", | ||
ProjectHasDocs = name => !name.StartsWith("fsdgen", StringComparison.Ordinal), | ||
}, | ||
}; | ||
|
||
build.AddDotNetTargets(dotNetBuildSettings); | ||
|
||
build.Target("codegen") | ||
.DependsOn("build") | ||
.Describe("Generates code from the FSD") | ||
.Does(() => CodeGen(verify: false)); | ||
|
||
build.Target("verify-codegen") | ||
.DependsOn("build") | ||
.Describe("Ensures the generated code is up-to-date") | ||
.Does(() => CodeGen(verify: true)); | ||
|
||
build.Target("test") | ||
.DependsOn("verify-codegen"); | ||
|
||
void CodeGen(bool verify) | ||
GitLogin = gitLogin, | ||
GitAuthor = new GitAuthorInfo("FacilityApiBot", "[email protected]"), | ||
SourceCodeUrl = "https://github.com/FacilityApi/RepoTemplate/tree/master/src", | ||
ProjectHasDocs = name => !name.StartsWith("fsdgen", StringComparison.Ordinal), | ||
}, | ||
PackageSettings = new DotNetPackageSettings | ||
{ | ||
var configuration = dotNetBuildSettings!.BuildOptions!.ConfigurationOption!.Value; | ||
var toolPath = FindFiles($"src/{codegen}/bin/{configuration}/netcoreapp3.1/{codegen}.dll").FirstOrDefault(); | ||
GitLogin = gitLogin, | ||
PushTagOnPublish = x => $"nuget.{x.Version}", | ||
}, | ||
}; | ||
|
||
build.AddDotNetTargets(dotNetBuildSettings); | ||
|
||
build.Target("codegen") | ||
.DependsOn("build") | ||
.Describe("Generates code from the FSD") | ||
.Does(() => CodeGen(verify: false)); | ||
|
||
build.Target("verify-codegen") | ||
.DependsOn("build") | ||
.Describe("Ensures the generated code is up-to-date") | ||
.Does(() => CodeGen(verify: true)); | ||
|
||
build.Target("test") | ||
.DependsOn("verify-codegen"); | ||
|
||
void CodeGen(bool verify) | ||
{ | ||
var configuration = dotNetBuildSettings.GetConfiguration(); | ||
var toolPath = FindFiles($"src/{codegen}/bin/{configuration}/net5.0/{codegen}.dll").FirstOrDefault(); | ||
|
||
var verifyOption = verify ? "--verify" : null; | ||
var verifyOption = verify ? "--verify" : null; | ||
|
||
RunDotNet(toolPath, "___", "___", "--newline", "lf", verifyOption); | ||
} | ||
}); | ||
} | ||
RunDotNet(toolPath, "___", "___", "--newline", "lf", verifyOption); | ||
} | ||
}); |
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
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 |
---|---|---|
@@ -1,9 +1,3 @@ | ||
using XmlDocMarkdown.Core; | ||
|
||
namespace XmlDocGen | ||
{ | ||
internal sealed class XmlDocGenApp | ||
{ | ||
public static int Main(string[] args) => XmlDocMarkdownApp.Run(args); | ||
} | ||
} | ||
return XmlDocMarkdownApp.Run(args); |