From 97b9f790b73297a41f81abf67372b7cb363b3a6b Mon Sep 17 00:00:00 2001 From: Geoff Evans Date: Fri, 16 Oct 2020 10:01:29 -0700 Subject: [PATCH] Add source indexing and update some resource strings --- .github/workflows/release.yml | 4 +++ .gitignore | 3 +-- resource.h | 6 +++++ resource.rc | 16 ++++++------ source_index_pdb.bat | 46 +++++++++++++++++++++++++++++++++++ source_index_repo.bat | 33 +++++++++++++++++++++++++ 6 files changed, 97 insertions(+), 11 deletions(-) create mode 100644 source_index_pdb.bat create mode 100644 source_index_repo.bat diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a6181d..e1047aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,6 +28,10 @@ jobs: run: | MSBuild.exe PowerMateTray.sln -p:Configuration=Release + - name: Source Index PDB + run: | + cmd.exe /c call source_index_pdb.bat build\x64\Release\PowerMateTray.pdb + - name: Build Installer run: | cmd.exe /c call build_installer.bat diff --git a/.gitignore b/.gitignore index bdc1201..9ac8801 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,5 @@ *.REMOTE.* .vs/* build/* -install/* ipch/* -install_dir.txt +source_index.txt diff --git a/resource.h b/resource.h index ba819bd..c6081e7 100644 --- a/resource.h +++ b/resource.h @@ -11,6 +11,12 @@ #define RESOURCE_VERSION_TOSTRING(major, minor, patch) RESOURCE_VERSION_STRINGIFY(major, minor, patch) #define RESOURCE_VERSION_STRING RESOURCE_VERSION_TOSTRING( VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH ) +#define APP_NAME_STRING "PowerMateTray" +#define APP_VERSION_STRING RESOURCE_VERSION_STRING +#define APP_COMPANY_STRING "" +#define APP_COPYRIGHT_STRING "" +#define APP_DESCRIPTION_STRING "A simple System Tray app for Griffin PowerMate Bluetooth" + // Next default values for new objects // #ifdef APSTUDIO_INVOKED diff --git a/resource.rc b/resource.rc index 0051ca6..e4611a8 100644 --- a/resource.rc +++ b/resource.rc @@ -75,15 +75,13 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "Comments", "A system tray applicaton used to launch shells and tools through EShell." - VALUE "CompanyName", "Helium Project" - VALUE "FileDescription", "PowerMateTray" - VALUE "FileVersion", RESOURCE_VERSION_STRING - VALUE "InternalName", "PowerMateTray" - VALUE "LegalCopyright", "Copyright (C) Helium Project" - VALUE "OriginalFilename", "PowerMateTray.exe" - VALUE "ProductName", "PowerMateTray" - VALUE "ProductVersion", RESOURCE_VERSION_STRING + VALUE "Comments", APP_DESCRIPTION_STRING + VALUE "CompanyName", APP_COMPANY_STRING + VALUE "FileDescription", APP_NAME_STRING + VALUE "FileVersion", APP_VERSION_STRING + VALUE "LegalCopyright", APP_COPYRIGHT_STRING + VALUE "ProductName", APP_NAME_STRING + VALUE "ProductVersion", APP_VERSION_STRING END END BLOCK "VarFileInfo" diff --git a/source_index_pdb.bat b/source_index_pdb.bat new file mode 100644 index 0000000..fa72696 --- /dev/null +++ b/source_index_pdb.bat @@ -0,0 +1,46 @@ +@echo off + +setlocal +pushd %~dp0 + +:: +:: Generate the script section file for pdbstr.exe +:: + +echo: +echo Writing source_index.txt header... + +echo SRCSRV: ini ------------------------------------------------ > source_index.txt +echo VERSION=2 >> source_index.txt +echo VERCTRL=http >> source_index.txt +echo SRCSRV: variables ------------------------------------------ >> source_index.txt +echo HTTP_ALIAS=https://raw.githubusercontent.com >> source_index.txt +echo HTTP_EXTRACT_TARGET=%%HTTP_ALIAS%%%%var2%% >> source_index.txt +echo SRCSRVTRG=%%HTTP_EXTRACT_TARGET%% >> source_index.txt +echo SRCSRV: source files --------------------------------------- >> source_index.txt + +echo: +echo List Root +call source_index_repo.bat + +echo: +echo List Submodules +git submodule foreach --recursive cmd //c "%~dp0source_index_repo.bat" + +echo: +echo Writing footer... +echo SRCSRV: end ------------------------------------------------ >> source_index.txt + +:: +:: Update the pdb file with the script section +:: + +echo: +echo Adding srcsrv section to %1... +"%ProgramFiles(x86)%\Windows Kits\10\Debuggers\x64\srcsrv\pdbstr.exe" -w -p:%1 -s:srcsrv -i:source_index.txt + +popd +endlocal + +if %ERRORLEVEL% neq 0 exit /b 1 +exit /b 0 diff --git a/source_index_repo.bat b/source_index_repo.bat new file mode 100644 index 0000000..2f1f0de --- /dev/null +++ b/source_index_repo.bat @@ -0,0 +1,33 @@ +@echo off + +setlocal + +:: https://github.com/gorlak/PowerMateTray +for /f "delims=" %%f in ( 'git remote get-url origin' ) do set ORIGIN=%%f + +:: remove .git from the path if it's there (.git is the module url but not the source code url) +SET ORIGIN=%ORIGIN:.git=% + +:: 297d3d60af11c8749ab8515eec6ab188da3df317 +for /f "delims=" %%f in ( 'git rev-parse head' ) do set COMMIT=%%f + +:: /gorlak/PowerMateTray/297d3d60af11c8749ab8515eec6ab188da3df317/ +SET URL=%ORIGIN:https://github.com=%/%COMMIT% + +:: C:\Users\geoff\Projects\gorlak-PowerMateTray\.gitignore*.gitignore +for /f "delims=" %%f in ( 'git ls-files -- *.c *.C *.cc *.cp *.cpp *.cxx *.CPP *.h *.hh *.impl *.inl' ) do (call :PROCESS_FILE "%~dp0source_index.txt" "%%f") + +endlocal + +exit /b 0 + +:: +:: This is necessary to do some subsitutions that aren't possible with a for /f param +:: + +:PROCESS_FILE + set TXT=%1 + set FILE=%2 + set FILE_NOQUOTE=%FILE:"=% + echo %CD%\%FILE_NOQUOTE:/=\%*%URL%/%FILE_NOQUOTE% >> %TXT% + GOTO :eof \ No newline at end of file