Skip to content

User authentication over secure connection #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 33 additions & 32 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if /i not [%ARG:setup=%] == [%ARG%] (
where cl.exe >nul 2>&1
if ERRORLEVEL 1 (
echo.
echo ERROR: building environment not set. Run with /? to see options.
echo %~nx0: ERROR: building environment not set. Run with /? to see options.
echo.
goto END
)
Expand All @@ -80,7 +80,7 @@ REM presence of 'install'/'package': invoke respective _CONF "function"
if /i not [%ARG:install=%] == [%ARG%] (
if /i not [%ARG:package=%] == [%ARG%] (
REM Since CPACK uses the install target:
echo ERROR: 'install' and 'package' are mutually exclusive actions.
echo %~nx0: ERROR: 'install' and 'package' are mutually exclusive actions.
exit /b 1
)
call:INSTALL_CONF
Expand All @@ -94,7 +94,7 @@ if /i not [%ARG:type=%] == [%ARG%] (
) else (
set BUILD_TYPE=Debug
set MSBUILD_ARGS=/p:Configuration=!BUILD_TYPE!
echo Invoked without 'type', !BUILD_TYPE!-building (default^).
echo %~nx0: invoked without 'type', !BUILD_TYPE!-building (default^).
)

REM absence of nobuild: invoke BUILD "function";
Expand All @@ -112,7 +112,7 @@ if /i [%ARG:nobuild=%] == [%ARG%] (
goto END
)
) else (
echo Invoked with 'nobuild', building skipped.
echo %~nx0: invoked with 'nobuild', building skipped.
)


Expand Down Expand Up @@ -187,15 +187,16 @@ REM function to check and set cmake binary (if installed)
REM Using already set environment path
) else (
echo.
echo ERROR: needed cmake executable not found: when installed,
echo either set it in PATH or in environment variable CMAKE
echo %~nx0: ERROR: needed cmake executable not found: when
echo installed, either set it in PATH or in
echo environment variable CMAKE.
echo.
goto END
)
) else (
set CMAKE=cmake.exe
)
echo|set /p="Using CMAKE binary: %CMAKE% : "
echo|set /p="%~nx0: using CMAKE binary: %CMAKE% : "
%CMAKE% --version | findstr /C:"version"

goto:eof
Expand Down Expand Up @@ -259,7 +260,7 @@ REM USAGE function: output a usage message

REM PROPER function: clean up the build and libs dir.
:PROPER
echo Cleaning libs.
echo %~nx0: cleaning libs.
if exist %BUILD_DIR%\curlclean.vcxproj (
MSBuild %BUILD_DIR%\curlclean.vcxproj
)
Expand All @@ -274,7 +275,7 @@ REM PROPER function: clean up the build and libs dir.

