From e9924e0befa62ad399084be0962844feafa9ba45 Mon Sep 17 00:00:00 2001 From: Daniel Triendl Date: Wed, 8 May 2019 14:02:36 +0200 Subject: [PATCH] Initial Import --- .gitignore | 351 ++++++++++++++++++ CPABuildEvents.sln | 25 ++ CPABuildEvents/BuildEventsPackage.cs | 128 +++++++ CPABuildEvents/BuildEventsPackage.resx | 140 +++++++ CPABuildEvents/CPABuildEvents.csproj | 108 ++++++ CPABuildEvents/Properties/AssemblyInfo.cs | 33 ++ .../Resources/BuildEventsPackage.ico | Bin 0 -> 428446 bytes CPABuildEvents/RunPSScript.cs | 71 ++++ CPABuildEvents/source.extension.vsixmanifest | 22 ++ 9 files changed, 878 insertions(+) create mode 100644 .gitignore create mode 100644 CPABuildEvents.sln create mode 100644 CPABuildEvents/BuildEventsPackage.cs create mode 100644 CPABuildEvents/BuildEventsPackage.resx create mode 100644 CPABuildEvents/CPABuildEvents.csproj create mode 100644 CPABuildEvents/Properties/AssemblyInfo.cs create mode 100644 CPABuildEvents/Resources/BuildEventsPackage.ico create mode 100644 CPABuildEvents/RunPSScript.cs create mode 100644 CPABuildEvents/source.extension.vsixmanifest diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7b84f3d --- /dev/null +++ b/.gitignore @@ -0,0 +1,351 @@ + +# Created by https://www.gitignore.io/api/visualstudio +# Edit at https://www.gitignore.io/?templates=visualstudio + +### VisualStudio ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- Backup*.rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# End of https://www.gitignore.io/api/visualstudio diff --git a/CPABuildEvents.sln b/CPABuildEvents.sln new file mode 100644 index 0000000..739f383 --- /dev/null +++ b/CPABuildEvents.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.28803.352 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CPABuildEvents", "CPABuildEvents\CPABuildEvents.csproj", "{2EDFEE33-2BAD-49D3-87AC-C59C42A099D0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2EDFEE33-2BAD-49D3-87AC-C59C42A099D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2EDFEE33-2BAD-49D3-87AC-C59C42A099D0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2EDFEE33-2BAD-49D3-87AC-C59C42A099D0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2EDFEE33-2BAD-49D3-87AC-C59C42A099D0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {24B05F37-9539-484D-A83F-FF5F970ACE0D} + EndGlobalSection +EndGlobal diff --git a/CPABuildEvents/BuildEventsPackage.cs b/CPABuildEvents/BuildEventsPackage.cs new file mode 100644 index 0000000..0932d6a --- /dev/null +++ b/CPABuildEvents/BuildEventsPackage.cs @@ -0,0 +1,128 @@ +using System; +using System.Collections.ObjectModel; +using System.ComponentModel.Design; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.Globalization; +using System.IO; +using System.Management.Automation; +using System.Runtime.InteropServices; +using System.Threading; +using System.Threading.Tasks; +using EnvDTE; +using EnvDTE80; +using Microsoft.VisualStudio; +using Microsoft.VisualStudio.OLE.Interop; +using Microsoft.VisualStudio.PlatformUI; +using Microsoft.VisualStudio.Shell; +using Microsoft.VisualStudio.Shell.Interop; +using Microsoft.Win32; +using Task = System.Threading.Tasks.Task; + +namespace CPABuildEvents +{ + /// + /// This is the class that implements the package exposed by this assembly. + /// + /// + /// + /// The minimum requirement for a class to be considered a valid package for Visual Studio + /// is to implement the IVsPackage interface and register itself with the shell. + /// This package uses the helper classes defined inside the Managed Package Framework (MPF) + /// to do it: it derives from the Package class that provides the implementation of the + /// IVsPackage interface and uses the registration attributes defined in the framework to + /// register itself and its components with the shell. These attributes tell the pkgdef creation + /// utility what data to put into .pkgdef file. + /// + /// + /// To get loaded into VS, the package must be referred by <Asset Type="Microsoft.VisualStudio.VsPackage" ...> in .vsixmanifest file. + /// + /// + [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] + [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] // Info on this package for Help/About + [ProvideAutoLoad(UIContextGuids80.SolutionExists, PackageAutoLoadFlags.BackgroundLoad)] + [Guid(BuildEventsPackage.PackageGuidString)] + [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")] + public sealed class BuildEventsPackage : AsyncPackage + { + /// + /// VSPackage1 GUID string. + /// + public const string PackageGuidString = "90d6e709-5902-4603-8f56-3b4cdaaa784f"; + + private readonly Lazy _dte; + private readonly Lazy _events; + private readonly Lazy _buildEvents; + private readonly Lazy _outWindow; + private readonly Lazy _buildPane; + + /// + /// Initializes a new instance of the class. + /// + public BuildEventsPackage() + { + // Inside this method you can place any initialization code that does not require + // any Visual Studio service because at this point the package object is created but + // not sited yet inside Visual Studio environment. The place to do all the other + // initialization is the Initialize method. + _dte = new Lazy(() => ServiceProvider.GlobalProvider.GetService(typeof(DTE)) as DTE2); + _events = new Lazy(() => _dte.Value.Events); + _buildEvents = new Lazy(() => _events.Value.BuildEvents); + _outWindow = new Lazy(() => GetGlobalService(typeof(SVsOutputWindow)) as IVsOutputWindow); + _buildPane = new Lazy(() => + { + _outWindow.Value.GetPane(VSConstants.GUID_BuildOutputWindowPane, out var pane); + return pane; + }); + } + + #region Package Members + + /// + /// Initialization of the package; this method is called right after the package is sited, so this is the place + /// where you can put all the initialization code that rely on services provided by VisualStudio. + /// + /// A cancellation token to monitor for initialization cancellation, which can occur when VS is shutting down. + /// A provider for progress updates. + /// A task representing the async work of package initialization, or an already completed task if there is none. Do not return null from this method. + protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress progress) + { + // When initialized asynchronously, the current thread may be a background thread at this point. + // Do any initialization that requires the UI thread after switching to the UI thread. + await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); + + _buildEvents.Value.OnBuildBegin += DoBuildBegin; + _buildEvents.Value.OnBuildDone += DoBuildEnd; + } + + private void DoBuildEnd(vsBuildScope Scope, vsBuildAction Action) + { + ThreadHelper.ThrowIfNotOnUIThread(); + var solution = _dte.Value.Solution; + if (solution != null) + { + var postBuildScript = Path.Combine(Path.GetDirectoryName(solution.FullName), "_postbuild.ps1"); + if (File.Exists(postBuildScript)) + { + new RunPSScript(postBuildScript, _buildPane.Value).RunScript(); + } + } + } + + private void DoBuildBegin(vsBuildScope Scope, vsBuildAction Action) + { + ThreadHelper.ThrowIfNotOnUIThread(); + var solution = _dte.Value.Solution; + if (solution != null) + { + var preBuildScript = Path.Combine(Path.GetDirectoryName(solution.FullName), "_prebuild.ps1"); + if (File.Exists(preBuildScript)) + { + new RunPSScript(preBuildScript, _buildPane.Value).RunScript(); + } + } + } + + #endregion + } +} diff --git a/CPABuildEvents/BuildEventsPackage.resx b/CPABuildEvents/BuildEventsPackage.resx new file mode 100644 index 0000000..a05ec95 --- /dev/null +++ b/CPABuildEvents/BuildEventsPackage.resx @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + VSPackage1 Extension + + + VSPackage1 Visual Studio Extension Detailed Info + + + Resources\BuildEventsPackage.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/CPABuildEvents/CPABuildEvents.csproj b/CPABuildEvents/CPABuildEvents.csproj new file mode 100644 index 0000000..68edadc --- /dev/null +++ b/CPABuildEvents/CPABuildEvents.csproj @@ -0,0 +1,108 @@ + + + + 16.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + true + + + + + + + + Debug + AnyCPU + 2.0 + {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {2EDFEE33-2BAD-49D3-87AC-C59C42A099D0} + Library + Properties + CPABuildEvents + CPABuildEvents + v4.7.2 + true + true + true + true + true + true + true + Program + $(DevEnvDir)devenv.exe + /rootsuffix Exp + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + Designer + + + + + + + + + + + + False + ..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\3.0\System.Management.Automation.dll + + + + + + + + compile; build; native; contentfiles; analyzers; buildtransitive + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + true + VSPackage + Designer + + + + + + \ No newline at end of file diff --git a/CPABuildEvents/Properties/AssemblyInfo.cs b/CPABuildEvents/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ee3a1fe --- /dev/null +++ b/CPABuildEvents/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CPABuildEvents")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CPABuildEvents")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CPABuildEvents/Resources/BuildEventsPackage.ico b/CPABuildEvents/Resources/BuildEventsPackage.ico new file mode 100644 index 0000000000000000000000000000000000000000..d323b07fb8d8b417bfc12e7c46dea88bee17760c GIT binary patch literal 428446 zcmeHwzmFYBl3qPFmz*Euki&m~ZRmipgt26b1bqtY(xX9RJvsvBK&Ri~Ag*@=9a#iM za>RpVtU*8~r_ZFd4k7cV&(R$~0mE^Iv%p}VGO8-7vf^b_R#j%ytLpdl?(59T$c&8m z;`{Q|D|Yu3#iqDf6vb`VUM>Fc--_b@xT|l!t*@^Y#ee+oMR9ssUH{vaqWB-L-R#@d z^*5WM_=o@L7PzlX@mcZBzuOf5`+w2;>iQqQDvE#p^Tw^OuRkk_=l{HM>#OTO{H`ee z{l7XV<@(d&o71bsfBk=(;{JWIyXyx<@%F~G+TUsMkAG7X|Mx##tNpoa=jR{(^R?RF zY4L}vMe!g0%eCU0%3)Escqy;)Yg;w@-<^SM+ilgj@2=}!+v5EE+!=P||BKy@dhX@^ zM?>_@`*PQ_e0}ux^t-cc?l!^xKI&~B_|Jm?_}6mI@6Cfg^bh{|tZVz=UxmPTMqi9? zjDJSke~0}m1b~05dB4Z}0RLI$w$J#4Fk>6H{v7J_xNQA-Yy(8M+kIUAd$2Q>KV(#}CpAcqj~A*v73thx$A&TYnzg zfPag*-(!42n6Zspe-8C|T(S-Mz(SfY3FNy9*<%Fw&s41 z@d;tZHg5en)aP;8`t#TZ{C(8hKI0R@jBVWdbEwbbvi0Y&4fwa1`#r`dgc;ko_2*EZ z$7So!V;k`IQE&Thrj4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=VdzAZ z9|}j<55+*SG+1+-Lt3})zI%P|UQHaX&%VnVGrtH!QFGdtUgdnU(VP+dxIZMuA#+>| zQGSWoeNBbA@UyegPZr5)(nYh>Ky0))V&DTCN9@6bda}&%5qFI7Zj*+wOeh{zE>l{dKdwOYQFDoc`lS^mAIL?seb2nxE5( zsK?_0^TDKbAqBsdvcG&U$aT&61(SD!Y|piy^uzwww7>RzNai+V-jw`@_@!8e%)|cG z`^*^r4Z-y?<1cxhay^BADf`K_Yux|X`G@?&|GgT??IAc#;r|f76w8o#Q}&m6rd(tH zVefy86Srgkb^<*I=zHE0d;jHqsiog7oLX~Q>-*wwEX=)W==#>KEDR#n*mIYiRBLf!nFmoR3g_ zzUKw?KD_r2?)ovUVS8VD;r`?2)~|E-0?WAKjA<_j_w+yTALp^7qLo&{Ox~ z=M?v^x(nsY<;8gpYNZ=mFS)8+(_C%6|9;Es<=B$fbIg5hU;KUR*w(jRVnu7@*pk)sender)[e.Index]; + + PrintRecordAsync(record); + } + + private async Task PrintRecordAsync(ErrorRecord record) + { + if (_pane == null) + { + return; + } + + await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); + _pane.OutputString($"{Path.GetFileName(_scriptFile)}: {record}\r\n"); + } + + private void PrintResults(Collection results) + { + if (_pane == null) + { + return; + } + + ThreadHelper.ThrowIfNotOnUIThread(); + foreach (var result in results) + { + _pane.OutputString($"{Path.GetFileNameWithoutExtension(_scriptFile)}: {result}\r\n"); + } + _pane.Activate(); + } + } +} diff --git a/CPABuildEvents/source.extension.vsixmanifest b/CPABuildEvents/source.extension.vsixmanifest new file mode 100644 index 0000000..4f35c96 --- /dev/null +++ b/CPABuildEvents/source.extension.vsixmanifest @@ -0,0 +1,22 @@ + + + + + CPABuildEvents + Run _prebuild.ps1 and _postbuild.ps1 on build start and end + true + + + + + + + + + + + + + + +