Skip to content

Commit 9c99140

Browse files
[Java & Python] Include PDB Files in Debug Builds for Compressed Language Extensions (#46)
* Include PDB * Resolve Comments
1 parent 86b5941 commit 9c99140

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

language-extensions/java/build/windows/create-java-extension-zip.cmd

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,16 @@ SET BUILD_OUTPUT=%ENL_ROOT%\build-output\java-extension\windows\%BUILD_CONFIGURA
1919
SET OUTPUT_JAR="%ENL_ROOT%\build-output\java-extension\target\%BUILD_CONFIGURATION%\mssql-java-lang-extension.jar"
2020

2121
mkdir %BUILD_OUTPUT%\packages
22-
powershell -NoProfile -ExecutionPolicy Unrestricted -Command "Compress-Archive -Path %BUILD_OUTPUT%\javaextension.dll, %OUTPUT_JAR% -DestinationPath %BUILD_OUTPUT%\packages\java-lang-extension.zip -Force"
22+
23+
REM Set common files to be included in the zip
24+
SET INCLUDE_FILES=%BUILD_OUTPUT%\javaextension.dll, %OUTPUT_JAR%
25+
26+
REM Check if BUILD_CONFIGURATION is debug, then include javaextension.pdb in the zip
27+
IF /I "%BUILD_CONFIGURATION%"=="debug" (
28+
SET INCLUDE_FILES=%INCLUDE_FILES%, %BUILD_OUTPUT%\javaextension.pdb
29+
)
30+
31+
powershell -NoProfile -ExecutionPolicy Unrestricted -Command "Compress-Archive -Path %INCLUDE_FILES% -DestinationPath %BUILD_OUTPUT%\packages\java-lang-extension.zip -Force"
2332
CALL :CHECK_BUILD_ERROR %ERRORLEVEL% %BUILD_CONFIGURATION%
2433

2534
REM Advance arg passed to create-java-extension.cmd
@@ -33,9 +42,9 @@ IF NOT "%~1"=="" GOTO LOOP
3342
EXIT /b %ERRORLEVEL%
3443

3544
:CHECK_BUILD_ERROR
36-
IF %1 == 0 (
37-
ECHO Success: Created zip for %2 config
38-
) ELSE (
39-
ECHO Error: Failed to create zip for %2 config
40-
EXIT /b %1
41-
)
45+
IF %1 == 0 (
46+
ECHO Success: Created zip for %2 config
47+
) ELSE (
48+
ECHO Error: Failed to create zip for %2 config
49+
EXIT /b %1
50+
)

language-extensions/python/build/windows/create-python-extension-zip.cmd

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ SET BUILD_OUTPUT=%ENL_ROOT%\build-output\pythonextension\windows\%BUILD_CONFIGUR
1919

2020
mkdir %BUILD_OUTPUT%\packages
2121

22-
powershell -NoProfile -ExecutionPolicy Unrestricted -Command "Compress-Archive -Path %BUILD_OUTPUT%\pythonextension.dll -DestinationPath %BUILD_OUTPUT%\packages\python-lang-extension.zip -Force"
22+
REM Check if BUILD_CONFIGURATION is debug, then include pythonextension.pdb in the zip
23+
IF /I "%BUILD_CONFIGURATION%"=="debug" (
24+
SET INCLUDE_FILES=%BUILD_OUTPUT%\pythonextension.dll, %BUILD_OUTPUT%\pythonextension.pdb
25+
) ELSE (
26+
SET INCLUDE_FILES=%BUILD_OUTPUT%\pythonextension.dll
27+
)
28+
29+
powershell -NoProfile -ExecutionPolicy Unrestricted -Command "Compress-Archive -Path %INCLUDE_FILES% -DestinationPath %BUILD_OUTPUT%\packages\python-lang-extension.zip -Force"
2330

2431
CALL :CHECK_BUILD_ERROR %ERRORLEVEL% %BUILD_CONFIGURATION%
2532

0 commit comments

Comments
 (0)