REM CLEAN function: clean up the build dir.
:CLEAN
echo Cleaning builds.
echo %~nx0: cleaning builds.
REM delete all files that don't have the "extension" .gitignore :-)
for %%i in (%BUILD_DIR%\*) do if not %%~xi == .gitignore (
del /s /q %%i >nul 2>&1
Expand All @@ -292,7 +293,7 @@ REM SETUP function: set-up the build environment
if exist "C:\Program Files (x86)\Microsoft Visual Studio\%RELEASE%\%%e\Common7\Tools\VsDevCmd.bat" (
if /i "%%e" == "Community" (
echo.
echo WARNING: Community edition is not licensed to build commerical projects.
echo %~nx0: WARNING: Community edition is not licensed to build commerical projects.
echo.
)
call "C:\Program Files (x86)\Microsoft Visual Studio\%RELEASE%\%%e\Common7\Tools\VsDevCmd.bat" -arch=!TARCH!
Expand All @@ -302,7 +303,7 @@ REM SETUP function: set-up the build environment
)
if [%EDITION%] == [] (
echo.
echo WARNING: no MSVC edition found, environment not set.
echo %~nx0: WARNING: no MSVC edition found, environment not set.
echo.
)

Expand All @@ -312,11 +313,11 @@ REM INSTALL_CONF function: extract install location, if any; this will be
REM injected into the project files generated by cmake
:INSTALL_CONF
if exist ALL_BUILD.vcxproj (
echo Project files already generated, install configuration skipped.
echo %~nx0: NOTICE: project files already generated, install configuration skipped.
goto:eof
)
if not [%INSTALL_DIR%] == [] (
echo Installation directory set by INSTALL_DIR=%INSTALL_DIR%
echo %~nx0: installation directory set by INSTALL_DIR=%INSTALL_DIR%.
goto:eof
)

Expand All @@ -326,7 +327,7 @@ REM injected into the project files generated by cmake
set crr=%%a
if /i ["!crr:~0,8!"] == ["install:"] (
set INSTALL_DIR=!crr:~8!
echo Setting the installation dir to: !INSTALL_DIR!
echo %~nx0: Setting the installation dir to: !INSTALL_DIR!.
goto:eof
)
)
Expand All @@ -338,7 +339,7 @@ REM PACKAGE_CONF function: extract versioning string, if any; this will be
REM injected into the project files generated by cmake
:PACKAGE_CONF
if exist ALL_BUILD.vcxproj (
echo Project files already generated, package configuration skipped.
echo %~nx0: NOTICE: project files already generated, package configuration skipped.
goto:eof
)

Expand All @@ -348,7 +349,7 @@ REM injected into the project files generated by cmake
set crr=%%a
if /i ["!crr:~0,8!"] == ["package:"] (
set PACKAGE_VER=!crr:~8!
echo Setting the packaging version string to: !PACKAGE_VER!
echo %~nx0: setting the packaging version string to: !PACKAGE_VER!.

REM CPACK needs a relative prefix in order to install the files
REM correctly.
Expand All @@ -369,7 +370,7 @@ REM BUILDTYPE function: set the build config to feed MSBuild
if /i ["!crr:~0,5!"] == ["type:"] (
set BUILD_TYPE=!crr:~5!
set MSBUILD_ARGS=/p:Configuration=!BUILD_TYPE!
echo Setting the build type to: !MSBUILD_ARGS!
echo %~nx0: setting the build type to: !MSBUILD_ARGS!.
goto:eof
)
)
Expand All @@ -380,7 +381,7 @@ REM BUILDTYPE function: set the build config to feed MSBuild
REM BUILD function: build various targets
:BUILD
if not exist ALL_BUILD.vcxproj (
echo Generating the project files.
echo %~nx0: generating the project files.

set CMAKE_ARGS=-DDRIVER_BASE_NAME=%DRIVER_BASE_NAME%
REM no explicit x86 generator and is the default (MSVC2017 only?).
Expand All @@ -392,21 +393,21 @@ REM BUILD function: build various targets
set CMAKE_ARGS=!CMAKE_ARGS! -DVERSION_QUALIFIER=!PACKAGE_VER!
)

echo cmake params: !CMAKE_ARGS!
echo %~nx0: cmake params: !CMAKE_ARGS!.
%CMAKE% !CMAKE_ARGS! !SRC_PATH!
)
if /i not [%ARG:genonly=%] == [%ARG%] (
goto:eof
)

