91 lines
2.0 KiB
C#
91 lines
2.0 KiB
C#
using System.IO;
|
|
|
|
namespace Matrix42.Extensions.Scaffolder.Core
|
|
{
|
|
internal static class Templates
|
|
{
|
|
public const string Gitignore = @"
|
|
.idea/
|
|
.vs/
|
|
.vscode/
|
|
node_modules/
|
|
dist/
|
|
|
|
package-lock.json
|
|
workspace.json
|
|
|
|
.vs/
|
|
.libs/
|
|
.build/
|
|
|
|
bin/
|
|
obj/
|
|
|
|
*.user
|
|
|
|
/**/AssemblyInfoProduct.cs
|
|
/**/_Resharper.Caches
|
|
/Solutions/*.sln.DotSettings.user
|
|
/Solutions/**/*.csproj.user
|
|
/Solutions/**/packages/*.*
|
|
/Solutions/**/**/AssemblyInfoProduct.cs
|
|
/Solutions/TestResult/*.*
|
|
|
|
BasePackage/Assemblies/
|
|
";
|
|
|
|
public const string PrepareVeracodeScanCmd = @"set arch=""C:\Program Files\7-Zip\7z.exe""
|
|
echo [*] Building backend archive...
|
|
%arch% a -tzip -mx5 -x!*.config %Build_ArtifactStagingDirectory%\{ns}.zip %BaseDir%\Solutions\{ns}\.build\*.*
|
|
";
|
|
|
|
public const string DefaultHostFileContent =
|
|
@"<?xml version=""1.0"" encoding=""utf-8"" ?>
|
|
<host xmlns=""urn:m42/host.config"">
|
|
<modules></modules>
|
|
<sections></sections>
|
|
</host>
|
|
";
|
|
|
|
public const string BuildEventCmdTemplate =
|
|
@"call %~dps0..\..\TeamBuildEvent.cmd %1 %2 %3 ""/Solutions/{ns}""";
|
|
|
|
internal static string GetMatrix42AssembliesTargets()
|
|
{
|
|
var asm = typeof(Templates).Assembly;
|
|
const string resourceName = "Matrix42.Extensions.Scaffolder.Core.Extension.Assemblies.targets";
|
|
|
|
using (var stream = asm.GetManifestResourceStream(resourceName))
|
|
{
|
|
if (stream == null)
|
|
{
|
|
throw new FileNotFoundException($"Embedded resource '{resourceName}' not found in assembly '{asm.FullName}'.");
|
|
}
|
|
|
|
using (var reader = new StreamReader(stream))
|
|
{
|
|
return reader.ReadToEnd();
|
|
}
|
|
}
|
|
}
|
|
|
|
internal static string GetAzurePiplineCi()
|
|
{
|
|
var asm = typeof(Templates).Assembly;
|
|
const string resourceName = "Matrix42.Extensions.Scaffolder.Core.azure-pipelines-ci.yaml";
|
|
|
|
using (var stream = asm.GetManifestResourceStream(resourceName))
|
|
{
|
|
if (stream == null)
|
|
{
|
|
throw new FileNotFoundException($"Embedded resource '{resourceName}' not found in assembly '{asm.FullName}'.");
|
|
}
|
|
|
|
using (var reader = new StreamReader(stream))
|
|
{
|
|
return reader.ReadToEnd();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |