Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
855f0cbbbf | ||
|
|
ddebf71e02 | ||
|
|
9d1faa791b | ||
|
|
e301b231db | ||
|
|
05ac4f3b6e | ||
|
|
12120e443b | ||
|
|
42b286909d | ||
|
|
ba4e07e361 | ||
|
|
b9610951d8 | ||
|
|
5de050ab62 | ||
|
|
eaf9df8551 | ||
|
|
37ead804bf | ||
|
|
bb5c1d49b6 | ||
|
|
d9c8de2951 | ||
|
|
ece2cbfe14 | ||
|
|
9269468a7b | ||
|
|
c9789a415e | ||
|
|
610c8b2901 | ||
|
|
802153883e | ||
|
|
2399e733b4 | ||
|
|
2e375112e6 | ||
|
|
1ac63f0158 | ||
|
|
42fc52b8f7 | ||
|
|
43c647e2d2 | ||
|
|
289ac4ab63 | ||
|
|
fc02982acc | ||
|
|
2305a74e6c | ||
|
|
4f74235ca1 | ||
|
|
ff65a3f285 | ||
|
|
db1c3b3f40 | ||
|
|
2d6d554cb1 | ||
|
|
332cf7be70 | ||
|
|
0a1fdee998 | ||
|
|
6ecc2d630b | ||
|
|
8ec7f02433 | ||
|
|
4e60574bf0 | ||
|
|
d80b1fc848 | ||
|
|
299b3a1cf7 | ||
|
|
9e06323ba7 | ||
|
|
e089900571 | ||
|
|
8c5b69dce6 | ||
|
|
91969770d5 | ||
|
|
2c6322631b | ||
|
|
63c81e27a2 | ||
|
|
96c68c4d0b | ||
|
|
244c9af3c6 | ||
|
|
8d68203727 | ||
|
|
01864b4d0c | ||
|
|
01b1e0d6f1 | ||
|
|
2e117c4b6d | ||
|
|
053ca3d8d1 | ||
|
|
3f19a0393a | ||
|
|
3a192c8089 | ||
|
|
f2c7ecbbdf | ||
|
|
bec7aa4aac | ||
|
|
faae66b304 | ||
|
|
3c72ce7459 | ||
|
|
48811959fd | ||
|
|
c6c49b2d45 | ||
|
|
0455cb33f5 | ||
|
|
0d98b02431 | ||
|
|
cad595a32c | ||
|
|
e536f20e36 | ||
|
|
94551bf689 | ||
|
|
7bc89acdf5 | ||
|
|
1982f4459a | ||
|
|
4bb88a51b7 | ||
|
|
83e5497a18 | ||
|
|
e57e51a839 | ||
|
|
9d0b86ad98 | ||
|
|
9a36d48d1e | ||
|
|
da756c9a4c | ||
|
|
997f952b86 | ||
|
|
77e748a5e1 | ||
|
|
9bcde198a5 | ||
|
|
b4166be89b | ||
|
|
eb25472f11 | ||
|
|
6ac340f602 | ||
|
|
31b9b74ca8 | ||
|
|
db4f18c70d | ||
|
|
2b9ea45e33 | ||
|
|
a66daa9ac0 | ||
|
|
99ea3b2a25 | ||
|
|
a2554a9f75 | ||
|
|
8370caf705 | ||
|
|
d60a9c82d5 | ||
|
|
293a2a84c3 | ||
|
|
73dd912fd6 | ||
|
|
68affaa4bc | ||
|
|
ea047cde78 | ||
|
|
5d35455492 | ||
|
|
7e7d661bf1 | ||
|
|
70b24f9097 | ||
|
|
7a814f930d | ||
|
|
0b432c07fd |
+8
-9
@@ -13,8 +13,7 @@
|
||||
/bin/test/data/temp.xml
|
||||
/bin/test/data/TestSettings.xml
|
||||
|
||||
/java_indexer/bin/
|
||||
/java_indexer/lib/
|
||||
/java_indexer/target/
|
||||
|
||||
/setup/Linux/lib/
|
||||
|
||||
@@ -22,13 +21,13 @@
|
||||
.idea
|
||||
.vscode
|
||||
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/SourcetrailPlugin/bin
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/SourcetrailPlugin/obj
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/SourcetrailPluginTests/bin/Debug
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/SourcetrailPluginTests/bin/Release
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/SourcetrailPluginTests/obj
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/SourcetrailPluginUtility/bin
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/SourcetrailPluginUtility/obj
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/SourcetrailExtension/bin
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/SourcetrailExtension/obj
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/SourcetrailExtensionTests/bin/Debug
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/SourcetrailExtensionTests/bin/Release
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/SourcetrailExtensionTests/obj
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/SourcetrailExtensionUtility/bin
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/SourcetrailExtensionUtility/obj
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/VCProjectEngineWrapperInterfaces/bin
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/VCProjectEngineWrapperInterfaces/obj
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/VCProjectEngineWrapper/bin
|
||||
|
||||
+11
-25
@@ -3,12 +3,12 @@
|
||||
- ./script/setup.sh
|
||||
- ./script/buildonly.sh all
|
||||
- ./script/buildonly.sh package
|
||||
- ./build/Release/app/Sourcetrail --licenseFile ./setup/license.txt
|
||||
- ./build/Release/app/Sourcetrail config -z ./setup/license.txt
|
||||
- cd ./bin/test
|
||||
- ../../build/Release/test/Sourcetrail_test
|
||||
|
||||
Linux64:
|
||||
image: st4ll1/coati_linux_64
|
||||
Linux64_test:
|
||||
image: st4ll1/coati_64
|
||||
stage: deploy
|
||||
only:
|
||||
- master
|
||||
@@ -21,7 +21,7 @@ Linux64:
|
||||
expire_in: 3 days
|
||||
|
||||
Linux64_tag:
|
||||
image: st4ll1/coati_linux_64
|
||||
image: st4ll1/coati_64
|
||||
stage: deploy
|
||||
only:
|
||||
- tags
|
||||
@@ -31,20 +31,19 @@ Linux64_tag:
|
||||
paths:
|
||||
- Sourcetrail*.tar.gz
|
||||
|
||||
Linux64_manual:
|
||||
image: st4ll1/coati_linux_64
|
||||
Linux64:
|
||||
image: st4ll1/coati_64
|
||||
stage: deploy
|
||||
except:
|
||||
- master
|
||||
when: manual
|
||||
<<: *script_definition
|
||||
artifacts:
|
||||
name: "$CI_JOB_NAME"
|
||||
paths:
|
||||
- Sourcetrail*.tar.gz
|
||||
expire_in: 3 days
|
||||
|
||||
Linux64_licenseGenerator:
|
||||
image: st4ll1/coati_linux_64
|
||||
image: st4ll1/coati_64
|
||||
stage: deploy
|
||||
when: manual
|
||||
script:
|
||||
@@ -58,11 +57,9 @@ Linux64_licenseGenerator:
|
||||
expire_in: 3 days
|
||||
|
||||
Linux32:
|
||||
image: st4ll1/coati_linux_32
|
||||
image: st4ll1/coati_32
|
||||
stage: deploy
|
||||
only:
|
||||
- master
|
||||
- triggers
|
||||
when: manual
|
||||
<<: *script_definition
|
||||
artifacts:
|
||||
name: "$CI_JOB_NAME"
|
||||
@@ -71,7 +68,7 @@ Linux32:
|
||||
expire_in: 3 days
|
||||
|
||||
Linux32_tag:
|
||||
image: st4ll1/coati_linux_32
|
||||
image: st4ll1/coati_32
|
||||
stage: deploy
|
||||
only:
|
||||
- tags
|
||||
@@ -81,14 +78,3 @@ Linux32_tag:
|
||||
paths:
|
||||
- Sourcetrail*.tar.gz
|
||||
|
||||
Linux32_manual:
|
||||
image: st4ll1/coati_linux_32
|
||||
stage: deploy
|
||||
except:
|
||||
- master
|
||||
when: manual
|
||||
<<: *script_definition
|
||||
artifacts:
|
||||
name: "$CI_JOB_NAME"
|
||||
paths:
|
||||
- Sourcetrail*.tar.gz
|
||||
|
||||
+38
-22
@@ -9,13 +9,27 @@ include(cmake/create_source_groups.cmake)
|
||||
include(cmake/version.cmake)
|
||||
include(cmake/version_setup.cmake)
|
||||
include(cmake/licenses.cmake)
|
||||
include(cmake/setWinXxBits.cmake)
|
||||
|
||||
|
||||
# prohibit in-source-builds
|
||||
IF(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
|
||||
MESSAGE(STATUS "In-source-builds are not allowed")
|
||||
MESSAGE(STATUS "Clean your source directory (e.g. delete the CMakeCache.txt file)")
|
||||
MESSAGE(FATAL_ERROR "Please create a separate build directory and call CMake again")
|
||||
ENDIF(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
|
||||
|
||||
# Variables --------------------------------------------------------------------
|
||||
|
||||
set(PROJECT_NAME Sourcetrail)
|
||||
set(PROJECT_NAME_LOWER_CASE sourcetrail)
|
||||
|
||||
# speed up recompiling on unix with ccache
|
||||
find_program(CCACHE_PROGRAM ccache)
|
||||
if(CCACHE_PROGRAM)
|
||||
# Support Unix Makefiles and Ninja
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
|
||||
endif()
|
||||
|
||||
set(APP_PROJECT_NAME "${PROJECT_NAME}")
|
||||
set(LIB_LICENSE_PROJECT_NAME "${PROJECT_NAME}_lib_license")
|
||||
set(LIB_GUI_PROJECT_NAME "${PROJECT_NAME}_lib_gui")
|
||||
@@ -28,6 +42,7 @@ set(TEST_PROJECT_NAME "${PROJECT_NAME}_test")
|
||||
set (APP_INDEXER_NAME "${PROJECT_NAME_LOWER_CASE}_indexer")
|
||||
|
||||
if (WIN32)
|
||||
include(cmake/setWinXxBits.cmake)
|
||||
set(PLATFORM_INCLUDE "includesWindows.h")
|
||||
# this adds the library path for VLD, must be done before the project target is created
|
||||
if(${WINXXBITS} STREQUAL "Win32")
|
||||
@@ -53,11 +68,10 @@ if(UNIX AND NOT APPLE)
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib/:$$ORIGIN/lib/")
|
||||
include(cmake/external.cmake)
|
||||
endif()
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
|
||||
# Settings ---------------------------------------------------------------------
|
||||
@@ -97,29 +111,30 @@ add_definitions(${CLANG_DEFINITIONS})
|
||||
set(Boost_USE_MULTITHREAD ON)
|
||||
set(Boost_USE_STATIC_LIBS ON)
|
||||
set(Boost_USE_STATIC_RUNTIME OFF)
|
||||
set(BOOST_LIBRARYDIR $ENV{BOOST_159_DIR})
|
||||
set(BOOST_LIBRARYDIR $ENV{BOOST_DIR})
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(BOOST_ROOT $ENV{BOOST_DIR})
|
||||
elseif(UNIX AND APPLE)
|
||||
set(BOOST_ROOT $ENV{BOOST_159_DIR})
|
||||
set(BOOST_ROOT $ENV{BOOST_DIR})
|
||||
set(Boost_NO_SYSTEM_PATHS ON)
|
||||
else()
|
||||
set(BOOST_INCLUDEDIR $ENV{BOOST_DIR})
|
||||
STRING(REGEX REPLACE "\\\\" "/" BOOST_LIBRARYDIR ${BOOST_LIBRARYDIR})
|
||||
|
||||
if(${WINXXBITS} STREQUAL "Win32")
|
||||
set(BOOST_ROOT "${BOOST_LIBRARYDIR}/win32")
|
||||
set(BOOST_LIBRARYDIR "${BOOST_LIBRARYDIR}/lib32-msvc-14")
|
||||
else()
|
||||
set(BOOST_ROOT "${BOOST_LIBRARYDIR}/win64")
|
||||
set(BOOST_LIBRARYDIR "${BOOST_LIBRARYDIR}/lib64-msvc-14")
|
||||
endif()
|
||||
set(Boost_NO_SYSTEM_PATHS ON)
|
||||
endif()
|
||||
|
||||
find_package(Boost 1.59 COMPONENTS system program_options filesystem date_time REQUIRED)
|
||||
find_package(Boost 1.64 COMPONENTS system program_options filesystem date_time REQUIRED)
|
||||
|
||||
# Botan -------------------------------------------------------------------------
|
||||
|
||||
set(BOTAN_VERSION "botan-1.11" "botan-2")
|
||||
set(BOTAN_VERSION "botan-2")
|
||||
|
||||
if(APPLE)
|
||||
find_library(BOTAN ${BOTAN_VERSION} $ENV{BOTAN_DIR}/release NO_DEFAULT_PATH)
|
||||
@@ -157,7 +172,11 @@ elseif(WIN32)
|
||||
set(BOTAN_INCLUDE_DIR "$ENV{BOTAN_DIR}/win64/build/include")
|
||||
endif()
|
||||
else()
|
||||
set(BOTAN_INCLUDE_DIR "$ENV{BOTAN_DIR}/build/include")
|
||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||
set(BOTAN_INCLUDE_DIR "$ENV{BOTAN_DIR}/release/build/include")
|
||||
else()
|
||||
set(BOTAN_INCLUDE_DIR "$ENV{BOTAN_DIR}/debug/build/include")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT BOTAN_INCLUDE_DIR)
|
||||
@@ -178,14 +197,13 @@ endif ()
|
||||
|
||||
add_subdirectory(src/lib_license)
|
||||
|
||||
add_library(${LIB_LICENSE_PROJECT_NAME} ${LIB_LICENSE_FILES})
|
||||
add_library(${LIB_LICENSE_PROJECT_NAME} STATIC ${LIB_LICENSE_FILES})
|
||||
|
||||
create_source_groups(${LIB_LICENSE_FILES})
|
||||
|
||||
set_property(
|
||||
TARGET ${LIB_LICENSE_PROJECT_NAME}
|
||||
PROPERTY INCLUDE_DIRECTORIES
|
||||
"${CMAKE_SOURCE_DIR}/src/lib_license"
|
||||
target_include_directories( ${LIB_LICENSE_PROJECT_NAME} PUBLIC
|
||||
"${CMAKE_SOURCE_DIR}/src/lib_license"
|
||||
"${CMAKE_BINARY_DIR}/src/lib_license"
|
||||
)
|
||||
|
||||
target_include_directories(${LIB_LICENSE_PROJECT_NAME} SYSTEM
|
||||
@@ -353,6 +371,8 @@ add_custom_target(
|
||||
|
||||
add_library(${LIB_GUI_PROJECT_NAME} ${LIB_GUI_FILES} ${CMAKE_BINARY_DIR}/src/lib_gui/version.h)
|
||||
|
||||
target_link_libraries(${LIB_GUI_PROJECT_NAME} Qt5::Widgets Qt5::Network)
|
||||
|
||||
# command for versioning script
|
||||
add_custom_command(
|
||||
TARGET versionnumber
|
||||
@@ -385,10 +405,6 @@ target_include_directories(${LIB_GUI_PROJECT_NAME} SYSTEM
|
||||
PUBLIC ${Boost_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
# Use the Widgets module from Qt 5.
|
||||
qt5_use_modules(${LIB_GUI_PROJECT_NAME} Widgets)
|
||||
qt5_use_modules(${LIB_GUI_PROJECT_NAME} Network)
|
||||
|
||||
# configure platform specific include file
|
||||
configure_file(
|
||||
"${PROJECT_SOURCE_DIR}/src/lib_gui/platform_includes/includes.h.in"
|
||||
@@ -484,13 +500,13 @@ if (WIN32)
|
||||
|
||||
add_executable(${APP_PROJECT_NAME} ${APP_FILES} ${CMAKE_BINARY_DIR}/Sourcetrail.rc)
|
||||
|
||||
# hide the console when running a release build.
|
||||
# also show the console when running a release build.
|
||||
set_target_properties(${APP_PROJECT_NAME} PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:CONSOLE /DEBUG:FASTLINK")
|
||||
set_target_properties(${APP_PROJECT_NAME} PROPERTIES COMPILE_DEFINITIONS_DEBUG "_CONSOLE")
|
||||
set_target_properties(${APP_PROJECT_NAME} PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/SUBSYSTEM:CONSOLE")
|
||||
set_target_properties(${APP_PROJECT_NAME} PROPERTIES COMPILE_DEFINITIONS_RELWITHDEBINFO "_CONSOLE")
|
||||
set_target_properties(${APP_PROJECT_NAME} PROPERTIES LINK_FLAGS_RELEASE "/ENTRY:\"mainCRTStartup\" /SUBSYSTEM:WINDOWS /DEBUG")
|
||||
set_target_properties(${APP_PROJECT_NAME} PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:WINDOWS")
|
||||
set_target_properties(${APP_PROJECT_NAME} PROPERTIES LINK_FLAGS_RELEASE "/ENTRY:\"mainCRTStartup\" /SUBSYSTEM:CONSOLE /DEBUG")
|
||||
set_target_properties(${APP_PROJECT_NAME} PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:CONSOLE")
|
||||
|
||||
# generate pdb for release build
|
||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
#### External Software
|
||||
|
||||
* JDK 1.8
|
||||
* QT 5.8
|
||||
* QT 5.9.1
|
||||
* CxxTest 4.3
|
||||
* Valgrind 3.9.0 (linux)
|
||||
* Clang & LLVM 3.9 (doesnt quite work for windows, use unix setup below and skip all the ninja stuff)(installation guide http://clang.llvm.org/docs/LibASTMatchersTutorial.html)
|
||||
* Boost 1.59
|
||||
* Botan 1.11.34
|
||||
* Clang & LLVM 4.0.1 (doesnt quite work for windows, use unix setup below and skip all the ninja stuff)(installation guide http://clang.llvm.org/docs/LibASTMatchersTutorial.html)
|
||||
* Boost 1.64
|
||||
* Botan 2.1.0
|
||||
|
||||
also something about java, but who knows...
|
||||
|
||||
@@ -18,15 +18,15 @@ also something about java, but who knows...
|
||||
|
||||
* CXX_TEST_DIR - .../cxxtest-4.3
|
||||
* CLANG_DIR - .../clang-llvm
|
||||
* BOOST_159_DIR - .../boost_1_59_0
|
||||
* BOTAN_DIR - .../Botan-1.11.34
|
||||
* BOOST_DIR - .../boost_1_64_0
|
||||
* BOTAN_DIR - .../Botan-2.1.0
|
||||
|
||||
For MacOS and Linux
|
||||
* QT_DIR - .../Qt/Qt5.8.0/5.8/<IDE>
|
||||
* QT_DIR - .../Qt/Qt5.9.1/5.9.1/<IDE>
|
||||
|
||||
For Windows:
|
||||
* QT_WIN32_DIR - .../Qt/Qt5.8.0/win32/5.8/msvc2015<IDE>
|
||||
* QT_WIN64_DIR - .../Qt/Qt5.8.0/win64/5.8/msvc2015_64<IDE>
|
||||
* QT_WIN32_DIR - .../Qt/Qt5.9.1/5.9.1/msvc2015<IDE>
|
||||
* QT_WIN64_DIR - .../Qt/Qt5.9.1/5.9.1/msvc2015_64<IDE>
|
||||
* VLD_DIR - .../Visual Leak Detector
|
||||
* path
|
||||
- apped path to git.exe
|
||||
@@ -42,7 +42,11 @@ Execute Cmake twice (once for each target compiler (32 and 64 bit)). Set the res
|
||||
##### Boost setup
|
||||
|
||||
For Windows:
|
||||
Build the Boost libs for 32 and 64 bit. Create the subdirectories ${BOOST_159_DIR}/win32 and ${BOOST_159_DIR}/win64 and copy the ${BOOST_159_DIR}/boost folder into each of those platform specific directories. Also move the platform specific libs into the respective ( ${BOOST_159_DIR}/win32/lib and ${BOOST_159_DIR}/win64/lib) folder.
|
||||
Build the Boost libs for 32 and 64 bit. Make sure that the platform specific libs are located in ${BOOST_DIR}/lib32-msvc-14 and ${BOOST_DIR}/lib64-msvc-14.
|
||||
|
||||
For Mac:
|
||||
$ ./bootstrap.sh --with-libraries=filesystem,program_options,system,date_time
|
||||
$ ./b2 --link=static --variant=release --threading=multi --runtime-link=static --cxxflags=-fPIC
|
||||
|
||||
##### Botan setup
|
||||
|
||||
@@ -71,7 +75,10 @@ Build release lib in ${BOTAN_DIR}/release
|
||||
Build debug lib in ${BOTAN_DIR}/debug
|
||||
|
||||
for Mac:
|
||||
$ python configure.py --disable-shared --disable-modules=darwin_secrandom
|
||||
$ mkdir debug/release
|
||||
$ cd debug/release
|
||||
$ python ../configure.py --disable-shared --disable-modules=darwin_secrandom (--with-debug-info)
|
||||
$ make -j 4
|
||||
|
||||
for Linux:
|
||||
$ python configure.py --disable-shared
|
||||
@@ -115,7 +122,7 @@ $ cd ../../../../../build_debug
|
||||
$ cmake -G Ninja -DLLVM_ENABLE_RTTI=ON ../llvm
|
||||
$ ninja -j4 check-all
|
||||
|
||||
$ cd ../release_build
|
||||
$ cd ../build_release
|
||||
$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RTTI=ON ../llvm
|
||||
$ ninja -j4 check-all
|
||||
|
||||
@@ -147,9 +154,14 @@ gifsicle --resize-height 18 trans.gif > loader.gif
|
||||
|
||||
### Changelog
|
||||
|
||||
#### 1.0 (beta)
|
||||
released 2017-06-07
|
||||
#### 2017.2
|
||||
released 2017-06-21
|
||||
|
||||
* Fixed crash when using shortcuts containing letters with focus on the graph on macOS (issue #390)
|
||||
* Improved Visual Studio plugin performance
|
||||
* Updated End User License Agreement and have users accept on first run on macOS and Linux
|
||||
* Fixed memory issues when using large Compilation Database files (issue #396)
|
||||
* Updated to JavaParser and JavaSymbolSolver
|
||||
* Fixed issue where black borders appeared around dialogs for some Linux window managers (issue #376)
|
||||
* Use platform default window decorations for UI dialogs
|
||||
* Code: Made snippet minimize/maximize buttons more interactive by showing hover states
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2017 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
@@ -93,7 +93,7 @@
|
||||
</title>
|
||||
|
||||
<ref_count>
|
||||
<text>#C4C4C4</text>
|
||||
<text>#D4D4D4</text>
|
||||
<background>#494949</background>
|
||||
</ref_count>
|
||||
</file>
|
||||
@@ -108,21 +108,21 @@
|
||||
</title>
|
||||
|
||||
<line_number>
|
||||
<text>#C4C4C4</text>
|
||||
<text>#D4D4D4</text>
|
||||
<inactive_text>#A0A0A0</inactive_text>
|
||||
<background>#494949</background>
|
||||
<marker>#C4C4C4</marker>
|
||||
<marker>#D4D4D4</marker>
|
||||
</line_number>
|
||||
|
||||
<syntax>
|
||||
<normal>#C4C4C4</normal>
|
||||
<normal>#D4D4D4</normal>
|
||||
<directive>#00A0B6</directive>
|
||||
<keyword>#00A0B6</keyword>
|
||||
<type>#FF4A52</type>
|
||||
<comment>#A0A0A4</comment>
|
||||
<number>#EE7326</number>
|
||||
<quotation>#D663D6</quotation>
|
||||
<function>#FBBA00</function>
|
||||
<keyword>#00BCD6</keyword>
|
||||
<type>#FF5961</type>
|
||||
<comment>#78946B</comment>
|
||||
<number>#FC7F30</number>
|
||||
<quotation>#DB77DB</quotation>
|
||||
<function>#FFCC3B</function>
|
||||
</syntax>
|
||||
|
||||
<selection>
|
||||
@@ -240,6 +240,9 @@
|
||||
<enum>
|
||||
<like>type</like>
|
||||
</enum>
|
||||
<union>
|
||||
<like>type</like>
|
||||
</union>
|
||||
<typedef>
|
||||
<like>type</like>
|
||||
</typedef>
|
||||
@@ -252,7 +255,7 @@
|
||||
|
||||
<function>
|
||||
<fill>
|
||||
<normal>#FBBA00</normal>
|
||||
<normal>#FFCC3B</normal>
|
||||
<focus>#FFD05A</focus>
|
||||
</fill>
|
||||
<border>
|
||||
@@ -269,8 +272,8 @@
|
||||
|
||||
<global_variable>
|
||||
<fill>
|
||||
<normal>#00A0B6</normal>
|
||||
<focus>#3BAFB2</focus>
|
||||
<normal>#00BCD6</normal>
|
||||
<focus>#38D3E8</focus>
|
||||
</fill>
|
||||
<border>
|
||||
<normal>transparent</normal>
|
||||
@@ -393,12 +396,12 @@
|
||||
</override>
|
||||
|
||||
<call>
|
||||
<normal>#FBBA00</normal>
|
||||
<normal>#DEA400</normal>
|
||||
<trail_focus>#FFFFFF</trail_focus>
|
||||
</call>
|
||||
|
||||
<use>
|
||||
<normal>#2A6484</normal>
|
||||
<normal>#00A0B6</normal>
|
||||
</use>
|
||||
|
||||
<template_argument>
|
||||
@@ -432,9 +435,9 @@
|
||||
</graph>
|
||||
<table>
|
||||
<background>#494949</background>
|
||||
<table>#C4C4C4</table>
|
||||
<table>#D4D4D4</table>
|
||||
<text>
|
||||
<normal>#C4C4C4</normal>
|
||||
<normal>#D4D4D4</normal>
|
||||
<active>black</active>
|
||||
</text>
|
||||
<table_line_1>
|
||||
@@ -448,7 +451,7 @@
|
||||
</table>
|
||||
<tab>
|
||||
<background>#494949</background>
|
||||
<active>#C4C4C4</active>
|
||||
<active>#D4D4D4</active>
|
||||
<hover>#878787</hover>
|
||||
<text>#878787</text>
|
||||
</tab>
|
||||
|
||||
@@ -5,26 +5,26 @@
|
||||
<background>white</background>
|
||||
|
||||
<button>
|
||||
<normal>#E0E0E0</normal>
|
||||
<hover>#B2B2B2</hover>
|
||||
<press>#626262</press>
|
||||
<normal>#D0D0D0</normal>
|
||||
<hover>#A2A2A2</hover>
|
||||
<press>#525252</press>
|
||||
<disabled>#F2F2F2</disabled>
|
||||
<icon>white</icon>
|
||||
<icon_disabled>#DEDEDE</icon_disabled>
|
||||
<icon_disabled>#CECECE</icon_disabled>
|
||||
</button>
|
||||
|
||||
<field>
|
||||
<text>black</text>
|
||||
<background>#E0E0E0</background>
|
||||
<highlight>#B2B2B2</highlight>
|
||||
<background>#D0D0D0</background>
|
||||
<highlight>#A2A2A2</highlight>
|
||||
</field>
|
||||
|
||||
<popup>
|
||||
<text>black</text>
|
||||
<by_text>#626262</by_text>
|
||||
<by_text>#525252</by_text>
|
||||
<background>white</background>
|
||||
<highlight>#D0D0D0</highlight>
|
||||
<line>#E0E0E0</line>
|
||||
<line>#D0D0D0</line>
|
||||
</popup>
|
||||
|
||||
<query>
|
||||
@@ -75,8 +75,8 @@
|
||||
<background>white</background>
|
||||
|
||||
<navigation>
|
||||
<text>#B2B2B2</text>
|
||||
<line>#B2B2B2</line>
|
||||
<text>#A2A2A2</text>
|
||||
<line>#A2A2A2</line>
|
||||
</navigation>
|
||||
|
||||
<file>
|
||||
@@ -85,8 +85,8 @@
|
||||
<title>
|
||||
<text>black</text>
|
||||
<normal>#E0E0E0</normal>
|
||||
<hover>#B2B2B2</hover>
|
||||
<press>#626262</press>
|
||||
<hover>#C2C2C2</hover>
|
||||
<press>#A2A2A2</press>
|
||||
<icon>black</icon>
|
||||
<border>white</border>
|
||||
<hatching>bright</hatching>
|
||||
@@ -119,7 +119,7 @@
|
||||
<directive>#1B8856</directive>
|
||||
<keyword>#1B8856</keyword>
|
||||
<type>#C1492D</type>
|
||||
<comment>#1A801A</comment>
|
||||
<comment>#6B9AB2</comment>
|
||||
<number>#C1315E</number>
|
||||
<quotation>#865F9E</quotation>
|
||||
<function>#CC9533</function>
|
||||
@@ -127,7 +127,7 @@
|
||||
|
||||
<selection>
|
||||
<text>black</text>
|
||||
<background>#E0E0E0</background>
|
||||
<background>#D0D0D0</background>
|
||||
</selection>
|
||||
|
||||
<annotation>
|
||||
@@ -173,7 +173,7 @@
|
||||
<text>#000000</text>
|
||||
</normal>
|
||||
<focus>
|
||||
<fill>#FFFF0000</fill>
|
||||
<fill>#CCFF0000</fill>
|
||||
</focus>
|
||||
</error>
|
||||
<fulltext>
|
||||
@@ -232,6 +232,9 @@
|
||||
<enum>
|
||||
<like>type</like>
|
||||
</enum>
|
||||
<union>
|
||||
<like>type</like>
|
||||
</union>
|
||||
<typedef>
|
||||
<like>type</like>
|
||||
</typedef>
|
||||
@@ -294,8 +297,8 @@
|
||||
|
||||
<file>
|
||||
<fill>
|
||||
<normal>#DDD</normal>
|
||||
<focus>#CCC</focus>
|
||||
<normal>#BEE0AF</normal>
|
||||
<focus>#A6D492</focus>
|
||||
</fill>
|
||||
<border>
|
||||
<normal>#203C3C3C</normal>
|
||||
@@ -347,7 +350,7 @@
|
||||
<normal>transparent</normal>
|
||||
</fill>
|
||||
<text>
|
||||
<normal>#B2B2B2</normal>
|
||||
<normal>#A2A2A2</normal>
|
||||
</text>
|
||||
</text>
|
||||
</node>
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
<directive>#1F9C62</directive>
|
||||
<keyword>#1F9C62</keyword>
|
||||
<type>#D95233</type>
|
||||
<comment>#A0A0A4</comment>
|
||||
<comment>#4E768A</comment>
|
||||
<number>#CC3463</number>
|
||||
<quotation>#9368AD</quotation>
|
||||
<function>#D69C36</function>
|
||||
@@ -137,12 +137,12 @@
|
||||
<fill>transparent</fill>
|
||||
</normal>
|
||||
<focus>
|
||||
<border>#F7F7F7</border>
|
||||
<border>#D5D5D5</border>
|
||||
<fill>transparent</fill>
|
||||
</focus>
|
||||
<active>
|
||||
<border>transparent</border>
|
||||
<fill>#F7F7F7</fill>
|
||||
<fill>#D5D5D5</fill>
|
||||
<text>#272728</text>
|
||||
</active>
|
||||
</token>
|
||||
@@ -171,7 +171,7 @@
|
||||
<error>
|
||||
<normal>
|
||||
<border>transparent</border>
|
||||
<fill>#A0FF0000</fill>
|
||||
<fill>#BBFF0000</fill>
|
||||
<text>#000000</text>
|
||||
</normal>
|
||||
<focus>
|
||||
@@ -235,6 +235,9 @@
|
||||
<enum>
|
||||
<like>type</like>
|
||||
</enum>
|
||||
<union>
|
||||
<like>type</like>
|
||||
</union>
|
||||
<typedef>
|
||||
<like>type</like>
|
||||
</typedef>
|
||||
@@ -396,8 +399,8 @@
|
||||
</macro_use>
|
||||
|
||||
<aggregation>
|
||||
<normal>#3D3D3D</normal>
|
||||
<focus>#4D4D4D</focus>
|
||||
<normal>#4D4D4D</normal>
|
||||
<focus>#6D6D6D</focus>
|
||||
</aggregation>
|
||||
</edge>
|
||||
</graph>
|
||||
|
||||
@@ -172,8 +172,6 @@
|
||||
#code_area {
|
||||
background-color: transparent;
|
||||
color: <color:code/snippet/syntax/normal>;
|
||||
font-family: "<setting:font_name>";
|
||||
font-size: <setting:font_size>px;
|
||||
selection-color: <color:code/snippet/selection/text>;
|
||||
selection-background-color: <color:code/snippet/selection/background>;
|
||||
}
|
||||
|
||||
@@ -35,10 +35,10 @@ QWidget#search_box_highlight {
|
||||
|
||||
QAbstractItemView#search_box_popup {
|
||||
background-color: <color:search/popup/background>;
|
||||
border: none;
|
||||
border: 1px solid <color:search/popup/line>;
|
||||
color: <color:search/popup/text>;
|
||||
font-family: "<setting:font_name>";
|
||||
margin: 8px 0 0;
|
||||
margin: 0;
|
||||
min-height: 26px;
|
||||
selection-background-color: <color:search/popup/highlight>;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ QAbstractItemView#search_box_popup {
|
||||
background: <color:search/button/normal>;
|
||||
border: none;
|
||||
border-radius: 12px;
|
||||
background-position: 15px 5px;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,10 @@ QAbstractItemView#search_box_popup {
|
||||
border-top-left-radius: 0px;
|
||||
}
|
||||
|
||||
#search_button:disabled, #home_button:disabled {
|
||||
background: <color:search/button/disabled>;
|
||||
}
|
||||
|
||||
#search_button:hover, #home_button:hover {
|
||||
background: <color:search/button/hover>;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,18 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#updateLabel {
|
||||
#updateButton {
|
||||
margin: 1px 0 3px;
|
||||
text-align: left;
|
||||
padding: 0;
|
||||
background: none;
|
||||
border: none;
|
||||
color: #007AC2;
|
||||
font-size: 12px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#updateCheckbox {
|
||||
color: black;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#tooltip {
|
||||
background-color: <color:code/file/background>;
|
||||
border: 1px solid <color:code/file/background>;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
#tooltip_title {
|
||||
color: <color:code/file/title/text>;
|
||||
padding: 3px;
|
||||
font-size: <setting:font_size>px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#tooltip_references {
|
||||
background-color: <color:code/file/ref_count/background>;
|
||||
color: <color:code/file/ref_count/text>;
|
||||
margin: 4px;
|
||||
padding: 3px 5px;
|
||||
border-radius: 8px;
|
||||
font-size: <setting:font_size-2>px;
|
||||
}
|
||||
|
||||
#tooltip_widget {
|
||||
background-color: <color:code/snippet/background>;
|
||||
border-bottom: 1px solid <color:code/file/background>;
|
||||
padding: 3px;
|
||||
color: <color:code/snippet/syntax/normal>;
|
||||
}
|
||||
@@ -4,7 +4,8 @@
|
||||
<!-- INTEGER: int e.g 123 -->
|
||||
<!-- DECIMAL: float e.g 123.456 -->
|
||||
<!-- STRING: string e.g hello -->
|
||||
<!-- COLOR: int int int int - rgba e.g. 125 125 125 255 -->
|
||||
<!-- UUID: string e.g. 00000000-0000-0000-0000-000000000000 -->
|
||||
<!-- TIME: string in format "%Y-%m-%d %H:%M:%S" -->
|
||||
|
||||
<config>
|
||||
<version><!-- INTEGER: Version number --></version>
|
||||
@@ -77,6 +78,13 @@
|
||||
</license>
|
||||
|
||||
<accepted_eula_version><!-- INTEGER: last accepted eula version --></accepted_eula_version>
|
||||
|
||||
<token><!-- UUID: identifier for this user --></token>
|
||||
|
||||
<update_check>
|
||||
<automatic><!-- BOOL: whether to check automatically for new software updates --></automatic>
|
||||
<time_stamp><!-- TIME: time of the last update check --></time_stamp>
|
||||
</update_check>
|
||||
</user>
|
||||
|
||||
<network>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<source_path>./src/main/java</source_path>
|
||||
<source_path>./target/generated-sources/javacc</source_path>
|
||||
</source_paths>
|
||||
<use_jre_system_library>1</use_jre_system_library>
|
||||
<standard>8</standard>
|
||||
</source_group_7a9e75fc-2cad-42d5-8c5b-c86d02f7b4e4>
|
||||
</source_groups>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
|
||||
#include "graph_tutorial_1.h"
|
||||
#include "graph_tutorial_5.h"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
@@ -59,7 +60,7 @@ public:
|
||||
// click the edge?
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
static int this_last_member;
|
||||
static ClickMeLater this_last_member;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -10,29 +10,23 @@ class ProducerOfTheLastMember
|
||||
public:
|
||||
void in()
|
||||
{
|
||||
ClassWithHiddenMembers::this_last_member++;
|
||||
ClassWithHiddenMembers::this_last_member.produce();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// 7 - THAT'S IT
|
||||
// You completed the tutorial on the graph view. There is still more to learn
|
||||
// but I guess you will figure it out on your own. One last thing: If you see
|
||||
// an element with a hatched background please call us. It's a runaway!
|
||||
// Just kidding. Those are elements that are used within your code, but have no
|
||||
// definition anywhere in your source folder (like the "int" symbol on the
|
||||
// right hand side of the graph). So if you click them, Sourcetrail will display
|
||||
// all the relations for the element, but the code view won't show a
|
||||
// definition. If you want to learn more about Sourcetrail, go back to the central
|
||||
// hub. It is called in the function below but you can also try to get there
|
||||
// using only the graph.
|
||||
// 7 - ADVANCED TRAINING
|
||||
// Now that we have covered all the basics of navigating code using the graph,
|
||||
// I'd like to conclude this section of the tutorial by showing you a special
|
||||
// feature. Activate "ClickMeLater" in the far right of the graph when you are
|
||||
// ready.
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
private:
|
||||
void the()
|
||||
{
|
||||
if (ClassWithHiddenMembers::this_last_member <= 0);
|
||||
if (ClassWithHiddenMembers::this_last_member.isPositive())
|
||||
{
|
||||
the_central_hub();
|
||||
}
|
||||
@@ -40,7 +34,7 @@ private:
|
||||
|
||||
void codeview()
|
||||
{
|
||||
ClassWithHiddenMembers::this_last_member *= 2;
|
||||
ClassWithHiddenMembers::this_last_member.produce();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ class ConsumerOfTheLastMember
|
||||
public:
|
||||
void go()
|
||||
{
|
||||
ClassWithHiddenMembers::this_last_member = 42;
|
||||
ClassWithHiddenMembers::this_last_member.consume();
|
||||
}
|
||||
|
||||
void on()
|
||||
{
|
||||
ClassWithHiddenMembers::this_last_member--;
|
||||
ClassWithHiddenMembers::this_last_member.consume();
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
//------------------------------------------------------------------------------
|
||||
void reading()
|
||||
{
|
||||
ClassWithHiddenMembers::this_last_member /= 2;
|
||||
ClassWithHiddenMembers::this_last_member.consume();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
#ifndef GRAPH_TUTORIAL_5_H
|
||||
#define GRAPH_TUTORIAL_5_H
|
||||
|
||||
|
||||
|
||||
#include "graph_tutorial_6.h"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// 8 - EXPANDING THE SCOPE
|
||||
// Showing only one level of dependencies in the graph works well if you want
|
||||
// to get a quick overview on the parts of your codebase that are related to a
|
||||
// certain symbol. So using the graph makes sure that you don't overlook any
|
||||
// relation while planning to modify the source code. But sometimes that is not
|
||||
// enough.
|
||||
// Sometimes you are interested in a whole call graph for a certain function or
|
||||
// you want to see the complete inheritance chain of a specific class and you
|
||||
// want to expand the scope shown by the graph.
|
||||
// Do you see the small icon on the upper left of the graph? Use it to show the
|
||||
// depth graph controls and click the "show base hierarchy" button.
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class ClickMeLater: public JustMoveOn, public NothingToSeeHere
|
||||
{
|
||||
public:
|
||||
void produce() { value++; }
|
||||
|
||||
void consume() { value--; }
|
||||
|
||||
bool isPositive() { return value > 0; }
|
||||
|
||||
int value;
|
||||
};
|
||||
|
||||
#endif // GRAPH_TUTORIAL_5_H
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
#ifndef GRAPH_TUTORIAL_6_H
|
||||
#define GRAPH_TUTORIAL_6_H
|
||||
|
||||
|
||||
#include <string>
|
||||
|
||||
class BoringClass
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// 9 - THAT'S IT
|
||||
// Great work! You have found this previously hidden base class. Of course you
|
||||
// can also use the depth graph controls to expand the all classes that derive
|
||||
// from a selected symbol or, if the active symbol is a function or a method it
|
||||
// allows you to display the caller or callee graph.
|
||||
// You completed the tutorial on the graph view. There is still more to learn
|
||||
// but I guess you will figure it out on your own. One last thing: If you see
|
||||
// an element with a hatched background please call us. It's a runaway!
|
||||
// Just kidding. Those are elements that are used within your code, but have no
|
||||
// definition anywhere in your source folder (like the "string" symbol on the
|
||||
// right hand side of the graph). So if you click them, Sourcetrail will
|
||||
// display all the relations for the element, but the code view won't show a
|
||||
// definition. If you want to learn more about Sourcetrail, use the graph to go
|
||||
// back to the central hub.
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class click_me_to_continue
|
||||
{
|
||||
void method(std::string s)
|
||||
{
|
||||
the_central_hub();
|
||||
}
|
||||
};
|
||||
|
||||
class NothingToSeeHere: public BoringClass, public click_me_to_continue
|
||||
{
|
||||
};
|
||||
|
||||
class JustMoveOn
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
#endif // GRAPH_TUTORIAL_6_H
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
../target
|
||||
@@ -24,6 +24,16 @@ Settings.cpp WARNING: File for Settings not found: data/SettingsTestSuite/wrong_
|
||||
SourceLocationCollection.cpp ERROR: SourceLocation has wrong boundaries: file.c 2:3 2:1
|
||||
SourceLocationCollection.cpp ERROR: SourceLocation has wrong boundaries: file.c 4:1 1:10
|
||||
TextAccess.cpp ERROR: Could not open file path/to/test.h
|
||||
StorageTransformationAnonymousTypedef.cpp INFO: Applying storage transformation to rename anonymous types inside typedefs.
|
||||
StorageTransformationAnonymousTypedef.cpp INFO: Renamed 1 types.
|
||||
StorageTransformationAnonymousTypedef.cpp INFO: Applying storage transformation to rename anonymous types inside typedefs.
|
||||
StorageTransformationAnonymousTypedef.cpp INFO: Renamed 1 types.
|
||||
StorageTransformationAnonymousTypedef.cpp INFO: Applying storage transformation to rename anonymous types inside typedefs.
|
||||
StorageTransformationAnonymousTypedef.cpp INFO: Renamed 1 types.
|
||||
StorageTransformationAnonymousTypedef.cpp INFO: Applying storage transformation to rename anonymous types inside typedefs.
|
||||
StorageTransformationAnonymousTypedef.cpp INFO: Renamed 1 types.
|
||||
StorageTransformationAnonymousTypedef.cpp INFO: Applying storage transformation to rename anonymous types inside typedefs.
|
||||
StorageTransformationAnonymousTypedef.cpp INFO: Renamed 0 types.
|
||||
TextAccess.cpp WARNING: Index 'firstLine' has to be lower or equal index 'lastLine', is 3 > 2
|
||||
TextAccess.cpp WARNING: Tried to access index 10. Maximum index is 8
|
||||
TextAccess.cpp WARNING: Tried to access index 10. Maximum index is 8
|
||||
@@ -73,3 +83,7 @@ TextAccess.cpp WARNING: Line numbers start with one, is 0
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
include(cmake/external.cmake)
|
||||
|
||||
if (UNIX AND APPLE)
|
||||
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||
@@ -38,6 +37,7 @@ endif()
|
||||
# Remove unwanted flags
|
||||
string(REPLACE "-fno-exceptions" "" CLANG_DEFINITIONS "${CLANG_DEFINITIONS}")
|
||||
string(REPLACE "-fno-rtti" "" CLANG_DEFINITIONS "${CLANG_DEFINITIONS}")
|
||||
string(REPLACE "-std=c++11" "" CLANG_DEFINITIONS "${CLANG_DEFINITIONS}")
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
string(REPLACE "-Wcovered-switch-default" "" CLANG_DEFINITIONS "${CLANG_DEFINITIONS}")
|
||||
@@ -49,10 +49,6 @@ if(UNIX AND NOT APPLE)
|
||||
OUTPUT_VARIABLE CLANG_INCLUDE_DIRS
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
#set(CLANG_INCLUDE_DIRS
|
||||
#"${EXTERNAL_SRC}/clang/include"
|
||||
#"${CLANG_BUILD_PATH}/tools/clang/include"
|
||||
#)
|
||||
else()
|
||||
set(CLANG_INCLUDE_DIRS
|
||||
"$ENV{CLANG_DIR}/llvm/tools/clang/include"
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
const std::string PRIVATE_KEY = "@KEY@";
|
||||
const char PRIVATE_KEY[] = "@KEY@";
|
||||
|
||||
#endif // PRIVATE_KEY_H
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
const std::string PUBLIC_KEY = "@KEY@";
|
||||
const char PUBLIC_KEY[] = "@KEY@";
|
||||
|
||||
#endif // PUBLIC_KEY_H
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
|
||||
find_package(PythonInterp REQUIRED)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/script/getSystemString.py"
|
||||
OUTPUT_VARIABLE SYSSTRING
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
set(EXTERNAL_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../Sourcetrail_External")
|
||||
set(EXTERNAL_SRC "${EXTERNAL_ROOT}/src")
|
||||
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||
set(EXTERNAL_BUILD "${EXTERNAL_ROOT}/${SYSSTRING}/Debug")
|
||||
else()
|
||||
set(EXTERNAL_BUILD "${EXTERNAL_ROOT}/${SYSSTRING}/Release")
|
||||
endif()
|
||||
|
||||
@@ -30,8 +30,9 @@ AddLicense("JavaSymbolSolver" "https://github.com/ftomassetti/java-symbol-solver
|
||||
AddLicense("Javaparser" "http://javaparser.org/" "${LICENSEFOLDER}/license_javaparser.txt")
|
||||
AddLicense("Javaslang" "http://www.javaslang.io/" "${LICENSEFOLDER}/license_javaslang.txt")
|
||||
AddLicense("Javassist" "http://www.javassist.org/" "${LICENSEFOLDER}/license_javassist.txt")
|
||||
AddLicense("OpenSSL" "https://www.openssl.org/" "${LICENSEFOLDER}/license_openssl.txt")
|
||||
AddLicense("Qt" "http://qt.io" "${LICENSEFOLDER}/license_qt.txt")
|
||||
AddLicense("TinyXMl" "http://www.grinninglizard.com/tinyxml2/" "${LICENSEFOLDER}/license_tinyxml.txt")
|
||||
AddLicense("TinyXML" "http://www.grinninglizard.com/tinyxml2/" "${LICENSEFOLDER}/license_tinyxml.txt")
|
||||
|
||||
set(LICENSE_ARRAY "${LICENSE_ARRAY}\n")
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ function(AddSharedToComponent componentName)
|
||||
COMPONENT ${componentName}
|
||||
PATTERN "log/*" EXCLUDE
|
||||
PATTERN "data/src" EXCLUDE
|
||||
PATTERN "data/gui/installer" EXCLUDE
|
||||
PATTERN "projects" EXCLUDE
|
||||
PATTERN "data/install" EXCLUDE
|
||||
PATTERN "ProjectSettings_template.xml" EXCLUDE
|
||||
|
||||
@@ -15,18 +15,18 @@ set(binPath ${CMAKE_CURRENT_LIST_DIR}/../build/Release/app/Sourcetrail)
|
||||
set(projPath ${CMAKE_CURRENT_LIST_DIR}/../bin/app/user/projects)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${binPath} -z ${CMAKE_CURRENT_LIST_DIR}/../setup/license.txt
|
||||
COMMAND ${binPath} config -z ${CMAKE_CURRENT_LIST_DIR}/../setup/license.txt
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${binPath} -f -d ${projPath}/tictactoe/tictactoe.srctrlprj
|
||||
COMMAND ${binPath} index --full ${projPath}/tictactoe/tictactoe.srctrlprj
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${binPath} -f -d ${projPath}/tutorial/tutorial.srctrlprj
|
||||
COMMAND ${binPath} index --full ${projPath}/tutorial/tutorial.srctrlprj
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${binPath} -f -d ${projPath}/javaparser/javaparser.srctrlprj
|
||||
COMMAND ${binPath} index --full ${projPath}/javaparser/javaparser.srctrlprj
|
||||
)
|
||||
|
||||
|
||||
@@ -100,6 +100,8 @@
|
||||
<File Id='GraphTutorial2Header' Name='graph_tutorial_2.h' DiskId='1' Source='./../../../bin/app/user/projects/tutorial/src/graph_tutorial_2.h' KeyPath='no' />
|
||||
<File Id='GraphTutorial3Header' Name='graph_tutorial_3.h' DiskId='1' Source='./../../../bin/app/user/projects/tutorial/src/graph_tutorial_3.h' KeyPath='no' />
|
||||
<File Id='GraphTutorial4Header' Name='graph_tutorial_4.h' DiskId='1' Source='./../../../bin/app/user/projects/tutorial/src/graph_tutorial_4.h' KeyPath='no' />
|
||||
<File Id='GraphTutorial5Header' Name='graph_tutorial_5.h' DiskId='1' Source='./../../../bin/app/user/projects/tutorial/src/graph_tutorial_5.h' KeyPath='no' />
|
||||
<File Id='GraphTutorial6Header' Name='graph_tutorial_6.h' DiskId='1' Source='./../../../bin/app/user/projects/tutorial/src/graph_tutorial_6.h' KeyPath='no' />
|
||||
<File Id='MainCpp' Name='main.cpp' DiskId='1' Source='./../../../bin/app/user/projects/tutorial/src/main.cpp' KeyPath='no' />
|
||||
<File Id='MyFirstStepHeader' Name='my_first_step.h' DiskId='1' Source='./../../../bin/app/user/projects/tutorial/src/my_first_step.h' KeyPath='no' />
|
||||
<File Id='MyNextStepHeader' Name='my_next_step.h' DiskId='1' Source='./../../../bin/app/user/projects/tutorial/src/my_next_step.h' KeyPath='no' />
|
||||
|
||||
@@ -209,16 +209,20 @@
|
||||
<File Id='apiMsWinCrtUtility_l1_1_0' Name='api-ms-win-crt-utility-l1-1-0.dll' DiskId='1' Source='$(var.PlatformSourceFolder)/api-ms-win-crt-utility-l1-1-0.dll' KeyPath='yes' />
|
||||
</Component>
|
||||
|
||||
<Component Id='ucrtbaseDll' Guid='*' Win64="$(var.Win64)">
|
||||
<File Id='ucrtbase' Name='ucrtbase.dll' DiskId='1' Source='$(var.PlatformSourceFolder)/ucrtbase.dll' KeyPath='yes' />
|
||||
<Component Id='libeay32_dll' Guid='*' Win64="$(var.Win64)">
|
||||
<File Id='libeay32' Name='libeay32.dll' DiskId='1' Source='$(var.PlatformSourceFolder)/libeay32.dll' KeyPath='yes' />
|
||||
</Component>
|
||||
|
||||
<Component Id='msvcp140_dll' Guid='*' Win64="$(var.Win64)">
|
||||
<File Id='msvcp140' Name='msvcp140.dll' DiskId='1' Source='$(var.PlatformSourceFolder)/msvcp140.dll' KeyPath='yes' />
|
||||
</Component>
|
||||
|
||||
<Component Id='qtConf' Guid='*' Win64="$(var.Win64)">
|
||||
<File Id='qt' Name='qt.conf' DiskId='1' Source='$(var.PlatformSourceFolder)/qt.conf' KeyPath='yes' />
|
||||
</Component>
|
||||
|
||||
<Component Id='msvcp140_dll' Guid='*' Win64="$(var.Win64)">
|
||||
<File Id='msvcp140' Name='msvcp140.dll' DiskId='1' Source='$(var.PlatformSourceFolder)/msvcp140.dll' KeyPath='yes' />
|
||||
<Component Id='ucrtbaseDll' Guid='*' Win64="$(var.Win64)">
|
||||
<File Id='ucrtbase' Name='ucrtbase.dll' DiskId='1' Source='$(var.PlatformSourceFolder)/ucrtbase.dll' KeyPath='yes' />
|
||||
</Component>
|
||||
|
||||
<Component Id='vcruntime140_dll' Guid='*' Win64="$(var.Win64)">
|
||||
@@ -656,15 +660,19 @@
|
||||
<File Id='TabbedView' Name='tabbed_view.css' DiskId='1' Source='./../../../bin/app/data/gui/tabbed_view/tabbed_view.css' KeyPath='yes' />
|
||||
</Component>
|
||||
</Directory>
|
||||
|
||||
<Directory Id='DataTooltipView' Name='tooltip_view'>
|
||||
<Component Id='TooltipViewCss' Guid='*' Win64="$(var.Win64)">
|
||||
<File Id='TooltipView' Name='tooltip_view.css' DiskId='1' Source='./../../../bin/app/data/gui/tooltip_view/tooltip_view.css' KeyPath='yes' />
|
||||
</Component>
|
||||
</Directory>
|
||||
|
||||
<Directory Id='DataUndoRedoView' Name='undoredo_view'>
|
||||
|
||||
<Component Id='UndoRedoViewCss' Guid='*' Win64="$(var.Win64)">
|
||||
<File Id='UndoRedoView' Name='undoredo_view.css' DiskId='1' Source='./../../../bin/app/data/gui/undoredo_view/undoredo_view.css' KeyPath='yes' />
|
||||
</Component>
|
||||
|
||||
|
||||
<Directory Id='DataUndoRedoViewImages' Name='images'>
|
||||
|
||||
<Component Id='ArrowLeftPng' Guid='*' Win64="$(var.Win64)">
|
||||
<File Id='ArrowLeft' Name='arrow_left.png' DiskId='1' Source='./../../../bin/app/data/gui/undoredo_view/images/arrow_left.png' KeyPath='yes' />
|
||||
</Component>
|
||||
@@ -674,7 +682,6 @@
|
||||
<Component Id='HistoryPng' Guid='*' Win64="$(var.Win64)">
|
||||
<File Id='History' Name='history.png' DiskId='1' Source='./../../../bin/app/data/gui/undoredo_view/images/history.png' KeyPath='yes' />
|
||||
</Component>
|
||||
|
||||
</Directory>
|
||||
</Directory>
|
||||
|
||||
|
||||
@@ -218,9 +218,10 @@
|
||||
<ComponentRef Id='apiMsWinCrtString_l1_1_0Dll'/>
|
||||
<ComponentRef Id='apiMsWinCrtTime_l1_1_0Dll'/>
|
||||
<ComponentRef Id='apiMsWinCrtUtility_l1_1_0Dll'/>
|
||||
<ComponentRef Id='ucrtbaseDll'/>
|
||||
<ComponentRef Id='qtConf'/>
|
||||
<ComponentRef Id='libeay32_dll'/>
|
||||
<ComponentRef Id='msvcp140_dll'/>
|
||||
<ComponentRef Id='qtConf'/>
|
||||
<ComponentRef Id='ucrtbaseDll'/>
|
||||
<ComponentRef Id='vcruntime140_dll'/>
|
||||
|
||||
<ComponentRef Id='QWindowsDll'/>
|
||||
@@ -357,6 +358,8 @@
|
||||
|
||||
<ComponentRef Id='TabbedViewCss'/>
|
||||
|
||||
<ComponentRef Id='TooltipViewCss'/>
|
||||
|
||||
<ComponentRef Id='UndoRedoViewCss'/>
|
||||
<ComponentRef Id='ArrowLeftPng'/>
|
||||
<ComponentRef Id='ArrowRightPng'/>
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#vs-sourcetrail
|
||||
|
||||
The Visual Studio extension source code is hosted at Github.
|
||||
|
||||
The extension is available in the Visual Studio Marketplace. To install this extension follow these steps:
|
||||
* open Visual Studio
|
||||
* from the menu bar select `Tools` -> `Extensions and Updates...`
|
||||
* in the `Extensions and Updates` dialog choose `Online` -> `Visual Studio Gallery`
|
||||
* press `Ctrl` + `E` and enter "Sourcetrail Extension" into the search bar
|
||||
* click the install button
|
||||
|
||||
Link to the repository: [vs-sourcetrail](https://github.com/CoatiSoftware/vs-sourcetrail).
|
||||
@@ -1,96 +0,0 @@
|
||||
-Check latest plugin version is installed
|
||||
-Start VS and load a C/C++ solution (best mixed with multiple projects)
|
||||
-Check all projects are loaded in Solution Explorer
|
||||
-Check Plugin Logging and Obfuscation is off
|
||||
-VS Menu Bar -> Tools -> Options -> Sourcetrail -> Logging & Obfuscation is off
|
||||
-Delete log file and dictionary for current VS session if present
|
||||
-delete log file for current session at ..AppData/Local/Coati Software/Plugin/VS if present
|
||||
-delete dictionary file for current session at ..AppData/Local/Coati Software/Plugin/VS if present
|
||||
-Create CDB from solution
|
||||
-Check all C/C++ projects listed in CDB dialogue
|
||||
-Check eventual non-C/C++ projects are not listed
|
||||
-Check all projects unselected
|
||||
-Check 'Create' Button is disabled
|
||||
-Select one project
|
||||
-Check 'Create' Button is enabled
|
||||
-Click 'De/Select All'
|
||||
-Check all projects selected
|
||||
-Click 'De/Select All'
|
||||
-Check no project selected
|
||||
-Click 'De/Select All'
|
||||
-Check all projects selected
|
||||
-Check all Solution Configurations are listed in the Configuration dropdown
|
||||
-Check all Solution Platforms are listed in the Platform dropdown
|
||||
-Copy target location to clip board
|
||||
-Click 'Browse'
|
||||
-Check Folder Browser opens
|
||||
-Select a different folder
|
||||
-Check target folder field changed to selected folder
|
||||
-Paste old target location
|
||||
-Reopen Folder Browser and check it's set to old target location
|
||||
-Click Create
|
||||
-Wait for CDB to be finished
|
||||
-check progress bar shows progress
|
||||
-Check finished CDB
|
||||
-check at correct location with correct name
|
||||
-check CDB file is non-empty (at least estimate whether number of lines in CDB coincides with VS solution)
|
||||
-Check no new Log file or Dictionary file was created
|
||||
-Check ..AppData/Local/Coati Software/Plugin/VS for no new log created
|
||||
-Check ..AppData/Local/Coati Software/Plugin/VS for no new dictionary created
|
||||
-Turn on Logging
|
||||
-VS Menu Bar -> Tools -> Options -> Sourcetrail -> Logging ON & Obfuscation OFF
|
||||
-Enable VS Output Window
|
||||
-VS Menu Bar -> View -> Output
|
||||
-In Output Window, show Sourcetrail log (Show Output from: Sourcetrail Log)
|
||||
-Create CDB from solution again
|
||||
-Check location and name is the same as last time
|
||||
-Check dialogue asking whether to overwrite old file or not
|
||||
-Click no
|
||||
-Check number appended to file name
|
||||
-Create CDB with the new name
|
||||
-Check VS Output Window displays messages during creation
|
||||
-Check project- and file names and directories are in clear text
|
||||
-Check finished CDB
|
||||
-check at correct location with correct name
|
||||
-check CDB file is non-empty (at least estimate whether number of lines in CDB coincides with VS solution)
|
||||
-Unload a project in the Solution Explorer
|
||||
-Check new Log file but no Dictionary file was created
|
||||
-Check ..AppData/Local/Coati Software/Plugin/VS for new log created
|
||||
-Check ..AppData/Local/Coati Software/Plugin/VS for no new dictionary created
|
||||
-Turn on Obfuscation
|
||||
-VS Menu Bar -> Tools -> Options -> Sourcetrail -> Logging ON & Obfuscation ON
|
||||
-Create CDB from solution again
|
||||
-Check unloaded project is not in the listed projects in the dialogue
|
||||
-Check location and name is the same as first time
|
||||
-Check dialogue asking whether to overwrite old file or not
|
||||
-Click yes
|
||||
-Click Create
|
||||
-Check VS Output Window displays messages during creation
|
||||
-Check project- and file names and directories are obfuscated (a0, b0, c0,...)
|
||||
-Check finished CDB
|
||||
-check at correct location with correct name
|
||||
-check CDB file is smaller now (reduced size has to make sense considering the missing project)
|
||||
-Check new Log entries and Dictionary file was created
|
||||
-Check ..AppData/Local/Coati Software/Plugin/VS for no new log file
|
||||
-Check the log file created in this session at ..AppData/Local/Coati Software/Plugin/VS for new entries
|
||||
-Check new entries are using obfuscated names
|
||||
-Check ..AppData/Local/Coati Software/Plugin/VS for new dictionary created
|
||||
-Create CDB from solution again
|
||||
-Check location and name is the same as first time
|
||||
-Check dialogue asking whether to overwrite old file or not
|
||||
-Click no
|
||||
-Check number appended to file name
|
||||
-Check number is one higher than number from 2nd CDB
|
||||
-Click Create
|
||||
-Close Progress Bar before CDB is finished
|
||||
-Check no new CDB was created
|
||||
-Switch to Sourcetrail
|
||||
-Keep Visual Studio running
|
||||
-Open the 'New Project From Visual Studio Solution'
|
||||
-Click 'Create CDB' button
|
||||
-Check 'Create Compilation Database' dialog opens
|
||||
-Create a new CDB with Settings of your choice
|
||||
-Wait for CDB to be finished
|
||||
-Click 'Yes' in the 'CDB finished' dialog
|
||||
-Switch back to Sourcetrail
|
||||
-Check prefilled data is correct
|
||||
@@ -1,11 +0,0 @@
|
||||
------------
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
Json.NET
|
||||
-Install
|
||||
-Rightclick on 'References'
|
||||
-Click 'Manage NuGet Packages'
|
||||
-Search 'json'
|
||||
-Install 'Newtsoft.Json'
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
These Edge Cases should be considered in a dedicated Test Solution for the Plugin
|
||||
|
||||
-Non C/C++ Projects
|
||||
-include projects that are not C/C++ based
|
||||
-those should be ignored by the plugin
|
||||
-not show up in the project list when creating a CDB
|
||||
-not show up in the resulting CDB
|
||||
|
||||
-Solution Folders
|
||||
-the solution should include Solution Folders with Projects inside
|
||||
-at least two levels deep
|
||||
|
||||
-Include Paths
|
||||
-add at least one include path to Project->Properties->Configuration Properties->VC++ Directories->Include Directories
|
||||
|
||||
-Solution Structure
|
||||
-have a solution with no projects directly under the solution
|
||||
-so: Solution/Folder/Project
|
||||
-no: Solution/Project
|
||||
Binary file not shown.
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<TestSettings name="Integration Tests" id="6299ba98-e7db-415b-8d40-3472f579309a" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
|
||||
<Description>These are default test settings for a local test run.</Description>
|
||||
<Execution>
|
||||
<Hosts>
|
||||
<VSSDKTestHostRunConfig name="VS IDE" HiveKind="DevEnv" HiveName="15.0Exp" xmlns="http://microsoft.com/schemas/VisualStudio/SDK/Tools/IdeHostAdapter/2006/06" />
|
||||
</Hosts>
|
||||
<TestTypeSpecific>
|
||||
<UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">
|
||||
<AssemblyResolution>
|
||||
<TestDirectory useLoadContext="true" />
|
||||
</AssemblyResolution>
|
||||
</UnitTestRunConfig>
|
||||
</TestTypeSpecific>
|
||||
<AgentRule name="Execution Agents">
|
||||
</AgentRule>
|
||||
</Execution>
|
||||
<Properties />
|
||||
</TestSettings>
|
||||
@@ -1,83 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26403.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SourcetrailPlugin", "SourcetrailPlugin\SourcetrailPlugin.csproj", "{A585A530-E120-4C74-934E-D57ED12A7DA9}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{F592DB46-0C77-470B-AAF8-80C51F44380E} = {F592DB46-0C77-470B-AAF8-80C51F44380E}
|
||||
{8188D64D-E880-490C-B267-B493A2171BE3} = {8188D64D-E880-490C-B267-B493A2171BE3}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SourcetrailPluginTests", "SourcetrailPluginTests\SourcetrailPluginTests.csproj", "{9DE8C188-0F0E-4F5D-B3C4-ECF9CFB23E0D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VCProjectEngineWrapperInterfaces", "VCProjectEngineWrapperInterfaces\VCProjectEngineWrapperInterfaces.csproj", "{F592DB46-0C77-470B-AAF8-80C51F44380E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VCProjectEngineWrapperVs2013", "VCProjectEngineWrapper\VCProjectEngineWrapperVs2013.csproj", "{8718929C-5270-4E5A-8998-48AC7CE19DC2}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VCProjectEngineWrapperFactories", "VCProjectEngineWrapperFactories\VCProjectEngineWrapperFactories.csproj", "{8188D64D-E880-490C-B267-B493A2171BE3}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{1C139999-9592-4891-AA62-2C8A16430D0A} = {1C139999-9592-4891-AA62-2C8A16430D0A}
|
||||
{8718929C-5270-4E5A-8998-48AC7CE19DC2} = {8718929C-5270-4E5A-8998-48AC7CE19DC2}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VCProjectEngineWrapperVs2015", "VCProjectEngineWrapper\VCProjectEngineWrapperVs2015.csproj", "{1C139999-9592-4891-AA62-2C8A16430D0A}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VCProjectEngineWrapperVs2017", "VCProjectEngineWrapper\VCProjectEngineWrapperVs2017.csproj", "{B49207F9-89A3-42D8-BC04-8BF77ED2E295}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VCProjectEngineWrapperVs2012", "VCProjectEngineWrapper\VCProjectEngineWrapperVs2012.csproj", "{C5439B90-42E7-414D-8C3F-BDCABB0592E2}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SourcetrailPluginUtility", "SourcetrailPluginUtility\SourcetrailPluginUtility.csproj", "{604B5751-AF34-4FF9-92C3-C85A6BCDF98E}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7298A53A-50A0-404A-B0C8-B408FE8AF2FB}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
IntegrationTests.testsettings = IntegrationTests.testsettings
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{A585A530-E120-4C74-934E-D57ED12A7DA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A585A530-E120-4C74-934E-D57ED12A7DA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A585A530-E120-4C74-934E-D57ED12A7DA9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A585A530-E120-4C74-934E-D57ED12A7DA9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9DE8C188-0F0E-4F5D-B3C4-ECF9CFB23E0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9DE8C188-0F0E-4F5D-B3C4-ECF9CFB23E0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9DE8C188-0F0E-4F5D-B3C4-ECF9CFB23E0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9DE8C188-0F0E-4F5D-B3C4-ECF9CFB23E0D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F592DB46-0C77-470B-AAF8-80C51F44380E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F592DB46-0C77-470B-AAF8-80C51F44380E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F592DB46-0C77-470B-AAF8-80C51F44380E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F592DB46-0C77-470B-AAF8-80C51F44380E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8718929C-5270-4E5A-8998-48AC7CE19DC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8718929C-5270-4E5A-8998-48AC7CE19DC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8718929C-5270-4E5A-8998-48AC7CE19DC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8718929C-5270-4E5A-8998-48AC7CE19DC2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8188D64D-E880-490C-B267-B493A2171BE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8188D64D-E880-490C-B267-B493A2171BE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8188D64D-E880-490C-B267-B493A2171BE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8188D64D-E880-490C-B267-B493A2171BE3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1C139999-9592-4891-AA62-2C8A16430D0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1C139999-9592-4891-AA62-2C8A16430D0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1C139999-9592-4891-AA62-2C8A16430D0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1C139999-9592-4891-AA62-2C8A16430D0A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B49207F9-89A3-42D8-BC04-8BF77ED2E295}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B49207F9-89A3-42D8-BC04-8BF77ED2E295}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B49207F9-89A3-42D8-BC04-8BF77ED2E295}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B49207F9-89A3-42D8-BC04-8BF77ED2E295}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C5439B90-42E7-414D-8C3F-BDCABB0592E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C5439B90-42E7-414D-8C3F-BDCABB0592E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C5439B90-42E7-414D-8C3F-BDCABB0592E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C5439B90-42E7-414D-8C3F-BDCABB0592E2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{604B5751-AF34-4FF9-92C3-C85A6BCDF98E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{604B5751-AF34-4FF9-92C3-C85A6BCDF98E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{604B5751-AF34-4FF9-92C3-C85A6BCDF98E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{604B5751-AF34-4FF9-92C3-C85A6BCDF98E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,111 +0,0 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using ComTypes = System.Runtime.InteropServices.ComTypes;
|
||||
|
||||
namespace ComUtils
|
||||
{
|
||||
public class ComHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a string value representing the type name of the specified COM object.
|
||||
/// </summary>
|
||||
/// <param name="comObj">A COM object the type name of which to return.</param>
|
||||
/// <returns>A string containing the type name.</returns>
|
||||
public static string GetTypeName(object comObj)
|
||||
{
|
||||
|
||||
if (comObj == null)
|
||||
return String.Empty;
|
||||
|
||||
if (!Marshal.IsComObject(comObj))
|
||||
//The specified object is not a COM object
|
||||
return String.Empty;
|
||||
|
||||
IDispatch dispatch = comObj as IDispatch;
|
||||
if (dispatch == null)
|
||||
//The specified COM object doesn't support getting type information
|
||||
return String.Empty;
|
||||
|
||||
ComTypes.ITypeInfo typeInfo = null;
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
// obtain the ITypeInfo interface from the object
|
||||
dispatch.GetTypeInfo(0, 0, out typeInfo);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//Cannot get the ITypeInfo interface for the specified COM object
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
string typeName = "";
|
||||
string documentation, helpFile;
|
||||
int helpContext = -1;
|
||||
|
||||
try
|
||||
{
|
||||
//retrieves the documentation string for the specified type description
|
||||
typeInfo.GetDocumentation(-1, out typeName, out documentation,
|
||||
out helpContext, out helpFile);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Cannot extract ITypeInfo information
|
||||
return String.Empty;
|
||||
}
|
||||
return typeName;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Unexpected error
|
||||
return String.Empty;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (typeInfo != null) Marshal.ReleaseComObject(typeInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Exposes objects, methods and properties to programming tools and other
|
||||
/// applications that support Automation.
|
||||
/// </summary>
|
||||
[ComImport()]
|
||||
[Guid("00020400-0000-0000-C000-000000000046")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
interface IDispatch
|
||||
{
|
||||
[PreserveSig]
|
||||
int GetTypeInfoCount(out int Count);
|
||||
|
||||
[PreserveSig]
|
||||
int GetTypeInfo(
|
||||
[MarshalAs(UnmanagedType.U4)] int iTInfo,
|
||||
[MarshalAs(UnmanagedType.U4)] int lcid,
|
||||
out ComTypes.ITypeInfo typeInfo);
|
||||
|
||||
[PreserveSig]
|
||||
int GetIDsOfNames(
|
||||
ref Guid riid,
|
||||
[MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)]
|
||||
string[] rgsNames,
|
||||
int cNames,
|
||||
int lcid,
|
||||
[MarshalAs(UnmanagedType.LPArray)] int[] rgDispId);
|
||||
|
||||
[PreserveSig]
|
||||
int Invoke(
|
||||
int dispIdMember,
|
||||
ref Guid riid,
|
||||
uint lcid,
|
||||
ushort wFlags,
|
||||
ref ComTypes.DISPPARAMS pDispParams,
|
||||
out object pVarResult,
|
||||
ref ComTypes.EXCEPINFO pExcepInfo,
|
||||
IntPtr[] pArgErr);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// This file is used by Code Analysis to maintain SuppressMessage
|
||||
// attributes that are applied to this project. Project-level
|
||||
// suppressions either have no target or are given a specific target
|
||||
// and scoped to a namespace, type, member, etc.
|
||||
//
|
||||
// To add a suppression to this file, right-click the message in the
|
||||
// Error List, point to "Suppress Message(s)", and click "In Project
|
||||
// Suppression File". You do not need to add suppressions to this
|
||||
// file manually.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1017:MarkAssembliesWithComVisible")]
|
||||
@@ -1,14 +0,0 @@
|
||||
// Guids.cs
|
||||
// MUST match guids.h
|
||||
using System;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin
|
||||
{
|
||||
public static class GuidList
|
||||
{
|
||||
public const string guidSourcetrailPluginPkgString = "acf15780-03b5-440e-a41e-db79b7043fc2";
|
||||
public const string guidSourcetrailPluginCmdSetString = "0efb005b-715c-4a62-8a9b-1e5a870e6c34";
|
||||
|
||||
public static readonly Guid guidSourcetrailPluginCmdSet = new Guid(guidSourcetrailPluginCmdSetString);
|
||||
};
|
||||
}
|
||||
Binary file not shown.
@@ -1,19 +0,0 @@
|
||||
Copyright (c) 2017 Coati Software OG
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
-136
@@ -1,136 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// based on: https://msdn.microsoft.com/en-us/library/system.threading.tasks.taskscheduler(v=vs.110).aspx
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Multitasking
|
||||
{
|
||||
class LimitedThreadsTaskScheduler : TaskScheduler
|
||||
{
|
||||
[ThreadStatic]
|
||||
private static bool _currentThreadIsProcessingItems;
|
||||
|
||||
private readonly LinkedList<Task> _tasks = new LinkedList<Task>();
|
||||
|
||||
private readonly int _maxNumberOfRunningThreads = 0;
|
||||
|
||||
private int _delegatesQueuedOrRunning = 0;
|
||||
|
||||
public LimitedThreadsTaskScheduler(int maxNumberOfRunningThreads)
|
||||
{
|
||||
if (maxNumberOfRunningThreads < 1)
|
||||
{
|
||||
maxNumberOfRunningThreads = 1;
|
||||
}
|
||||
|
||||
_maxNumberOfRunningThreads = maxNumberOfRunningThreads;
|
||||
}
|
||||
|
||||
protected override IEnumerable<Task> GetScheduledTasks()
|
||||
{
|
||||
bool lockTaken = false;
|
||||
|
||||
try
|
||||
{
|
||||
Monitor.TryEnter(_tasks, ref lockTaken);
|
||||
if(lockTaken)
|
||||
{
|
||||
return _tasks;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (lockTaken)
|
||||
{
|
||||
Monitor.Exit(_tasks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void QueueTask(Task task)
|
||||
{
|
||||
lock(_tasks)
|
||||
{
|
||||
_tasks.AddLast(task);
|
||||
|
||||
if(_delegatesQueuedOrRunning < _maxNumberOfRunningThreads)
|
||||
{
|
||||
++_delegatesQueuedOrRunning;
|
||||
NotifyThreadPoolOfPendingWork();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
|
||||
{
|
||||
if(!_currentThreadIsProcessingItems)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(taskWasPreviouslyQueued)
|
||||
{
|
||||
if(TryDequeue(task))
|
||||
{
|
||||
return base.TryExecuteTask(task);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return base.TryExecuteTask(task);
|
||||
}
|
||||
}
|
||||
|
||||
private void NotifyThreadPoolOfPendingWork()
|
||||
{
|
||||
ThreadPool.UnsafeQueueUserWorkItem(_ =>
|
||||
{
|
||||
_currentThreadIsProcessingItems = true;
|
||||
try
|
||||
{
|
||||
while(true)
|
||||
{
|
||||
Task item;
|
||||
|
||||
lock(_tasks)
|
||||
{
|
||||
if(_tasks.Count <= 0)
|
||||
{
|
||||
--_delegatesQueuedOrRunning;
|
||||
break;
|
||||
}
|
||||
|
||||
item = _tasks.First.Value;
|
||||
_tasks.RemoveFirst();
|
||||
}
|
||||
|
||||
base.TryExecuteTask(item);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_currentThreadIsProcessingItems = false;
|
||||
}
|
||||
|
||||
}, null);
|
||||
}
|
||||
|
||||
protected sealed override bool TryDequeue(Task task)
|
||||
{
|
||||
lock(_tasks)
|
||||
{
|
||||
return _tasks.Remove(task);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
// PkgCmdID.cs
|
||||
// MUST match PkgCmdID.h
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin
|
||||
{
|
||||
static class PkgCmdIDList
|
||||
{
|
||||
public const uint cmdidSourcetrailSetActiveToken = 0x104;
|
||||
public const uint cmdidSourcetrailCreateCdb = 0x106;
|
||||
public const uint cmdidSourcetrailOpenLogFolder = 0x107;
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
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("SourcetrailPlugin")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Coati Software")]
|
||||
[assembly: AssemblyProduct("SourcetrailPlugin")]
|
||||
[assembly: AssemblyCopyright("Copyright © Coati Software 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: CLSCompliant(false)]
|
||||
[assembly: NeutralResourcesLanguage("en-US")]
|
||||
|
||||
// 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 Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0.*")]
|
||||
//[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
|
||||
|
||||
-63
@@ -1,63 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CoatiSoftware.SourcetrailPlugin.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
VS SDK Notes: This resx file contains the resources that will be consumed directly by your package.
|
||||
For example, if you chose to create a tool window, there is a resource with ID 'CanNotCreateWindow'. This
|
||||
is used in VsPkg.cs to determine the string to show the user if there is an error when attempting to create
|
||||
the tool window.
|
||||
|
||||
Resources that are accessed directly from your package *by Visual Studio* are stored in the VSPackage.resx
|
||||
file.
|
||||
-->
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.2 KiB |
-125
@@ -1,125 +0,0 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.SolutionParser
|
||||
{
|
||||
public class CompilationDatabase
|
||||
{
|
||||
private List<CompileCommand> _compileCommands = new List<CompileCommand>();
|
||||
|
||||
private bool TryLoadData(string filePath)
|
||||
{
|
||||
if (filePath.Length > 0)
|
||||
{
|
||||
if (System.IO.File.Exists(filePath))
|
||||
{
|
||||
string data = "";
|
||||
|
||||
using (System.IO.StreamReader file = new System.IO.StreamReader(filePath))
|
||||
{
|
||||
string line = "";
|
||||
|
||||
while ((line = file.ReadLine()) != null)
|
||||
{
|
||||
data += line;
|
||||
}
|
||||
}
|
||||
|
||||
DeserializeFromJson(data);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogError("The cdb file at \"" + filePath + "\" does not exist.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogWarning("Can't load cdb data. Filepath has not been set.");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static CompilationDatabase LoadFromFile(string filePath)
|
||||
{
|
||||
CompilationDatabase cdb = new CompilationDatabase();
|
||||
bool success = cdb.TryLoadData(filePath);
|
||||
return cdb;
|
||||
}
|
||||
|
||||
|
||||
public string SerializeToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(_compileCommands, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
public void DeserializeFromJson(string serialized)
|
||||
{
|
||||
_compileCommands.Clear();
|
||||
|
||||
if (serialized.Length > 0)
|
||||
{
|
||||
_compileCommands = JsonConvert.DeserializeObject<List<CompileCommand>>(serialized);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int CompileCommandCount
|
||||
{
|
||||
get { return _compileCommands.Count; }
|
||||
}
|
||||
|
||||
public static bool operator ==(CompilationDatabase a, CompilationDatabase b)
|
||||
{
|
||||
if (System.Object.ReferenceEquals(a, b))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (((object)a == null) || ((object)b == null))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (a.CompileCommandCount != b.CompileCommandCount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (CompileCommand aCommand in a._compileCommands)
|
||||
{
|
||||
CompileCommand bCommand = b._compileCommands.Find(x => x == aCommand);
|
||||
if (bCommand == null || aCommand.File != bCommand.File)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool operator !=(CompilationDatabase a, CompilationDatabase b)
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
public void AddCompileCommand(CompileCommand commandObject)
|
||||
{
|
||||
_compileCommands.Add(commandObject);
|
||||
}
|
||||
|
||||
public void SortAlphabetically()
|
||||
{
|
||||
_compileCommands.Sort((c1, c2) => c1.File.CompareTo(c2.File));
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
_compileCommands.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
-218
@@ -1,218 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.SolutionParser
|
||||
{
|
||||
public class CompilationDatabaseSettings
|
||||
{
|
||||
private string _name = "";
|
||||
private string _sourceProject = "";
|
||||
private string _directory = "";
|
||||
|
||||
private System.DateTime _lastUpdated = new System.DateTime();
|
||||
|
||||
private List<string> _includedProjects = new List<string>();
|
||||
private string _configurationName = "";
|
||||
private string _platformName = "";
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return _name; }
|
||||
set { _name = value; }
|
||||
}
|
||||
|
||||
public string SourceProject
|
||||
{
|
||||
get { return _sourceProject; }
|
||||
set { _sourceProject = value; }
|
||||
}
|
||||
|
||||
public string Directory
|
||||
{
|
||||
get { return _directory; }
|
||||
set { _directory = value; }
|
||||
}
|
||||
|
||||
public System.DateTime LastUpdated
|
||||
{
|
||||
get { return _lastUpdated; }
|
||||
set { _lastUpdated = value; }
|
||||
}
|
||||
|
||||
public List<string> IncludedProjects
|
||||
{
|
||||
get { return _includedProjects; }
|
||||
set { _includedProjects = value; }
|
||||
}
|
||||
|
||||
public string ConfigurationName
|
||||
{
|
||||
get { return _configurationName; }
|
||||
set { _configurationName = value; }
|
||||
}
|
||||
|
||||
public string PlatformName
|
||||
{
|
||||
get { return _platformName; }
|
||||
set { _platformName = value; }
|
||||
}
|
||||
|
||||
public bool CheckCdbExists()
|
||||
{
|
||||
if (_directory.Length > 0 && _name.Length > 0)
|
||||
{
|
||||
string path = GetFilePath();
|
||||
|
||||
if(System.IO.File.Exists(path) == false)
|
||||
{
|
||||
_lastUpdated = System.DateTime.MinValue; // if file is missing, set date way back so it doesn't interfere with re-building
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogWarning("Can't check cdb data, directory and/or name has not been set: directory - '" + _directory + "', name - '" + _name + "'");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public XmlNode GetMetaDataXML(XmlDocument doc)
|
||||
{
|
||||
// XmlDocument doc = new XmlDocument();
|
||||
XmlNode root = doc.CreateElement("cdb");
|
||||
|
||||
XmlElement name = doc.CreateElement("name");
|
||||
name.InnerText = _name;
|
||||
|
||||
XmlElement sourceProject = doc.CreateElement("sourceProject");
|
||||
sourceProject.InnerText = _sourceProject;
|
||||
|
||||
XmlElement directory = doc.CreateElement("directory");
|
||||
directory.InnerText = _directory;
|
||||
|
||||
XmlElement lastUpdated = doc.CreateElement("lastUpdated");
|
||||
lastUpdated.InnerText = _lastUpdated.ToString();
|
||||
|
||||
XmlElement includedProjects = doc.CreateElement("includedProjects");
|
||||
foreach (string project in _includedProjects)
|
||||
{
|
||||
XmlElement includedProject = doc.CreateElement("includedProject");
|
||||
includedProject.InnerText = project;
|
||||
includedProjects.AppendChild(includedProject);
|
||||
}
|
||||
|
||||
XmlElement configuration = doc.CreateElement("configuration");
|
||||
configuration.InnerText = _configurationName;
|
||||
|
||||
XmlElement platform = doc.CreateElement("platform");
|
||||
platform.InnerText = _platformName;
|
||||
|
||||
root.AppendChild(name);
|
||||
root.AppendChild(sourceProject);
|
||||
root.AppendChild(directory);
|
||||
root.AppendChild(lastUpdated);
|
||||
root.AppendChild(includedProjects);
|
||||
root.AppendChild(configuration);
|
||||
root.AppendChild(platform);
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
public string SerializeMetaDataXML()
|
||||
{
|
||||
XmlDocument doc = new XmlDocument();
|
||||
XmlNode root = GetMetaDataXML(doc);
|
||||
|
||||
System.IO.StringWriter writer = new System.IO.StringWriter();
|
||||
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(XmlElement));
|
||||
serializer.Serialize(writer, root);
|
||||
|
||||
return writer.ToString();
|
||||
}
|
||||
|
||||
public static List<CompilationDatabaseSettings> ParseCdbsMetaData(string data)
|
||||
{
|
||||
List<CompilationDatabaseSettings> cdbs = new List<CompilationDatabaseSettings>();
|
||||
|
||||
if(data.Length > 0)
|
||||
{
|
||||
XmlDocument doc = new XmlDocument();
|
||||
doc.LoadXml(data);
|
||||
XmlNode root = doc.SelectSingleNode("cdbs");
|
||||
|
||||
XmlNodeList nodes = root.SelectNodes("cdb");
|
||||
|
||||
foreach (XmlNode node in nodes)
|
||||
{
|
||||
cdbs.Add(ParseCdbMetaData(node));
|
||||
}
|
||||
}
|
||||
|
||||
return cdbs;
|
||||
}
|
||||
|
||||
public static CompilationDatabaseSettings ParseCdbMetaData(XmlNode node)
|
||||
{
|
||||
CompilationDatabaseSettings cdb = new CompilationDatabaseSettings();
|
||||
|
||||
XmlNode nameNode = node.SelectSingleNode("name");
|
||||
string name = nameNode.InnerText;
|
||||
|
||||
XmlNode sourceNode = node.SelectSingleNode("sourceProject");
|
||||
string source = sourceNode.InnerText;
|
||||
|
||||
XmlNode directoryNode = node.SelectSingleNode("directory");
|
||||
string directory = directoryNode.InnerText;
|
||||
|
||||
XmlNode updatedNode = node.SelectSingleNode("lastUpdated");
|
||||
string updated = updatedNode.InnerText;
|
||||
System.DateTime updatedDate;
|
||||
if(System.DateTime.TryParse(updated, out updatedDate) == false)
|
||||
{
|
||||
updatedDate = System.DateTime.MinValue;
|
||||
}
|
||||
|
||||
XmlNode includedProjects = node.SelectSingleNode("includedProjects");
|
||||
XmlNodeList includedProjectNodes = includedProjects.SelectNodes("includedProject");
|
||||
List<string> includedProjectsList = new List<string>();
|
||||
foreach(XmlNode p in includedProjectNodes)
|
||||
{
|
||||
includedProjectsList.Add(p.InnerText);
|
||||
}
|
||||
|
||||
XmlNode configurationNode = node.SelectSingleNode("configuration");
|
||||
string configuration = configurationNode.InnerText;
|
||||
|
||||
XmlNode platformNode = node.SelectSingleNode("platform");
|
||||
string platform = platformNode.InnerText;
|
||||
|
||||
// if cdb file is not there anymore, set the modified date back so that a full update will be performed
|
||||
if(System.IO.File.Exists(directory + "\\" + name + ".json") == false)
|
||||
{
|
||||
updatedDate = System.DateTime.MinValue;
|
||||
}
|
||||
|
||||
cdb.Name = name;
|
||||
cdb.SourceProject = source;
|
||||
cdb.Directory = directory;
|
||||
cdb.LastUpdated = updatedDate;
|
||||
cdb.IncludedProjects = includedProjectsList;
|
||||
cdb.ConfigurationName = configuration;
|
||||
cdb.PlatformName = platform;
|
||||
|
||||
return cdb;
|
||||
}
|
||||
|
||||
private string GetFilePath()
|
||||
{
|
||||
return _directory + "\\" + _name + ".json";
|
||||
}
|
||||
}
|
||||
}
|
||||
-84
@@ -1,84 +0,0 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.SolutionParser
|
||||
{
|
||||
public class CompileCommand
|
||||
{
|
||||
private string _directory = "";
|
||||
private string _command = "";
|
||||
private string _file = "";
|
||||
|
||||
[JsonProperty(propertyName: "directory")]
|
||||
public string Directory
|
||||
{
|
||||
get { return _directory; }
|
||||
set { _directory = value; }
|
||||
}
|
||||
|
||||
[JsonProperty(propertyName: "command")]
|
||||
public string Command
|
||||
{
|
||||
get { return _command; }
|
||||
set
|
||||
{
|
||||
_command = value;
|
||||
//_command = _command.Replace('"', '\'');
|
||||
//_command = _command.Replace("\"", "'");
|
||||
//_command = _command.Replace("\\\"", "'");
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty(propertyName: "file")]
|
||||
public string File
|
||||
{
|
||||
get { return _file; }
|
||||
set
|
||||
{
|
||||
_file = value;
|
||||
//_file = _file.Replace('"', '\'');
|
||||
//_file = _file.Replace('\"', '\'');
|
||||
//_file = _file.Replace("\\\"", "'");
|
||||
}
|
||||
}
|
||||
|
||||
public static bool operator ==(CompileCommand a, CompileCommand b)
|
||||
{
|
||||
if (System.Object.ReferenceEquals(a, b))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (((object)a == null) || ((object)b == null))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (a.File != b.File || a.Command != b.Command || a.Directory != b.Directory)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool operator !=(CompileCommand a, CompileCommand b)
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
public string SerializeToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
public static CompileCommand DeserializeFromJson(string serialized)
|
||||
{
|
||||
CompileCommand command = null;
|
||||
if (serialized.Length > 0)
|
||||
{
|
||||
command = JsonConvert.DeserializeObject<CompileCommand>(serialized);
|
||||
}
|
||||
return command;
|
||||
}
|
||||
}
|
||||
}
|
||||
-394
@@ -1,394 +0,0 @@
|
||||
using CoatiSoftware.SourcetrailPlugin.Utility;
|
||||
using EnvDTE;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using VCProjectEngineWrapper;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.SolutionParser
|
||||
{
|
||||
public class SolutionParser
|
||||
{
|
||||
static private List<Guid> _reloadedProjectGuids = new List<Guid>();
|
||||
static private List<string> _compatibilityFlags = new List<string>() { "-fms-extensions", "-fms-compatibility" };
|
||||
static private string _compatibilityVersionFlagBase = "-fms-compatibility-version="; // We want to get the exact version at runtime for this flag, therefore keeping it seperate from the others makes things easier
|
||||
static private List<string> _sourceExtensionWhiteList = new List<string>() { "c", "cc", "cpp", "cxx" };
|
||||
static private List<string> _headerExtensionWhiteList = new List<string>() { "h", "hpp" };
|
||||
|
||||
private string _compatibilityVersionFlag = _compatibilityVersionFlagBase + "19"; // This default version would correspond to VS2015
|
||||
|
||||
private List<string> _headerDirectories = new List<string>();
|
||||
|
||||
private IPathResolver _pathResolver = null;
|
||||
|
||||
public List<string> HeaderDirectories
|
||||
{
|
||||
get { return _headerDirectories; }
|
||||
}
|
||||
|
||||
public SolutionParser(IPathResolver pathResolver)
|
||||
{
|
||||
_pathResolver = pathResolver;
|
||||
}
|
||||
|
||||
public List<CompileCommand> CreateCompileCommands(Project project, string configurationName, string platformName, string cStandard)
|
||||
{
|
||||
Logging.Logging.LogInfo("Creating command objects for project \"" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(project.Name) + "\".");
|
||||
|
||||
List<CompileCommand> result = new List<CompileCommand>();
|
||||
|
||||
DTE dte = project.DTE;
|
||||
Guid projectGuid = Utility.ProjectUtility.ReloadProject(project);
|
||||
|
||||
IVCProjectWrapper vcProject = VCProjectEngineWrapper.VCProjectWrapperFactory.create(project.Object);
|
||||
if (vcProject != null && vcProject.isValid())
|
||||
{
|
||||
Logging.Logging.LogInfo("Project \"" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(project.Name) + "\" has been converted to VCProject " + vcProject.GetWrappedVersion() + ".");
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogWarning("Project \"" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(project.Name) + "\" could not be converted to VCProject, skipping.");
|
||||
return result;
|
||||
}
|
||||
|
||||
SetCompatibilityVersionFlag(vcProject, configurationName, platformName);
|
||||
|
||||
// gather include paths and preprocessor definitions of the project
|
||||
List<string> includeDirectories = Utility.ProjectUtility.GetProjectIncludeDirectories(vcProject, configurationName, platformName, _pathResolver);
|
||||
List<string> preprocessorDefinitions = Utility.ProjectUtility.GetProjectPreprocessorDefinitions(vcProject, configurationName, platformName);
|
||||
|
||||
string cppStandard = Utility.ProjectUtility.GetCppStandardForProject(vcProject, configurationName, platformName);
|
||||
Logging.Logging.LogInfo("Found C++ standard " + cppStandard + ".");
|
||||
|
||||
// create command objects for all applicable project items
|
||||
foreach (EnvDTE.ProjectItem item in Utility.ProjectUtility.GetProjectItems(project))
|
||||
{
|
||||
CompileCommand command = CreateCompileCommand(item, includeDirectories, preprocessorDefinitions, cppStandard, cStandard, configurationName, platformName);
|
||||
if (command != null)
|
||||
{
|
||||
result.Add(command);
|
||||
}
|
||||
}
|
||||
|
||||
if (projectGuid != Guid.Empty)
|
||||
{
|
||||
Utility.ProjectUtility.UnloadProject(projectGuid, dte);
|
||||
}
|
||||
|
||||
_headerDirectories = _headerDirectories.Distinct().ToList();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private CompileCommand CreateCompileCommand(EnvDTE.ProjectItem item, List<string> includeDirectories, List<string> preprocessorDefinitions, string vcStandard, string cStandard, string configurationName, string platformName)
|
||||
{
|
||||
Logging.Logging.LogInfo("Starting to create Command Object from item \"" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(item.Name) + "\"");
|
||||
|
||||
try
|
||||
{
|
||||
DTE dte = item.DTE;
|
||||
|
||||
if (dte == null)
|
||||
{
|
||||
Logging.Logging.LogError("Failed to retreive DTE object. Abort creating command object.");
|
||||
}
|
||||
|
||||
IVCCLCompilerToolWrapper compilerTool = null;
|
||||
|
||||
IVCFileWrapper vcFile = VCFileWrapperFactory.create(item.Object);
|
||||
List<IVCFileConfigurationWrapper> vcFileConfigurations = vcFile.GetFileConfigurations();
|
||||
foreach (IVCFileConfigurationWrapper vcFileConfiguration in vcFileConfigurations)
|
||||
{
|
||||
if (vcFileConfiguration != null && vcFileConfiguration.isValid())
|
||||
{
|
||||
compilerTool = vcFileConfiguration.GetTool();
|
||||
if (compilerTool != null && compilerTool.isValid())
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (compilerTool == null || !compilerTool.isValid())
|
||||
{
|
||||
Logging.Logging.LogInfo("Unable to retrieve build tool. Using extension white-list to determine file type.");
|
||||
}
|
||||
|
||||
if (CheckIsSourceFile(item, compilerTool))
|
||||
{
|
||||
CompileCommand command = new CompileCommand();
|
||||
command.File = item.Name;
|
||||
|
||||
string additionalOptions = "";
|
||||
if (compilerTool != null && compilerTool.isValid())
|
||||
{
|
||||
additionalOptions = compilerTool.GetAdditionalOptions();
|
||||
|
||||
if (additionalOptions == "$(NOINHERIT)")
|
||||
{
|
||||
additionalOptions = "";
|
||||
}
|
||||
|
||||
// check wheter it's a .c file, we don't want that...
|
||||
// TODO: there is a property for comilation as .c or .cpp file (/TC and /TP), try to retrieve it
|
||||
string extension = item.Properties.Item("Extension").Value.ToString();
|
||||
if (compilerTool.GetCompilesAsC())
|
||||
{
|
||||
vcStandard = "-std=" + cStandard;
|
||||
}
|
||||
}
|
||||
|
||||
// if a language standard was defined in the additional options the 'vcStandard' string is not used
|
||||
if (additionalOptions.Contains("-std="))
|
||||
{
|
||||
vcStandard = "";
|
||||
}
|
||||
|
||||
string relativeFilePath = item.Properties.Item("RelativePath").Value.ToString();
|
||||
command.File = _pathResolver.GetAsAbsoluteCanonicalPath(relativeFilePath, vcFile.GetProject());
|
||||
command.File = command.File.Replace('\\', '/');
|
||||
|
||||
command.Directory = _pathResolver.GetCompilationDatabaseFilePath();
|
||||
|
||||
command.Command = "clang-tool ";
|
||||
|
||||
foreach (string flag in _compatibilityFlags)
|
||||
{
|
||||
command.Command += flag + " ";
|
||||
}
|
||||
|
||||
command.Command += _compatibilityVersionFlag + " ";
|
||||
|
||||
foreach (string dir in includeDirectories)
|
||||
{
|
||||
command.Command += " -isystem '" + dir + "' "; // using '-isystem' because it allows for use of quotes and pointy brackets in source files. In other words it's more robust. It's slower than '-I' though
|
||||
}
|
||||
|
||||
foreach (string prepDef in preprocessorDefinitions)
|
||||
{
|
||||
command.Command += " -D " + prepDef + " ";
|
||||
}
|
||||
|
||||
command.Command += vcStandard + " ";
|
||||
|
||||
command.Command += additionalOptions + " ";
|
||||
|
||||
command.Command += "'" + command.File + "'";
|
||||
|
||||
return command;
|
||||
}
|
||||
else if (CheckIsHeaderFile(item, compilerTool))
|
||||
{
|
||||
if (ProjectUtility.HasProperty(item.Properties, "FullPath"))
|
||||
{
|
||||
string propValue = item.Properties.Item("FullPath").Value.ToString();
|
||||
|
||||
int i = propValue.LastIndexOf('\\');
|
||||
|
||||
propValue = propValue.Substring(0, i);
|
||||
|
||||
_headerDirectories.Add(propValue);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogInfo("Item discarded, wrong code model");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
}
|
||||
|
||||
Logging.Logging.LogError("Failed to create command object.");
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
static private bool CheckIsSourceFile(ProjectItem item, IVCCLCompilerToolWrapper tool)
|
||||
{
|
||||
if (tool != null && tool.isValid()) // if the tool is null it's probably not a normal VC project, indicating that the file code model is unavailable
|
||||
{
|
||||
try
|
||||
{
|
||||
if (ProjectUtility.HasProperty(item.Properties, "ContentType") && item.Properties.Item("ContentType").Value.ToString() == "CppCode")
|
||||
{
|
||||
Logging.Logging.LogInfo("Accepting item because of its \"ContentType\" property");
|
||||
return true;
|
||||
}
|
||||
else if(ProjectUtility.HasProperty(item.Properties, "ItemType") && item.Properties.Item("ItemType").Value.ToString() == "ClCompile")
|
||||
{
|
||||
Logging.Logging.LogInfo("Accepting item because of its \"ItemType\" property");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
}
|
||||
|
||||
if (item.FileCodeModel != null && item.FileCodeModel.Language == CodeModelLanguageConstants.vsCMLanguageVC)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (_sourceExtensionWhiteList.Contains(GetFileExtension(item).ToLower()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static private bool CheckIsHeaderFile(EnvDTE.ProjectItem item, IVCCLCompilerToolWrapper tool)
|
||||
{
|
||||
if (tool != null && tool.isValid()) // if the tool is null it's probably not a normal VC project, indicating that the file code model is unavailable
|
||||
{
|
||||
try
|
||||
{
|
||||
if (ProjectUtility.HasProperty(item.Properties, "ItemType") && item.Properties.Item("ItemType").Value.ToString() == "ClInclude")
|
||||
{
|
||||
Logging.Logging.LogInfo("Accepting item because of its \"ItemType\" property");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
}
|
||||
}
|
||||
else if (_headerExtensionWhiteList.Contains(GetFileExtension(item).ToLower()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static private void ReloadAll(DTE dte)
|
||||
{
|
||||
if (dte == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EnvDTE.Solution solution = dte.Solution;
|
||||
|
||||
List<EnvDTE.Project> projects = Utility.SolutionUtility.GetSolutionProjectList(dte);
|
||||
|
||||
foreach (EnvDTE.Project project in projects)
|
||||
{
|
||||
_reloadedProjectGuids.Add(Utility.ProjectUtility.ReloadProject(project));
|
||||
}
|
||||
}
|
||||
|
||||
static private void UnloadReloadedProjects(DTE dte)
|
||||
{
|
||||
foreach (Guid guid in _reloadedProjectGuids)
|
||||
{
|
||||
Utility.ProjectUtility.UnloadProject(guid, dte);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetCompatibilityVersionFlag(IVCProjectWrapper project, string configurationName, string platformName)
|
||||
{
|
||||
Logging.Logging.LogInfo("Determining CL.exe (C++ compiler) version");
|
||||
|
||||
IVCConfigurationWrapper vcProjectConfig = project.getConfiguration(configurationName, platformName);
|
||||
|
||||
IVCCLCompilerToolWrapper compilerTool = vcProjectConfig.GetCompilerTool();
|
||||
|
||||
if (compilerTool != null && compilerTool.isValid())
|
||||
{
|
||||
int majorCompilerVersion = GetCLMajorVersion(compilerTool, vcProjectConfig);
|
||||
|
||||
if (majorCompilerVersion > -1)
|
||||
{
|
||||
Logging.Logging.LogInfo("Found compiler version " + majorCompilerVersion.ToString());
|
||||
|
||||
_compatibilityVersionFlag = _compatibilityVersionFlagBase + majorCompilerVersion.ToString();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static private int GetCLMajorVersion(IVCCLCompilerToolWrapper compilerTool, IVCConfigurationWrapper vcProjectConfig)
|
||||
{
|
||||
Logging.Logging.LogInfo("Looking up CL.exe (C++ compiler)");
|
||||
|
||||
if (compilerTool == null || !compilerTool.isValid() || vcProjectConfig == null || !vcProjectConfig.isValid())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IVCPlatformWrapper platform = vcProjectConfig.GetPlatform();
|
||||
|
||||
List<string> finalDirectories = new List<string>();
|
||||
foreach (string directory in platform.GetExecutableDirectories().Split(';'))
|
||||
{
|
||||
IPathResolver resolver = new VsPathResolver("");
|
||||
string resolvedDirectory = resolver.ResolveVsMacroInPath(directory, vcProjectConfig);
|
||||
string[] splitResolvedDirectory = resolvedDirectory.Split(';'); // resolved macros might result in concatenated paths
|
||||
|
||||
foreach (string d in splitResolvedDirectory)
|
||||
{
|
||||
finalDirectories.Add(d);
|
||||
}
|
||||
}
|
||||
|
||||
string toolPath = compilerTool.GetToolPath();
|
||||
|
||||
Logging.Logging.LogInfo("Found " + finalDirectories.Count.ToString() + " possible compiler directories.");
|
||||
|
||||
foreach (string fd in finalDirectories)
|
||||
{
|
||||
string path = fd + "\\" + toolPath;
|
||||
|
||||
if (File.Exists(path))
|
||||
{
|
||||
FileVersionInfo info = FileVersionInfo.GetVersionInfo(path);
|
||||
int version = info.FileMajorPart;
|
||||
|
||||
Logging.Logging.LogInfo("Found compiler location. Compiler tool version is " + version.ToString());
|
||||
|
||||
return version;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
}
|
||||
|
||||
Logging.Logging.LogWarning("Failed to find C++ compiler tool.");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static private string GetFileExtension(ProjectItem item)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string name = item.Name;
|
||||
|
||||
int idx = name.LastIndexOf(".");
|
||||
|
||||
if (idx > -1 && idx < name.Length - 1)
|
||||
{
|
||||
return name.Substring(idx + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
using CoatiSoftware.SourcetrailPlugin.Utility;
|
||||
using System;
|
||||
using VCProjectEngineWrapper;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.SolutionParser
|
||||
{
|
||||
public class VsPathResolver : IPathResolver
|
||||
{
|
||||
private string _compilationDatabaseFilePath = "";
|
||||
|
||||
public VsPathResolver(string compilationDatabaseFilePath)
|
||||
{
|
||||
_compilationDatabaseFilePath = compilationDatabaseFilePath.Replace('\\', '/');
|
||||
}
|
||||
|
||||
public override string GetCompilationDatabaseFilePath()
|
||||
{
|
||||
return _compilationDatabaseFilePath;
|
||||
}
|
||||
|
||||
protected override string DoGetAsAbsoluteCanonicalPath(string path, IVCProjectWrapper project)
|
||||
{
|
||||
string absolutePath = project.GetProjectDirectory() + path;
|
||||
return new Uri(absolutePath).LocalPath;
|
||||
}
|
||||
|
||||
protected override string ResolveVsMacro(string potentialMacro, IVCConfigurationWrapper vcProjectConfig)
|
||||
{
|
||||
return vcProjectConfig.EvaluateMacro(potentialMacro);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,290 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VisualStudioYear>2015</VisualStudioYear>
|
||||
<VisualStudioYear Condition="'$(VisualStudioVersion)' >= '15.0'">2017</VisualStudioYear>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' >= '11.0'">
|
||||
<MinimumVisualStudioVersion>$(VisualStudioVersion)</MinimumVisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' >= '12.0'">
|
||||
<OldToolsVersion>4.0</OldToolsVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{A585A530-E120-4C74-934E-D57ED12A7DA9}</ProjectGuid>
|
||||
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CoatiSoftware.SourcetrailPlugin</RootNamespace>
|
||||
<AssemblyName>sourcetrail_plugin</AssemblyName>
|
||||
<SignAssembly>True</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<Choose>
|
||||
<When Condition="'$(VisualStudioVersion)' >= '15'">
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.Shell.Framework, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
</ItemGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
<ItemGroup>
|
||||
<Reference Include="EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="EnvDTE80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.Shell.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TemplateWizardInterface, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
<Reference Include="Microsoft.VisualStudio.TextManager.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Design" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.Package.LanguageService.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<COMReference Include="Microsoft.VisualStudio.CommandBars">
|
||||
<Guid>{1CBA492E-7263-47BB-87FE-639000619B15}</Guid>
|
||||
<VersionMajor>8</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
<COMReference Include="stdole">
|
||||
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
|
||||
<VersionMajor>2</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ComUtils.cs" />
|
||||
<Compile Include="Multitasking\LimitedThreadsTaskScheduler.cs" />
|
||||
<Compile Include="SolutionParser\CompilationDatabase.cs" />
|
||||
<Compile Include="Utility\IPathResolver.cs" />
|
||||
<Compile Include="SolutionParser\VsPathResolver.cs" />
|
||||
<Compile Include="Utility\CompilationDatabaseSettingsList.cs" />
|
||||
<Compile Include="Utility\DataUtility.cs" />
|
||||
<Compile Include="Utility\FileUtility.cs" />
|
||||
<Compile Include="Guids.cs" />
|
||||
<Compile Include="Utility\NetworkProtocolUtility.cs" />
|
||||
<Compile Include="Utility\NetworkUtility.cs" />
|
||||
<Compile Include="Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="SourcetrailPluginPackage.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="PkgCmdID.cs" />
|
||||
<Compile Include="SolutionParser\CompileCommand.cs" />
|
||||
<Compile Include="SolutionParser\CompilationDatabaseSettings.cs" />
|
||||
<Compile Include="SolutionParser\SolutionParser.cs" />
|
||||
<Compile Include="Utility\ProjectUtility.cs" />
|
||||
<Compile Include="Utility\QueuedFileWriter.cs" />
|
||||
<Compile Include="Utility\SolutionUtility.cs" />
|
||||
<Compile Include="Utility\SystemUtility.cs" />
|
||||
<Compile Include="Utility\StringUtility.cs" />
|
||||
<Compile Include="Wizard\WindowCdbReady.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Wizard\WindowCdbReady.Designer.cs">
|
||||
<DependentUpon>WindowCdbReady.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Wizard\WindowCreateCdb.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Wizard\WindowCreateCdb.Designer.cs">
|
||||
<DependentUpon>WindowCreateCdb.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Wizard\ProjectSetupWindow.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Wizard\ProjectSetupWindow.Designer.cs">
|
||||
<DependentUpon>ProjectSetupWindow.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Wizard\WindowMessage.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Wizard\WindowMessage.Designer.cs">
|
||||
<DependentUpon>WindowMessage.cs</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="VSPackage.resx">
|
||||
<MergeWithCTO>true</MergeWithCTO>
|
||||
<ManifestResourceName>VSPackage</ManifestResourceName>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Wizard\WindowCdbReady.resx">
|
||||
<DependentUpon>WindowCdbReady.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Wizard\WindowCreateCdb.resx">
|
||||
<DependentUpon>WindowCreateCdb.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Wizard\ProjectSetupWindow.resx">
|
||||
<DependentUpon>ProjectSetupWindow.cs</DependentUpon>
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>ProjectSetupWindow1.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Wizard\WindowMessage.resx">
|
||||
<DependentUpon>WindowMessage.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="source.extension.vsixmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Key.snk" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<VSCTCompile Include="SourcetrailPlugin.vsct">
|
||||
<ResourceName>Menus.ctmenu</ResourceName>
|
||||
<SubType>Designer</SubType>
|
||||
</VSCTCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\favicon_16x16.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="LICENSE.txt">
|
||||
<IncludeInVSIX>true</IncludeInVSIX>
|
||||
</Content>
|
||||
<Content Include="sourcetrail.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<IncludeInVSIX>true</IncludeInVSIX>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SourcetrailPluginUtility\SourcetrailPluginUtility.csproj">
|
||||
<Project>{604b5751-af34-4ff9-92c3-c85a6bcdf98e}</Project>
|
||||
<Name>SourcetrailPluginUtility</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\VCProjectEngineWrapperFactories\VCProjectEngineWrapperFactories.csproj">
|
||||
<Project>{8188d64d-e880-490c-b267-b493a2171be3}</Project>
|
||||
<Name>VCProjectEngineWrapperFactories</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\VCProjectEngineWrapperInterfaces\VCProjectEngineWrapperInterfaces.csproj">
|
||||
<Project>{f592db46-0c77-470b-aaf8-80c51f44380e}</Project>
|
||||
<Name>VCProjectEngineWrapperInterfaces</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\VCProjectEngineWrapper\VCProjectEngineWrapperVs2012.csproj">
|
||||
<Project>{c5439b90-42e7-414d-8c3f-bdcabb0592e2}</Project>
|
||||
<Name>VCProjectEngineWrapperVs2012</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\VCProjectEngineWrapper\VCProjectEngineWrapperVs2013.csproj">
|
||||
<Project>{8718929c-5270-4e5a-8998-48ac7ce19dc2}</Project>
|
||||
<Name>VCProjectEngineWrapperVs2013</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\VCProjectEngineWrapper\VCProjectEngineWrapperVs2015.csproj">
|
||||
<Project>{1c139999-9592-4891-aa62-2c8a16430d0a}</Project>
|
||||
<Name>VCProjectEngineWrapperVs2015</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\VCProjectEngineWrapper\VCProjectEngineWrapperVs2017.csproj">
|
||||
<Project>{b49207f9-89a3-42d8-bc04-8bf77ed2e295}</Project>
|
||||
<Name>VCProjectEngineWrapperVs2017</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<UseCodebase>true</UseCodebase>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<StartAction>Program</StartAction>
|
||||
<StartProgram>D:\programme\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe</StartProgram>
|
||||
<StartArguments>/rootsuffix Exp</StartArguments>
|
||||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<StartAction>Program</StartAction>
|
||||
<StartProgram>D:\programme\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe</StartProgram>
|
||||
<StartArguments>/rootsuffix Exp</StartArguments>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,157 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<!-- This is the file that defines the actual layout and type of the commands.
|
||||
It is divided in different sections (e.g. command definition, command
|
||||
placement, ...), with each defining a specific set of properties.
|
||||
See the comment before each section for more details about how to
|
||||
use it. -->
|
||||
|
||||
<!-- The VSCT compiler (the tool that translates this file into the binary
|
||||
format that VisualStudio will consume) has the ability to run a preprocessor
|
||||
on the vsct file; this preprocessor is (usually) the C++ preprocessor, so
|
||||
it is possible to define includes and macros with the same syntax used
|
||||
in C++ files. Using this ability of the compiler here, we include some files
|
||||
defining some of the constants that we will use inside the file. -->
|
||||
|
||||
<!--This is the file that defines the IDs for all the commands exposed by VisualStudio. -->
|
||||
<Extern href="stdidcmd.h"/>
|
||||
|
||||
<!--This header contains the command ids for the menus provided by the shell. -->
|
||||
<Extern href="vsshlids.h"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--The Commands section is where we the commands, menus and menu groups are defined.
|
||||
This section uses a Guid to identify the package that provides the command defined inside it. -->
|
||||
<Commands package="guidSourcetrailPluginPkg">
|
||||
<Bitmaps>
|
||||
<Bitmap guid="icon" href="Resources\favicon_16x16.png" usedList="icon0"/>
|
||||
</Bitmaps>
|
||||
|
||||
<Groups>
|
||||
|
||||
<Group guid="guidSourcetrailPluginCmdSet" id="ContextMenuGroup" priority="0x0600">
|
||||
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_CODEWIN"/>
|
||||
</Group>
|
||||
|
||||
<Group guid="guidSourcetrailPluginCmdSet" id="TopLevelMenu" priority="0x0600">
|
||||
<Parent guid="guidSHLMainMenu" id="IDM_VS_TOOL_MAINMENU"/>
|
||||
</Group>
|
||||
|
||||
<Group guid="guidSourcetrailPluginCmdSet" id="SubMenu" priority="0x0600">
|
||||
<Parent guid="guidSourcetrailPluginCmdSet" id="TopLevelMenu"/>
|
||||
</Group>
|
||||
|
||||
<!--
|
||||
<Group guid="guidSourcetrailPluginCmdSet" id="HelpMenu" priority="0x0600">
|
||||
<Parent guid="guidSourcetrailPluginCmdSet" id="TopLevelMenu"/>
|
||||
</Group>
|
||||
-->
|
||||
|
||||
</Groups>
|
||||
|
||||
<Buttons>
|
||||
|
||||
<Button guid="guidSourcetrailPluginCmdSet" id="cmdidSourcetrailSetActiveToken" priority="0x0100" type="Button">
|
||||
<Parent guid="guidSourcetrailPluginCmdSet" id="ContextMenuGroup" />
|
||||
<Icon guid="icon" id="icon0" />
|
||||
<Strings>
|
||||
<ButtonText>Set active Token</ButtonText>
|
||||
</Strings>
|
||||
</Button>
|
||||
|
||||
<Button guid="guidSourcetrailPluginCmdSet" id="cmdidSourcetrailCreateCdb" priority="0x0100" type="Button">
|
||||
<Parent guid="guidSourcetrailPluginCmdSet" id="SubMenu" />
|
||||
<Icon guid="icon" id="icon0" />
|
||||
<Strings>
|
||||
<ButtonText>Create Compilation Database</ButtonText>
|
||||
</Strings>
|
||||
</Button>
|
||||
|
||||
<Button guid="guidSourcetrailPluginCmdSet" id="cmdidSourcetrailOpenLogFolder" priority="0x0100" type="Button">
|
||||
<Parent guid="guidSourcetrailPluginCmdSet" id="SubMenu" />
|
||||
<Strings>
|
||||
<ButtonText>Open Log Directory</ButtonText>
|
||||
</Strings>
|
||||
</Button>
|
||||
|
||||
<!--
|
||||
<Button guid="guidSourcetrailPluginCmdSet" id="cmdidSourcetrailHelp" priority="0x0100" type="Button">
|
||||
<Parent guid="guidSourcetrailPluginCmdSet" id="HelpMenu" />
|
||||
<Strings>
|
||||
<ButtonText>Online Help</ButtonText>
|
||||
</Strings>
|
||||
</Button>
|
||||
-->
|
||||
|
||||
</Buttons>
|
||||
|
||||
<Menus>
|
||||
|
||||
<Menu guid="guidSourcetrailPluginCmdSet" id="TopLevelMenu" priority="0x700" type="Menu">
|
||||
<Parent guid="guidSHLMainMenu" id="IDG_VS_MM_TOOLSADDINS"/>
|
||||
<Strings>
|
||||
<ButtonText>Sourcetrail</ButtonText>
|
||||
<CommandName>Sourcetrail</CommandName>
|
||||
</Strings>
|
||||
</Menu>
|
||||
|
||||
<!--
|
||||
<Menu guid="guidSourcetrailPluginCmdSet" id="HelpMenu" priority="0x700" type="Menu">
|
||||
<Parent guid="guidSourcetrailPluginCmdSet" id="TopLevelMenu"/>
|
||||
<Strings>
|
||||
<ButtonText>Sourcetrail Help</ButtonText>
|
||||
<CommandName>Sourcetrail Help</CommandName>
|
||||
</Strings>
|
||||
</Menu>
|
||||
-->
|
||||
|
||||
</Menus>
|
||||
|
||||
</Commands>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<Symbols>
|
||||
<!-- This is the package guid. -->
|
||||
<GuidSymbol name="guidSourcetrailPluginPkg" value="{acf15780-03b5-440e-a41e-db79b7043fc2}" />
|
||||
|
||||
<!-- This is the guid used to group the menu commands together -->
|
||||
<GuidSymbol name="guidSourcetrailPluginCmdSet" value="{0efb005b-715c-4a62-8a9b-1e5a870e6c34}">
|
||||
|
||||
<IDSymbol name="ContextMenuGroup" value="0x1020" />
|
||||
<IDSymbol name="cmdidSourcetrailPing" value="0x0100" />
|
||||
<IDSymbol name="cmdidSourcetrailFile" value="0x0101"/>
|
||||
<IDSymbol name="cmdidSourcetrailGetActiveFileName" value="0x0102"/>
|
||||
<IDSymbol name="cmdidSourcetrailGetActiveLineNumber" value="0x0103"/>
|
||||
<IDSymbol name="cmdidSourcetrailSetActiveToken" value="0x0104"/>
|
||||
<IDSymbol name="cmdidSourcetrailCreateCdb" value="0x0106"/>
|
||||
<IDSymbol name="cmdidSourcetrailOpenLogFolder" value="0x0107"/>
|
||||
<IDSymbol name="TopLevelMenu" value="0x1021"/>
|
||||
<IDSymbol name="SubMenu" value="0x1022"/>
|
||||
<IDSymbol name="HelpMenu" value="0x1023"/>
|
||||
<IDSymbol name="cmdidSourcetrailHelp" value="0x1024"/>
|
||||
</GuidSymbol>
|
||||
|
||||
|
||||
|
||||
<GuidSymbol name="guidImages" value="{e447cfde-511d-4f75-80c1-a40b8a03152a}" >
|
||||
<IDSymbol name="bmpPic1" value="1" />
|
||||
<IDSymbol name="bmpPic2" value="2" />
|
||||
<IDSymbol name="bmpPicSearch" value="3" />
|
||||
<IDSymbol name="bmpPicX" value="4" />
|
||||
<IDSymbol name="bmpPicArrows" value="5" />
|
||||
<IDSymbol name="bmpPicStrikethrough" value="6" />
|
||||
</GuidSymbol>
|
||||
|
||||
<GuidSymbol name="icon" value="{403BFDD2-B84C-4BCE-A1D1-B16F9F2B8230}" >
|
||||
<IDSymbol name="icon0" value="1" />
|
||||
</GuidSymbol>
|
||||
|
||||
</Symbols>
|
||||
|
||||
</CommandTable>
|
||||
-534
@@ -1,534 +0,0 @@
|
||||
using EnvDTE;
|
||||
using Microsoft.VisualStudio.Shell.Interop;
|
||||
using Microsoft.VisualStudio.Shell;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.Design;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin
|
||||
{
|
||||
public class OptionPageGrid : DialogPage
|
||||
{
|
||||
private uint _serverPort = 6666;
|
||||
private uint _clientPort = 6667;
|
||||
private bool _logging = false;
|
||||
private bool _obfuscateLogging = false;
|
||||
private uint _threadCount = 1;
|
||||
|
||||
public delegate void Callback();
|
||||
public static Callback _serverPortChangeCallback = null;
|
||||
public static Callback _clientPortChangeCallback = null;
|
||||
public static Callback _loggingToggled = null;
|
||||
public static Callback _obfuscationToggled = null;
|
||||
public static Callback _threadCountChanged = null;
|
||||
|
||||
[Category("Sourcetrail")]
|
||||
[DisplayName("VS Port")]
|
||||
[Description("The port on which Visual Studio will receive messages")]
|
||||
public uint ServerPort
|
||||
{
|
||||
get { return _serverPort; }
|
||||
set
|
||||
{
|
||||
_serverPort = value;
|
||||
if (_serverPortChangeCallback != null)
|
||||
{
|
||||
_serverPortChangeCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Sourcetrail")]
|
||||
[DisplayName("Sourcetrail Port")]
|
||||
[Description("The port on which Sourcetrail will receive messages")]
|
||||
public uint ClientPort
|
||||
{
|
||||
get { return _clientPort; }
|
||||
set
|
||||
{
|
||||
_clientPort = value;
|
||||
if (_clientPortChangeCallback != null)
|
||||
{
|
||||
_clientPortChangeCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Sourcetrail")]
|
||||
[DisplayName("File Logging")]
|
||||
[Description("Enables or disables file logging for the plugin")]
|
||||
public bool LoggingEnabled
|
||||
{
|
||||
get { return _logging; }
|
||||
set
|
||||
{
|
||||
_logging = value;
|
||||
if(_loggingToggled != null)
|
||||
{
|
||||
_loggingToggled();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Sourcetrail")]
|
||||
[DisplayName("Log Obfuscation")]
|
||||
[Description("Names will be obfuscated in log files. Note that already logged data will not be obfuscated retroactively. A dictionary file will be created that you can use to make sense of obfuscated logs. Keep this dictionary to yourself!")]
|
||||
public bool ObfuscateLogging
|
||||
{
|
||||
get { return _obfuscateLogging; }
|
||||
set
|
||||
{
|
||||
_obfuscateLogging = value;
|
||||
if (_obfuscationToggled != null)
|
||||
{
|
||||
_obfuscationToggled();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Sourcetrail")]
|
||||
[DisplayName("Thread Count")]
|
||||
[Description("The maximum number of threads that will be used while building Compilation Databases")]
|
||||
public uint ThreadCount
|
||||
{
|
||||
get { return _threadCount; }
|
||||
set
|
||||
{
|
||||
_threadCount = value;
|
||||
if(_threadCountChanged != null)
|
||||
{
|
||||
_threadCountChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public OptionPageGrid()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[PackageRegistration(UseManagedResourcesOnly = true)]
|
||||
[InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
|
||||
[ProvideMenuResource("Menus.ctmenu", 1)]
|
||||
[Guid(GuidList.guidSourcetrailPluginPkgString)]
|
||||
[ProvideAutoLoad(Microsoft.VisualStudio.Shell.Interop.UIContextGuids80.NoSolution)]
|
||||
[ProvideOptionPage(typeof(OptionPageGrid), "Sourcetrail", "Sourcetrail Settings", 0, 0, true)]
|
||||
|
||||
public sealed class SourcetrailPluginPackage : Package
|
||||
{
|
||||
private MenuCommand _menuItemSetActiveToken = null;
|
||||
private MenuCommand _menuItemCreateCdb = null;
|
||||
private MenuCommand _menuItemOpenLogDir = null;
|
||||
|
||||
private SolutionEvents _solutionEvents = null;
|
||||
|
||||
private bool _validSolutionLoaded = false;
|
||||
|
||||
Utility.CompilationDatabaseSettingsList _recentSettingsList = new Utility.CompilationDatabaseSettingsList();
|
||||
|
||||
public uint ServerPort
|
||||
{
|
||||
get
|
||||
{
|
||||
OptionPageGrid page = (OptionPageGrid)GetDialogPage(typeof(OptionPageGrid));
|
||||
return page.ServerPort;
|
||||
}
|
||||
}
|
||||
|
||||
public uint ClientPort
|
||||
{
|
||||
get
|
||||
{
|
||||
OptionPageGrid page = (OptionPageGrid)GetDialogPage(typeof(OptionPageGrid));
|
||||
return page.ClientPort;
|
||||
}
|
||||
}
|
||||
|
||||
public bool LoggingEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
OptionPageGrid page = (OptionPageGrid)GetDialogPage(typeof(OptionPageGrid));
|
||||
return page.LoggingEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
public bool LogObfuscationEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
OptionPageGrid page = (OptionPageGrid)GetDialogPage(typeof(OptionPageGrid));
|
||||
return page.ObfuscateLogging;
|
||||
}
|
||||
}
|
||||
|
||||
public uint ThreadCount
|
||||
{
|
||||
get
|
||||
{
|
||||
OptionPageGrid page = (OptionPageGrid)GetDialogPage(typeof(OptionPageGrid));
|
||||
return page.ThreadCount;
|
||||
}
|
||||
}
|
||||
|
||||
System.Threading.Thread _serverThread = null;
|
||||
|
||||
|
||||
|
||||
public SourcetrailPluginPackage()
|
||||
{}
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
InitLogging();
|
||||
InitNetwork();
|
||||
|
||||
Utility.FileUtility._errorCallback = new Utility.FileUtility.ErrorCallback(OnFileUtilityError);
|
||||
|
||||
// register callbacks for changes of plugin settings
|
||||
OptionPageGrid._serverPortChangeCallback = new OptionPageGrid.Callback(OnServerPortChanged);
|
||||
OptionPageGrid._clientPortChangeCallback = new OptionPageGrid.Callback(OnClientPortChanged);
|
||||
OptionPageGrid._loggingToggled = new OptionPageGrid.Callback(OnLoggingToggled);
|
||||
OptionPageGrid._obfuscationToggled = new OptionPageGrid.Callback(OnObfuscationToggled);
|
||||
|
||||
// register the plugin UI elements
|
||||
OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
|
||||
if (null != mcs)
|
||||
{
|
||||
CommandID setActiveTokenCommandID = new CommandID(GuidList.guidSourcetrailPluginCmdSet, (int)PkgCmdIDList.cmdidSourcetrailSetActiveToken);
|
||||
CommandID createCdbID = new CommandID(GuidList.guidSourcetrailPluginCmdSet, (int)PkgCmdIDList.cmdidSourcetrailCreateCdb);
|
||||
CommandID openLogDirID = new CommandID(GuidList.guidSourcetrailPluginCmdSet, (int)PkgCmdIDList.cmdidSourcetrailOpenLogFolder);
|
||||
|
||||
_menuItemSetActiveToken = new MenuCommand(MenuItemCallback, setActiveTokenCommandID);
|
||||
_menuItemCreateCdb = new MenuCommand(MenuItemCallback, createCdbID);
|
||||
_menuItemOpenLogDir = new MenuCommand(MenuItemCallback, openLogDirID);
|
||||
|
||||
_menuItemSetActiveToken.Enabled = false;
|
||||
_menuItemCreateCdb.Enabled = false;
|
||||
_menuItemOpenLogDir.Enabled = true;
|
||||
|
||||
mcs.AddCommand(_menuItemSetActiveToken);
|
||||
mcs.AddCommand(_menuItemCreateCdb);
|
||||
mcs.AddCommand(_menuItemOpenLogDir);
|
||||
}
|
||||
|
||||
// register callbacks to enable/disable interaction for eligible solutions
|
||||
DTE dte = (DTE)GetService(typeof(DTE));
|
||||
_solutionEvents = dte.Events.SolutionEvents;
|
||||
|
||||
_solutionEvents.Opened += OnSolutionOpened;
|
||||
_solutionEvents.AfterClosing += OnSolutionClosed;
|
||||
|
||||
SendPing();
|
||||
|
||||
Logging.Logging.LogInfo("Initialization done");
|
||||
}
|
||||
|
||||
void OnSolutionOpened()
|
||||
{
|
||||
Logging.Logging.LogInfo("A solution was loaded, checking languages");
|
||||
|
||||
try
|
||||
{
|
||||
// the sourcetrail ui should only be enabled when the solution contains C/C++ projects
|
||||
DTE dte = (DTE)GetService(typeof(DTE));
|
||||
List<String> languages = Utility.SolutionUtility.GetSolutionLanguages(dte);
|
||||
|
||||
string solutionPath = Utility.SolutionUtility.GetSolutionPath(dte);
|
||||
|
||||
if(_recentSettingsList.CheckCdbForSolutionExists(solutionPath))
|
||||
{
|
||||
Logging.Logging.LogInfo("A Cdb for the loaded solution already exists.");
|
||||
}
|
||||
|
||||
bool enable = false;
|
||||
foreach (String language in languages)
|
||||
{
|
||||
if (language == CodeModelLanguageConstants.vsCMLanguageVC
|
||||
|| language == CodeModelLanguageConstants.vsCMLanguageMC)
|
||||
{
|
||||
Logging.Logging.LogInfo("C/C++ project was detected");
|
||||
enable = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (enable)
|
||||
{
|
||||
Logging.Logging.LogInfo("Enabling plugin UI");
|
||||
_menuItemSetActiveToken.Enabled = true;
|
||||
_menuItemCreateCdb.Enabled = true;
|
||||
|
||||
_validSolutionLoaded = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_validSolutionLoaded = false;
|
||||
|
||||
Logging.Logging.LogInfo("No C/C++ project was detected");
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
DisplayMessage("Error", e.Message);
|
||||
Logging.Logging.LogError(e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
void OnSolutionClosed()
|
||||
{
|
||||
Logging.Logging.LogInfo("Solution closed, disabling plugin UI");
|
||||
|
||||
_menuItemSetActiveToken.Enabled = false;
|
||||
_menuItemCreateCdb.Enabled = false;
|
||||
|
||||
_validSolutionLoaded = false;
|
||||
}
|
||||
|
||||
private void InitNetwork()
|
||||
{
|
||||
Logging.Logging.LogInfo("Initializing Network with Server Port " + ServerPort.ToString() + " and Client Port " + ClientPort.ToString());
|
||||
|
||||
Utility.AsynchronousSocketListener._port = ServerPort;
|
||||
Utility.AsynchronousSocketListener server = new Utility.AsynchronousSocketListener();
|
||||
Utility.AsynchronousSocketListener._onReadCallback = new Utility.AsynchronousSocketListener.OnReadCallback(OnNetworkReadCallback);
|
||||
Utility.AsynchronousSocketListener._onErrorCallback = new Utility.AsynchronousSocketListener.OnReadCallback(OnNetworkErrorCallback);
|
||||
_serverThread = new System.Threading.Thread(server.DoWork);
|
||||
_serverThread.Start();
|
||||
|
||||
Utility.AsynchronousClient._port = ClientPort;
|
||||
Utility.AsynchronousClient._onErrorCallback = new Utility.AsynchronousSocketListener.OnReadCallback(OnNetworkErrorCallback);
|
||||
}
|
||||
|
||||
private void InitLogging()
|
||||
{
|
||||
DTE dte = (DTE)GetService(typeof(DTE));
|
||||
|
||||
Logging.FileLogger fileLogger = new Logging.FileLogger();
|
||||
Logging.VSOutputLogger vsLogger = new Logging.VSOutputLogger(dte);
|
||||
|
||||
Logging.LogManager.GetInstance().Loggers.Add(fileLogger);
|
||||
Logging.LogManager.GetInstance().Loggers.Add(vsLogger);
|
||||
Logging.LogManager.GetInstance().LoggingEnabled = LoggingEnabled;
|
||||
|
||||
Logging.Obfuscation.NameObfuscator.Enabled(LogObfuscationEnabled);
|
||||
|
||||
Logging.Logging.LogInfo("Logging initialized");
|
||||
}
|
||||
|
||||
private void SendPing()
|
||||
{
|
||||
string message = Utility.NetworkProtocolUtility.CreatePingMessage();
|
||||
|
||||
Utility.AsynchronousClient.Send(message);
|
||||
}
|
||||
|
||||
private void OnCreateProject(List<EnvDTE.Project> projects, string configurationName, string platformName, string targetDir, string fileName, string cStandard)
|
||||
{
|
||||
DTE dte = (DTE)GetService(typeof(DTE));
|
||||
|
||||
Wizard.WindowCreateCdb createCdbWindow = new Wizard.WindowCreateCdb();
|
||||
createCdbWindow.Projects = projects;
|
||||
createCdbWindow.ConfigurationName = configurationName;
|
||||
createCdbWindow.PlatformName = platformName;
|
||||
createCdbWindow.TargetDir = targetDir;
|
||||
createCdbWindow.FileName = fileName;
|
||||
createCdbWindow.CStandard = cStandard;
|
||||
createCdbWindow.ThreadCount = (int)ThreadCount;
|
||||
createCdbWindow.SolutionDir = Utility.SolutionUtility.GetSolutionPath(dte);
|
||||
|
||||
createCdbWindow.Cdb = _recentSettingsList.GetCdbForSolution(createCdbWindow.SolutionDir, targetDir + "\\" + fileName + ".json");
|
||||
|
||||
createCdbWindow.CallbackOnFinishedCreatingCdb = HandleFinishedCdb;
|
||||
|
||||
createCdbWindow.StartWorking();
|
||||
createCdbWindow.ShowDialog();
|
||||
}
|
||||
|
||||
private void HandleFinishedCdb(Wizard.WindowCreateCdb.CreationResult creationResult)
|
||||
{
|
||||
if(creationResult._cdbSettings != null && creationResult._cdbDirectory.Length > 0 && creationResult._cdbName.Length > 0)
|
||||
{
|
||||
_recentSettingsList.AppendOrUpdate(creationResult._cdbSettings);
|
||||
_recentSettingsList.SaveMetaData();
|
||||
|
||||
Wizard.WindowCdbReady dialog = new Wizard.WindowCdbReady();
|
||||
dialog.setData(creationResult);
|
||||
dialog.ShowDialog();
|
||||
|
||||
_recentSettingsList.Refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogError("Invalid data received");
|
||||
}
|
||||
}
|
||||
|
||||
private void MenuItemCallback(object sender, EventArgs e)
|
||||
{
|
||||
MenuCommand menuCommand = sender as MenuCommand;
|
||||
|
||||
DTE dte = (DTE)GetService(typeof(DTE));
|
||||
|
||||
if (menuCommand != null)
|
||||
{
|
||||
if (menuCommand.CommandID.ID == (int)PkgCmdIDList.cmdidSourcetrailSetActiveToken)
|
||||
{
|
||||
string fileName = Utility.FileUtility.GetActiveDocumentName(dte);
|
||||
string filePath = Utility.FileUtility.GetActiveDocumentPath(dte);
|
||||
|
||||
int lineNumber = Utility.FileUtility.GetActiveLineNumber(dte);
|
||||
int columnNumber = Utility.FileUtility.GetActiveColumnNumber(dte);
|
||||
|
||||
string message = Utility.NetworkProtocolUtility.CreateActivateTokenMessage(filePath + fileName, lineNumber, columnNumber);
|
||||
|
||||
Utility.AsynchronousClient.Send(message);
|
||||
}
|
||||
else if(menuCommand.CommandID.ID == (int)PkgCmdIDList.cmdidSourcetrailCreateCdb)
|
||||
{
|
||||
CreateCompilationDatabase(dte);
|
||||
}
|
||||
else if(menuCommand.CommandID.ID == (int)PkgCmdIDList.cmdidSourcetrailOpenLogFolder)
|
||||
{
|
||||
Utility.SystemUtility.OpenWindowsExplorerAtDirectory(Utility.DataUtility.GetStandardFolderDirectory());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnNetworkReadCallback(string message)
|
||||
{
|
||||
Utility.NetworkProtocolUtility.MESSAGE_TYPE messageType = Utility.NetworkProtocolUtility.GetMessageType(message);
|
||||
|
||||
if(messageType == Utility.NetworkProtocolUtility.MESSAGE_TYPE.MOVE_CURSOR)
|
||||
{
|
||||
Utility.NetworkProtocolUtility.CursorPosition cursorPosition = Utility.NetworkProtocolUtility.ParseSetCursorMessage(message);
|
||||
if (cursorPosition.Valid)
|
||||
{
|
||||
cursorPosition.ColumnNumber += 1; // VS counts columns starting at 1, sourcetrail starts at 0
|
||||
DTE dte = (DTE)GetService(typeof(DTE));
|
||||
if (Utility.FileUtility.OpenSourceFile(dte, cursorPosition.FilePath))
|
||||
{
|
||||
Utility.FileUtility.GoToLine(dte, cursorPosition.LineNumber, cursorPosition.ColumnNumber);
|
||||
|
||||
Utility.SystemUtility.GetWindowFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(messageType == Utility.NetworkProtocolUtility.MESSAGE_TYPE.CREATE_CDB)
|
||||
{
|
||||
if(_validSolutionLoaded)
|
||||
{
|
||||
DTE dte = (DTE)GetService(typeof(DTE));
|
||||
|
||||
CreateCompilationDatabase(dte);
|
||||
}
|
||||
}
|
||||
else if(messageType == Utility.NetworkProtocolUtility.MESSAGE_TYPE.PING)
|
||||
{
|
||||
SendPing();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnNetworkErrorCallback(string message)
|
||||
{
|
||||
Logging.Logging.LogError("Network Error: " + message.ToString());
|
||||
DisplayMessage("Sourcetrail Network Error", message);
|
||||
}
|
||||
|
||||
private void OnFileUtilityError(string message)
|
||||
{
|
||||
Logging.Logging.LogError("File Error: " + message.ToString());
|
||||
DisplayMessage("Sourcetrail File Error", message);
|
||||
}
|
||||
|
||||
private void OnServerPortChanged()
|
||||
{
|
||||
Logging.Logging.LogInfo("Changing Server Port to " + ServerPort.ToString());
|
||||
|
||||
Utility.AsynchronousSocketListener._port = ServerPort;
|
||||
|
||||
_serverThread.Abort();
|
||||
Utility.AsynchronousSocketListener server = new Utility.AsynchronousSocketListener();
|
||||
_serverThread = new System.Threading.Thread(server.DoWork);
|
||||
_serverThread.Start();
|
||||
}
|
||||
|
||||
private void OnClientPortChanged()
|
||||
{
|
||||
Logging.Logging.LogInfo("Changing Client Port to " + ClientPort.ToString());
|
||||
|
||||
Utility.AsynchronousClient._port = ClientPort;
|
||||
}
|
||||
|
||||
private void OnLoggingToggled()
|
||||
{
|
||||
Logging.LogManager.GetInstance().LoggingEnabled = LoggingEnabled;
|
||||
|
||||
if(LoggingEnabled)
|
||||
{
|
||||
Logging.Logging.LogInfo("Logging enabled");
|
||||
}
|
||||
}
|
||||
|
||||
private void OnObfuscationToggled()
|
||||
{
|
||||
Logging.Obfuscation.NameObfuscator.Enabled(LogObfuscationEnabled);
|
||||
|
||||
if(LogObfuscationEnabled)
|
||||
{
|
||||
Logging.Logging.LogInfo("Log Obfuscation enabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogInfo("Log Obfuscation disabled");
|
||||
}
|
||||
}
|
||||
|
||||
private void DisplayMessage(string title, string message)
|
||||
{
|
||||
IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell));
|
||||
Guid clsid = Guid.Empty;
|
||||
int result;
|
||||
Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(uiShell.ShowMessageBox(
|
||||
0,
|
||||
ref clsid,
|
||||
title,
|
||||
message,
|
||||
string.Empty,
|
||||
0,
|
||||
OLEMSGBUTTON.OLEMSGBUTTON_OK,
|
||||
OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
|
||||
OLEMSGICON.OLEMSGICON_INFO,
|
||||
0, // false
|
||||
out result
|
||||
));
|
||||
}
|
||||
|
||||
private void CreateCompilationDatabase(DTE dte)
|
||||
{
|
||||
Logging.Logging.LogInfo("Preparing CDB dialog");
|
||||
|
||||
Wizard.ProjectSetupWindow window = new Wizard.ProjectSetupWindow();
|
||||
|
||||
window._projectStructure = Utility.SolutionUtility.GetSolutionVCProjects(dte);
|
||||
window._configurations = Utility.SolutionUtility.GetConfigurationNames(dte);
|
||||
window._platforms = Utility.SolutionUtility.GetPlatformNames(dte);
|
||||
window._solutionDirectory = Path.GetDirectoryName(dte.Solution.FullName);
|
||||
window._solutionFileName = Path.GetFileNameWithoutExtension(dte.Solution.FullName);
|
||||
|
||||
bool containsCFiles = true; // Utility.SolutionUtility.ContainsCFiles(dte); // takes ridiculously long, I'd rather just display the option by default
|
||||
window._containsCFiles = containsCFiles;
|
||||
|
||||
window._cdb = _recentSettingsList.GetMostCurrentCdbForSolution(Utility.SolutionUtility.GetSolutionPath(dte));
|
||||
|
||||
window.UpdateGUI();
|
||||
window._onCreateProject = OnCreateProject;
|
||||
|
||||
window.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
-145
@@ -1,145 +0,0 @@
|
||||
using CoatiSoftware.SourcetrailPlugin.SolutionParser;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Utility
|
||||
{
|
||||
class CompilationDatabaseSettingsList
|
||||
{
|
||||
private List<CompilationDatabaseSettings> _settings = new List<CompilationDatabaseSettings>();
|
||||
|
||||
public List<CompilationDatabaseSettings> Settings
|
||||
{
|
||||
get { return _settings; }
|
||||
}
|
||||
|
||||
public CompilationDatabaseSettingsList()
|
||||
{
|
||||
Refresh();
|
||||
}
|
||||
|
||||
public void AppendOrUpdate(CompilationDatabaseSettings cdb)
|
||||
{
|
||||
if(_settings.Exists(item => item.Name == cdb.Name && item.Directory == cdb.Directory) == false)
|
||||
{
|
||||
_settings.Add(cdb);
|
||||
}
|
||||
else
|
||||
{
|
||||
int idx = _settings.FindIndex(item => item.Name == cdb.Name && item.Directory == cdb.Directory);
|
||||
_settings[idx] = cdb;
|
||||
}
|
||||
}
|
||||
|
||||
public void Refresh()
|
||||
{
|
||||
List<CompilationDatabaseSettings> cdbs = new List<CompilationDatabaseSettings>();
|
||||
|
||||
try
|
||||
{
|
||||
string data = Utility.DataUtility.GetInstance().GetData();
|
||||
cdbs = CompilationDatabaseSettings.ParseCdbsMetaData(data);
|
||||
|
||||
foreach (CompilationDatabaseSettings cdb in cdbs)
|
||||
{
|
||||
cdb.CheckCdbExists();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Failed to aquire data: " + e.Message);
|
||||
}
|
||||
|
||||
_settings = cdbs;
|
||||
}
|
||||
|
||||
public List<CompilationDatabaseSettings> GetCdbsForSolution(string solutionPath)
|
||||
{
|
||||
return _settings.FindAll(item => item.SourceProject == solutionPath);
|
||||
}
|
||||
|
||||
public CompilationDatabaseSettings GetCdbForSolution(string solutionPath)
|
||||
{
|
||||
return _settings.Find(item => item.SourceProject == solutionPath);
|
||||
}
|
||||
|
||||
public CompilationDatabaseSettings GetMostCurrentCdbForSolution(string solutionPath)
|
||||
{
|
||||
CompilationDatabaseSettings result = null;
|
||||
|
||||
try
|
||||
{
|
||||
List<CompilationDatabaseSettings> candidates = GetCdbsForSolution(solutionPath);
|
||||
|
||||
System.DateTime youngest = System.DateTime.MinValue;
|
||||
foreach (CompilationDatabaseSettings cdb in candidates)
|
||||
{
|
||||
if (cdb.LastUpdated >= youngest)
|
||||
{
|
||||
youngest = cdb.LastUpdated;
|
||||
result = cdb;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Failed to find cdb: " + e.Message);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public CompilationDatabaseSettings GetCdbForSolution(string solutionPath, string cdbPath)
|
||||
{
|
||||
return _settings.Find(item => item.SourceProject == solutionPath && (item.Directory + "\\" + item.Name + ".json") == cdbPath);
|
||||
}
|
||||
|
||||
public bool CheckCdbForSolutionExists(string solutionPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
CompilationDatabaseSettings cdb = GetCdbForSolution(solutionPath);
|
||||
if (cdb != null && System.IO.File.Exists(cdb.Directory + "\\" + cdb.Name + ".json"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Failed to check cdb: " + e.Message);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void SaveMetaData()
|
||||
{
|
||||
try
|
||||
{
|
||||
XmlDocument doc = new XmlDocument();
|
||||
XmlNode root = doc.CreateElement("cdbs");
|
||||
|
||||
foreach (CompilationDatabaseSettings cdb in _settings)
|
||||
{
|
||||
XmlNode metaData = cdb.GetMetaDataXML(doc);
|
||||
|
||||
root.AppendChild(metaData);
|
||||
}
|
||||
|
||||
System.IO.StringWriter writer = new System.IO.StringWriter();
|
||||
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(XmlElement));
|
||||
serializer.Serialize(writer, root);
|
||||
|
||||
DataUtility.GetInstance().ClearData();
|
||||
DataUtility.GetInstance().AppendData(writer.ToString());
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Failed to save meta data: " + e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Utility
|
||||
{
|
||||
class DataUtility
|
||||
{
|
||||
static private string _standardFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Coati Software\\Plugins\\VS\\";
|
||||
static private string _standardFileName = "cdbs.sourcetraildata";
|
||||
|
||||
static private DataUtility _instance = null;
|
||||
|
||||
static private bool _valid = true; // stores if a file system operation failed, indicating that there is something wrong
|
||||
|
||||
static public string GetStandardFolderDirectory()
|
||||
{
|
||||
return _standardFolder;
|
||||
}
|
||||
|
||||
static bool Valid
|
||||
{
|
||||
get { return _valid; }
|
||||
}
|
||||
|
||||
static public DataUtility GetInstance()
|
||||
{
|
||||
if(_instance == null)
|
||||
{
|
||||
_instance = new DataUtility();
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
|
||||
private DataUtility()
|
||||
{
|
||||
CreateStandardFolderIfNotExists();
|
||||
CreateStandardFileIfNotExists();
|
||||
}
|
||||
|
||||
public void AppendData(string data)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (System.IO.StreamWriter file = System.IO.File.AppendText(_standardFolder + _standardFileName))
|
||||
{
|
||||
file.WriteLine(data);
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Failed to write data to file '" + _standardFolder + _standardFileName + "':" + e.Message);
|
||||
_valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
public string GetData()
|
||||
{
|
||||
string result = "";
|
||||
|
||||
try
|
||||
{
|
||||
string data = "";
|
||||
if (System.IO.File.Exists(_standardFolder + _standardFileName))
|
||||
{
|
||||
using (System.IO.StreamReader file = new System.IO.StreamReader(_standardFolder + _standardFileName))
|
||||
{
|
||||
string line = "";
|
||||
|
||||
while ((line = file.ReadLine()) != null)
|
||||
{
|
||||
data += line;
|
||||
}
|
||||
}
|
||||
}
|
||||
result = data;
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Failed to read data from file '" + _standardFolder + _standardFileName + "':" + e.Message);
|
||||
_valid = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void ClearData()
|
||||
{
|
||||
try
|
||||
{
|
||||
System.IO.File.WriteAllText(_standardFolder + _standardFileName, "");
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Failed to clear data: " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateStandardFolderIfNotExists()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (System.IO.Directory.Exists(_standardFolder) == false)
|
||||
{
|
||||
System.IO.Directory.CreateDirectory(_standardFolder);
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Failed to create folder: " + e.Message);
|
||||
_valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateStandardFileIfNotExists()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (System.IO.File.Exists(_standardFolder + _standardFileName) == false)
|
||||
{
|
||||
System.IO.File.Create(_standardFolder + _standardFileName);
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Failed to create file: " + e.Message);
|
||||
_valid = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
using EnvDTE;
|
||||
using System;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Utility
|
||||
{
|
||||
class FileUtility
|
||||
{
|
||||
public delegate void ErrorCallback(string message);
|
||||
|
||||
public static ErrorCallback _errorCallback = null;
|
||||
|
||||
/**
|
||||
* Returns true when file was found, false otherwise
|
||||
*/
|
||||
public static bool OpenSourceFile(DTE dte, string fileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
dte.ItemOperations.OpenFile(fileName);
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
|
||||
if (_errorCallback != null)
|
||||
{
|
||||
_errorCallback("Failed to open file at " + fileName);
|
||||
}
|
||||
|
||||
string message = "Failed to open file at " + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(fileName);
|
||||
Logging.Logging.LogError(message);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void GoToLine(DTE dte, int lineNumber, int columnNumber)
|
||||
{
|
||||
try
|
||||
{
|
||||
((EnvDTE.TextSelection)dte.ActiveDocument.Selection).MoveToLineAndOffset(lineNumber, columnNumber);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
|
||||
if (_errorCallback != null)
|
||||
{
|
||||
_errorCallback("Failed to set cursor to position [" + lineNumber.ToString() + "," + columnNumber.ToString() + "]");
|
||||
|
||||
string message = "Failed to set cursor to position [" + lineNumber.ToString() + "," + columnNumber.ToString() + "]";
|
||||
Logging.Logging.LogError(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetActiveDocumentName(DTE dte)
|
||||
{
|
||||
return dte.ActiveDocument.Name;
|
||||
}
|
||||
|
||||
public static string GetActiveDocumentPath(DTE dte)
|
||||
{
|
||||
return dte.ActiveDocument.Path;
|
||||
}
|
||||
|
||||
public static int GetActiveLineNumber(DTE dte)
|
||||
{
|
||||
return ((EnvDTE.TextSelection)dte.ActiveDocument.Selection).ActivePoint.Line;
|
||||
}
|
||||
|
||||
public static int GetActiveColumnNumber(DTE dte)
|
||||
{
|
||||
return ((EnvDTE.TextSelection)dte.ActiveDocument.Selection).ActivePoint.LineCharOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
using VCProjectEngineWrapper;
|
||||
using System;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Utility
|
||||
{
|
||||
public abstract class IPathResolver
|
||||
{
|
||||
public string ResolveVsMacroInPath(string path, IVCConfigurationWrapper vcProjectConfig)
|
||||
{
|
||||
string result = path;
|
||||
|
||||
try
|
||||
{
|
||||
Tuple<int, int> potentialMacroPosition = Utility.StringUtility.FindFirstRange(path, "$(", ")");
|
||||
|
||||
if (potentialMacroPosition != null)
|
||||
{
|
||||
string potentialMacro = path.Substring(potentialMacroPosition.Item1, potentialMacroPosition.Item2 - potentialMacroPosition.Item1 + 1);
|
||||
|
||||
string resolvedMacro = ResolveVsMacro(potentialMacro, vcProjectConfig);
|
||||
|
||||
result = path.Substring(0, potentialMacroPosition.Item1) + resolvedMacro + path.Substring(potentialMacroPosition.Item2 + 1);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public string GetAsAbsoluteCanonicalPath(string path, IVCProjectWrapper project)
|
||||
{
|
||||
if (path.Length > 0 && !System.IO.Path.IsPathRooted(path))
|
||||
{
|
||||
path = DoGetAsAbsoluteCanonicalPath(path, project);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
public abstract string GetCompilationDatabaseFilePath();
|
||||
|
||||
protected abstract string DoGetAsAbsoluteCanonicalPath(string path, IVCProjectWrapper project);
|
||||
|
||||
protected abstract string ResolveVsMacro(string potentialMacro, IVCConfigurationWrapper vcProjectConfig);
|
||||
}
|
||||
}
|
||||
-280
@@ -1,280 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Utility
|
||||
{
|
||||
class NetworkProtocolUtility
|
||||
{
|
||||
private static string s_divider = ">>";
|
||||
private static string s_setActiveTokenPrefix = "setActiveToken";
|
||||
private static string s_moveCursorPrefix = "moveCursor";
|
||||
private static string s_endOfMessageToken = "<EOM>";
|
||||
|
||||
private static string s_createCdbProjectPrefix = "createCDBProject";
|
||||
private static string s_ideId = "vs";
|
||||
|
||||
private static string s_createCdbPrefix = "createCDB";
|
||||
|
||||
private static string s_pingPrefix = "ping";
|
||||
|
||||
public enum MESSAGE_TYPE
|
||||
{
|
||||
UNKNOWN = 0,
|
||||
MOVE_CURSOR,
|
||||
CREATE_CDB,
|
||||
PING
|
||||
}
|
||||
|
||||
public class CursorPosition
|
||||
{
|
||||
private string _filePath = "";
|
||||
private int _lineNumber = 0;
|
||||
private int _columnNumber = 0;
|
||||
private bool _valid = false;
|
||||
|
||||
public string FilePath
|
||||
{
|
||||
get { return _filePath; }
|
||||
set { _filePath = value; }
|
||||
}
|
||||
|
||||
public int LineNumber
|
||||
{
|
||||
get { return _lineNumber; }
|
||||
set { _lineNumber = value; }
|
||||
}
|
||||
|
||||
public int ColumnNumber
|
||||
{
|
||||
get { return _columnNumber; }
|
||||
set { _columnNumber = value; }
|
||||
}
|
||||
|
||||
public bool Valid
|
||||
{
|
||||
get { return _valid; }
|
||||
set { _valid = value; }
|
||||
}
|
||||
}
|
||||
|
||||
public class Ping
|
||||
{
|
||||
private string _id = "";
|
||||
private bool _valid = false;
|
||||
|
||||
public string Id
|
||||
{
|
||||
get { return _id; }
|
||||
set { _id = value; }
|
||||
}
|
||||
|
||||
public bool Valid
|
||||
{
|
||||
get { return _valid; }
|
||||
set { _valid = value; }
|
||||
}
|
||||
}
|
||||
|
||||
public static string CreateActivateTokenMessage(string filePath, int lineNumber, int columnNumber)
|
||||
{
|
||||
string message = s_setActiveTokenPrefix;
|
||||
|
||||
message += s_divider;
|
||||
|
||||
message += filePath;
|
||||
|
||||
message += s_divider;
|
||||
|
||||
message += lineNumber.ToString();
|
||||
|
||||
message += s_divider;
|
||||
|
||||
message += columnNumber.ToString();
|
||||
|
||||
message += s_endOfMessageToken;
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
public static string CreateCreateProjectMessage(string cdbPath, List<string> headerPaths)
|
||||
{
|
||||
string message = s_createCdbProjectPrefix;
|
||||
|
||||
message += s_divider;
|
||||
|
||||
message += cdbPath;
|
||||
|
||||
message += s_divider;
|
||||
|
||||
foreach(string path in headerPaths)
|
||||
{
|
||||
message += path;
|
||||
|
||||
message += s_divider;
|
||||
}
|
||||
|
||||
message += s_ideId;
|
||||
|
||||
message += s_endOfMessageToken;
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
public static string CreatePingMessage()
|
||||
{
|
||||
string message = s_pingPrefix;
|
||||
|
||||
message += s_divider;
|
||||
|
||||
message += s_ideId;
|
||||
|
||||
message += s_endOfMessageToken;
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
public static MESSAGE_TYPE GetMessageType(string message)
|
||||
{
|
||||
List<string> tokens = GetMessageTokens(message);
|
||||
|
||||
if (tokens.Count > 0)
|
||||
{
|
||||
if (tokens[0] == s_createCdbPrefix)
|
||||
{
|
||||
return MESSAGE_TYPE.CREATE_CDB;
|
||||
}
|
||||
else if (tokens[0] == s_moveCursorPrefix)
|
||||
{
|
||||
return MESSAGE_TYPE.MOVE_CURSOR;
|
||||
}
|
||||
else if (tokens[0] == s_pingPrefix)
|
||||
{
|
||||
return MESSAGE_TYPE.PING;
|
||||
}
|
||||
else
|
||||
{
|
||||
return MESSAGE_TYPE.UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
return MESSAGE_TYPE.UNKNOWN;
|
||||
}
|
||||
|
||||
public static CursorPosition ParseSetCursorMessage(string message)
|
||||
{
|
||||
CursorPosition result = new CursorPosition();
|
||||
|
||||
List<string> tokens = GetMessageTokens(message);
|
||||
|
||||
if(tokens.Count != 4)
|
||||
{
|
||||
Logging.Logging.LogError("Invalid message: " + message);
|
||||
Logging.Logging.LogError("Invalid token count for 'move cursor' message. Expected 4, but got " + tokens.Count.ToString());
|
||||
return result;
|
||||
}
|
||||
|
||||
if(tokens[0] != s_moveCursorPrefix)
|
||||
{
|
||||
Logging.Logging.LogError("Invalid message: " + message);
|
||||
Logging.Logging.LogError("Invalid message type. Expected '" + s_moveCursorPrefix + "' but got '" + tokens[0] + "'");
|
||||
return result;
|
||||
}
|
||||
|
||||
result.FilePath = tokens[1];
|
||||
|
||||
int lineNumber = 0;
|
||||
if(int.TryParse(tokens[2], out lineNumber))
|
||||
{
|
||||
result.LineNumber = lineNumber;
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogError("Invalid message: " + message);
|
||||
Logging.Logging.LogError("Failed to parse line number");
|
||||
return result;
|
||||
}
|
||||
|
||||
int columnNumber = 0;
|
||||
if(int.TryParse(tokens[3], out columnNumber))
|
||||
{
|
||||
result.ColumnNumber = columnNumber;
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogError("Invalid message: " + message);
|
||||
Logging.Logging.LogError("Failed to parse column number");
|
||||
return result;
|
||||
}
|
||||
|
||||
result.Valid = true;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Ping ParsePingMessage(string message)
|
||||
{
|
||||
Ping result = new Ping();
|
||||
|
||||
List<string> tokens = GetMessageTokens(message);
|
||||
|
||||
if(tokens.Count != 2)
|
||||
{
|
||||
Logging.Logging.LogError("Invalid message: " + message);
|
||||
Logging.Logging.LogError("Invalid token count for 'ping' message. Expected 2, but got " + tokens.Count.ToString());
|
||||
return result;
|
||||
}
|
||||
|
||||
if (tokens[0] != s_pingPrefix)
|
||||
{
|
||||
Logging.Logging.LogError("Invalid message: " + message);
|
||||
Logging.Logging.LogError("Invalid message type. Expected '" + s_pingPrefix + "' but got '" + tokens[0] + "'");
|
||||
return result;
|
||||
}
|
||||
|
||||
result.Id = tokens[1];
|
||||
result.Valid = true;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static List<string> GetMessageTokens(string message)
|
||||
{
|
||||
List<string> tokens = new List<string>();
|
||||
|
||||
if(RemoveEOMString(ref message))
|
||||
{
|
||||
tokens = message.Split(s_divider.ToCharArray()).ToList();
|
||||
|
||||
// removing empty strings
|
||||
List<string> cleanTokens = new List<string>();
|
||||
foreach(string token in tokens)
|
||||
{
|
||||
if(token.Length > 0)
|
||||
{
|
||||
cleanTokens.Add(token);
|
||||
}
|
||||
}
|
||||
|
||||
tokens = cleanTokens;
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogError("");
|
||||
}
|
||||
|
||||
return tokens;
|
||||
}
|
||||
|
||||
// returns false if no EOM string was found
|
||||
private static bool RemoveEOMString(ref string message)
|
||||
{
|
||||
if (message.IndexOf(s_endOfMessageToken) > -1)
|
||||
{
|
||||
message = message.Substring(0, message.IndexOf(s_endOfMessageToken));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,276 +0,0 @@
|
||||
using System;
|
||||
using System.Net.Sockets;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Utility
|
||||
{
|
||||
public class StateObject
|
||||
{
|
||||
public Socket _workSocket = null;
|
||||
public const int _bufferSize = 1024;
|
||||
public byte[] _buffer = new byte[_bufferSize];
|
||||
public StringBuilder _stringBuilder = new StringBuilder();
|
||||
}
|
||||
|
||||
public class AsynchronousSocketListener
|
||||
{
|
||||
public static ManualResetEvent _allDone = new ManualResetEvent(false);
|
||||
|
||||
public delegate void OnReadCallback(string message);
|
||||
|
||||
public static OnReadCallback _onReadCallback = null;
|
||||
public static OnReadCallback _onErrorCallback = null;
|
||||
|
||||
private static string _endOfMessageToken = "<EOM>";
|
||||
|
||||
public static uint _port = 6666;
|
||||
|
||||
public AsynchronousSocketListener()
|
||||
{
|
||||
}
|
||||
|
||||
public void DoWork()
|
||||
{
|
||||
StartListening();
|
||||
}
|
||||
|
||||
public static void StartListening()
|
||||
{
|
||||
const string ipAddressString = "127.0.0.1";
|
||||
|
||||
byte[] bytes = new Byte[1024];
|
||||
|
||||
IPAddress ipAddress = IPAddress.Parse(ipAddressString);
|
||||
IPEndPoint localEndPoint = new IPEndPoint(ipAddress, (int)_port);
|
||||
|
||||
Socket listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||
|
||||
try
|
||||
{
|
||||
listener.Bind(localEndPoint);
|
||||
listener.Listen(100);
|
||||
|
||||
while (true)
|
||||
{
|
||||
_allDone.Reset();
|
||||
|
||||
listener.BeginAccept(new AsyncCallback(AcceptCallback), listener);
|
||||
_allDone.WaitOne();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void AcceptCallback(IAsyncResult ar)
|
||||
{
|
||||
try
|
||||
{
|
||||
_allDone.Set();
|
||||
|
||||
Socket listener = (Socket)ar.AsyncState;
|
||||
Socket handler = listener.EndAccept(ar);
|
||||
|
||||
StateObject state = new StateObject();
|
||||
state._workSocket = handler;
|
||||
handler.BeginReceive(state._buffer, 0, StateObject._bufferSize, 0, new AsyncCallback(ReadCallback), state);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadCallback(IAsyncResult ar)
|
||||
{
|
||||
try
|
||||
{
|
||||
string content = String.Empty;
|
||||
|
||||
StateObject state = (StateObject)ar.AsyncState;
|
||||
Socket handler = state._workSocket;
|
||||
|
||||
int bytesRead = handler.EndReceive(ar);
|
||||
|
||||
if (bytesRead > 0)
|
||||
{
|
||||
state._stringBuilder.Append(Encoding.ASCII.GetString(state._buffer, 0, bytesRead));
|
||||
|
||||
content = state._stringBuilder.ToString();
|
||||
if (content.IndexOf(_endOfMessageToken) > -1)
|
||||
{
|
||||
if (_onReadCallback != null)
|
||||
{
|
||||
_onReadCallback(content);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
handler.BeginReceive(state._buffer, 0, StateObject._bufferSize, 0, new AsyncCallback(ReadCallback), state);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Excpetion: " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private static void Send(Socket handler, String data)
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] byteData = Encoding.ASCII.GetBytes(data);
|
||||
handler.BeginSend(byteData, 0, byteData.Length, 0, new AsyncCallback(SendCallback), handler);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Excpetion: " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private static void SendCallback(IAsyncResult ar)
|
||||
{
|
||||
try
|
||||
{
|
||||
Socket handler = (Socket)ar.AsyncState;
|
||||
|
||||
int bytesSent = handler.EndSend(ar);
|
||||
Logging.Logging.LogInfo("Sent " + bytesSent.ToString() + " bytes to client.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Excpetion: " + e.Message);
|
||||
|
||||
if (_onErrorCallback != null)
|
||||
{
|
||||
_onErrorCallback(e.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class AsynchronousClient
|
||||
{
|
||||
public static uint _port = 6667;
|
||||
|
||||
private static ManualResetEvent connectDone = new ManualResetEvent(false);
|
||||
private static ManualResetEvent sendDone = new ManualResetEvent(false);
|
||||
|
||||
private static String response = String.Empty;
|
||||
|
||||
public static AsynchronousSocketListener.OnReadCallback _onErrorCallback = null;
|
||||
|
||||
public static void Send(string message)
|
||||
{
|
||||
IPAddress ipAddress = IPAddress.Parse("127.0.0.1");
|
||||
IPEndPoint remoteEP = new IPEndPoint(ipAddress, (int)_port);
|
||||
|
||||
Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||
|
||||
try
|
||||
{
|
||||
IAsyncResult ar = client.BeginConnect(remoteEP, new AsyncCallback(ConnectCallback), client);
|
||||
if (!connectDone.WaitOne(2000))
|
||||
{
|
||||
client.EndConnect(ar);
|
||||
client.Shutdown(SocketShutdown.Both);
|
||||
client.Close();
|
||||
|
||||
Logging.Logging.LogWarning("Connection timed out, message was not sent");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Send(client, message);
|
||||
sendDone.WaitOne();
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(client.Connected)
|
||||
{
|
||||
client.Shutdown(SocketShutdown.Both);
|
||||
client.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void ConnectCallback(IAsyncResult ar)
|
||||
{
|
||||
try
|
||||
{
|
||||
Socket client = (Socket)ar.AsyncState;
|
||||
|
||||
if (client.Connected == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
client.EndConnect(ar);
|
||||
|
||||
connectDone.Set();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Excpetion: " + e.Message);
|
||||
|
||||
if (_onErrorCallback != null)
|
||||
{
|
||||
_onErrorCallback(e.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void Send(Socket client, String data)
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] byteData = Encoding.ASCII.GetBytes(data);
|
||||
|
||||
client.BeginSend(byteData, 0, byteData.Length, 0, new AsyncCallback(SendCallback), client);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private static void SendCallback(IAsyncResult ar)
|
||||
{
|
||||
try
|
||||
{
|
||||
Socket client = (Socket)ar.AsyncState;
|
||||
|
||||
int bytesSent = client.EndSend(ar);
|
||||
|
||||
sendDone.Set();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Excpetion: " + e.Message);
|
||||
|
||||
if (_onErrorCallback != null)
|
||||
{
|
||||
if (e is ObjectDisposedException)
|
||||
{
|
||||
// get this exception every once in a while
|
||||
// doesn't seem to do much, no idea yet why it's there to begin with
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
_onErrorCallback(e.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,356 +0,0 @@
|
||||
using EnvDTE;
|
||||
using Microsoft.VisualStudio;
|
||||
using Microsoft.VisualStudio.Shell;
|
||||
using Microsoft.VisualStudio.Shell.Interop;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using VCProjectEngineWrapper;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Utility
|
||||
{
|
||||
public class ProjectUtility
|
||||
{
|
||||
public static List<string> GetPropertyNamesAndValues(Properties properties)
|
||||
{
|
||||
List<string> ret = new List<string>();
|
||||
foreach (Property propertiy in properties)
|
||||
{
|
||||
string name = propertiy.Name;
|
||||
string value = "";
|
||||
|
||||
try
|
||||
{
|
||||
value = propertiy.Value.ToString();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
value = "Error occurred while converting value to string.";
|
||||
}
|
||||
|
||||
ret.Add(name + ": " + value);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static bool HasProperty(Properties properties, string propertyName)
|
||||
{
|
||||
if (properties != null)
|
||||
{
|
||||
foreach (Property item in properties)
|
||||
{
|
||||
if (item != null && item.Name == propertyName)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool ContainsCFiles(Project project)
|
||||
{
|
||||
List<ProjectItem> projectItems = GetProjectItems(project);
|
||||
|
||||
try
|
||||
{
|
||||
foreach (EnvDTE.ProjectItem item in projectItems)
|
||||
{
|
||||
if (item.FileCodeModel != null && item.FileCodeModel.Language == CodeModelLanguageConstants.vsCMLanguageVC)
|
||||
{
|
||||
string extension = item.Properties.Item("Extension").Value.ToString();
|
||||
if (extension == ".c")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static public List<ProjectItem> GetProjectItems(Project project)
|
||||
{
|
||||
List<ProjectItem> items = new List<ProjectItem>();
|
||||
|
||||
IEnumerator itemEnumerator = project.ProjectItems.GetEnumerator();
|
||||
|
||||
while (itemEnumerator.MoveNext())
|
||||
{
|
||||
ProjectItem currentItem = (ProjectItem)itemEnumerator.Current;
|
||||
items.Add(GetProjectSubItemsRecursive(currentItem, ref items));
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
static private ProjectItem GetProjectSubItemsRecursive(ProjectItem item, ref List<ProjectItem> projectItems)
|
||||
{
|
||||
if (item.ProjectItems == null)
|
||||
{
|
||||
return item;
|
||||
}
|
||||
|
||||
IEnumerator items = item.ProjectItems.GetEnumerator();
|
||||
|
||||
while (items.MoveNext())
|
||||
{
|
||||
ProjectItem currentItem = (ProjectItem)items.Current;
|
||||
projectItems.Add(GetProjectSubItemsRecursive(currentItem, ref projectItems));
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
static public List<string> GetProjectIncludeDirectories(IVCProjectWrapper project, string configurationName, string platformName, IPathResolver pathResolver)
|
||||
{
|
||||
// get additional include directories
|
||||
// source: http://www.mztools.com/articles/2014/MZ2014005.aspx
|
||||
|
||||
Logging.Logging.LogInfo("Attempting to retreive Include Directories for project '" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(project.GetName()) + "'");
|
||||
|
||||
List<string> includeDirectories = new List<string>();
|
||||
|
||||
IVCConfigurationWrapper vcProjectConfig = project.getConfiguration(configurationName, platformName);
|
||||
|
||||
if (vcProjectConfig != null && vcProjectConfig.isValid())
|
||||
{
|
||||
IVCCLCompilerToolWrapper compilerTool = vcProjectConfig.GetCompilerTool();
|
||||
|
||||
if (compilerTool != null && compilerTool.isValid())
|
||||
{
|
||||
foreach (string directory in compilerTool.GetAdditionalIncludeDirectories())
|
||||
{
|
||||
if (directory.Length <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
string resolvedDirectories = pathResolver.ResolveVsMacroInPath(directory, vcProjectConfig);
|
||||
|
||||
foreach (string resolvedDirectory in resolvedDirectories.Split(';'))
|
||||
{
|
||||
string dir = pathResolver.GetAsAbsoluteCanonicalPath(resolvedDirectory, project);
|
||||
includeDirectories.Add(dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IVCPlatformWrapper platform = vcProjectConfig.GetPlatform();
|
||||
if (platform != null && platform.isValid())
|
||||
{
|
||||
foreach (string directory in platform.GetIncludeDirectories())
|
||||
{
|
||||
string resolvedDirectories = pathResolver.ResolveVsMacroInPath(directory, vcProjectConfig);
|
||||
foreach (string resolvedDirectory in resolvedDirectories.Split(';'))
|
||||
{
|
||||
includeDirectories.Add(resolvedDirectory);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Failed to retreive platform include directories: " + e.Message);
|
||||
return new List<string>();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogWarning("Could not retreive Project Configuration. No include directories could be retreived.");
|
||||
return new List<string>();
|
||||
}
|
||||
|
||||
includeDirectories = includeDirectories.Distinct().ToList();
|
||||
|
||||
Logging.Logging.LogInfo("Attempting to clean up.");
|
||||
|
||||
for (int i = 0; i < includeDirectories.Count; i++)
|
||||
{
|
||||
string path = includeDirectories.ElementAt(i).Replace("\\", "/"); // backslashes would cause some string-escaping hassles...
|
||||
|
||||
if (path.Length == 0)
|
||||
{
|
||||
includeDirectories.RemoveAt(i);
|
||||
i--;
|
||||
}
|
||||
else
|
||||
{
|
||||
includeDirectories[i] = path;
|
||||
}
|
||||
}
|
||||
|
||||
Logging.Logging.LogInfo("Found " + includeDirectories.Count.ToString() + " distinct include directories.");
|
||||
|
||||
return includeDirectories;
|
||||
}
|
||||
|
||||
static public List<string> GetProjectPreprocessorDefinitions(IVCProjectWrapper project, string configurationName, string platformName)
|
||||
{
|
||||
Logging.Logging.LogInfo("Attempting to retreive Preprocessor Definitions for project '" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(project.GetName()) + "'");
|
||||
|
||||
List<string> preprocessorDefinitions = new List<string>();
|
||||
|
||||
IVCCLCompilerToolWrapper compilerTool = null;
|
||||
IVCConfigurationWrapper vcProjectConfig = project.getConfiguration(configurationName, platformName);
|
||||
if (vcProjectConfig != null && vcProjectConfig.isValid())
|
||||
{
|
||||
compilerTool = vcProjectConfig.GetCompilerTool();
|
||||
}
|
||||
|
||||
if (compilerTool != null && compilerTool.isValid())
|
||||
{
|
||||
foreach (string preprocessorDefinition in compilerTool.GetPreprocessorDefinitions())
|
||||
{
|
||||
preprocessorDefinitions.Add(preprocessorDefinition.Replace("\\\"", "\""));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogWarning("Could not retreive compiler tool. No preprocessor definitions could be retreived.");
|
||||
return new List<string>();
|
||||
}
|
||||
|
||||
preprocessorDefinitions = preprocessorDefinitions.Distinct().ToList();
|
||||
|
||||
Logging.Logging.LogInfo("Found " + preprocessorDefinitions.Count.ToString() + " distinct preprocessor definitions.");
|
||||
|
||||
return preprocessorDefinitions;
|
||||
}
|
||||
|
||||
// AFAIK there is no way to programmatically get the c++ standard version supported by any given VS version
|
||||
// instead I'm refearing to the VS docu for that information
|
||||
// https://msdn.microsoft.com/en-us/library/hh567368.aspx
|
||||
static public string GetCppStandardForProject(IVCProjectWrapper project, string configurationName, string platformName)
|
||||
{
|
||||
string result = "";
|
||||
|
||||
string toolset = project.GetWrappedVersion();
|
||||
string justNumbers = new String(toolset.Where(Char.IsDigit).ToArray());
|
||||
int versionNumber = int.Parse(justNumbers);
|
||||
|
||||
if (versionNumber < 120) // version 11 (2012)
|
||||
{
|
||||
result = "-std=c++11";
|
||||
}
|
||||
else if (versionNumber < 130) // version 12 (2013)
|
||||
{
|
||||
result = "-std=c++14";
|
||||
}
|
||||
else if (versionNumber < 150) // version 14 (2015)
|
||||
{
|
||||
result = "-std=c++14";
|
||||
}
|
||||
else if (versionNumber < 160) // version 15 (2017)
|
||||
{
|
||||
result = "-std=c++14";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// returns a valid Guid if the project was reloaded or an empty Guid if the project did not need to be reloaded
|
||||
static public Guid ReloadProject(Project project)
|
||||
{
|
||||
Logging.Logging.LogInfo("Attempting to reload project");
|
||||
|
||||
try
|
||||
{
|
||||
if (project != null && project.Kind == EnvDTE.Constants.vsProjectKindUnmodeled)
|
||||
{
|
||||
DTE dte = project.DTE;
|
||||
|
||||
ServiceProvider sp = new ServiceProvider(dte as Microsoft.VisualStudio.OLE.Interop.IServiceProvider);
|
||||
IVsSolution vsSolution = sp.GetService(typeof(IVsSolution)) as IVsSolution;
|
||||
|
||||
IVsHierarchy hierarchy;
|
||||
|
||||
string solutionDirectory = "";
|
||||
string solutionFile = "";
|
||||
string userOptions = "";
|
||||
vsSolution.GetSolutionInfo(out solutionDirectory, out solutionFile, out userOptions);
|
||||
|
||||
vsSolution.GetProjectOfUniqueName(solutionDirectory + project.UniqueName, out hierarchy);
|
||||
|
||||
if (hierarchy != null)
|
||||
{
|
||||
Guid projectGuid;
|
||||
|
||||
hierarchy.GetGuidProperty(
|
||||
VSConstants.VSITEMID_ROOT,
|
||||
(int)__VSHPROPID.VSHPROPID_ProjectIDGuid,
|
||||
out projectGuid);
|
||||
|
||||
if (projectGuid != null)
|
||||
{
|
||||
Logging.Logging.LogInfo("Project '" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(project.Name) + "' with GUID {" + projectGuid.ToString() + "} loaded.");
|
||||
(vsSolution as IVsSolution4).ReloadProject(projectGuid);
|
||||
return projectGuid;
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogError("Failed to load project '" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(project.Name) + "'");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogError("Failed to retreive IVsHierarchy. Can't load project '" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(project.Name) + "'");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (project == null)
|
||||
{
|
||||
Logging.Logging.LogWarning("Project is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogInfo("Project '" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(project.Name) + "' is already loaded");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
|
||||
return Guid.Empty;
|
||||
}
|
||||
|
||||
return Guid.Empty;
|
||||
}
|
||||
|
||||
static public void UnloadProject(Guid guid, DTE dte)
|
||||
{
|
||||
Logging.Logging.LogInfo("Attempting to unload project with GUID {" + guid.ToString() + "}");
|
||||
|
||||
if (dte == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
ServiceProvider sp = new ServiceProvider(dte as Microsoft.VisualStudio.OLE.Interop.IServiceProvider);
|
||||
IVsSolution vsSolution = sp.GetService(typeof(SVsSolution)) as IVsSolution;
|
||||
|
||||
(vsSolution as IVsSolution4).UnloadProject(guid, (uint)_VSProjectUnloadStatus.UNLOADSTATUS_UnloadedByUser);
|
||||
|
||||
Logging.Logging.LogInfo("Done unloading project with GUID {" + guid.ToString() + "}");
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-167
@@ -1,167 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Utility
|
||||
{
|
||||
class QueuedFileWriter
|
||||
{
|
||||
private bool _working = false;
|
||||
private Thread _workerThread = null;
|
||||
|
||||
private static ReaderWriterLockSlim _statusLock = new ReaderWriterLockSlim();
|
||||
private static ReaderWriterLockSlim _queueLock = new ReaderWriterLockSlim();
|
||||
private static ReaderWriterLockSlim _fileLock = new ReaderWriterLockSlim();
|
||||
|
||||
private Queue<string> _inputQueue = new Queue<string>();
|
||||
private Queue<string> _outputQueue = new Queue<string>();
|
||||
|
||||
private string _targetDirectory = "";
|
||||
private string _fileName = "";
|
||||
|
||||
private int _messagesReceived = 0;
|
||||
private int _messageWrittenCount = 0;
|
||||
|
||||
public string TargetDirectory
|
||||
{
|
||||
get { return _targetDirectory; }
|
||||
set { _targetDirectory = value; }
|
||||
}
|
||||
|
||||
public string FileName
|
||||
{
|
||||
get { return _fileName; }
|
||||
set { _fileName = value; }
|
||||
}
|
||||
|
||||
public QueuedFileWriter(string fileName, string targetDirectory)
|
||||
{
|
||||
_fileName = fileName;
|
||||
_targetDirectory = targetDirectory;
|
||||
}
|
||||
|
||||
public void PushMessage(string message)
|
||||
{
|
||||
_queueLock.EnterWriteLock();
|
||||
_messagesReceived++;
|
||||
try
|
||||
{
|
||||
_inputQueue.Enqueue(message);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError(e.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_queueLock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public void StartWorking()
|
||||
{
|
||||
_statusLock.EnterReadLock();
|
||||
if (_working == true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_statusLock.ExitReadLock();
|
||||
|
||||
_statusLock.EnterWriteLock();
|
||||
_working = true;
|
||||
_workerThread = new Thread(new ThreadStart(Work));
|
||||
_workerThread.Start();
|
||||
_statusLock.ExitWriteLock();
|
||||
}
|
||||
|
||||
public void StopWorking()
|
||||
{
|
||||
_statusLock.EnterWriteLock();
|
||||
_working = false;
|
||||
_statusLock.ExitWriteLock();
|
||||
|
||||
if(_workerThread != null)
|
||||
{
|
||||
_workerThread.Join();
|
||||
}
|
||||
|
||||
// write remaining messages if stop was called
|
||||
_queueLock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
WriteQueueToFile(ref _inputQueue);
|
||||
WriteQueueToFile(ref _outputQueue);
|
||||
|
||||
Logging.Logging.LogInfo("final commit done");
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError(e.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_queueLock.ExitWriteLock();
|
||||
}
|
||||
|
||||
Logging.Logging.LogInfo("Messages received: " + _messagesReceived);
|
||||
Logging.Logging.LogInfo("Messages written: " + _messageWrittenCount);
|
||||
}
|
||||
|
||||
private void Work()
|
||||
{
|
||||
bool working = true;
|
||||
|
||||
while(working)
|
||||
{
|
||||
Commit();
|
||||
|
||||
_statusLock.EnterReadLock();
|
||||
working = _working;
|
||||
_statusLock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
|
||||
private void Commit()
|
||||
{
|
||||
{
|
||||
_queueLock.EnterWriteLock();
|
||||
Queue<string> tmpQueue = _inputQueue;
|
||||
_inputQueue = _outputQueue;
|
||||
_outputQueue = tmpQueue;
|
||||
_queueLock.ExitWriteLock();
|
||||
}
|
||||
|
||||
WriteQueueToFile(ref _outputQueue);
|
||||
}
|
||||
|
||||
private void WriteQueueToFile(ref Queue<string> messageQueue)
|
||||
{
|
||||
if (messageQueue.Count > 0)
|
||||
{
|
||||
_fileLock.EnterWriteLock();
|
||||
|
||||
try
|
||||
{
|
||||
StreamWriter writer = System.IO.File.AppendText(_targetDirectory + "\\" + _fileName);
|
||||
|
||||
while (messageQueue.Count > 0)
|
||||
{
|
||||
_messageWrittenCount++;
|
||||
writer.WriteLine(messageQueue.Dequeue());
|
||||
}
|
||||
|
||||
writer.Close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError(e.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_fileLock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,449 +0,0 @@
|
||||
using EnvDTE;
|
||||
using EnvDTE80;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Utility
|
||||
{
|
||||
public class SolutionUtility
|
||||
{
|
||||
[DllImport("ole32.dll")]
|
||||
private static extern void CreateBindCtx(int reserved, out IBindCtx bindCtx);
|
||||
[DllImport("ole32.dll")]
|
||||
private static extern void GetRunningObjectTable(int reserved, out IRunningObjectTable runningObjectTable);
|
||||
|
||||
public class SolutionStructure
|
||||
{
|
||||
public class Node
|
||||
{
|
||||
public enum NodeType
|
||||
{
|
||||
UNKNOWN = 0,
|
||||
PROJECT,
|
||||
FOLDER
|
||||
};
|
||||
|
||||
public string Name = "";
|
||||
public Project Project = null;
|
||||
public Object UserData = null;
|
||||
|
||||
public virtual NodeType GetNodeType()
|
||||
{
|
||||
throw (new NotImplementedException());
|
||||
}
|
||||
}
|
||||
|
||||
public class FolderNode : Node
|
||||
{
|
||||
public List<Node> SubNodes = new List<Node>();
|
||||
|
||||
public override NodeType GetNodeType()
|
||||
{
|
||||
return NodeType.FOLDER;
|
||||
}
|
||||
}
|
||||
|
||||
public class ProjectNode : Node
|
||||
{
|
||||
public bool Include = false;
|
||||
|
||||
public override NodeType GetNodeType()
|
||||
{
|
||||
return NodeType.PROJECT;
|
||||
}
|
||||
}
|
||||
|
||||
public List<Node> Nodes = new List<Node>();
|
||||
}
|
||||
|
||||
public static String GetSolutionPath(DTE dte)
|
||||
{
|
||||
try
|
||||
{
|
||||
EnvDTE.Solution solution = dte.Solution;
|
||||
|
||||
return solution.FullName;
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
|
||||
return "N/A";
|
||||
}
|
||||
}
|
||||
|
||||
public static SolutionStructure GetSolutionVCProjects(DTE dte)
|
||||
{
|
||||
return GetProjectStructureRecursive(dte); ;
|
||||
}
|
||||
|
||||
public static SolutionStructure GetProjectStructureRecursive(DTE dte)
|
||||
{
|
||||
EnvDTE.Solution solution = dte.Solution;
|
||||
EnvDTE.Projects solutionProjects = solution.Projects;
|
||||
|
||||
List<Guid> guids = new List<Guid>();
|
||||
|
||||
SolutionStructure projectStructure = new SolutionStructure();
|
||||
|
||||
foreach(Project project in solutionProjects)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (project.Kind == EnvDTE.Constants.vsProjectKindUnmodeled) // not loaded
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// check it's a c/c++ project
|
||||
if (project.CodeModel != null)
|
||||
{
|
||||
if (project.CodeModel.Language != CodeModelLanguageConstants.vsCMLanguageVC)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (project.Kind == "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}")
|
||||
{
|
||||
SolutionStructure.ProjectNode projectNode = new SolutionStructure.ProjectNode();
|
||||
projectNode.Name = project.Name;
|
||||
projectNode.Project = project;
|
||||
projectNode.Include = false;
|
||||
|
||||
projectStructure.Nodes.Add(projectNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
SolutionStructure.Node folderNode = GetSubProjects(project);
|
||||
|
||||
if (folderNode != null)
|
||||
{
|
||||
projectStructure.Nodes.Add(folderNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogWarning("Subnode was NULL");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
return projectStructure;
|
||||
}
|
||||
|
||||
private static SolutionStructure.Node GetSubProjects(EnvDTE.Project project)
|
||||
{
|
||||
ProjectItems projectItems = project.ProjectItems;
|
||||
List<Project> items = new List<Project>();
|
||||
|
||||
try
|
||||
{
|
||||
foreach (ProjectItem item in projectItems)
|
||||
{
|
||||
Project p = item.Object as Project;
|
||||
if (p != null)
|
||||
{
|
||||
items.Add(p);
|
||||
}
|
||||
}
|
||||
|
||||
if (items.Count > 0)
|
||||
{
|
||||
SolutionStructure.FolderNode folderNode = new SolutionStructure.FolderNode();
|
||||
folderNode.Name = project.Name;
|
||||
|
||||
for (int i = 0; i < items.Count; i++)
|
||||
{
|
||||
Project item = items[i];
|
||||
|
||||
SolutionStructure.Node subFolderNode = GetSubProjects(item);
|
||||
|
||||
if(subFolderNode != null)
|
||||
{
|
||||
folderNode.SubNodes.Add(subFolderNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogWarning("SubNode was NULL");
|
||||
}
|
||||
}
|
||||
|
||||
return folderNode;
|
||||
}
|
||||
else
|
||||
{
|
||||
SolutionStructure.ProjectNode projectNode = new SolutionStructure.ProjectNode();
|
||||
projectNode.Name = project.Name;
|
||||
projectNode.Project = project;
|
||||
projectNode.Include = false;
|
||||
|
||||
return projectNode;
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Deprecated: remove when old project parsing is retired
|
||||
public static List<String> GetSolutionProjectsFullNames(DTE dte)
|
||||
{
|
||||
List<String> projectNames = new List<String>();
|
||||
|
||||
EnvDTE.Solution solution = dte.Solution;
|
||||
EnvDTE.Projects projects = solution.Projects;
|
||||
|
||||
List<Guid> guids = new List<Guid>();
|
||||
|
||||
foreach (EnvDTE.Project project in projects)
|
||||
{
|
||||
guids.Add(ProjectUtility.ReloadProject(project));
|
||||
}
|
||||
|
||||
projects = solution.Projects;
|
||||
|
||||
foreach (EnvDTE.Project project in projects)
|
||||
{
|
||||
projectNames.Add(project.FullName);
|
||||
}
|
||||
|
||||
foreach (Guid guid in guids)
|
||||
{
|
||||
ProjectUtility.UnloadProject(guid, dte);
|
||||
}
|
||||
|
||||
return projectNames;
|
||||
}
|
||||
|
||||
public static List<String> GetSolutionLanguages(DTE dte)
|
||||
{
|
||||
List<String> languages = new List<String>();
|
||||
|
||||
List<Project> projects = GetSolutionProjectList(dte);
|
||||
|
||||
foreach (EnvDTE.Project project in projects)
|
||||
{
|
||||
if (project.CodeModel != null)
|
||||
{
|
||||
string language = project.CodeModel.Language;
|
||||
languages.Add(language);
|
||||
}
|
||||
}
|
||||
|
||||
languages = languages.Distinct().ToList();
|
||||
|
||||
return languages;
|
||||
}
|
||||
|
||||
public static bool GetSolutionIsSaved(DTE dte)
|
||||
{
|
||||
try
|
||||
{
|
||||
EnvDTE.Solution solution = dte.Solution;
|
||||
|
||||
return solution.Saved;
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
public static List<string> GetConfigurationNames(DTE dte)
|
||||
{
|
||||
List<string> configurationNames = new List<string>();
|
||||
|
||||
SolutionBuild2 solutionBuild = GetSolutionBuild2(dte);
|
||||
|
||||
if (solutionBuild != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (SolutionConfiguration2 solutionConfiguration in solutionBuild.SolutionConfigurations)
|
||||
{
|
||||
foreach (SolutionContext context in solutionConfiguration.SolutionContexts)
|
||||
{
|
||||
configurationNames.Add(context.ConfigurationName);
|
||||
}
|
||||
}
|
||||
configurationNames = configurationNames.Distinct().ToList();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
return configurationNames;
|
||||
}
|
||||
|
||||
public static List<string> GetPlatformNames(DTE dte)
|
||||
{
|
||||
List<string> platformNames = new List<string>();
|
||||
|
||||
SolutionBuild2 solutionBuild = GetSolutionBuild2(dte);
|
||||
|
||||
if (solutionBuild != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (SolutionConfiguration2 solutionConfiguration in solutionBuild.SolutionConfigurations)
|
||||
{
|
||||
foreach (SolutionContext context in solutionConfiguration.SolutionContexts)
|
||||
{
|
||||
platformNames.Add(context.PlatformName);
|
||||
}
|
||||
}
|
||||
platformNames = platformNames.Distinct().ToList();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
return platformNames;
|
||||
}
|
||||
|
||||
public static DTE2 GetDTE2(DTE dte)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<DTE2> dte2List = new List<DTE2>();
|
||||
|
||||
IRunningObjectTable runningObjectTable = null;
|
||||
GetRunningObjectTable(0, out runningObjectTable);
|
||||
|
||||
IEnumMoniker enumMoniker = null;
|
||||
runningObjectTable.EnumRunning(out enumMoniker);
|
||||
|
||||
enumMoniker.Reset();
|
||||
IntPtr fetched = IntPtr.Zero;
|
||||
IMoniker[] moniker = new IMoniker[1];
|
||||
|
||||
while (enumMoniker.Next(1, moniker, fetched) == 0)
|
||||
{
|
||||
IBindCtx bindCtx = null;
|
||||
CreateBindCtx(0, out bindCtx);
|
||||
|
||||
string displayName = "";
|
||||
moniker[0].GetDisplayName(bindCtx, null, out displayName);
|
||||
// add all VisualStudio ROT entries to list
|
||||
if (displayName.StartsWith("!VisualStudio"))
|
||||
{
|
||||
object comObject;
|
||||
runningObjectTable.GetObject(moniker[0], out comObject);
|
||||
dte2List.Add((DTE2)comObject);
|
||||
}
|
||||
}
|
||||
|
||||
// find the correct dte2 instance (each running VS instance has one...)
|
||||
KeyValuePair<DTE2, int> maxMatch = new KeyValuePair<DTE2, int>(null, 0);
|
||||
foreach (DTE2 dte2 in dte2List)
|
||||
{
|
||||
int m = StringUtility.GetMatchingCharsFromStart(dte.Solution.FullName, dte2.Solution.FullName);
|
||||
if (m > maxMatch.Value)
|
||||
{
|
||||
maxMatch = new KeyValuePair<DTE2, int>(dte2, m);
|
||||
}
|
||||
}
|
||||
|
||||
return maxMatch.Key;
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static public SolutionBuild2 GetSolutionBuild2(DTE dte)
|
||||
{
|
||||
DTE2 dte2 = SolutionUtility.GetDTE2(dte);
|
||||
|
||||
if (dte2 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
EnvDTE80.Solution2 solution = (EnvDTE80.Solution2)dte2.Solution;
|
||||
if (solution == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return (EnvDTE80.SolutionBuild2)solution.SolutionBuild;
|
||||
}
|
||||
|
||||
static public bool ContainsCFiles(DTE dte)
|
||||
{
|
||||
List<Project> projects = GetSolutionProjectList(dte); // dte.Solution.Projects;
|
||||
|
||||
foreach (Project project in projects)
|
||||
{
|
||||
if(ProjectUtility.ContainsCFiles(project) == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static public List<EnvDTE.Project> GetSolutionProjectList(DTE dte)
|
||||
{
|
||||
List<EnvDTE.Project> solutionProjects = new List<EnvDTE.Project>();
|
||||
|
||||
try
|
||||
{
|
||||
SolutionStructure solutionStructure = GetProjectStructureRecursive(dte);
|
||||
|
||||
Stack<SolutionStructure.Node> nodeStack = new Stack<Utility.SolutionUtility.SolutionStructure.Node>();
|
||||
foreach (SolutionStructure.Node node in solutionStructure.Nodes)
|
||||
{
|
||||
nodeStack.Push(node);
|
||||
}
|
||||
|
||||
while (nodeStack.Count > 0)
|
||||
{
|
||||
Utility.SolutionUtility.SolutionStructure.Node node = nodeStack.Pop();
|
||||
|
||||
string name = node.Name;
|
||||
|
||||
if (node.GetNodeType() == Utility.SolutionUtility.SolutionStructure.Node.NodeType.PROJECT)
|
||||
{
|
||||
solutionProjects.Add(node.Project);
|
||||
}
|
||||
else if (node.GetNodeType() == Utility.SolutionUtility.SolutionStructure.Node.NodeType.FOLDER)
|
||||
{
|
||||
Utility.SolutionUtility.SolutionStructure.FolderNode folderNode = node as Utility.SolutionUtility.SolutionStructure.FolderNode;
|
||||
foreach (Utility.SolutionUtility.SolutionStructure.Node subNode in folderNode.SubNodes)
|
||||
{
|
||||
nodeStack.Push(subNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return solutionProjects;
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
|
||||
return new List<EnvDTE.Project>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Utility
|
||||
{
|
||||
public class StringUtility
|
||||
{
|
||||
static public Tuple<int, int> FindFirstRange(string text, string startTag, string endTag)
|
||||
{
|
||||
if(startTag.Length > 0 && endTag.Length > 0 && (startTag.Length + endTag.Length) < text.Length)
|
||||
{
|
||||
int start = text.IndexOf(startTag);
|
||||
int end = text.IndexOf(endTag);
|
||||
|
||||
// just check wheter both, start and end, are valid and the end tag occurs after the start tag
|
||||
if(start > -1 && end > -1 && end > start)
|
||||
{
|
||||
return new Tuple<int, int>(start, end);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
static public int GetMatchingCharsFromStart(string a, string b)
|
||||
{
|
||||
int matchingChars = 0;
|
||||
|
||||
if (a != string.Empty)
|
||||
{
|
||||
a = a.ToLower();
|
||||
}
|
||||
else
|
||||
{
|
||||
return matchingChars;
|
||||
}
|
||||
|
||||
if (b != string.Empty)
|
||||
{
|
||||
b = b.ToLower();
|
||||
}
|
||||
else
|
||||
{
|
||||
return matchingChars;
|
||||
}
|
||||
|
||||
for (int i = 0; i < Math.Min(a.Length, b.Length); i++)
|
||||
{
|
||||
if (!char.Equals(a[i], b[i]))
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
matchingChars++;
|
||||
}
|
||||
}
|
||||
|
||||
return matchingChars;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Utility
|
||||
{
|
||||
class SystemUtility
|
||||
{
|
||||
[System.Runtime.InteropServices.DllImport("user32.dll")]
|
||||
static extern bool SetForegroundWindow(IntPtr hWnd);
|
||||
[System.Runtime.InteropServices.DllImport("user32.dll")]
|
||||
static extern IntPtr SetActiveWindow(IntPtr hWnd);
|
||||
|
||||
public static void GetWindowFocus()
|
||||
{
|
||||
try
|
||||
{
|
||||
System.Diagnostics.Process process = System.Diagnostics.Process.GetCurrentProcess();
|
||||
IntPtr windowHandle = process.MainWindowHandle;
|
||||
|
||||
if (windowHandle != null)
|
||||
{
|
||||
SetForegroundWindow(windowHandle);
|
||||
SetActiveWindow(windowHandle);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Exception: " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void OpenWindowsExplorerAtDirectory(string directory)
|
||||
{
|
||||
System.Diagnostics.Process.Start(directory);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="110" xml:space="preserve">
|
||||
<value>SourcetrailPlugin</value>
|
||||
</data>
|
||||
<data name="112" xml:space="preserve">
|
||||
<value>The Sourcetrail Plugin allows Visual Studio to communicate with Sourcetrail - an external source code exploration tool. It also enables Visual Studio to generate a Clang Compilation Database from any Visual Studio Solution which can be used to automate the Sourcetrail project setup and to run other Clang based tools.</value>
|
||||
</data>
|
||||
</root>
|
||||
Generated
-281
@@ -1,281 +0,0 @@
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Wizard
|
||||
{
|
||||
partial class ProjectSetupWindow
|
||||
{
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProjectSetupWindow));
|
||||
this.buttonCancel = new System.Windows.Forms.Button();
|
||||
this.buttonCreate = new System.Windows.Forms.Button();
|
||||
this.comboBoxConfiguration = new System.Windows.Forms.ComboBox();
|
||||
this.comboBoxPlatform = new System.Windows.Forms.ComboBox();
|
||||
this.labelConfiguration = new System.Windows.Forms.Label();
|
||||
this.labelPlatform = new System.Windows.Forms.Label();
|
||||
this.buttonSelectAll = new System.Windows.Forms.Button();
|
||||
this.labelSelectProject = new System.Windows.Forms.Label();
|
||||
this.folderBrowserTargetDirectory = new System.Windows.Forms.FolderBrowserDialog();
|
||||
this.textBoxTargetDirectory = new System.Windows.Forms.TextBox();
|
||||
this.buttonSelect = new System.Windows.Forms.Button();
|
||||
this.textBoxFileName = new System.Windows.Forms.TextBox();
|
||||
this.labelFileName = new System.Windows.Forms.Label();
|
||||
this.labelFileNameExtension = new System.Windows.Forms.Label();
|
||||
this.helpProvider1 = new System.Windows.Forms.HelpProvider();
|
||||
this.comboBoxCStandard = new System.Windows.Forms.ComboBox();
|
||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
|
||||
this.labelCStandard = new System.Windows.Forms.Label();
|
||||
this.treeViewProjects = new System.Windows.Forms.TreeView();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
this.helpProvider1.SetHelpString(this.buttonCancel, "Abort creation of the Compilation Database");
|
||||
this.buttonCancel.Location = new System.Drawing.Point(12, 413);
|
||||
this.buttonCancel.Name = "buttonCancel";
|
||||
this.helpProvider1.SetShowHelp(this.buttonCancel, true);
|
||||
this.buttonCancel.Size = new System.Drawing.Size(92, 23);
|
||||
this.buttonCancel.TabIndex = 9;
|
||||
this.buttonCancel.Text = "Cancel";
|
||||
this.toolTip1.SetToolTip(this.buttonCancel, "Abort creation of the Compilation Database");
|
||||
this.buttonCancel.UseVisualStyleBackColor = true;
|
||||
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
|
||||
//
|
||||
// buttonCreate
|
||||
//
|
||||
this.helpProvider1.SetHelpString(this.buttonCreate, "Start creation of the Compilation Database");
|
||||
this.buttonCreate.Location = new System.Drawing.Point(178, 413);
|
||||
this.buttonCreate.Name = "buttonCreate";
|
||||
this.helpProvider1.SetShowHelp(this.buttonCreate, true);
|
||||
this.buttonCreate.Size = new System.Drawing.Size(92, 23);
|
||||
this.buttonCreate.TabIndex = 8;
|
||||
this.buttonCreate.Text = "Create";
|
||||
this.toolTip1.SetToolTip(this.buttonCreate, "Start creation of the Compilation Database");
|
||||
this.buttonCreate.UseVisualStyleBackColor = true;
|
||||
this.buttonCreate.Click += new System.EventHandler(this.buttonCreate_Click);
|
||||
//
|
||||
// comboBoxConfiguration
|
||||
//
|
||||
this.comboBoxConfiguration.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBoxConfiguration.FormattingEnabled = true;
|
||||
this.helpProvider1.SetHelpKeyword(this.comboBoxConfiguration, "Build configuration for Compilation Database");
|
||||
this.helpProvider1.SetHelpString(this.comboBoxConfiguration, "The selected build configuration determines the compile flags for the Compilation" +
|
||||
" Database");
|
||||
this.comboBoxConfiguration.Location = new System.Drawing.Point(87, 277);
|
||||
this.comboBoxConfiguration.Name = "comboBoxConfiguration";
|
||||
this.helpProvider1.SetShowHelp(this.comboBoxConfiguration, true);
|
||||
this.comboBoxConfiguration.Size = new System.Drawing.Size(183, 21);
|
||||
this.comboBoxConfiguration.TabIndex = 3;
|
||||
this.toolTip1.SetToolTip(this.comboBoxConfiguration, "The selected build configuration determines the compile flags for the Compilation" +
|
||||
" Database");
|
||||
//
|
||||
// comboBoxPlatform
|
||||
//
|
||||
this.comboBoxPlatform.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBoxPlatform.FormattingEnabled = true;
|
||||
this.helpProvider1.SetHelpString(this.comboBoxPlatform, "The target platform determines some compiler flags included in the Compilation Da" +
|
||||
"tabase");
|
||||
this.comboBoxPlatform.Location = new System.Drawing.Point(87, 304);
|
||||
this.comboBoxPlatform.Name = "comboBoxPlatform";
|
||||
this.helpProvider1.SetShowHelp(this.comboBoxPlatform, true);
|
||||
this.comboBoxPlatform.Size = new System.Drawing.Size(183, 21);
|
||||
this.comboBoxPlatform.TabIndex = 4;
|
||||
this.toolTip1.SetToolTip(this.comboBoxPlatform, "The target platform determines some compiler flags included in the Compilation Da" +
|
||||
"tabase");
|
||||
//
|
||||
// labelConfiguration
|
||||
//
|
||||
this.labelConfiguration.AutoSize = true;
|
||||
this.labelConfiguration.Location = new System.Drawing.Point(12, 280);
|
||||
this.labelConfiguration.Name = "labelConfiguration";
|
||||
this.labelConfiguration.Size = new System.Drawing.Size(69, 13);
|
||||
this.labelConfiguration.TabIndex = 6;
|
||||
this.labelConfiguration.Text = "Configuration";
|
||||
//
|
||||
// labelPlatform
|
||||
//
|
||||
this.labelPlatform.AutoSize = true;
|
||||
this.labelPlatform.Location = new System.Drawing.Point(12, 307);
|
||||
this.labelPlatform.Name = "labelPlatform";
|
||||
this.labelPlatform.Size = new System.Drawing.Size(45, 13);
|
||||
this.labelPlatform.TabIndex = 7;
|
||||
this.labelPlatform.Text = "Platform";
|
||||
//
|
||||
// buttonSelectAll
|
||||
//
|
||||
this.helpProvider1.SetHelpString(this.buttonSelectAll, "Select all projects if not all are ticked. Deselect all otherwise");
|
||||
this.buttonSelectAll.Location = new System.Drawing.Point(178, 248);
|
||||
this.buttonSelectAll.Name = "buttonSelectAll";
|
||||
this.helpProvider1.SetShowHelp(this.buttonSelectAll, true);
|
||||
this.buttonSelectAll.Size = new System.Drawing.Size(92, 23);
|
||||
this.buttonSelectAll.TabIndex = 2;
|
||||
this.buttonSelectAll.Text = "De/Select All";
|
||||
this.toolTip1.SetToolTip(this.buttonSelectAll, "Select all projects if not all are ticked. Deselect all otherwise");
|
||||
this.buttonSelectAll.UseVisualStyleBackColor = true;
|
||||
this.buttonSelectAll.Click += new System.EventHandler(this.buttonSelectAll_Click);
|
||||
//
|
||||
// labelSelectProject
|
||||
//
|
||||
this.labelSelectProject.AutoSize = true;
|
||||
this.labelSelectProject.Location = new System.Drawing.Point(9, 9);
|
||||
this.labelSelectProject.Name = "labelSelectProject";
|
||||
this.labelSelectProject.Size = new System.Drawing.Size(78, 13);
|
||||
this.labelSelectProject.TabIndex = 9;
|
||||
this.labelSelectProject.Text = "Select Projects";
|
||||
this.labelSelectProject.Click += new System.EventHandler(this.label1_Click);
|
||||
//
|
||||
// textBoxTargetDirectory
|
||||
//
|
||||
this.helpProvider1.SetHelpString(this.textBoxTargetDirectory, "Target directory where the Compilation Database will be stored");
|
||||
this.textBoxTargetDirectory.Location = new System.Drawing.Point(12, 333);
|
||||
this.textBoxTargetDirectory.Name = "textBoxTargetDirectory";
|
||||
this.helpProvider1.SetShowHelp(this.textBoxTargetDirectory, true);
|
||||
this.textBoxTargetDirectory.Size = new System.Drawing.Size(177, 20);
|
||||
this.textBoxTargetDirectory.TabIndex = 10;
|
||||
this.toolTip1.SetToolTip(this.textBoxTargetDirectory, "Target directory where the Compilation Database will be stored");
|
||||
//
|
||||
// buttonSelect
|
||||
//
|
||||
this.helpProvider1.SetHelpString(this.buttonSelect, "Pick a target directory via folder browser");
|
||||
this.buttonSelect.Location = new System.Drawing.Point(195, 331);
|
||||
this.buttonSelect.Name = "buttonSelect";
|
||||
this.helpProvider1.SetShowHelp(this.buttonSelect, true);
|
||||
this.buttonSelect.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonSelect.TabIndex = 5;
|
||||
this.buttonSelect.Text = "Browse";
|
||||
this.toolTip1.SetToolTip(this.buttonSelect, "Pick a target directory via folder browser");
|
||||
this.buttonSelect.UseVisualStyleBackColor = true;
|
||||
this.buttonSelect.Click += new System.EventHandler(this.buttonSelect_Click);
|
||||
//
|
||||
// textBoxFileName
|
||||
//
|
||||
this.textBoxFileName.Location = new System.Drawing.Point(87, 360);
|
||||
this.textBoxFileName.Name = "textBoxFileName";
|
||||
this.textBoxFileName.Size = new System.Drawing.Size(148, 20);
|
||||
this.textBoxFileName.TabIndex = 6;
|
||||
this.textBoxFileName.TextChanged += new System.EventHandler(this.textBoxFileName_TextChanged);
|
||||
this.textBoxFileName.Leave += new System.EventHandler(this.textBoxFileName_Leave);
|
||||
//
|
||||
// labelFileName
|
||||
//
|
||||
this.labelFileName.AutoSize = true;
|
||||
this.labelFileName.Location = new System.Drawing.Point(12, 363);
|
||||
this.labelFileName.Name = "labelFileName";
|
||||
this.labelFileName.Size = new System.Drawing.Size(49, 13);
|
||||
this.labelFileName.TabIndex = 13;
|
||||
this.labelFileName.Text = "Filename";
|
||||
//
|
||||
// labelFileNameExtension
|
||||
//
|
||||
this.labelFileNameExtension.AutoSize = true;
|
||||
this.labelFileNameExtension.Location = new System.Drawing.Point(241, 363);
|
||||
this.labelFileNameExtension.Name = "labelFileNameExtension";
|
||||
this.labelFileNameExtension.Size = new System.Drawing.Size(29, 13);
|
||||
this.labelFileNameExtension.TabIndex = 14;
|
||||
this.labelFileNameExtension.Text = ".json";
|
||||
//
|
||||
// comboBoxCStandard
|
||||
//
|
||||
this.comboBoxCStandard.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBoxCStandard.FormattingEnabled = true;
|
||||
this.helpProvider1.SetHelpString(this.comboBoxCStandard, "In case your solution contains C files, please specify which C standard is to be " +
|
||||
"used for building.");
|
||||
this.comboBoxCStandard.Location = new System.Drawing.Point(87, 386);
|
||||
this.comboBoxCStandard.Name = "comboBoxCStandard";
|
||||
this.helpProvider1.SetShowHelp(this.comboBoxCStandard, true);
|
||||
this.comboBoxCStandard.Size = new System.Drawing.Size(183, 21);
|
||||
this.comboBoxCStandard.TabIndex = 7;
|
||||
this.toolTip1.SetToolTip(this.comboBoxCStandard, "In case your solution contains C files, please specify which C standard is to be " +
|
||||
"used for building.");
|
||||
//
|
||||
// labelCStandard
|
||||
//
|
||||
this.labelCStandard.AutoSize = true;
|
||||
this.labelCStandard.Location = new System.Drawing.Point(12, 389);
|
||||
this.labelCStandard.Name = "labelCStandard";
|
||||
this.labelCStandard.Size = new System.Drawing.Size(60, 13);
|
||||
this.labelCStandard.TabIndex = 16;
|
||||
this.labelCStandard.Text = "C Standard";
|
||||
//
|
||||
// treeViewProjects
|
||||
//
|
||||
this.treeViewProjects.CheckBoxes = true;
|
||||
this.treeViewProjects.Location = new System.Drawing.Point(12, 26);
|
||||
this.treeViewProjects.Name = "treeViewProjects";
|
||||
this.treeViewProjects.Size = new System.Drawing.Size(258, 216);
|
||||
this.treeViewProjects.TabIndex = 17;
|
||||
this.treeViewProjects.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.treeViewProjects_NodeCheckChanged);
|
||||
this.treeViewProjects.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ProjectCheckList_MouseUp);
|
||||
//
|
||||
// ProjectSetupWindow
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.ClientSize = new System.Drawing.Size(282, 443);
|
||||
this.Controls.Add(this.treeViewProjects);
|
||||
this.Controls.Add(this.labelCStandard);
|
||||
this.Controls.Add(this.comboBoxCStandard);
|
||||
this.Controls.Add(this.labelFileNameExtension);
|
||||
this.Controls.Add(this.labelFileName);
|
||||
this.Controls.Add(this.textBoxFileName);
|
||||
this.Controls.Add(this.buttonSelect);
|
||||
this.Controls.Add(this.textBoxTargetDirectory);
|
||||
this.Controls.Add(this.labelSelectProject);
|
||||
this.Controls.Add(this.buttonSelectAll);
|
||||
this.Controls.Add(this.labelPlatform);
|
||||
this.Controls.Add(this.labelConfiguration);
|
||||
this.Controls.Add(this.comboBoxPlatform);
|
||||
this.Controls.Add(this.comboBoxConfiguration);
|
||||
this.Controls.Add(this.buttonCreate);
|
||||
this.Controls.Add(this.buttonCancel);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.helpProvider1.SetHelpString(this, "Create a Compilation Database from the current C/C++ solution.");
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ProjectSetupWindow";
|
||||
this.helpProvider1.SetShowHelp(this, true);
|
||||
this.Text = "Create Compilation Database";
|
||||
this.toolTip1.SetToolTip(this, "Create a Compilation Database from the current C/C++ solution.");
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.Button buttonCancel;
|
||||
private System.Windows.Forms.Button buttonCreate;
|
||||
private System.Windows.Forms.ComboBox comboBoxConfiguration;
|
||||
private System.Windows.Forms.ComboBox comboBoxPlatform;
|
||||
private System.Windows.Forms.Label labelConfiguration;
|
||||
private System.Windows.Forms.Label labelPlatform;
|
||||
private System.Windows.Forms.Button buttonSelectAll;
|
||||
private System.Windows.Forms.Label labelSelectProject;
|
||||
private System.Windows.Forms.FolderBrowserDialog folderBrowserTargetDirectory;
|
||||
private System.Windows.Forms.TextBox textBoxTargetDirectory;
|
||||
private System.Windows.Forms.Button buttonSelect;
|
||||
private System.Windows.Forms.TextBox textBoxFileName;
|
||||
private System.Windows.Forms.Label labelFileName;
|
||||
private System.Windows.Forms.Label labelFileNameExtension;
|
||||
private System.Windows.Forms.HelpProvider helpProvider1;
|
||||
private System.Windows.Forms.ToolTip toolTip1;
|
||||
private System.ComponentModel.BackgroundWorker backgroundWorker1;
|
||||
private System.Windows.Forms.ComboBox comboBoxCStandard;
|
||||
private System.Windows.Forms.Label labelCStandard;
|
||||
private System.Windows.Forms.TreeView treeViewProjects;
|
||||
}
|
||||
}
|
||||
-496
@@ -1,496 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Wizard
|
||||
{
|
||||
public partial class ProjectSetupWindow : Form
|
||||
{
|
||||
public class SolutionProject
|
||||
{
|
||||
public string _name = "";
|
||||
public bool _include = false;
|
||||
|
||||
public SolutionProject(string name, bool include)
|
||||
{
|
||||
_name = name;
|
||||
_include = include;
|
||||
}
|
||||
}
|
||||
|
||||
public delegate void OnCreateProject(List<EnvDTE.Project> projects, string configurationName, string platformName, string targetDir, string fileName, string cStandard);
|
||||
|
||||
// public List<SolutionProject> m_projects = new List<SolutionProject>();
|
||||
public Utility.SolutionUtility.SolutionStructure _projectStructure = new Utility.SolutionUtility.SolutionStructure();
|
||||
|
||||
public List<string> _configurations = new List<string>();
|
||||
public List<string> _platforms = new List<string>();
|
||||
|
||||
public OnCreateProject _onCreateProject = null;
|
||||
|
||||
public string _solutionDirectory = "";
|
||||
public string _solutionFileName = "foo";
|
||||
|
||||
public bool _containsCFiles = false;
|
||||
|
||||
private List<string> _cStandards = new List<string>() { "c1x", "gnu1x", "iso9899:201x", "c11", "gnu11", "iso9899:2011",
|
||||
"c9x", "gnu9x", "iso9899:199x", "c99", "gnu99", "iso9899:1999", "iso9899:199409", "c90", "gnu90", "iso9899:1990",
|
||||
"c89", "gnu89" };
|
||||
|
||||
public SolutionParser.CompilationDatabaseSettings _cdb = new SolutionParser.CompilationDatabaseSettings();
|
||||
|
||||
public ProjectSetupWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
UpdateGUI();
|
||||
|
||||
buttonCreate.Enabled = false;
|
||||
}
|
||||
|
||||
public void UpdateGUI()
|
||||
{
|
||||
Logging.Logging.LogInfo("Populating GUI");
|
||||
|
||||
InitProjectCheckList();
|
||||
InitComboBoxConfigurations();
|
||||
InitComboBoxPlatforms();
|
||||
InitTextBoxTargetDirectory();
|
||||
InitTextBoxFileName();
|
||||
InitComboBoxCStandard();
|
||||
}
|
||||
|
||||
private void InitComboBoxConfigurations()
|
||||
{
|
||||
Logging.Logging.LogInfo("Adding " + _configurations.Count.ToString() + " build configurations.");
|
||||
|
||||
foreach(string configuration in _configurations)
|
||||
{
|
||||
comboBoxConfiguration.Items.Add(configuration);
|
||||
}
|
||||
|
||||
if(comboBoxConfiguration.Items.Count > 0)
|
||||
{
|
||||
if(_cdb != null)
|
||||
{
|
||||
int index = comboBoxConfiguration.Items.IndexOf(_cdb.ConfigurationName);
|
||||
comboBoxConfiguration.SelectedIndex = index;
|
||||
}
|
||||
else
|
||||
{
|
||||
comboBoxConfiguration.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void InitComboBoxPlatforms()
|
||||
{
|
||||
Logging.Logging.LogInfo("Adding " + _platforms.Count.ToString() + " target platforms.");
|
||||
|
||||
foreach (string platform in _platforms)
|
||||
{
|
||||
comboBoxPlatform.Items.Add(platform);
|
||||
}
|
||||
|
||||
if(comboBoxPlatform.Items.Count > 0)
|
||||
{
|
||||
if(_cdb != null)
|
||||
{
|
||||
int index = comboBoxPlatform.Items.IndexOf(_cdb.PlatformName);
|
||||
comboBoxPlatform.SelectedIndex = index;
|
||||
}
|
||||
else
|
||||
{
|
||||
comboBoxPlatform.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void InitProjectCheckList()
|
||||
{
|
||||
// way to slow for large projects
|
||||
//if(_cdb != null)
|
||||
//{
|
||||
// _cdb.TryLoadData();
|
||||
//}
|
||||
|
||||
foreach(Utility.SolutionUtility.SolutionStructure.Node node in _projectStructure.Nodes)
|
||||
{
|
||||
if(node.GetNodeType() == Utility.SolutionUtility.SolutionStructure.Node.NodeType.PROJECT)
|
||||
{
|
||||
TreeNode treeNode = new TreeNode(node.Name);
|
||||
node.UserData = treeNode;
|
||||
|
||||
if (_cdb != null && _cdb.IncludedProjects.Exists(item => item == treeNode.Text))
|
||||
{
|
||||
treeNode.Checked = true;
|
||||
}
|
||||
|
||||
treeViewProjects.Nodes.Add(treeNode);
|
||||
}
|
||||
else if(node.GetNodeType() == Utility.SolutionUtility.SolutionStructure.Node.NodeType.FOLDER)
|
||||
{
|
||||
TreeNode[] subNodes = GetSubNodes(node as Utility.SolutionUtility.SolutionStructure.FolderNode);
|
||||
TreeNode treeNode = new TreeNode(node.Name, subNodes);
|
||||
node.UserData = treeNode;
|
||||
treeViewProjects.Nodes.Add(treeNode);
|
||||
}
|
||||
}
|
||||
|
||||
UpdateCreateButtonEnabled();
|
||||
}
|
||||
|
||||
private TreeNode[] GetSubNodes(Utility.SolutionUtility.SolutionStructure.FolderNode folderNode)
|
||||
{
|
||||
List<TreeNode> result = new List<TreeNode>();
|
||||
|
||||
foreach(Utility.SolutionUtility.SolutionStructure.Node node in folderNode.SubNodes)
|
||||
{
|
||||
if(node.GetNodeType() == Utility.SolutionUtility.SolutionStructure.Node.NodeType.PROJECT)
|
||||
{
|
||||
TreeNode treeNode = new TreeNode(node.Name);
|
||||
node.UserData = treeNode;
|
||||
result.Add(treeNode);
|
||||
}
|
||||
else if(node.GetNodeType() == Utility.SolutionUtility.SolutionStructure.Node.NodeType.FOLDER)
|
||||
{
|
||||
TreeNode[] subNodes = GetSubNodes(node as Utility.SolutionUtility.SolutionStructure.FolderNode);
|
||||
TreeNode treeNode = new TreeNode(node.Name, subNodes);
|
||||
node.UserData = treeNode;
|
||||
result.Add(treeNode);
|
||||
}
|
||||
}
|
||||
|
||||
return result.ToArray();
|
||||
}
|
||||
|
||||
private void InitTextBoxTargetDirectory()
|
||||
{
|
||||
if (_cdb == null)
|
||||
{
|
||||
Logging.Logging.LogInfo("Setting default target directory to default: \"" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(_solutionDirectory) + "\"");
|
||||
folderBrowserTargetDirectory.SelectedPath = _solutionDirectory;
|
||||
textBoxTargetDirectory.Text = _solutionDirectory;
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogInfo("Setting default target directory to recent: \"" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(_cdb.Directory) + "\"");
|
||||
folderBrowserTargetDirectory.SelectedPath = _cdb.Directory;
|
||||
textBoxTargetDirectory.Text = _cdb.Directory;
|
||||
}
|
||||
}
|
||||
|
||||
private void InitTextBoxFileName()
|
||||
{
|
||||
if(_cdb == null)
|
||||
{
|
||||
Logging.Logging.LogInfo("Setting file name to default: '" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(_solutionFileName) + "'");
|
||||
textBoxFileName.Text = _solutionFileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogInfo("Setting file name to recent: '" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(_cdb.Name) + "'");
|
||||
textBoxFileName.Text = _cdb.Name;
|
||||
}
|
||||
}
|
||||
|
||||
private void InitComboBoxCStandard()
|
||||
{
|
||||
if(_containsCFiles == false)
|
||||
{
|
||||
Logging.Logging.LogInfo("Hiding C Standard selection");
|
||||
|
||||
comboBoxCStandard.Hide();
|
||||
labelCStandard.Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogInfo("Showing C Standard selection");
|
||||
|
||||
comboBoxCStandard.Show();
|
||||
labelCStandard.Show();
|
||||
|
||||
foreach(string standard in _cStandards)
|
||||
{
|
||||
comboBoxCStandard.Items.Add(standard);
|
||||
}
|
||||
|
||||
comboBoxCStandard.SelectedIndex = 3;
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
Logging.Logging.LogInfo("Close button pressed. Aborting.");
|
||||
|
||||
Close();
|
||||
}
|
||||
|
||||
private void buttonCreate_Click(object sender, EventArgs e)
|
||||
{
|
||||
OnCreate();
|
||||
}
|
||||
|
||||
private void OnCreate()
|
||||
{
|
||||
Logging.Logging.LogInfo("Create button pressed");
|
||||
|
||||
if (_onCreateProject != null)
|
||||
{
|
||||
string configurationName = "";
|
||||
string platformName = "";
|
||||
|
||||
configurationName = comboBoxConfiguration.SelectedItem as string;
|
||||
platformName = comboBoxPlatform.SelectedItem as string;
|
||||
|
||||
Logging.Logging.LogInfo("Configuration " + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(configurationName) + "|" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(platformName) + " was selected.");
|
||||
|
||||
string targetDir = textBoxTargetDirectory.Text;
|
||||
|
||||
if(Directory.Exists(targetDir) && CheckFileNameIsValid(textBoxFileName.Text))
|
||||
{
|
||||
if (CheckFileExists())
|
||||
{
|
||||
Logging.Logging.LogWarning("A file \"" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(targetDir + "\\" + textBoxFileName.Text) + "\" already exists.");
|
||||
|
||||
DialogResult result = MessageBox.Show("A file of the chosen name already exists. Do you want to replace it?", "Sourcetrail Plugin", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
|
||||
|
||||
if(result == DialogResult.No)
|
||||
{
|
||||
Logging.Logging.LogInfo("Aborting Cdb creation and attempting to make file name unique.");
|
||||
MakeFileNameUnique();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
string cStandard = "c11";
|
||||
if(_containsCFiles)
|
||||
{
|
||||
cStandard = comboBoxCStandard.SelectedItem as string;
|
||||
}
|
||||
|
||||
Logging.Logging.LogInfo("Setting C standard flag to " + cStandard);
|
||||
|
||||
_onCreateProject(GetTreeViewProjectItems(), configurationName, platformName, targetDir, textBoxFileName.Text, cStandard);
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(Directory.Exists(targetDir) == false)
|
||||
{
|
||||
Logging.Logging.LogError("The target directory \"" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(targetDir) + "\" does not exist.");
|
||||
MessageBox.Show("The target directory does not exist.", "Sourcetrail Plugin", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
|
||||
if (CheckFileNameIsValid(textBoxFileName.Text) == false)
|
||||
{
|
||||
Logging.Logging.LogError("The chosen file name \"" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(textBoxFileName.Text) + "\" is not valid. I'd almost dare to say it's invalid!");
|
||||
MessageBox.Show("The chosen file name is not valid.", "Sourcetrail Plugin", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogError("Cdb create callback is not set. Cannot start creating Cdb.");
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckFileNameIsValid(string fileName)
|
||||
{
|
||||
Regex badChars = new Regex("[" + Regex.Escape(new string(System.IO.Path.GetInvalidFileNameChars())) + "]");
|
||||
if(badChars.IsMatch(fileName))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool CheckFileExists()
|
||||
{
|
||||
string fileName = textBoxFileName.Text;
|
||||
string path = textBoxTargetDirectory.Text;
|
||||
string extension = labelFileNameExtension.Text;
|
||||
|
||||
return File.Exists(path + "\\" + fileName + extension);
|
||||
}
|
||||
|
||||
private List<EnvDTE.Project> GetTreeViewProjectItems()
|
||||
{
|
||||
List<EnvDTE.Project> solutionProjects = new List<EnvDTE.Project>();
|
||||
|
||||
// Stack<TreeNode> treeNodes = new Stack<TreeNode>();
|
||||
Stack<Utility.SolutionUtility.SolutionStructure.Node> nodeStack = new Stack<Utility.SolutionUtility.SolutionStructure.Node>();
|
||||
foreach(Utility.SolutionUtility.SolutionStructure.Node node in _projectStructure.Nodes)
|
||||
{
|
||||
nodeStack.Push(node);
|
||||
}
|
||||
|
||||
while(nodeStack.Count > 0)
|
||||
{
|
||||
Utility.SolutionUtility.SolutionStructure.Node node = nodeStack.Pop();
|
||||
|
||||
bool include = (node.UserData as TreeNode).Checked;
|
||||
|
||||
string name = node.Name;
|
||||
|
||||
if(node.GetNodeType() == Utility.SolutionUtility.SolutionStructure.Node.NodeType.PROJECT
|
||||
&& (node.UserData as TreeNode).Checked == true)
|
||||
{
|
||||
solutionProjects.Add(node.Project);
|
||||
}
|
||||
else if(node.GetNodeType() == Utility.SolutionUtility.SolutionStructure.Node.NodeType.FOLDER)
|
||||
{
|
||||
Utility.SolutionUtility.SolutionStructure.FolderNode folderNode = node as Utility.SolutionUtility.SolutionStructure.FolderNode;
|
||||
foreach(Utility.SolutionUtility.SolutionStructure.Node subNode in folderNode.SubNodes)
|
||||
{
|
||||
nodeStack.Push(subNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return solutionProjects;
|
||||
}
|
||||
|
||||
private void ProjectCheckList_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void buttonSelectAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
bool select = false;
|
||||
|
||||
// if one or more items are unselected, select all
|
||||
// otherwise deselect all
|
||||
for (int i = 0; i < treeViewProjects.Nodes.Count; i++)
|
||||
{
|
||||
if (treeViewProjects.Nodes[i].Checked == false)
|
||||
{
|
||||
select = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < treeViewProjects.Nodes.Count; i++)
|
||||
{
|
||||
treeViewProjects.Nodes[i].Checked = select;
|
||||
}
|
||||
|
||||
UpdateCreateButtonEnabled();
|
||||
}
|
||||
|
||||
private void label1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void buttonSelect_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(Directory.Exists(textBoxTargetDirectory.Text))
|
||||
{
|
||||
folderBrowserTargetDirectory.SelectedPath = textBoxTargetDirectory.Text;
|
||||
}
|
||||
|
||||
folderBrowserTargetDirectory.SelectedPath = textBoxTargetDirectory.Text;
|
||||
|
||||
DialogResult result = folderBrowserTargetDirectory.ShowDialog();
|
||||
|
||||
string selectedPath = folderBrowserTargetDirectory.SelectedPath;
|
||||
|
||||
textBoxTargetDirectory.Text = selectedPath;
|
||||
}
|
||||
|
||||
private void treeViewProjects_NodeCheckChanged(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
// treeViewProjects.AfterCheck -= treeViewProjects_NodeCheckChanged;
|
||||
|
||||
Stack<TreeNode> nodeStack = new Stack<TreeNode>();
|
||||
|
||||
foreach (TreeNode subNode in e.Node.Nodes)
|
||||
{
|
||||
nodeStack.Push(subNode);
|
||||
}
|
||||
|
||||
while (nodeStack.Count > 0)
|
||||
{
|
||||
var node = nodeStack.Pop();
|
||||
|
||||
node.Checked = e.Node.Checked;
|
||||
|
||||
//foreach (TreeNode subNode in node.Nodes)
|
||||
//{
|
||||
// nodeStack.Push(subNode);
|
||||
//}
|
||||
}
|
||||
|
||||
// treeViewProjects.AfterCheck += treeViewProjects_NodeCheckChanged;
|
||||
}
|
||||
|
||||
private void textBoxFileName_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void textBoxFileName_Leave(object sender, EventArgs e)
|
||||
{
|
||||
// MakeFileNameUnique();
|
||||
}
|
||||
|
||||
private void MakeFileNameUnique()
|
||||
{
|
||||
string fileName = textBoxFileName.Text;
|
||||
|
||||
int i = 0;
|
||||
while (CheckFileExists())
|
||||
{
|
||||
++i;
|
||||
textBoxFileName.Text = fileName + i.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void ProjectCheckList_ItemCheck(object sender, ItemCheckEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void ProjectCheckList_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void ProjectCheckList_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
UpdateCreateButtonEnabled();
|
||||
}
|
||||
|
||||
private void UpdateCreateButtonEnabled()
|
||||
{
|
||||
bool anythingChecked = false;
|
||||
|
||||
Stack<TreeNode> treeNodes = new Stack<TreeNode>();
|
||||
foreach(TreeNode node in treeViewProjects.Nodes)
|
||||
{
|
||||
treeNodes.Push(node);
|
||||
}
|
||||
|
||||
while(treeNodes.Count > 0)
|
||||
{
|
||||
TreeNode node = treeNodes.Pop();
|
||||
|
||||
if(node.Nodes.Count <= 0 && node.Checked == true)
|
||||
{
|
||||
anythingChecked = true;
|
||||
}
|
||||
|
||||
foreach(TreeNode subNode in node.Nodes)
|
||||
{
|
||||
treeNodes.Push(subNode);
|
||||
}
|
||||
}
|
||||
|
||||
buttonCreate.Enabled = anythingChecked;
|
||||
}
|
||||
}
|
||||
}
|
||||
-1343
File diff suppressed because it is too large
Load Diff
Generated
-108
@@ -1,108 +0,0 @@
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Wizard
|
||||
{
|
||||
partial class WindowCdbReady
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WindowCdbReady));
|
||||
this.label_message = new System.Windows.Forms.Label();
|
||||
this.button_ok = new System.Windows.Forms.Button();
|
||||
this.button_import = new System.Windows.Forms.Button();
|
||||
this.button_open = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label_message
|
||||
//
|
||||
this.label_message.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label_message.Location = new System.Drawing.Point(10, 9);
|
||||
this.label_message.MinimumSize = new System.Drawing.Size(290, 70);
|
||||
this.label_message.Name = "label_message";
|
||||
this.label_message.Size = new System.Drawing.Size(290, 70);
|
||||
this.label_message.TabIndex = 0;
|
||||
this.label_message.Text = "Message";
|
||||
//
|
||||
// button_ok
|
||||
//
|
||||
this.button_ok.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.button_ok.Location = new System.Drawing.Point(12, 87);
|
||||
this.button_ok.Name = "button_ok";
|
||||
this.button_ok.Size = new System.Drawing.Size(75, 23);
|
||||
this.button_ok.TabIndex = 1;
|
||||
this.button_ok.Text = "Finish";
|
||||
this.button_ok.UseVisualStyleBackColor = true;
|
||||
this.button_ok.Click += new System.EventHandler(this.button_ok_Click);
|
||||
//
|
||||
// button_import
|
||||
//
|
||||
this.button_import.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button_import.Location = new System.Drawing.Point(227, 87);
|
||||
this.button_import.Name = "button_import";
|
||||
this.button_import.Size = new System.Drawing.Size(75, 23);
|
||||
this.button_import.TabIndex = 2;
|
||||
this.button_import.Text = "Import";
|
||||
this.button_import.UseVisualStyleBackColor = true;
|
||||
this.button_import.Click += new System.EventHandler(this.button_import_Click);
|
||||
//
|
||||
// button_open
|
||||
//
|
||||
this.button_open.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.button_open.Location = new System.Drawing.Point(111, 87);
|
||||
this.button_open.Name = "button_open";
|
||||
this.button_open.Size = new System.Drawing.Size(92, 23);
|
||||
this.button_open.TabIndex = 3;
|
||||
this.button_open.Text = "Open Folder";
|
||||
this.button_open.UseVisualStyleBackColor = true;
|
||||
this.button_open.Click += new System.EventHandler(this.button_open_Click);
|
||||
//
|
||||
// WindowCdbReady
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(314, 122);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.button_open);
|
||||
this.Controls.Add(this.button_import);
|
||||
this.Controls.Add(this.button_ok);
|
||||
this.Controls.Add(this.label_message);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MinimumSize = new System.Drawing.Size(330, 160);
|
||||
this.Name = "WindowCdbReady";
|
||||
this.Text = "Cdb Ready";
|
||||
this.Resize += new System.EventHandler(this.WindowCdbReady_Resize);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.Button button_ok;
|
||||
private System.Windows.Forms.Button button_import;
|
||||
private System.Windows.Forms.Button button_open;
|
||||
private System.Windows.Forms.Label label_message;
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Wizard
|
||||
{
|
||||
public partial class WindowCdbReady : Form
|
||||
{
|
||||
private WindowCreateCdb.CreationResult _creationResult = new WindowCreateCdb.CreationResult();
|
||||
|
||||
public WindowCdbReady()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
label_message.AutoSize = false;
|
||||
label_message.MaximumSize = new Size((int)((float)MaximumSize.Width * 0.8f), 0);
|
||||
}
|
||||
|
||||
public void setData(WindowCreateCdb.CreationResult creationResult)
|
||||
{
|
||||
_creationResult = creationResult;
|
||||
|
||||
label_message.Text = "The Compilation Database \"" + creationResult._cdbName +
|
||||
"\" was created at directory \"" + creationResult._cdbDirectory + "\".\n" +
|
||||
"Do you want to auto-import it in Sourcetrail now?";
|
||||
}
|
||||
|
||||
private void button_ok_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void button_open_Click(object sender, EventArgs e)
|
||||
{
|
||||
Utility.SystemUtility.OpenWindowsExplorerAtDirectory(_creationResult._cdbDirectory);
|
||||
}
|
||||
|
||||
private void button_import_Click(object sender, EventArgs e)
|
||||
{
|
||||
string message = Utility.NetworkProtocolUtility.CreateCreateProjectMessage(_creationResult._cdbDirectory + "\\" + _creationResult._cdbName + ".json", _creationResult._headerDirectories);
|
||||
|
||||
Utility.AsynchronousClient.Send(message);
|
||||
|
||||
Close();
|
||||
}
|
||||
|
||||
private void WindowCdbReady_Resize(object sender, EventArgs e)
|
||||
{
|
||||
label_message.MaximumSize = new Size((int)((float)MaximumSize.Width * 0.8f), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
-1328
File diff suppressed because it is too large
Load Diff
Generated
-84
@@ -1,84 +0,0 @@
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Wizard
|
||||
{
|
||||
partial class WindowCreateCdb
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WindowCreateCdb));
|
||||
this.progressBar = new System.Windows.Forms.ProgressBar();
|
||||
this.labelStatus = new System.Windows.Forms.Label();
|
||||
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// progressBar
|
||||
//
|
||||
this.progressBar.Location = new System.Drawing.Point(12, 12);
|
||||
this.progressBar.Name = "progressBar";
|
||||
this.progressBar.Size = new System.Drawing.Size(259, 23);
|
||||
this.progressBar.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.progressBar.TabIndex = 0;
|
||||
//
|
||||
// labelStatus
|
||||
//
|
||||
this.labelStatus.AutoSize = true;
|
||||
this.labelStatus.Location = new System.Drawing.Point(13, 42);
|
||||
this.labelStatus.Name = "labelStatus";
|
||||
this.labelStatus.Size = new System.Drawing.Size(52, 13);
|
||||
this.labelStatus.TabIndex = 1;
|
||||
this.labelStatus.Text = "Waiting...";
|
||||
//
|
||||
// backgroundWorker1
|
||||
//
|
||||
this.backgroundWorker1.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork);
|
||||
this.backgroundWorker1.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorker1_ProgressChanged);
|
||||
this.backgroundWorker1.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted);
|
||||
//
|
||||
// WindowCreateCdb
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(284, 63);
|
||||
this.Controls.Add(this.labelStatus);
|
||||
this.Controls.Add(this.progressBar);
|
||||
this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "WindowCreateCdb";
|
||||
this.Text = "Creating Compilation Data Base";
|
||||
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.WindowCreateCdb_FormClosed);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ProgressBar progressBar;
|
||||
private System.Windows.Forms.Label labelStatus;
|
||||
private System.ComponentModel.BackgroundWorker backgroundWorker1;
|
||||
}
|
||||
}
|
||||
@@ -1,292 +0,0 @@
|
||||
using CoatiSoftware.SourcetrailPlugin.SolutionParser;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Wizard
|
||||
{
|
||||
public partial class WindowCreateCdb : Form
|
||||
{
|
||||
public struct CreationResult
|
||||
{
|
||||
public SolutionParser.CompilationDatabaseSettings _cdbSettings;
|
||||
public string _cdbDirectory;
|
||||
public string _cdbName;
|
||||
public List<string> _headerDirectories;
|
||||
}
|
||||
|
||||
public delegate void OnFinishedCreatingCdb(CreationResult result);
|
||||
|
||||
private OnFinishedCreatingCdb _onFinishedCreateCdb = null;
|
||||
|
||||
private List<EnvDTE.Project> _projects = new List<EnvDTE.Project>();
|
||||
|
||||
private string _configurationName = "";
|
||||
private string _platformName = "";
|
||||
private string _targetDir = "";
|
||||
private string _fileName = "";
|
||||
private string _cStandard = "";
|
||||
private string _solutionDir = "";
|
||||
private List<string> _headerDirectories;
|
||||
|
||||
private SolutionParser.CompilationDatabaseSettings _cdb = null;
|
||||
|
||||
private CreationResult _result = new CreationResult();
|
||||
|
||||
private int _threadCount = 1;
|
||||
|
||||
private static object _lockObject = new object();
|
||||
private static ReaderWriterLockSlim _readWriteLock = new ReaderWriterLockSlim();
|
||||
|
||||
public OnFinishedCreatingCdb CallbackOnFinishedCreatingCdb
|
||||
{
|
||||
get { return _onFinishedCreateCdb; }
|
||||
set { _onFinishedCreateCdb = value; }
|
||||
}
|
||||
|
||||
public List<EnvDTE.Project> Projects
|
||||
{
|
||||
get { return _projects; }
|
||||
set { _projects = value; }
|
||||
}
|
||||
|
||||
public string ConfigurationName
|
||||
{
|
||||
get { return _configurationName; }
|
||||
set { _configurationName = value; }
|
||||
}
|
||||
|
||||
public string PlatformName
|
||||
{
|
||||
get { return _platformName; }
|
||||
set { _platformName = value; }
|
||||
}
|
||||
|
||||
public string TargetDir
|
||||
{
|
||||
get { return _targetDir; }
|
||||
set { _targetDir = value; }
|
||||
}
|
||||
|
||||
public string FileName
|
||||
{
|
||||
get { return _fileName; }
|
||||
set { _fileName = value; }
|
||||
}
|
||||
|
||||
public string CStandard
|
||||
{
|
||||
get { return _cStandard; }
|
||||
set { _cStandard = value; }
|
||||
}
|
||||
|
||||
public int ThreadCount
|
||||
{
|
||||
get { return _threadCount; }
|
||||
set { _threadCount = value; }
|
||||
}
|
||||
|
||||
public string SolutionDir
|
||||
{
|
||||
get { return _solutionDir; }
|
||||
set { _solutionDir = value; }
|
||||
}
|
||||
|
||||
public SolutionParser.CompilationDatabaseSettings Cdb
|
||||
{
|
||||
get { return _cdb; }
|
||||
set { _cdb = value; }
|
||||
}
|
||||
|
||||
|
||||
public WindowCreateCdb()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
progressBar.Maximum = 100;
|
||||
progressBar.Value = 0;
|
||||
|
||||
backgroundWorker1.WorkerReportsProgress = true;
|
||||
backgroundWorker1.WorkerSupportsCancellation = true;
|
||||
}
|
||||
|
||||
public void StartWorking()
|
||||
{
|
||||
backgroundWorker1.RunWorkerAsync();
|
||||
}
|
||||
|
||||
private CreationResult CreateCdb()
|
||||
{
|
||||
CreationResult result = new CreationResult();
|
||||
result._cdbSettings = null;
|
||||
result._cdbDirectory = "";
|
||||
result._cdbName = "";
|
||||
result._headerDirectories = new List<string>();
|
||||
|
||||
Logging.Logging.LogInfo("Starting to create CDB");
|
||||
|
||||
SolutionParser.CompilationDatabaseSettings cdbSettings = null;
|
||||
_headerDirectories = new List<string>();
|
||||
|
||||
try
|
||||
{
|
||||
System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
|
||||
watch.Start();
|
||||
CreateCompilationDatabase();
|
||||
watch.Stop();
|
||||
|
||||
Logging.Logging.LogInfo("Finished creating CDB, elapsed time: " + watch.ElapsedMilliseconds.ToString() + " ms");
|
||||
|
||||
cdbSettings = new CompilationDatabaseSettings();
|
||||
cdbSettings.Name = _fileName;
|
||||
cdbSettings.Directory = _targetDir;
|
||||
cdbSettings.SourceProject = _solutionDir;
|
||||
cdbSettings.LastUpdated = DateTime.Now;
|
||||
cdbSettings.ConfigurationName = _configurationName;
|
||||
cdbSettings.PlatformName = _platformName;
|
||||
|
||||
cdbSettings.IncludedProjects = new List<string>();
|
||||
foreach (EnvDTE.Project p in _projects)
|
||||
{
|
||||
cdbSettings.IncludedProjects.Add(p.Name);
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Failed to create CDB: " + e.Message);
|
||||
}
|
||||
|
||||
result._cdbSettings = cdbSettings;
|
||||
result._cdbDirectory = _targetDir;
|
||||
result._cdbName = _fileName;
|
||||
result._headerDirectories = _headerDirectories;
|
||||
|
||||
Logging.Logging.LogInfo("Done creating CDB");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void CreateCompilationDatabase()
|
||||
{
|
||||
File.WriteAllText(_targetDir + "\\" + _fileName + ".json", "");
|
||||
File.AppendAllText(_targetDir + "\\" + _fileName + ".json", "[\n");
|
||||
|
||||
Utility.QueuedFileWriter fileWriter = new Utility.QueuedFileWriter(_fileName + ".json", _targetDir);
|
||||
fileWriter.StartWorking();
|
||||
|
||||
try
|
||||
{
|
||||
Multitasking.LimitedThreadsTaskScheduler scheduler = new Multitasking.LimitedThreadsTaskScheduler(_threadCount);
|
||||
TaskFactory factory = new TaskFactory(scheduler);
|
||||
List<Task> tasks = new List<Task>();
|
||||
|
||||
int projectsProcessed = 0;
|
||||
foreach (EnvDTE.Project project in _projects)
|
||||
{
|
||||
Logging.Logging.LogInfo("Scheduling project \"" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(project.Name) + "\" for parsing.");
|
||||
|
||||
Task task = factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
SolutionParser.SolutionParser solutionParser = new SolutionParser.SolutionParser(new VsPathResolver(_targetDir));
|
||||
|
||||
List<CompileCommand> commands = solutionParser.CreateCompileCommands(project, _configurationName, _platformName, _cStandard);
|
||||
|
||||
lock (_lockObject)
|
||||
{
|
||||
projectsProcessed++;
|
||||
_headerDirectories.AddRange(solutionParser.HeaderDirectories);
|
||||
}
|
||||
|
||||
float relativProgress = (float)projectsProcessed / (float)_projects.Count;
|
||||
Logging.Logging.LogInfo("Processing project \"" + Logging.Obfuscation.NameObfuscator.GetObfuscatedName(project.Name) + "\"");
|
||||
backgroundWorker1.ReportProgress((int)(relativProgress * 100), "Processing project \"" + project.Name + "\"");
|
||||
|
||||
foreach (CompileCommand command in commands)
|
||||
{
|
||||
string serializedCommand = "";
|
||||
foreach (string line in command.SerializeToJson().Split('\n'))
|
||||
{
|
||||
serializedCommand += " " + line + "\n";
|
||||
}
|
||||
serializedCommand = serializedCommand.TrimEnd('\n');
|
||||
|
||||
fileWriter.PushMessage(serializedCommand + ",\n");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Failed to create CDB for project with exception: " + e.Message);
|
||||
Logging.Logging.LogError("Stack Trace: " + e.StackTrace);
|
||||
throw (e);
|
||||
}
|
||||
});
|
||||
|
||||
tasks.Add(task);
|
||||
}
|
||||
|
||||
int threadCount = System.Diagnostics.Process.GetCurrentProcess().Threads.Count;
|
||||
|
||||
Task.WaitAll(tasks.ToArray());
|
||||
|
||||
fileWriter.StopWorking();
|
||||
|
||||
backgroundWorker1.ReportProgress(100, "Writing data to file. This might take several minutes...");
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Logging.Logging.LogError("Failed to create CDB for solution with exception: " + e.Message);
|
||||
Logging.Logging.LogError("Stack Trace: " + e.StackTrace);
|
||||
}
|
||||
finally
|
||||
{
|
||||
File.AppendAllText(_targetDir + "\\" + _fileName + ".json", "\n]");
|
||||
}
|
||||
}
|
||||
|
||||
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
_result = CreateCdb();
|
||||
}
|
||||
|
||||
private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
|
||||
{
|
||||
if(backgroundWorker1.CancellationPending == false)
|
||||
{
|
||||
progressBar.Value = e.ProgressPercentage;
|
||||
|
||||
labelStatus.Text = e.UserState as string;
|
||||
}
|
||||
else
|
||||
{
|
||||
progressBar.Value = 0;
|
||||
|
||||
labelStatus.Text = "Cancelling...";
|
||||
}
|
||||
}
|
||||
|
||||
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
|
||||
{
|
||||
if(e.Cancelled == false && e.Error == null /*&& progressBar.Value >= 100*/)
|
||||
{
|
||||
_onFinishedCreateCdb?.Invoke(_result);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Logging.LogWarning("Cdb creation was aborted by user");
|
||||
}
|
||||
|
||||
Close();
|
||||
}
|
||||
|
||||
private void WindowCreateCdb_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
backgroundWorker1.CancelAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
-1331
File diff suppressed because it is too large
Load Diff
Generated
-92
@@ -1,92 +0,0 @@
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Wizard
|
||||
{
|
||||
partial class WindowMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WindowMessage));
|
||||
this.buttonCancel = new System.Windows.Forms.Button();
|
||||
this.buttonOK = new System.Windows.Forms.Button();
|
||||
this.labelContent = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.buttonCancel.Location = new System.Drawing.Point(13, 78);
|
||||
this.buttonCancel.Name = "buttonCancel";
|
||||
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonCancel.TabIndex = 0;
|
||||
this.buttonCancel.Text = "Cancel";
|
||||
this.buttonCancel.UseVisualStyleBackColor = true;
|
||||
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
|
||||
//
|
||||
// buttonOK
|
||||
//
|
||||
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.buttonOK.Location = new System.Drawing.Point(257, 78);
|
||||
this.buttonOK.Name = "buttonOK";
|
||||
this.buttonOK.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonOK.TabIndex = 1;
|
||||
this.buttonOK.Text = "OK";
|
||||
this.buttonOK.UseVisualStyleBackColor = true;
|
||||
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
|
||||
//
|
||||
// labelContent
|
||||
//
|
||||
this.labelContent.AutoSize = true;
|
||||
this.labelContent.Location = new System.Drawing.Point(13, 13);
|
||||
this.labelContent.MaximumSize = new System.Drawing.Size(300, 0);
|
||||
this.labelContent.Name = "labelContent";
|
||||
this.labelContent.Size = new System.Drawing.Size(44, 13);
|
||||
this.labelContent.TabIndex = 2;
|
||||
this.labelContent.Text = "Content";
|
||||
//
|
||||
// WindowMessage
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(344, 113);
|
||||
this.Controls.Add(this.labelContent);
|
||||
this.Controls.Add(this.buttonOK);
|
||||
this.Controls.Add(this.buttonCancel);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "WindowMessage";
|
||||
this.Text = "Message";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button buttonCancel;
|
||||
private System.Windows.Forms.Button buttonOK;
|
||||
private System.Windows.Forms.Label labelContent;
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.Wizard
|
||||
{
|
||||
public partial class WindowMessage : Form
|
||||
{
|
||||
private string _title = "Title";
|
||||
private string _message = "Message";
|
||||
|
||||
public delegate void Callback();
|
||||
|
||||
private Callback _onOK = null;
|
||||
private Callback _onCancel = null;
|
||||
|
||||
public string Title
|
||||
{
|
||||
get { return _title; }
|
||||
set { _title = value; }
|
||||
}
|
||||
|
||||
public string Message
|
||||
{
|
||||
get { return _message; }
|
||||
set { _message = value; }
|
||||
}
|
||||
|
||||
public Callback OnOK
|
||||
{
|
||||
get { return _onOK; }
|
||||
set { _onOK = value; }
|
||||
}
|
||||
|
||||
public Callback OnCancel
|
||||
{
|
||||
get { return _onCancel; }
|
||||
set { _onCancel = value; }
|
||||
}
|
||||
|
||||
public WindowMessage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void RefreshWindow()
|
||||
{
|
||||
Text = _title;
|
||||
labelContent.Text = _message;
|
||||
|
||||
if(_onCancel != null)
|
||||
{
|
||||
buttonCancel.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
buttonCancel.Hide();
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(_onCancel != null)
|
||||
{
|
||||
_onCancel();
|
||||
}
|
||||
|
||||
Close();
|
||||
}
|
||||
|
||||
private void buttonOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(_onOK != null)
|
||||
{
|
||||
_onOK();
|
||||
}
|
||||
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net461" />
|
||||
</packages>
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
|
||||
<Metadata>
|
||||
<Identity Id="acf15780-03b5-440e-a41e-db79b7043fc2" Version="0.9.83" Language="en-US" Publisher="Coati Software OG" />
|
||||
<DisplayName>SourcetrailPlugin</DisplayName>
|
||||
<Description xml:space="preserve">The Sourcetrail Plugin allows Visual Studio to communicate with Sourcetrail - an external source code exploration tool. It also enables Visual Studio to generate a Clang Compilation Database from any Visual Studio Solution which can be used to automate the Sourcetrail project setup and to run other Clang based tools.</Description>
|
||||
<MoreInfo>https://www.sourcetrail.com/</MoreInfo>
|
||||
<License>LICENSE.txt</License>
|
||||
<GettingStartedGuide>https://www.sourcetrail.com/documentation/#VisualStudio</GettingStartedGuide>
|
||||
<Icon>sourcetrail.ico</Icon>
|
||||
</Metadata>
|
||||
<Installation InstalledByMsi="false">
|
||||
<InstallationTarget Version="[11.0,16.0)" Id="Microsoft.VisualStudio.Community" />
|
||||
</Installation>
|
||||
<Dependencies>
|
||||
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="4.6" />
|
||||
<Dependency Id="Microsoft.VisualStudio.MPF.11.0" DisplayName="Visual Studio MPF 11.0" d:Source="Installed" Version="11.0" />
|
||||
</Dependencies>
|
||||
<Assets>
|
||||
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
|
||||
</Assets>
|
||||
<Prerequisites>
|
||||
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,16.0)" DisplayName="Visual Studio core editor" />
|
||||
</Prerequisites>
|
||||
</PackageManifest>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 70 KiB |
-23
@@ -1,23 +0,0 @@
|
||||
using CoatiSoftware.SourcetrailPlugin.Utility;
|
||||
using VCProjectEngineWrapper;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.IntegrationTests.Helpers
|
||||
{
|
||||
class TestPathResolver : IPathResolver
|
||||
{
|
||||
public override string GetCompilationDatabaseFilePath()
|
||||
{
|
||||
return "<CompilationDatabaseFilePath>";
|
||||
}
|
||||
|
||||
protected override string DoGetAsAbsoluteCanonicalPath(string path, IVCProjectWrapper project)
|
||||
{
|
||||
return "<ProjectBaseDirectory>/" + path;
|
||||
}
|
||||
|
||||
protected override string ResolveVsMacro(string potentialMacro, IVCConfigurationWrapper vcProjectConfig)
|
||||
{
|
||||
return "<Macro " + potentialMacro + ">";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
using EnvDTE;
|
||||
using Microsoft.VisualStudio;
|
||||
using Microsoft.VisualStudio.Shell.Interop;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Microsoft.VSSDK.Tools.VsIdeTesting;
|
||||
using System;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.IntegrationTests.Helpers
|
||||
{
|
||||
public static class TestUtility
|
||||
{
|
||||
public static void OpenSolution(string solutionFilePath)
|
||||
{
|
||||
IVsSolution solutionService = (IVsSolution)VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsSolution));
|
||||
int ret = solutionService.OpenSolutionFile((uint)__VSSLNOPENOPTIONS.SLNOPENOPT_DontConvertSLN, solutionFilePath);
|
||||
|
||||
DTE dte = (DTE)VsIdeTestHostContext.ServiceProvider.GetService(typeof(DTE));
|
||||
Console.WriteLine("opened solution contains " + dte.Solution.Projects.Count.ToString() + " projects");
|
||||
|
||||
Assert.AreEqual(VSConstants.S_OK, ret);
|
||||
}
|
||||
|
||||
public static void CloseCurrentSolution()
|
||||
{
|
||||
IVsSolution solutionService = (IVsSolution)VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsSolution));
|
||||
int ret = solutionService.CloseSolutionElement((uint)__VSSLNSAVEOPTIONS.SLNSAVEOPT_NoSave, null, 0);
|
||||
Assert.AreEqual(VSConstants.S_OK, ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
-131
@@ -1,131 +0,0 @@
|
||||
using CoatiSoftware.SourcetrailPlugin.IntegrationTests.Helpers;
|
||||
using CoatiSoftware.SourcetrailPlugin.SolutionParser;
|
||||
using EnvDTE;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Microsoft.VSSDK.Tools.VsIdeTesting;
|
||||
using Microsoft.VisualStudio.Shell.Interop;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.IntegrationTests
|
||||
{
|
||||
[TestClass]
|
||||
public class CreateCdbTests
|
||||
{
|
||||
private bool _updateExpectedOutput = false;
|
||||
|
||||
[TestMethod]
|
||||
[HostType("VS IDE")]
|
||||
public void TestSourcetrailPluginPackageGetsLoaded()
|
||||
{
|
||||
UIThreadInvoker.Invoke(new Action(() =>
|
||||
{
|
||||
// Load the package into the shell.
|
||||
Assert.IsNotNull(VsIdeTestHostContext.ServiceProvider);
|
||||
IVsShell shellService = (IVsShell)VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell));
|
||||
Guid packageGuid = new Guid(GuidList.guidSourcetrailPluginPkgString);
|
||||
|
||||
IVsPackage package;
|
||||
shellService.IsPackageLoaded(ref packageGuid, out package);
|
||||
if (package == null)
|
||||
{
|
||||
shellService.LoadPackage(ref packageGuid, out package);
|
||||
}
|
||||
|
||||
Assert.IsTrue(package is SourcetrailPluginPackage);
|
||||
}));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[HostType("VS IDE")]
|
||||
public void TestCompilationDatabaseCreationForCinderSolution()
|
||||
{
|
||||
UIThreadInvoker.Initialize();
|
||||
UIThreadInvoker.Invoke(new Action(() =>
|
||||
{
|
||||
TestCompilationDatabaseForSolution("../../../SourcetrailPluginTests/bin/data/cinder/cinder.sln");
|
||||
}));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[HostType("VS IDE")]
|
||||
public void TestCompilationDatabaseCreationForAllFilesInSameFolder()
|
||||
{
|
||||
UIThreadInvoker.Initialize();
|
||||
UIThreadInvoker.Invoke(new Action(() =>
|
||||
{
|
||||
TestCompilationDatabaseForSolution("../../../SourcetrailPluginTests/bin/data/all_in_same_folder/test.sln");
|
||||
}));
|
||||
}
|
||||
|
||||
private void TestCompilationDatabaseForSolution(string solutionPath)
|
||||
{
|
||||
Console.WriteLine("opening solution: " + solutionPath);
|
||||
Helpers.TestUtility.OpenSolution(solutionPath);
|
||||
|
||||
Console.WriteLine("creating compilation database");
|
||||
|
||||
CompilationDatabase output = null;
|
||||
try
|
||||
{
|
||||
output = CreateCompilationDatabaseForCurrentSolution();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("Exception: " + e.Message);
|
||||
Console.WriteLine("Stack Trace: " + e.StackTrace);
|
||||
Assert.Fail("Caught and exception while creating compilation database.");
|
||||
}
|
||||
|
||||
Assert.IsNotNull(output);
|
||||
|
||||
string cdbPath = Path.ChangeExtension(solutionPath, "json");
|
||||
if (_updateExpectedOutput)
|
||||
{
|
||||
output.SortAlphabetically();
|
||||
Console.WriteLine("writing compilation database to file: " + cdbPath);
|
||||
File.WriteAllText(cdbPath, output.SerializeToJson());
|
||||
Assert.IsTrue(File.Exists(cdbPath));
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("reading compilation database from file: " + cdbPath);
|
||||
CompilationDatabase expectedOutput = CompilationDatabase.LoadFromFile(cdbPath);
|
||||
Assert.IsNotNull(expectedOutput);
|
||||
|
||||
Console.WriteLine("comparing generated compilation database to expected output");
|
||||
Assert.IsTrue(output == expectedOutput, "The created compilation database differs from the expected output");
|
||||
}
|
||||
|
||||
Console.WriteLine("closing solution");
|
||||
Helpers.TestUtility.CloseCurrentSolution();
|
||||
}
|
||||
|
||||
private static CompilationDatabase CreateCompilationDatabaseForCurrentSolution()
|
||||
{
|
||||
DTE dte = (DTE)VsIdeTestHostContext.ServiceProvider.GetService(typeof(DTE));
|
||||
Assert.IsNotNull(dte);
|
||||
|
||||
CompilationDatabase cdb = new CompilationDatabase();
|
||||
foreach (Project project in dte.Solution.Projects)
|
||||
{
|
||||
List<string> configurationNames = Utility.SolutionUtility.GetConfigurationNames(dte);
|
||||
Assert.IsTrue(configurationNames.Count > 0, "No target configurations found in loaded solution.");
|
||||
|
||||
List<string> platformNames = Utility.SolutionUtility.GetPlatformNames(dte);
|
||||
Assert.IsTrue(platformNames.Count > 0, "No target platforms found in loaded solution.");
|
||||
|
||||
SolutionParser.SolutionParser solutionParser = new SolutionParser.SolutionParser(new TestPathResolver());
|
||||
foreach (SolutionParser.CompileCommand command in solutionParser.CreateCompileCommands(
|
||||
project, configurationNames[0], platformNames[0], "c11"
|
||||
))
|
||||
{
|
||||
cdb.AddCompileCommand(command);
|
||||
}
|
||||
}
|
||||
|
||||
return cdb;
|
||||
}
|
||||
}
|
||||
}
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("SourcetrailPlugin.IntegrationTests")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Coati Software")]
|
||||
[assembly: AssemblyProduct("SourcetrailPlugin.IntegrationTests")]
|
||||
[assembly: AssemblyCopyright("Copyright © Coati Software 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
[assembly: Guid("9de8c188-0f0e-4f5d-b3c4-ecf9cfb23e0d")]
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0.*")]
|
||||
//[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
-122
@@ -1,122 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\MSTest.TestAdapter.1.1.11\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.1.11\build\net45\MSTest.TestAdapter.props')" />
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VisualStudioYear>2015</VisualStudioYear>
|
||||
<VisualStudioYear Condition="'$(VisualStudioVersion)' >= '15.0'">2017</VisualStudioYear>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' >= '11.0'">
|
||||
<MinimumVisualStudioVersion>$(VisualStudioVersion)</MinimumVisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' >= '12.0'">
|
||||
<OldToolsVersion>4.0</OldToolsVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{9DE8C188-0F0E-4F5D-B3C4-ECF9CFB23E0D}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CoatiSoftware.SourcetrailPlugin.IntegrationTests</RootNamespace>
|
||||
<AssemblyName>SourcetrailPlugin.IntegrationTests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
||||
<IsCodedUITest>False</IsCodedUITest>
|
||||
<TestProjectType>UnitTest</TestProjectType>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<Choose>
|
||||
<When Condition="'$(VisualStudioVersion)' >= '15'">
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VSSDK.TestHostFramework, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
</ItemGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.VCProjectEngine, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VSSDK.TestHostFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
</ItemGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
<ItemGroup>
|
||||
<Reference Include="EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="EnvDTE80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
<Reference Include="Microsoft.VisualStudio.Shell.11.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<Reference Include="Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Helpers\TestPathResolver.cs" />
|
||||
<Compile Include="IntegrationTests\CreateCdbTests.cs" />
|
||||
<Compile Include="Helpers\TestUtility.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="UnitTests\CompilationDatabaseTests.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SourcetrailPlugin\SourcetrailPlugin.csproj">
|
||||
<Project>{a585a530-e120-4c74-934e-d57ed12a7da9}</Project>
|
||||
<Name>SourcetrailPlugin</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\VCProjectEngineWrapperInterfaces\VCProjectEngineWrapperInterfaces.csproj">
|
||||
<Project>{F592DB46-0C77-470B-AAF8-80C51F44380E}</Project>
|
||||
<Name>VCProjectEngineWrapperInterfaces</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.1.11\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.1.11\build\net45\MSTest.TestAdapter.props'))" />
|
||||
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.1.11\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.1.11\build\net45\MSTest.TestAdapter.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\MSTest.TestAdapter.1.1.11\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.1.11\build\net45\MSTest.TestAdapter.targets')" />
|
||||
</Project>
|
||||
-60
@@ -1,60 +0,0 @@
|
||||
using CoatiSoftware.SourcetrailPlugin.SolutionParser;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace CoatiSoftware.SourcetrailPlugin.IntegrationTests.UnitTests
|
||||
{
|
||||
[TestClass]
|
||||
public class CompilationDatabaseTests
|
||||
{
|
||||
[TestMethod]
|
||||
public void TestComparingCompileCommandWithSelfByValueWorks()
|
||||
{
|
||||
CompileCommand command1 = new CompileCommand();
|
||||
command1.File = "test.cpp";
|
||||
command1.Directory = "./";
|
||||
command1.Command = "D test test.cpp";
|
||||
|
||||
CompileCommand command2 = new CompileCommand();
|
||||
command2.File = "test.cpp";
|
||||
command2.Directory = "./";
|
||||
command2.Command = "D test test.cpp";
|
||||
|
||||
Assert.IsTrue(command1 == command2);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestComparingCompilationDatabaseWithSelfByValueWorks()
|
||||
{
|
||||
CompileCommand command = new CompileCommand();
|
||||
command.File = "test.cpp";
|
||||
command.Directory = "./";
|
||||
command.Command = "D test test.cpp";
|
||||
|
||||
CompilationDatabase cdb1 = new CompilationDatabase();
|
||||
cdb1.AddCompileCommand(command);
|
||||
|
||||
CompilationDatabase cdb2 = new CompilationDatabase();
|
||||
cdb2.AddCompileCommand(command);
|
||||
|
||||
Assert.IsTrue(cdb1 == cdb2);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestCompilationDatabaseRetainsEscapedQuotesWhenDeserializedAfterSerialization()
|
||||
{
|
||||
CompileCommand command = new CompileCommand();
|
||||
command.File = "test.cpp";
|
||||
command.Directory = "./";
|
||||
command.Command = "D DEFINE=\"value\" test.cpp";
|
||||
|
||||
CompilationDatabase originalCompilationDatabase = new CompilationDatabase();
|
||||
originalCompilationDatabase.AddCompileCommand(command);
|
||||
string serialized = originalCompilationDatabase.SerializeToJson();
|
||||
|
||||
CompilationDatabase deserializedCompilationDatabase = new CompilationDatabase();
|
||||
deserializedCompilationDatabase.DeserializeFromJson(serialized);
|
||||
|
||||
Assert.IsTrue(deserializedCompilationDatabase == originalCompilationDatabase);
|
||||
}
|
||||
}
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
[
|
||||
{
|
||||
"directory": "<CompilationDatabaseFilePath>",
|
||||
"command": "clang-tool -fms-extensions -fms-compatibility -fms-compatibility-version=19 -isystem '<Macro $(VC_IncludePath)>' -isystem '<Macro $(WindowsSDK_IncludePath)>' -D WIN32 -D _DEBUG -D _CONSOLE -std=c++14 '<ProjectBaseDirectory>/main.cpp'",
|
||||
"file": "<ProjectBaseDirectory>/main.cpp"
|
||||
}
|
||||
]
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BR9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test.vcxproj", "{03CDC311-12CE-4B5A-B1D6-DEE68194163D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
MinSizeRel|x64 = MinSizeRel|x64
|
||||
MinSizeRel|x86 = MinSizeRel|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
RelWithDebInfo|x64 = RelWithDebInfo|x64
|
||||
RelWithDebInfo|x86 = RelWithDebInfo|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{03CDC311-12CE-4B5A-B1D6-DEE68194163D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{03CDC311-12CE-4B5A-B1D6-DEE68194163D}.Debug|x64.Build.0 = Debug|x64
|
||||
{03CDC311-12CE-4B5A-B1D6-DEE68194163D}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{03CDC311-12CE-4B5A-B1D6-DEE68194163D}.Debug|x86.Build.0 = Debug|Win32
|
||||
{03CDC311-12CE-4B5A-B1D6-DEE68194163D}.MinSizeRel|x64.ActiveCfg = Release|x64
|
||||
{03CDC311-12CE-4B5A-B1D6-DEE68194163D}.MinSizeRel|x64.Build.0 = Release|x64
|
||||
{03CDC311-12CE-4B5A-B1D6-DEE68194163D}.MinSizeRel|x86.ActiveCfg = Release|Win32
|
||||
{03CDC311-12CE-4B5A-B1D6-DEE68194163D}.MinSizeRel|x86.Build.0 = Release|Win32
|
||||
{03CDC311-12CE-4B5A-B1D6-DEE68194163D}.Release|x64.ActiveCfg = Release|x64
|
||||
{03CDC311-12CE-4B5A-B1D6-DEE68194163D}.Release|x64.Build.0 = Release|x64
|
||||
{03CDC311-12CE-4B5A-B1D6-DEE68194163D}.Release|x86.ActiveCfg = Release|Win32
|
||||
{03CDC311-12CE-4B5A-B1D6-DEE68194163D}.Release|x86.Build.0 = Release|Win32
|
||||
{03CDC311-12CE-4B5A-B1D6-DEE68194163D}.RelWithDebInfo|x64.ActiveCfg = Release|x64
|
||||
{03CDC311-12CE-4B5A-B1D6-DEE68194163D}.RelWithDebInfo|x64.Build.0 = Release|x64
|
||||
{03CDC311-12CE-4B5A-B1D6-DEE68194163D}.RelWithDebInfo|x86.ActiveCfg = Release|Win32
|
||||
{03CDC311-12CE-4B5A-B1D6-DEE68194163D}.RelWithDebInfo|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
-65
@@ -1,65 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{03CDC311-12CE-4B5A-B1D6-DEE68194163D}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>testtest</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup>
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>Debug</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
-175
File diff suppressed because one or more lines are too long
-169
File diff suppressed because one or more lines are too long
-1277
File diff suppressed because it is too large
Load Diff
-51
@@ -1,51 +0,0 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
Project("{8CC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ALL_BUILD", "ALL_BUILD.vcxproj", "{77DB15F6-B3BF-32CA-B434-F11CCD83B9C9}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{33039C50-EF04-3EAA-BDC7-703712A3249F} = {33039C50-EF04-3EAA-BDC7-703712A3249F}
|
||||
{C9438973-99BC-3461-A610-4C65A2403BF5} = {C9438973-99BC-3461-A610-4C65A2403BF5}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8CC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZERO_CHECK", "ZERO_CHECK.vcxproj", "{33039C50-EF04-3EAA-BDC7-703712A3249F}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8CC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cinder", "cinder.vcxproj", "{C9438973-99BC-3461-A610-4C65A2403BF5}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{33039C50-EF04-3EAA-BDC7-703712A3249F} = {33039C50-EF04-3EAA-BDC7-703712A3249F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
MinSizeRel|Win32 = MinSizeRel|Win32
|
||||
RelWithDebInfo|Win32 = RelWithDebInfo|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{77DB15F6-B3BF-32CA-B434-F11CCD83B9C9}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{77DB15F6-B3BF-32CA-B434-F11CCD83B9C9}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{77DB15F6-B3BF-32CA-B434-F11CCD83B9C9}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32
|
||||
{77DB15F6-B3BF-32CA-B434-F11CCD83B9C9}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32
|
||||
{33039C50-EF04-3EAA-BDC7-703712A3249F}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{33039C50-EF04-3EAA-BDC7-703712A3249F}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{33039C50-EF04-3EAA-BDC7-703712A3249F}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{33039C50-EF04-3EAA-BDC7-703712A3249F}.Release|Win32.Build.0 = Release|Win32
|
||||
{33039C50-EF04-3EAA-BDC7-703712A3249F}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32
|
||||
{33039C50-EF04-3EAA-BDC7-703712A3249F}.MinSizeRel|Win32.Build.0 = MinSizeRel|Win32
|
||||
{33039C50-EF04-3EAA-BDC7-703712A3249F}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32
|
||||
{33039C50-EF04-3EAA-BDC7-703712A3249F}.RelWithDebInfo|Win32.Build.0 = RelWithDebInfo|Win32
|
||||
{C9438973-99BC-3461-A610-4C65A2403BF5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C9438973-99BC-3461-A610-4C65A2403BF5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C9438973-99BC-3461-A610-4C65A2403BF5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C9438973-99BC-3461-A610-4C65A2403BF5}.Release|Win32.Build.0 = Release|Win32
|
||||
{C9438973-99BC-3461-A610-4C65A2403BF5}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32
|
||||
{C9438973-99BC-3461-A610-4C65A2403BF5}.MinSizeRel|Win32.Build.0 = MinSizeRel|Win32
|
||||
{C9438973-99BC-3461-A610-4C65A2403BF5}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32
|
||||
{C9438973-99BC-3461-A610-4C65A2403BF5}.RelWithDebInfo|Win32.Build.0 = RelWithDebInfo|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
-1028
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user