|
1 | | -<Project Sdk="Microsoft.NET.Sdk"> |
2 | | - |
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | +<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| 3 | + <PropertyGroup> |
| 4 | + <MinimumVisualStudioVersion>17.0</MinimumVisualStudioVersion> |
| 5 | + <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> |
| 6 | + <RuntimeIdentifiers>win;win-x86;win-x64;win-arm;win-arm64</RuntimeIdentifiers> |
| 7 | + </PropertyGroup> |
| 8 | + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
3 | 9 | <PropertyGroup> |
| 10 | + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
| 11 | + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
| 12 | + <SchemaVersion>2.0</SchemaVersion> |
| 13 | + <ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> |
| 14 | + <ProjectGuid>{A1B2C3D4-E5F6-A7B8-C9D0-E1F2A3B4C5D6}</ProjectGuid> |
4 | 15 | <OutputType>Library</OutputType> |
5 | | - <TargetFramework>net472</TargetFramework> |
6 | | - <UseWPF>true</UseWPF> |
7 | | - <Nullable>enable</Nullable> |
8 | | - <LangVersion>latest</LangVersion> |
| 16 | + <AppDesignerFolder>Properties</AppDesignerFolder> |
9 | 17 | <RootNamespace>CopilotTokenTracker</RootNamespace> |
10 | 18 | <AssemblyName>CopilotTokenTracker</AssemblyName> |
11 | | - <!-- Required for VS extension to locate the assembly from its install dir --> |
| 19 | + <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> |
| 20 | + <LangVersion>latest</LangVersion> |
| 21 | + <Nullable>enable</Nullable> |
| 22 | + <GeneratePkgDefFile>true</GeneratePkgDefFile> |
12 | 23 | <UseCodebase>true</UseCodebase> |
13 | | - <!-- Suppress package reference warnings for VS SDK assemblies excluded from output --> |
14 | | - <NoWarn>$(NoWarn);NU1701</NoWarn> |
| 24 | + <IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer> |
| 25 | + <IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer> |
| 26 | + <IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment> |
| 27 | + <CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory> |
| 28 | + <CopyOutputSymbolsToOutputDirectory>true</CopyOutputSymbolsToOutputDirectory> |
| 29 | + <StartAction>Program</StartAction> |
| 30 | + <StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram> |
| 31 | + <StartArguments>/rootsuffix Exp</StartArguments> |
| 32 | + </PropertyGroup> |
| 33 | + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
| 34 | + <DebugSymbols>true</DebugSymbols> |
| 35 | + <DebugType>full</DebugType> |
| 36 | + <Optimize>false</Optimize> |
| 37 | + <OutputPath>bin\Debug\</OutputPath> |
| 38 | + <DefineConstants>DEBUG;TRACE</DefineConstants> |
| 39 | + <ErrorReport>prompt</ErrorReport> |
| 40 | + <WarningLevel>4</WarningLevel> |
| 41 | + </PropertyGroup> |
| 42 | + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
| 43 | + <DebugType>pdbonly</DebugType> |
| 44 | + <Optimize>true</Optimize> |
| 45 | + <OutputPath>bin\Release\</OutputPath> |
| 46 | + <DefineConstants>TRACE</DefineConstants> |
| 47 | + <ErrorReport>prompt</ErrorReport> |
| 48 | + <WarningLevel>4</WarningLevel> |
15 | 49 | </PropertyGroup> |
16 | 50 |
|
| 51 | + <!-- Source files --> |
17 | 52 | <ItemGroup> |
18 | | - <!-- Visual Studio SDK (excluded from runtime — VS provides these at host time) --> |
19 | | - <PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.6.36389" ExcludeAssets="Runtime" /> |
20 | | - <PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.6.2164" PrivateAssets="all" /> |
21 | | - <!-- Embedded Chromium for the WebView2 tool window --> |
22 | | - <PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2478.35" /> |
23 | | - <!-- MessagePack for parsing VS Copilot Chat binary session files --> |
24 | | - <PackageReference Include="MessagePack" Version="2.5.187" /> |
25 | | - <!-- JSON serialisation for the data bridge to the webview --> |
26 | | - <PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> |
27 | | - <!-- System.Text.Json is not built into net472; pull it via NuGet --> |
28 | | - <PackageReference Include="System.Text.Json" Version="8.0.5" /> |
| 53 | + <Compile Include="CopilotTokenTrackerPackage.cs" /> |
| 54 | + <Compile Include="Commands\ShowTokenTrackerCommand.cs" /> |
| 55 | + <Compile Include="Data\Models.cs" /> |
| 56 | + <Compile Include="Data\SessionDiscovery.cs" /> |
| 57 | + <Compile Include="Data\SessionParser.cs" /> |
| 58 | + <Compile Include="Data\StatsBuilder.cs" /> |
| 59 | + <Compile Include="Data\TokenEstimator.cs" /> |
| 60 | + <Compile Include="Properties\Settings.Designer.cs"> |
| 61 | + <DesignTimeSharedInput>True</DesignTimeSharedInput> |
| 62 | + <AutoGen>True</AutoGen> |
| 63 | + <DependentUpon>Settings.settings</DependentUpon> |
| 64 | + </Compile> |
| 65 | + <Compile Include="ToolWindow\TokenTrackerToolWindow.cs" /> |
| 66 | + <Compile Include="WebBridge\ThemedHtmlBuilder.cs" /> |
| 67 | + <Compile Include="Properties\AssemblyInfo.cs" /> |
29 | 68 | </ItemGroup> |
30 | 69 |
|
31 | | - <!-- Framework assemblies needed for OleMenuCommandService / MenuCommand --> |
| 70 | + <!-- WPF XAML --> |
32 | 71 | <ItemGroup> |
33 | | - <Reference Include="System.Design" /> |
| 72 | + <Page Include="ToolWindow\TokenTrackerControl.xaml"> |
| 73 | + <Generator>MSBuild:Compile</Generator> |
| 74 | + <SubType>Designer</SubType> |
| 75 | + </Page> |
| 76 | + <Compile Include="ToolWindow\TokenTrackerControl.xaml.cs"> |
| 77 | + <DependentUpon>TokenTrackerControl.xaml</DependentUpon> |
| 78 | + </Compile> |
| 79 | + </ItemGroup> |
| 80 | + |
| 81 | + <!-- VSIX manifest --> |
| 82 | + <ItemGroup> |
| 83 | + <None Include="Properties\Settings.settings"> |
| 84 | + <Generator>SettingsSingleFileGenerator</Generator> |
| 85 | + <LastGenOutput>Settings.Designer.cs</LastGenOutput> |
| 86 | + </None> |
| 87 | + <None Include="source.extension.vsixmanifest"> |
| 88 | + <SubType>Designer</SubType> |
| 89 | + </None> |
34 | 90 | </ItemGroup> |
35 | 91 |
|
36 | 92 | <!-- VSCT: VS Command Table definition (menus / commands) --> |
|
40 | 96 | </VSCTCompile> |
41 | 97 | </ItemGroup> |
42 | 98 |
|
43 | | - <!-- VSIX manifest --> |
| 99 | + <!-- Embedded resources --> |
44 | 100 | <ItemGroup> |
45 | | - <Content Include="source.extension.vsixmanifest"> |
46 | | - <SubType>Designer</SubType> |
47 | | - </Content> |
| 101 | + <EmbeddedResource Include="WebBridge\vscode-shim.js" /> |
48 | 102 | </ItemGroup> |
49 | 103 |
|
50 | | - <!-- vscode-shim.js embedded as a resource so it can be injected into WebView2 pages --> |
| 104 | + <!-- Framework references --> |
51 | 105 | <ItemGroup> |
52 | | - <EmbeddedResource Include="WebBridge\vscode-shim.js" /> |
| 106 | + <Reference Include="System" /> |
| 107 | + <Reference Include="System.Design" /> |
| 108 | + <Reference Include="System.Drawing" /> |
| 109 | + <Reference Include="PresentationCore" /> |
| 110 | + <Reference Include="PresentationFramework" /> |
| 111 | + <Reference Include="WindowsBase" /> |
| 112 | + <Reference Include="System.Xaml" /> |
53 | 113 | </ItemGroup> |
54 | 114 |
|
| 115 | + <!-- NuGet packages --> |
| 116 | + <ItemGroup> |
| 117 | + <PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.6.36389" ExcludeAssets="runtime" NoWarn="NU1604" /> |
| 118 | + <PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.6.2164" NoWarn="NU1604" /> |
| 119 | + <PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2478.35" /> |
| 120 | + <PackageReference Include="MessagePack" Version="2.5.187" /> |
| 121 | + <PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> |
| 122 | + <PackageReference Include="System.Text.Json" Version="8.0.5" /> |
| 123 | + </ItemGroup> |
| 124 | + |
| 125 | + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
| 126 | + <Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" /> |
| 127 | + |
55 | 128 | <!-- |
56 | 129 | Copy webview JS bundles from the vscode-extension build output into this project's |
57 | 130 | webview\ folder so they can be packaged inside the VSIX. |
58 | 131 | Prerequisite: run `npm run compile` in vscode-extension/ first. |
59 | 132 | --> |
60 | 133 | <Target Name="CopyWebviewBundles" BeforeTargets="Build"> |
61 | 134 | <ItemGroup> |
62 | | - <_WebviewBundle Include="..\..\vscode-extension\dist\webview\details.js" /> |
63 | | - <_WebviewBundle Include="..\..\vscode-extension\dist\webview\chart.js" /> |
64 | | - <_WebviewBundle Include="..\..\vscode-extension\dist\webview\usage.js" /> |
65 | | - <_WebviewBundle Include="..\..\vscode-extension\dist\webview\diagnostics.js" /> |
| 135 | + <_WebviewBundle Include="..\..\..\vscode-extension\dist\webview\details.js" /> |
| 136 | + <_WebviewBundle Include="..\..\..\vscode-extension\dist\webview\chart.js" /> |
| 137 | + <_WebviewBundle Include="..\..\..\vscode-extension\dist\webview\usage.js" /> |
| 138 | + <_WebviewBundle Include="..\..\..\vscode-extension\dist\webview\diagnostics.js" /> |
66 | 139 | </ItemGroup> |
67 | 140 | <MakeDir Directories="$(MSBuildProjectDirectory)\webview" /> |
68 | | - <Copy |
69 | | - SourceFiles="@(_WebviewBundle)" |
70 | | - DestinationFolder="$(MSBuildProjectDirectory)\webview\" |
71 | | - SkipUnchangedFiles="true" |
72 | | - ContinueOnError="true" /> |
73 | | - <Message Importance="high" |
74 | | - Text="Copied webview bundles from vscode-extension/dist/webview/ — rebuild vscode-extension if they are missing." /> |
| 141 | + <Copy SourceFiles="@(_WebviewBundle)" DestinationFolder="$(MSBuildProjectDirectory)\webview\" SkipUnchangedFiles="true" ContinueOnError="true" /> |
| 142 | + <Message Importance="high" Text="Copied webview bundles from vscode-extension/dist/webview/ — rebuild vscode-extension if they are missing." /> |
75 | 143 | </Target> |
76 | 144 |
|
77 | 145 | <!-- Include copied webview JS files inside the VSIX package --> |
|
0 commit comments