summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2016-12-01 18:05:41 +0000
committerHans Wennborg <hans@hanshq.net>2016-12-01 18:05:41 +0000
commite9485e57f9e9fd6e7ba06a303846d68a43ab761d (patch)
tree3cde8fa634096f2413e1aa5b36c7253848f5c54f /tools
parent2f42451024d418bb049e96de5579568ddc091975 (diff)
Fix VS2015 build of clang-format-vsix by using NuGet to pull in required assemblies
Also added a gitignore to help track the right items to commit. Patch by Antonio Maiorano <amaiorano@gmail.com>! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288393 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/clang-format-vs/.gitignore11
-rw-r--r--tools/clang-format-vs/CMakeLists.txt9
-rw-r--r--tools/clang-format-vs/ClangFormat/ClangFormat.csproj98
-rw-r--r--tools/clang-format-vs/ClangFormat/packages.config22
-rw-r--r--tools/clang-format-vs/README.txt22
5 files changed, 138 insertions, 24 deletions
diff --git a/tools/clang-format-vs/.gitignore b/tools/clang-format-vs/.gitignore
new file mode 100644
index 0000000000..6453dd8ece
--- /dev/null
+++ b/tools/clang-format-vs/.gitignore
@@ -0,0 +1,11 @@
+# Visual Studio files
+.vs/
+/packages/
+/ClangFormat/obj/
+/ClangFormat/bin/
+
+# Generated and copied files
+/ClangFormat/Key.snk
+/ClangFormat/license.txt
+/ClangFormat/clang-format.exe
+/ClangFormat/source.extension.vsixmanifest
diff --git a/tools/clang-format-vs/CMakeLists.txt b/tools/clang-format-vs/CMakeLists.txt
index fd0d6b028c..6d2ef73632 100644
--- a/tools/clang-format-vs/CMakeLists.txt
+++ b/tools/clang-format-vs/CMakeLists.txt
@@ -18,8 +18,15 @@ if (BUILD_CLANG_FORMAT_VS_PLUGIN)
configure_file("source.extension.vsixmanifest.in"
"${CMAKE_CURRENT_SOURCE_DIR}/ClangFormat/source.extension.vsixmanifest")
+ find_program(NUGET_EXE nuget PATHS ${NUGET_EXE_DIR})
+ if (NOT NUGET_EXE)
+ message(FATAL_ERROR "Could not find nuget.exe. Download from https://www.nuget.org/nuget.exe"
+ " and add parent directory to PATH or pass it via NUGET_EXE_DIR var.")
+ endif()
+
add_custom_target(clang_format_vsix ALL
- devenv "${CMAKE_CURRENT_SOURCE_DIR}/ClangFormat.sln" /Build Release
+ COMMAND ${NUGET_EXE} restore "${CMAKE_CURRENT_SOURCE_DIR}/ClangFormat.sln"
+ COMMAND devenv "${CMAKE_CURRENT_SOURCE_DIR}/ClangFormat.sln" /Build Release
DEPENDS clang_format_exe_for_vsix "${CMAKE_CURRENT_SOURCE_DIR}/ClangFormat/source.extension.vsixmanifest"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_SOURCE_DIR}/ClangFormat/bin/Release/ClangFormat.vsix"
diff --git a/tools/clang-format-vs/ClangFormat/ClangFormat.csproj b/tools/clang-format-vs/ClangFormat/ClangFormat.csproj
index d4107733a1..5ce601d649 100644
--- a/tools/clang-format-vs/ClangFormat/ClangFormat.csproj
+++ b/tools/clang-format-vs/ClangFormat/ClangFormat.csproj
@@ -35,6 +35,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
+ <TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -44,6 +45,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -53,27 +55,87 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RunCodeAnalysis>true</RunCodeAnalysis>
+ <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="envdte, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <HintPath>..\packages\VSSDK.DTE.7.0.3\lib\net20\envdte.dll</HintPath>
+ <EmbedInteropTypes>False</EmbedInteropTypes>
+ </Reference>
<Reference Include="Microsoft.CSharp" />
- <Reference Include="Microsoft.VisualStudio.CoreUtility, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="Microsoft.VisualStudio.Editor, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="Microsoft.VisualStudio.OLE.Interop" />
- <Reference Include="Microsoft.VisualStudio.Shell.Interop" />
- <Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0" />
- <Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0" />
+ <Reference Include="Microsoft.VisualStudio.CoreUtility, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\VSSDK.CoreUtility.10.0.4\lib\net40\Microsoft.VisualStudio.CoreUtility.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.Editor, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\VSSDK.Editor.10.0.4\lib\net40\Microsoft.VisualStudio.Editor.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <HintPath>..\packages\VSSDK.OLE.Interop.7.0.4\lib\net20\Microsoft.VisualStudio.OLE.Interop.dll</HintPath>
+ <Private>True</Private>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.Shell.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\VSSDK.Shell.10.10.0.3\lib\net40\Microsoft.VisualStudio.Shell.10.0.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\VSSDK.Shell.Immutable.10.10.0.3\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <HintPath>..\packages\VSSDK.Shell.Interop.7.0.4\lib\net20\Microsoft.VisualStudio.Shell.Interop.dll</HintPath>
+ <Private>True</Private>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <HintPath>..\packages\VSSDK.Shell.Interop.8.8.0.3\lib\net20\Microsoft.VisualStudio.Shell.Interop.8.0.dll</HintPath>
+ <Private>True</Private>
+ <Private>False</Private>
+ </Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0" />
- <Reference Include="Microsoft.VisualStudio.TextManager.Interop" />
- <Reference Include="Microsoft.VisualStudio.Shell.10.0">
- <Private>false</Private>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.Text.Data, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="Microsoft.VisualStudio.Text.Logic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="Microsoft.VisualStudio.Text.UI, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="Microsoft.VisualStudio.Text.UI.Wpf, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="Microsoft.VisualStudio.TextManager.Interop" />
- <Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0" />
+ <Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <HintPath>..\packages\VSSDK.Shell.Interop.9.9.0.3\lib\net20\Microsoft.VisualStudio.Shell.Interop.9.0.dll</HintPath>
+ <Private>True</Private>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.Text.Data, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\VSSDK.Text.10.0.4\lib\net40\Microsoft.VisualStudio.Text.Data.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.Text.Logic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\VSSDK.Text.10.0.4\lib\net40\Microsoft.VisualStudio.Text.Logic.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.Text.UI, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\VSSDK.Text.10.0.4\lib\net40\Microsoft.VisualStudio.Text.UI.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.Text.UI.Wpf, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\VSSDK.Text.10.0.4\lib\net40\Microsoft.VisualStudio.Text.UI.Wpf.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.TextManager.Interop">
+ <HintPath>..\packages\VSSDK.TextManager.Interop.7.0.4\lib\net20\Microsoft.VisualStudio.TextManager.Interop.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.TextManager.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.TextManager.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <HintPath>..\packages\VSSDK.TextManager.Interop.8.8.0.4\lib\net20\Microsoft.VisualStudio.TextManager.Interop.8.0.dll</HintPath>
+ <Private>True</Private>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="PresentationCore" />
+ <Reference Include="PresentationFramework" />
+ <Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <HintPath>..\packages\VSSDK.DTE.7.0.3\lib\net20\stdole.dll</HintPath>
+ <EmbedInteropTypes>False</EmbedInteropTypes>
+ </Reference>
<Reference Include="System" />
+ <Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Design" />
@@ -81,6 +143,7 @@
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
+ <Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<COMReference Include="EnvDTE">
@@ -165,6 +228,7 @@
</ItemGroup>
<ItemGroup>
<None Include="Key.snk" />
+ <None Include="packages.config" />
<None Include="source.extension.vsixmanifest">
<SubType>Designer</SubType>
</None>
@@ -228,4 +292,4 @@
<Target Name="AfterBuild">
</Target>
-->
-</Project>
+</Project> \ No newline at end of file
diff --git a/tools/clang-format-vs/ClangFormat/packages.config b/tools/clang-format-vs/ClangFormat/packages.config
new file mode 100644
index 0000000000..38f64ed3a6
--- /dev/null
+++ b/tools/clang-format-vs/ClangFormat/packages.config
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="VSSDK.CoreUtility" version="10.0.4" targetFramework="net40" />
+ <package id="VSSDK.CoreUtility.10" version="10.0.4" targetFramework="net40" />
+ <package id="VSSDK.DTE" version="7.0.3" targetFramework="net40" />
+ <package id="VSSDK.Editor" version="10.0.4" targetFramework="net40" />
+ <package id="VSSDK.Editor.10" version="10.0.4" targetFramework="net40" />
+ <package id="VSSDK.IDE" version="7.0.4" targetFramework="net40" />
+ <package id="VSSDK.IDE.10" version="10.0.4" targetFramework="net40" />
+ <package id="VSSDK.IDE.8" version="8.0.4" targetFramework="net40" />
+ <package id="VSSDK.IDE.9" version="9.0.3" targetFramework="net40" />
+ <package id="VSSDK.OLE.Interop" version="7.0.4" targetFramework="net40" />
+ <package id="VSSDK.Shell.10" version="10.0.3" targetFramework="net40" />
+ <package id="VSSDK.Shell.Immutable.10" version="10.0.3" targetFramework="net40" />
+ <package id="VSSDK.Shell.Interop" version="7.0.4" targetFramework="net40" />
+ <package id="VSSDK.Shell.Interop.8" version="8.0.3" targetFramework="net40" />
+ <package id="VSSDK.Shell.Interop.9" version="9.0.3" targetFramework="net40" />
+ <package id="VSSDK.Text" version="10.0.4" targetFramework="net40" />
+ <package id="VSSDK.Text.10" version="10.0.4" targetFramework="net40" />
+ <package id="VSSDK.TextManager.Interop" version="7.0.4" targetFramework="net40" />
+ <package id="VSSDK.TextManager.Interop.8" version="8.0.4" targetFramework="net40" />
+</packages> \ No newline at end of file
diff --git a/tools/clang-format-vs/README.txt b/tools/clang-format-vs/README.txt
index b23355d0ce..edfffed774 100644
--- a/tools/clang-format-vs/README.txt
+++ b/tools/clang-format-vs/README.txt
@@ -2,13 +2,23 @@ This directory contains a VSPackage project to generate a Visual Studio extensio
for clang-format.
Build prerequisites are:
-- Visual Studio 2013 Professional
-- Visual Studio 2013 SDK
-- Visual Studio 2010 Professional (?)
-- Visual Studio 2010 SDK (?)
+- Visual Studio 2015
+- Extensions SDK (you'll be prompted to install it if you open ClangFormat.sln)
-The extension is built using CMake by setting BUILD_CLANG_FORMAT_VS_PLUGIN=ON
-when configuring a Clang build, and building the clang_format_vsix target.
+The extension is built using CMake to generate the usual LLVM.sln by setting
+the following CMake vars:
+
+- BUILD_CLANG_FORMAT_VS_PLUGIN=ON
+
+- NUGET_EXE_PATH=path/to/nuget_dir (unless nuget.exe is already available in PATH)
+
+example:
+ cd /d C:\code\llvm
+ mkdir build & cd build
+ cmake -DBUILD_CLANG_FORMAT_VS_PLUGIN=ON -DNUGET_EXE_PATH=C:\nuget ..
+
+Once LLVM.sln is generated, build the clang_format_vsix target, which will build
+ClangFormat.sln, the C# extension application.
The CMake build will copy clang-format.exe and LICENSE.TXT into the ClangFormat/
directory so they can be bundled with the plug-in, as well as creating