Move SnippetGenrator to Tools Directory (#1849)

* move SnippetGenrator to tools directory

* SkipDotNetInstall for snippet-generator

* use release configuration for packaging

* Switch to extends template
This commit is contained in:
Chidozie Ononiwu (His Righteousness) 2021-07-30 14:36:19 -07:00 коммит произвёл GitHub
Родитель 3e64aa3af4
Коммит f83399d6e1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
13 изменённых файлов: 89 добавлений и 53 удалений

Просмотреть файл

@ -36,7 +36,7 @@ stages:
inputs:
version: '${{ coalesce( parameters.DotNetCoreVersion, variables.DotNetCoreVersion) }}'
- script: 'dotnet pack -o $(Build.ArtifactStagingDirectory) -warnaserror'
- script: 'dotnet pack -o $(Build.ArtifactStagingDirectory) -warnaserror -c Release'
displayName: 'Build and Package'
workingDirectory: $(Build.SourcesDirectory)/${{parameters.ToolDirectory}}
env:

Просмотреть файл

@ -1,31 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29315.20
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SnippetGenerator", "SnippetGenerator.csproj", "{DC46BB54-17A2-471C-A21A-D7F329505955}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SnippetGenerator.Tests", "SnippetGenerator.Tests\SnippetGenerator.Tests.csproj", "{49A0F579-8121-472C-A2A7-B812FEC8CA18}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DC46BB54-17A2-471C-A21A-D7F329505955}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC46BB54-17A2-471C-A21A-D7F329505955}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC46BB54-17A2-471C-A21A-D7F329505955}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC46BB54-17A2-471C-A21A-D7F329505955}.Release|Any CPU.Build.0 = Release|Any CPU
{49A0F579-8121-472C-A2A7-B812FEC8CA18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{49A0F579-8121-472C-A2A7-B812FEC8CA18}.Release|Any CPU.ActiveCfg = Release|Any CPU
{49A0F579-8121-472C-A2A7-B812FEC8CA18}.Release|Any CPU.Build.0 = Release|Any CPU
{49A0F579-8121-472C-A2A7-B812FEC8CA18}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8162DAAE-F789-44E8-8552-58A3581A0AF3}
EndGlobalSection
EndGlobal

Просмотреть файл

