From 6ccbe99060639f0ace2faff00543f73923691128 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Wed, 16 Aug 2017 16:09:11 -0700 Subject: [PATCH] modified README for build scripts --- buildscripts/README.md | 10 ++++------ buildscripts/builddrivers.py | 14 +++++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/buildscripts/README.md b/buildscripts/README.md index da71851d..584c3c3c 100644 --- a/buildscripts/README.md +++ b/buildscripts/README.md @@ -69,7 +69,7 @@ It's recommended that the PHP SDK is unzipped into the shortest possible path, p * `py builddrivers.py -v=7.1.7 -a=x86 -t=ts -d=all -g=no` * `py builddrivers.py --PHPVER=7.0.22 --ARCH=x64 --THREAD=nts --DRIVER=sqlsrv --GITHUB=yes` -5. If the script detects the presence of a PHP source directory, you will be prompted whether to rebuild, clean or superclean. Choose +5. Based on the given configuration, if the script detects the presence of the PHP source directory, you can choose whether to rebuild, clean or superclean: * `rebuild` if you have always used the same configuration (32 bit, thread safe, etc.) * `clean` to remove previous builds (binaries) * `superclean` to remove the entire `php--src` directory, which is often unnecessary @@ -84,13 +84,11 @@ When something goes wrong during the build, the log file will be launched (you c In addition to the log files in `C:\php-sdk`, you can examine the contents of `C:\php-sdk\phpsdk-build-task.bat`, which is overwritten every time you run the build scripts. -#### Building the extensions unattended +#### Variation -You can invoke `py builddrivers.py` with the desired options plus the destination path `--DESTPATH=`. +If you want the PHP drivers to be copied to somewhere else, you can invoke `py builddrivers.py` by providing the option `--DESTPATH=`. -In such case, the `php-sdk` folder will be created in the same directory of these build scripts. Note that the PHP drivers will also be copied to the designated path. - -The script `builddrivers.py` provides an example for this case. Again, it's your choice whether to remove the `php-sdk` folder afterwards. +In this case, you will find a copy of the drivers (unless the build fails) and the `php-sdk` folder created in the same directory of these Python scripts. It's your choice whether to remove the `php-sdk` folder and/or the drivers' binaries afterwards. diff --git a/buildscripts/builddrivers.py b/buildscripts/builddrivers.py index 4005cbbf..d02c478b 100644 --- a/buildscripts/builddrivers.py +++ b/buildscripts/builddrivers.py @@ -197,7 +197,7 @@ class BuildDriver(object): # Only ask when building locally if self.local: - choice = input("Rebuild the same configuration(yes) or quit (no) [yes/no]: ") + choice = input("Rebuild using the same configuration(yes) or quit (no) [yes/no]: ") if choice.lower() == 'yes' or choice.lower() == 'y' or choice.lower() == '': print('Rebuilding drivers...') @@ -230,12 +230,12 @@ if __name__ == '__main__': parser.add_argument('-v', '--PHPVER', help="PHP version, e.g. 7.1.*, 7.2.* etc.") parser.add_argument('-a', '--ARCH', choices=['x64', 'x86']) parser.add_argument('-t', '--THREAD', choices=['nts', 'ts']) - parser.add_argument('-d', '--DRIVER', choices=['all', 'sqlsrv', 'pdo_sqlsrv']) - parser.add_argument('-m', '--DEBUG', default='no', choices=['yes', 'no'], help="enable debug mode") - parser.add_argument('-r', '--REPO', default='Microsoft', help="GitHub repository") - parser.add_argument('-b', '--BRANCH', default='dev', help="GitHub repository branch") - parser.add_argument('-g', '--GITHUB', default='yes', help="get source from GitHub or not") - parser.add_argument('-p', '--DESTPATH', default=None, help="the remote destination for the drivers (do not use this for local builds)") + parser.add_argument('-d', '--DRIVER', default='all', choices=['all', 'sqlsrv', 'pdo_sqlsrv'], help="driver to build (default: all)") + parser.add_argument('-m', '--DEBUG', default='no', choices=['yes', 'no'], help="enable debug mode (default: no)") + parser.add_argument('-r', '--REPO', default='Microsoft', help="GitHub repository (default: Microsoft)") + parser.add_argument('-b', '--BRANCH', default='dev', help="GitHub repository branch (default: dev)") + parser.add_argument('-g', '--GITHUB', default='yes', choices=['yes', 'no'], help="get source from GitHub (default: yes)") + parser.add_argument('-p', '--DESTPATH', default=None, help="the remote destination for the drivers (default: None)") args = parser.parse_args()