if /i not [%ARG:tests=%] == [%ARG%] (
echo Building all the project.
echo %~nx0: building all the project.
MSBuild ALL_BUILD.vcxproj %MSBUILD_ARGS%
if ERRORLEVEL 1 (
goto END
)
) else (
echo Building the driver.
echo %~nx0: building the driver.
REM file name expansion, cmd style...
for /f %%i in ("%DRIVER_BASE_NAME%*.vcxproj") do (
MSBuild %%~nxi %MSBUILD_ARGS%
Expand All @@ -422,7 +423,7 @@ REM BUILD function: build various targets
)

if /i not [%ARG:suiteS=%] == [%ARG%] (
echo Building the test projects.
echo %~nx0: building the test projects.
for %%i in (test\test_*.vcxproj) do (
MSBuild %%~fi %MSBUILD_ARGS%
if ERRORLEVEL 1 (
Expand All @@ -436,7 +437,7 @@ REM BUILD function: build various targets
set crr=%%a
if /i ["!crr:~0,6!"] == ["suite:"] (
set SUITE=!crr:~6!
echo Building one suite: !SUITE!
echo %~nx0: building one suite: !SUITE!.
MSBuild test\!SUITE!.vcxproj %MSBUILD_ARGS%
if ERRORLEVEL 1 (
goto END
Expand All @@ -457,9 +458,9 @@ REM TESTS_SUITE_S function: run the compiled tests
goto END
)
) else if /i not [%ARG:suiteS=%] == [%ARG%] (
echo Running all test suites.
echo %~nx0: running all test suites.
for %%i in (test\test_*.vcxproj) do (
echo Running test\%BUILD_TYPE%\%%~ni.exe :
echo %~nx0: running test\%BUILD_TYPE%\%%~ni.exe :
test\%BUILD_TYPE%\%%~ni.exe
if ERRORLEVEL 1 (
goto END
Expand All @@ -472,7 +473,7 @@ REM TESTS_SUITE_S function: run the compiled tests
set crr=%%a
if /i ["!crr:~0,6!"] == ["suite:"] (
set SUITE=!crr:~6!
echo Running one suite: !SUITE!
echo %~nx0: running one suite: !SUITE!.
test\%BUILD_TYPE%\!SUITE!.exe
if ERRORLEVEL 1 (
goto END
Expand All @@ -486,7 +487,7 @@ REM TESTS_SUITE_S function: run the compiled tests

REM INSTALL_DO function: copy DLLs (libcurl, odbc) into the install
:INSTALL_DO
echo Installing the driver files.
echo %~nx0: installing the driver files.
MSBuild INSTALL.vcxproj !MSBUILD_ARGS!
if ERRORLEVEL 1 (
goto END
Expand All @@ -496,24 +497,24 @@ REM INSTALL_DO function: copy DLLs (libcurl, odbc) into the install

REM PACKAGE_DO function: generate deliverable package
:PACKAGE_DO
echo Packaging the driver files.
echo %~nx0: packaging the driver files.
MSBuild PACKAGE.vcxproj !MSBUILD_ARGS!

goto:eof


REM REGADD function: add driver into the registry
:REGADD
echo Adding driver into the registry.
echo %~nx0: adding driver into the registry.

REM check if driver exists, otherwise the filename is unknown
if not exist %BUILD_DIR%\%BUILD_TYPE%\%DRIVER_BASE_NAME%*.dll (
echo Error: Driver can only be added into the registry once built.
echo %~nx0: ERROR: driver can only be added into the registry once built.
goto END
)
for /f %%i in ("%BUILD_DIR%\%BUILD_TYPE%\%DRIVER_BASE_NAME%*.dll") do set DRVNAME=%%~nxi

echo Adding ESODBC driver %INSTALL_DIR%\!DRVNAME! to the registry.
echo %~nx0: adding ESODBC driver %INSTALL_DIR%\!DRVNAME! to the registry.

reg add "HKLM\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers" ^
/v "Elasticsearch ODBC" /t REG_SZ /d Installed /f /reg:!BARCH!
Expand All @@ -532,7 +533,7 @@ REM REGADD function: add driver into the registry

REM REGDEL function: remove driver from the registry
:REGDEL
echo Removing ESODBC driver from the registry.
echo %~nx0: removing ESODBC driver from the registry.

reg delete "HKLM\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers" ^
/v "Elasticsearch ODBC" /f /reg:!BARCH!
Expand Down
Loading