@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SnippetGenerator.csproj" />
<ProjectReference Include="..\Azure.Sdk.Tools.SnippetGenerator\Azure.Sdk.Tools.SnippetGenerator.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using NUnit.Framework;
namespace SnippetGenerator.Tests
namespace Azure.Sdk.Tools.SnippetGenerator.Tests
{
public class Tests
{

Просмотреть файл

@ -3,20 +3,12 @@
<OutputType>Exe</OutputType>
<Description>Generates code snippets for readmes in the azure-sdk-for-net repo.</Description>
<TargetFramework>net5.0</TargetFramework>
<PackAsTool>true</PackAsTool>
<ToolCommandName>snippet-generator</ToolCommandName>
<VersionPrefix>1.0.0</VersionPrefix>
<AssemblyName>Azure.Sdk.Tools.SnippetGenerator</AssemblyName>
</PropertyGroup>
<Target Name="CopyBuildOutputIntoPackage" AfterTargets="Build" BeforeTargets="Pack" >
<ItemGroup>
<None Include="$(OutputPath)\**\*" PackagePath="tools\$(TargetFramework)" Pack="true" />
</ItemGroup>
</Target>
<ItemGroup>
<Compile Remove="SnippetGenerator.Tests\**" />
<EmbeddedResource Remove="SnippetGenerator.Tests\**" />
<None Remove="SnippetGenerator.Tests\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.3.4" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.2.1" />
@ -24,6 +16,5 @@
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="3.2.1" />
<PackageReference Include="Microsoft.Build" Version="16.0.461" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.0.461" />
<PackageReference Update="@(PackageReference)" PrivateAssets="All" />
</ItemGroup>
</Project>

Просмотреть файл

@ -7,7 +7,7 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace SnippetGenerator
namespace Azure.Sdk.Tools.SnippetGenerator
{
public class CSharpProcessor
{

Просмотреть файл

@ -14,7 +14,7 @@ using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
namespace SnippetGenerator
namespace Azure.Sdk.Tools.SnippetGenerator
{
public class DirectoryProcessor
{

Просмотреть файл

@ -5,7 +5,7 @@ using System;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace SnippetGenerator
namespace Azure.Sdk.Tools.SnippetGenerator
{
public class MarkdownProcessor
{

Просмотреть файл

@ -10,7 +10,7 @@ using System.Threading.Tasks;
using McMaster.Extensions.CommandLineUtils;
using Microsoft.CodeAnalysis.Options;
namespace SnippetGenerator
namespace Azure.Sdk.Tools.SnippetGenerator
{
public class Program
{

Просмотреть файл

@ -6,7 +6,7 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace SnippetGenerator
namespace Azure.Sdk.Tools.SnippetGenerator
{
internal static class RegexAsyncExtensions
{

Просмотреть файл

@ -3,7 +3,7 @@
using Microsoft.CodeAnalysis.Text;
namespace SnippetGenerator
namespace Azure.Sdk.Tools.SnippetGenerator
{
public class Snippet
{

Просмотреть файл

@ -0,0 +1,48 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30114.105
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Sdk.Tools.SnippetGenerator", "Azure.Sdk.Tools.SnippetGenerator\Azure.Sdk.Tools.SnippetGenerator.csproj", "{D7439AF5-4FA7-4747-933C-887ED6FC89B3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Sdk.Tools.SnippetGenerator.Tests", "Azure.Sdk.Tools.SnippetGenerator.Tests\Azure.Sdk.Tools.SnippetGenerator.Tests.csproj", "{83AFC5E6-0AE7-402C-A047-8502836C5DF7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D7439AF5-4FA7-4747-933C-887ED6FC89B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7439AF5-4FA7-4747-933C-887ED6FC89B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7439AF5-4FA7-4747-933C-887ED6FC89B3}.Debug|x64.ActiveCfg = Debug|Any CPU
{D7439AF5-4FA7-4747-933C-887ED6FC89B3}.Debug|x64.Build.0 = Debug|Any CPU
{D7439AF5-4FA7-4747-933C-887ED6FC89B3}.Debug|x86.ActiveCfg = Debug|Any CPU
{D7439AF5-4FA7-4747-933C-887ED6FC89B3}.Debug|x86.Build.0 = Debug|Any CPU
{D7439AF5-4FA7-4747-933C-887ED6FC89B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7439AF5-4FA7-4747-933C-887ED6FC89B3}.Release|Any CPU.Build.0 = Release|Any CPU
{D7439AF5-4FA7-4747-933C-887ED6FC89B3}.Release|x64.ActiveCfg = Release|Any CPU
{D7439AF5-4FA7-4747-933C-887ED6FC89B3}.Release|x64.Build.0 = Release|Any CPU
{D7439AF5-4FA7-4747-933C-887ED6FC89B3}.Release|x86.ActiveCfg = Release|Any CPU
{D7439AF5-4FA7-4747-933C-887ED6FC89B3}.Release|x86.Build.0 = Release|Any CPU
{83AFC5E6-0AE7-402C-A047-8502836C5DF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{83AFC5E6-0AE7-402C-A047-8502836C5DF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{83AFC5E6-0AE7-402C-A047-8502836C5DF7}.Debug|x64.ActiveCfg = Debug|Any CPU
{83AFC5E6-0AE7-402C-A047-8502836C5DF7}.Debug|x64.Build.0 = Debug|Any CPU
{83AFC5E6-0AE7-402C-A047-8502836C5DF7}.Debug|x86.ActiveCfg = Debug|Any CPU
{83AFC5E6-0AE7-402C-A047-8502836C5DF7}.Debug|x86.Build.0 = Debug|Any CPU
{83AFC5E6-0AE7-402C-A047-8502836C5DF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{83AFC5E6-0AE7-402C-A047-8502836C5DF7}.Release|Any CPU.Build.0 = Release|Any CPU
{83AFC5E6-0AE7-402C-A047-8502836C5DF7}.Release|x64.ActiveCfg = Release|Any CPU
{83AFC5E6-0AE7-402C-A047-8502836C5DF7}.Release|x64.Build.0 = Release|Any CPU
{83AFC5E6-0AE7-402C-A047-8502836C5DF7}.Release|x86.ActiveCfg = Release|Any CPU
{83AFC5E6-0AE7-402C-A047-8502836C5DF7}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,28 @@
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
trigger:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
paths:
include:
- tools/snippet-generator
pr:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
paths:
include:
- tools/snippet-generator
extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
parameters:
ToolDirectory: tools/snippet-generator
SkipDotNetInstall: true