gdeps package¶
Subpackages¶
- gdeps.test package
- Submodules
- gdeps.test.codeblocks-python module
- gdeps.test.folder module
- gdeps.test.settings module
- gdeps.test.test_7Zip module
- gdeps.test.test_bakefile module
- gdeps.test.test_boost module
- gdeps.test.test_cmake module
- gdeps.test.test_codeblocks module
- gdeps.test.test_compiler module
- gdeps.test.test_config module
- gdeps.test.test_make module
- gdeps.test.test_mingw module
- gdeps.test.test_project module
- gdeps.test.test_reporting module
- gdeps.test.test_repository module
- gdeps.test.test_system module
- gdeps.test.test_target module
- gdeps.test.test_visualstudio module
- gdeps.test.test_zip module
- gdeps.test.test_zlib module
- gdeps.test.zip module
- Module contents
Submodules¶
gdeps.archive module¶
-
class
gdeps.archive.
Archive
(inConfigFile, inFolderPath, inLogFileDirectory, inArchiveUrl, inSectionName, inExePath)[source]¶ Bases:
gdeps.config.Config
,gdeps.reporting.Reporting
-
callWithLogFile
(inCommand, inLogFileName, inReport, inReportParser, inAppend=False)[source]¶ Useful to call a command line, add and fill the reporting. :param inLogFileName: the log filename without wildcard. :type inLogFileName: str :param inAppend: if True append standard output at the end of file,
if False overwrite the file
-
download
()[source]¶ Download the archive on the current directory :return: The reporting. :rtype: GDeps.MacroReporting
Note
https://docs.python.org/3.5/library/urllib.request.html#module-urllib.request https://docs.python.org/3.0/library/urllib.request.html
Todo
Write a report
-
extract
()[source]¶ Override this method to extract the archive in inFolderPath
Returns: The reporting. Return type: GDeps.MacroReporting Note
Create the folder to extract the archive.
-
m_ArchiveUrl
= None¶ Archive url
-
m_FolderPath
= None¶ create this sub folder name and extract inside it.
-
m_LogFileDirectory
= None¶ store the log file directory
-
gdeps.bakefile module¶
-
class
gdeps.bakefile.
Bakefile029
(inConfigFile, inSectionName, inFolderDir, inSolutionName, inArgs, inTargetsArgs, inCompilers=[], inIdes=[], inExePath='', inTypeName='')[source]¶ Bases:
gdeps.make.Make
-
buildDigitalMars
(inMakePath, inSolutionPath, inBuildType, inCompiler, inTarget, inLogFilePath)[source]¶
-
buildVisualCPP
(inMakePath, inSolutionPath, inBuildType, inCompiler, inTarget, inLogFilePath)[source]¶
-
cleanArgs
(inArgs)[source]¶ The args has to begin with a space
Todo
has to be remove and use getParams
-
getOutputFolders
()[source]¶ If OUTPUT_FOLDERS is define. This function return a list of folders where the generated files are located. :return: a list of pair : first = parent folder, second = folder name :rtype: array of [str, str]
-
getParams
(inTargetArgs, inCompiler, inSeparator=' ', inEqualSign='=')[source]¶ Returns: the arguments to call the maker Return type: str - Example with wxWidgets:
>>> 'SHARED=1 MONOLITHIC=1 UNICODE=1'
-
-
class
gdeps.bakefile.
Bakefile125
(inConfigFile, inSectionName, inFolderDir, inSolutionName, inArgs, inTargetsArgs, inCompilers=[], inIdes=[], inExePath='', inTypeName='')[source]¶ Bases:
gdeps.make.Make
gdeps.boost module¶
-
class
gdeps.boost.
boost
(inConfigFile, inSectionName, inFolderDir, inSolutionName, inArgs, inTargetsArgs, inCompilers, inIdes, inExeName='b2.exe', inExePath='*.DEFAULT.*', inTypeName='boost2')[source]¶ Bases:
gdeps.make.Make
To build the boost library is not necessary to use an external boost.build. But if you want you can use your boost.build to build boost.
- To install boost.build :
Todo
Watch for boostJam
- Repository :
clone git@github.com:boostorg/build.git // If you haven’t a Github account or you don’t want add an ssh key use the subversion link on https://github.com/boostorg/build or download the zip file :
-
callexe
(inCompiler, inTargetArgs, inLogFilePath, inVariant='release', inLink='shared', inAdressModel='64', inToolSet='gcc', inEnv={}, inThreading='multi')[source]¶
-
callexes
(inCompiler, inAdressModel='64', inToolSet='gcc', inEnv={})[source]¶ Returns: A dictionary { reportId : log file path } to make the compiler reporting
-
getboostCompilerIds
(inCompiler)[source]¶ Returns: the adress model, compiler id for bootstrap, compiler id for b2/bjam
-
m_ExeName
= None¶ The maker executable name is function of the boost version.
-
make
()[source]¶ - See:
- http://www.boost.org/doc/libs/1_59_0/more/getting_started/unix-variants.html#identify-your-toolset http://www.boost.org/build/doc/html/bbv2/jam.html http://www.boost.org/build/doc/html/bbv2/reference/tools.html
- Clang:
- http://blog.llvm.org/2010/05/clang-builds-boost.html https://stackoverflow.com/questions/8486077/how-to-compile-link-boost-with-clang-libc
- Digital Mars
- http://www.boost.org/doc/libs/1_33_1/tools/build/v1/dmc-stlport-tools.jam
-
read
(inSection)[source]¶ - If you haven’t «boost.build» to build boost :
- You haven’t to define a config section with the value >>> exepath=r”.\”
- if you have boost.build :
define the boostrap.bat path
- Example
>>> [boost2_build_dir] >>> exepath=r"X:\\boost-build\\"
-
class
gdeps.boost.
boost2
(inConfigFile, inSectionName, inFolderDir, inSolutionName, inArgs, inTargetsArgs, inCompilers, inIdes=[], inExePath='*.DEFAULT.*')[source]¶ Bases:
gdeps.boost.boost
See: http://www.boost.org/doc/libs/master/doc/html/bbv2.html
-
class
gdeps.boost.
boostJam
(inConfigFile, inSectionName, inFolderDir, inSolutionName, inArgs, inTargetsArgs, inCompilers, inIdes=[], inExePath='*.DEFAULT.*')[source]¶ Bases:
gdeps.boost.boost
See: http://www.boost.org/doc/libs/1_46_1/more/getting_started/windows.html
-
class
gdeps.boost.
boostSelector
(inConfigFile, inSectionName, inFolderDir, inSolutionName, inArgs, inTargetsArgs, inCompilers, inIdes=[], inExePath='*.DEFAULT.*')[source]¶ Bases:
object
-
class
gdeps.boost.
boostTarget
[source]¶ Bases:
gdeps.reporting.Reporting
-
static
getReportId
(inVariant='release', inLink='shared', inAdressModel='64', inToolSet='gcc', inThreading='multi')[source]¶
-
m_ErrorRegexp
= None¶ See: http://www.boost.org/build/doc/html/jam/miscellaneous.html
-
static
-
class
gdeps.boost.
boostrapReport
[source]¶ Bases:
gdeps.reporting.Reporting
-
m_ErrorRegexp
= None¶ See: http://www.boost.org/build/doc/html/jam/miscellaneous.html
-
gdeps.clang module¶
-
class
gdeps.clang.
Clang
(inConfigFile, inSectionName, inDir, inAdressModel, inTypeName)[source]¶ Bases:
gdeps.compiler.Compiler
@link http://llvm.org/docs/GettingStarted.html#getting-a-modern-host-c-toolchain @link http://clang.llvm.org/docs/UsersManual.html#id7
-
class
gdeps.clang.
Clang_32
(inConfigFile, inSectionName='clang_32', inDir='C:\\Program Files (x86)\\LLVM\\bin')[source]¶ Bases:
gdeps.clang.Clang
Default path : C:Program Files (x86)LLVMbin
-
class
gdeps.clang.
Clang_64
(inConfigFile, inSectionName='clang_64', inDir='C:\\Program Files\\LLVM\\bin')[source]¶ Bases:
gdeps.clang.Clang
Default path : C:Program FilesLLVMbin
gdeps.cmake module¶
-
class
gdeps.cmake.
CMake
(inConfigFile, inSectionName, inFolderDir, inSolutionName, inArgs, inTargetsArgs, inCompilers, inIdes, inExePath='', inListeners=[])[source]¶ Bases:
gdeps.make.Make
CMake command line implementation See:
-
static
CMake.
generate_cmake_list
(inFolderDir, inProjectName, inFilesList=[], inExcludeFiles=[], inFindFiles=True, inRecursive=True, inExcludeDirectories=[], inIncludeDirectoriesList=[], inExcludeIncludeDirectories=[], inAdditionalDirectories=[], inIsLib=True, inWildcards=['cpp', 'h', 'cxx', 'tpp', 'c', 'hxx', 'hpp'], inDefinitions=[], inParams=[])[source]¶ Helper to generate a very simple CMakelist.txt.
Parameters: - inFolderDir (str) – The CmakeList will be create here and the sources and includes files will be search inside this folder.
- inProjectName (str) – The name of the project without space separators
- inFilesList (array of (str,str)) – You can specify a list of files. (The path is relative to the folder dir, The file name with the extension)
- inExcludeFiles (array of (str,str)) – You can specify a list of ignored files. (The path is relative to the folder dir, The file name with the extension)
- inFindFiles (bool) – If true gdeps will search every files matching to the extension. (inWildcards)
- inRecursive (bool) – If True gdeps will search inside to the sub folders
- inExcludeDirectories (array of str) – List of directories will be exclude from the files searching and from the include directories description.
- inIncludeDirectoriesList (array of str) – If it’s not empty the include directories description will be define by this array of directories.
- inExcludeIncludeDirectories (array of str) – inExcludeIncludeDirectories will be use to exclude some directories from include directories description.
- inAdditionalDirectories (array of str) – Specify the additional directories here. >>> [‘./../’]
- inIsLib (bool) – If True cmake will create a project to generate a lib if not an executable.
- inWildcards (array of str) – Specify the extension files like cxx, hpp, htt etc.
- inDefinitions (array of str) – Define the compilation definitions. Example: >>> [‘DOUBLE_PRECISION’, ‘BUILD_DLL’, ‘USE_OPTION1’]
- inParams (array of generate_cmake_param) – Additional dependencies to build the project
Todo
target_link_libraries
Note
to use the CMakelists.txt you have GDeps_DEF_32 and GDeps_DEF_64 to define your definitions.
>>> release = gdeps.TargetArgs(gdeps.Target.release_static, inArgs={}, inx86Args={'-DGDeps_DEF_32': '-D_M_IX86'}, inx64Args={'-DGDeps_DEF_64': '-D_M_X64'}, inCompilersArgs={}, inIdeArgs={})
By default the type is STATIC. The type can be STATIC or SHARED based on whether the current value of the variable BUILD_SHARED_LIBS is true. See https://cmake.org/cmake/help/cmake2.6docs.html#command:add_library
-
static
CMake.
getBuildType
(inTargetType)[source]¶ Returns: the CMake associate target ID. Is not necessary the same IDE buildType.
-
CMake.
getLogFilePath
(inTargetType, inCompiler, inIde)[source]¶ Returns: the log file path function of the build type and the model address
-
static
CMake.
getMakeID
(inIde, inCompiler)[source]¶ Return the CMake Generator ID
- See:
- https://cmake.org/cmake/help/v3.4/manual/cmake-generators.7.html#manual:cmake-generators%287%29
Todo
check the CMake version and add or not the suffix for the Visual Studio
For compatibility with CMake versions prior to 3.0, one may specify this generator using the name “Visual Studio 12” without the year component.
-
static
CMake.
get_build_path
(inFolderDir, inIde, inCompiler, inTarget)[source]¶ Returns: The path generate by gdeps.cmake for this configuration. Example: ‘C:gdepsProjectsogredepsogredepsCodeBlocksMingw_32- elease_dynamic’
rtype: str
-
CMake.
setupCompilerPATHS
(inCompiler)[source]¶ See: https://cmake.org/Wiki/CMake_FAQ#Method_2:_use_cmake_-D
-
static
-
class
gdeps.cmake.
CMakeListener
[source]¶ Bases:
object
Override this class to define some actions inside CMake process
-
class
gdeps.cmake.
CMakerapReport
[source]¶ Bases:
gdeps.reporting.Reporting
gdeps.codeblocks module¶
-
class
gdeps.codeblocks.
CodeBlocks
(inConfigFile, inSectionName, inCompilers, inCompilersAlias=[])[source]¶ Bases:
gdeps.ide.Ide
Code::Blocks is a free C, C++ and Fortran IDE built to meet the most demanding needs of its users. It is designed to be very extensible and fully configurable.
Config KEY username : default value “”
Trouble shooting :
- If you have :
- cl Command line warning D9024 : unrecognized source file type
- the error come from CB :
Sometime CB generate a good command line with a good include directory : [...] /IX:GDeps runkGDepsgdeps est est_codeblocks-solutiondir0 [...]
sometime no : cl.exe /nologo X:GDeps runkGDepsgdeps est est_codeblocks-solutiondir0
The reason you project options, you have to define your include in the directory section and not in the option section.
Good : Test_Project-0error0warning.cbp
- <Compiler>
- <Add directory=”$(#test_CB_dir)” />
</Compiler>
Bad: Test_Project-1error.cbp
- <Compiler>
- <Add option=”$(#test_CB_dir)” />
</Compile
-
beginGCV
(inParams)[source]¶ @link https://www.microsoft.com/security/portal/mmpc/shared/variables.aspx
-
build
(inProjectPath, inProjectName, inCompiler, inTargetName='all', inLogFilePath='Output_Buid_CodeBlocks.log', inWildCard='cbp', inRebuildAll=True, inIdeParams={}, inCompilerArgs={})[source]¶ Build the project or the solution file from the current dir.
- Keywords arguments :
param inProjectPath: the project path
param inProjectName: the project or the solution name
param inCompiler: allow the ide to know witch compiler it has to call, like to define the address model
param inTargetName: with codeblocks always “all”
param inLogFilePath: define the output file log
param inWildCard: project wildcard == cbp solution wildcard = workspace
param inRebuildAll: by default we rebuild all. This is a chronophage but cleaner. default( True )
param inIdeParams: To define GCV (Global compiler variable) use this syntax :
inPrams[#MY_GCV] = “C:PATHMYGCV”
param inCompilerArgs: Send the associate compilers arguments.
type inCompilerArgs: dict { str : array of str } >>> {[‘CXXFLAGS’] : [‘-g -std=c++11 -Wall -pedantic’]} or it can be like that >>> {[‘CXXFLAGS’] : [‘-g’, ‘-std=c++11’, ‘-Wall’, ‘-pedantic’]}
Actually the the key doesn’t matter. All it’s a compiler option.
todo: USe the compiler option flags ‘CFLAGS’ and ‘CXXFLAGS’
-
static
getTemporaryCBConfigDir
()[source]¶ return a directory ( the current dir for the build ) to: - copy the self.m_CBConfigDir - modify this one - build with this Config file
-
ms_ConfFileName
= '\\\\default.conf'¶ Default CodeBlocks config filename.
-
ms_KeyAppdataCBDir
= 'appdatacbdir'¶ - The key config file is “appdatacbdir”
- Example :
- appdatacbdir = C:\Users\Gandi\AppData\Roaming\codeblocks
- @remarks your are not oblige to define this key but if you use a daemon
- the default user will be the system and not the current session user. The result of this is Codeblocks cannot find the default.conf. In this case you have to define the default.conf directory.
- @remarks For each build we use a copy of this one in a temporary
- directory
gdeps.compiler module¶
-
class
gdeps.compiler.
Compiler
(inConfigFile, inSectionName, inDir, inAdressModel, inTypeName)[source]¶ Bases:
gdeps.config.Config
,gdeps.reporting.Reporting
-
getToolChain
()[source]¶ Returns: The compiler tool chain { command line name : the full path of the application } Return type: dict { str : str } >>> return {'cl': os.path.normpath(self.m_Dir + r'\\' + 'cl.exe'), >>> 'link': os.path.normpath(self.m_Dir + r'\\' + 'link.exe')}
-
m_Dir
= None¶ inDir examples : >>> “C:\TDM-GCC-32\bin”, >>> “C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin”
-
gdeps.config module¶
-
class
gdeps.config.
Alias
(inConfigFile, inSectionName)[source]¶ Bases:
gdeps.config.Config
-
class
gdeps.config.
Config
(inConfigFile, inSectionName='')[source]¶ Bases:
object
Some class need to load some data. To do that they have to be a child of this one.
-
class
gdeps.config.
ConfigFile
(inFilePath='')[source]¶ Bases:
configparser.ConfigParser
Each object with a Config has to be link with a ConfigFile. @link https://docs.python.org/3.4/library/configparser.html
-
getIncludes
(inSectionName)[source]¶ return a dictionary with all the pair{ key : items } into a section with the prefix GDeps.Keys.ms_IncludePrefix
-
getSection
(inSectionName)[source]¶ carefully with the full cycle inclusion. There are no security for that.
-
m_Includes
= None¶ { key : ConfigFile } The includes have to be write in the config file with a relative filepath from the directory of self.m_FilePath. They will be store in m_Includes with a global path
-
m_SetionDirectories
= None¶ if a section has a location into a another include, you have to add this one in this dictionary { section name : include key } include key € m_Includes
-
gdeps.cvs module¶
-
class
gdeps.cvs.
Cvs
(inConfigFile, inFolderPath, inLogFileDirectory, inReposUrl, inCloneArgs='', inUpdateArgs='', inSectionName='cvs', inExePath='C:\cvs\cvs.exe')[source]¶ Bases:
gdeps.repository.Versioning
-
clean
()[source]¶ - Usage: cvs unedit [-lR] [<file>]...
-l Local directory only, not recursive. -R Process directories recursively (default). (Specify the –help global option for a list of other help options.)
https://stackoverflow.com/questions/1812618/cvs-cleaning-up-the-cvs-repository
-
clone
()[source]¶ - cvs checkout [-ANPRcflnps] [-r rev] [-D date] [-d dir] [-j rev1] [-j rev2] [-k kopt] modules...
-A Reset any sticky tags/date/kopts. -N Don’t shorten module paths if -d specified. -P Prune empty directories. -R Process directories recursively. -c “cat” the module database. -f Force a head revision match if tag/date not found. -l Local directory only, not recursive -n Do not run module program (if any). -p Check out files to standard output (avoids stickiness). -s Like -c, but include module status. -r rev Check out revision or tag. (implies -P) (is sticky) -D date Check out revisions as of date. (implies -P) (is sticky) -d dir Check out into dir instead of module name. -k kopt Use RCS kopt -k option on checkout. (is sticky) -j rev Merge in changes made between current revision and rev.
-
update
()[source]¶ - Usage: cvs update [-APCdflRp] [-k kopt] [-r rev] [-D date] [-j rev] [-I ign] [-W spec] [files...]
-A Reset any sticky tags/date/kopts. -P Prune empty directories. -C Overwrite locally modified files with clean repository copies. -d Build directories, like checkout does. -f Force a head revision match if tag/date not found. -l Local directory only, no recursion. -R Process directories recursively. -p Send updates to standard output (avoids stickiness). -k kopt Use RCS kopt -k option on checkout. (is sticky) -r rev Update using specified revision/tag (is sticky). -D date Set date to update from (is sticky). -j rev Merge in changes made between current revision and rev. -I ign More files to ignore (! to reset). -W spec Wrappers specification line.
-
gdeps.dm module¶
-
class
gdeps.dm.
DigitalMars
(inConfigFile, inSectionName, inDir, inAdressModel, inTypeName)[source]¶ Bases:
gdeps.compiler.Compiler
-
class
gdeps.dm.
Dm_32
(inConfigFile, inSectionName='dm_32', inDir='C:\\dm\\bin')[source]¶ Bases:
gdeps.dm.DigitalMars
Implementation of Digitalmars 32 bits.
Note
By default we use `the STL port<https://www.daniweb.com/programming/software-development/threads/340777/digital-mars-unable-to-open-input-file-iostream>`_
gdeps.git module¶
-
class
gdeps.git.
Git
(inConfigFile, inFolderPath, inLogFileDirectory, inReposUrl, inCloneArgs='', inUpdateArgs='', inSectionName='git', inExePath='C:\Program Files (x86)\Git\bin\git.exe')[source]¶ Bases:
gdeps.repository.Versioning
-
clone
()[source]¶ - How to clone a branch:
- gdeps.Keys.ms_RepoCloneArgs: “–branch boost-1.64.0”
- The logs files will be:
- self.m_LogFileDirectory + “git-clone.log”
- and also if there are Clone Args :
self.m_LogFileDirectory + “git-checkout.log”
usage: git clone [<options>] [–] <repo> [<dir>]
-v, --verbose be more verbose -q, --quiet be more quiet --progress force progress reporting -n, --no-checkout don’t create a checkout --bare create a bare repository --mirror create a mirror repository (implies bare) -l, --local to clone from a local repository --no-hardlinks don’t use local hardlinks, always copy -s, --shared setup as shared repository --recursive initialize submodules in the clone --recurse-submodules initialize submodules in the clone --template <template-directory> directory from which templates will be used --reference <repo> reference repository --dissociate use –reference only while cloning -o, --origin <name> use <name> instead of ‘origin’ to track upstream -b, --branch <branch> checkout <branch> instead of the remote’s HEAD -u, --upload-pack <path> path to git-upload-pack on the remote --depth <depth> create a shallow clone of that depth --single-branch clone only one branch, HEAD or –branch --separate-git-dir <gitdir> separate git dir from working tree -c, --config <key=value> set config inside the new repository
-
m_CMDSetSSL
= None¶ SSL certificate problem: self signed certificate in certificate chain @link https://stackoverflow.com/questions/11621768/how-can-i-make-git-accept-a-self-signed-certificate
-
gdeps.hg module¶
-
class
gdeps.hg.
Mercurial
(inConfigFile, inFolderPath, inLogFileDirectory, inReposUrl, inCloneArgs='', inUpdateArgs='', inSectionName='hg', inExePath='C:\\Program Files\\Mercurial\\hg.exe')[source]¶ Bases:
gdeps.repository.Versioning
gdeps.ide module¶
-
class
gdeps.ide.
Ide
(inConfigFile, inSectionName, inTypeName, inCompilers=[], inCompilersAlias=[])[source]¶ Bases:
gdeps.config.Config
,gdeps.reporting.Reporting
Define the IDE base class
-
build
(inProjectPath, inProjectName, inCompiler, inTargetName, inLogFilePath, inWildCard, inRebuildAll=True, inIdeParams={}, inCompilerArgs={})[source]¶ Build the project or the solution file from the current directory.
- Keywords arguments :
param inProjectPath: The project path type inProjectPath: str param inProjectName: The project or the solution name type inProjectName: str param inCompiler: allow the ide to know witch compiler it has to call, like to define the address model type inCompiler: Gdeps.Compiler param inTargetName: depend of your maker generally it can be all, release or debug. type inTargetName: str param inLogFilePath: define the output file log type inLogFilePath: str param inWildCard: the projection or solution extension type inWildCard: str param inRebuildAll: by default we rebuild all. This is a chronophage but cleaner. default( True ) type inRebuildAll: bool param inIdeParams: For each IDE you can add some parameters here type inIdeParams: dict param inCompilerArgs: Send the associate compilers arguments. type inCompilerArgs: dict { str : array of str }
-
getBuildName
(inCompiler, inTargetType)[source]¶ return a name to identify within the current ide builds.
-
-
class
gdeps.ide.
IdeBuilder
(inIde, inSolutionName, inWildCard, inTargets, inFolderDir, inArgs, inLogFileOutPutDir='', inOverrideBuildType='')[source]¶ Bases:
object
without a maker build a Project or a Workspace/Solution with a IDE
gdeps.keys module¶
-
class
gdeps.keys.
Keys
[source]¶ Bases:
object
Contain all the keys can be use in your project. You can copy the string for more clarity or to detect the futures changes use GDeps.Keys.ms_XXX
Example
>>> params["maker_subir"] = "subdir1/subdir/"
- or
>>> params[GDeps.Keys.ms_SubDir] = "subdir1/subdir/"
-
ms_ArchiveFolder
= 'archive_folderdir'¶ To override the default GDeps.Keys.ms_FolderDir extract path.
- Example
>>> scriptdir = os.path.dirname(os.path.abspath(__file__)) >>> >>> params["folderdir"] = scriptdir + "\codeblocks" >>> params["archiver_alias"] = "7zip" >>> params["archive_url"] = "http://gdeps.org/archives/zip-2.3-3-bin.zip" >>> params["archive_folderdir"] = aParams["folderdir"] + "\src"
-
ms_ArchiveUrl
= 'archive_url'¶ This is the archive url
Example
>>> params["archiver_alias"] = "7zip" >>> params["archive_url"] = "http://gdeps.org/archives/zip-2.3-3-bin.zip"
-
ms_ArchiverAlias
= 'archiver_alias'¶ Alias to use a file achiver to download and extract an archive.
- The possible alias type are:
- SevenZip
- Example
- Project file:
>>> params["archiver_alias"] = "7zip"
- Config file:
The 7zip Alias
>>> [7zip] >>> type=SevenZip >>> name=7zip_dir
The 7zip directory:
>>> [7zip_dir] >>> exepath=C:\Program Files\7-Zip\7z.exe
-
ms_BakeFile029OutputFolders
= 'OUTPUT_FOLDERS'¶ See the argument inArgs of constructor GDeps.Bakefile029 Example
‘OUTPUT_FOLDERS’ : aFolderDir + r’buildmsw;’ + aFolderDir + r’lib;’
-
ms_BakeFile029UseSameOutputFolder
= 'USE_SAME_OUTPUT_FOLDER'¶ See the argument inArgs of constructor GDeps.Bakefile029 Example
‘USE_SAME_OUTPUT_FOLDER’ : True
-
ms_CompilerAliasPrefix
= 'compiler'¶ In your config file define a compiler with the prefix : «compiler» and add the alias key word to link with the compiler config
Example
>>> [compiler_0] >>> type=Mingw_32 >>> name=mingw_32 >>> >>> [compiler_windows] >>> type=VC120_32 >>> name=vc120_32 >>> >>> [compilerOldVC] >>> type=VC90_32 >>> name=vc90_32 >>> >>> [mingw_32] >>> dir = C:\TDM-GCC-32\bin >>> >>> [vc90_32] >>> dir = C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE >>> >>> [vc120_32] >>> dir = C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin
-
ms_ConfigFilePath
= 'config_filepath'¶ The config dir + filename
-
ms_ExePath
= 'exepath'¶ Some object config need to have an executable directory
Be care full (or not some time no!!!) don’t write manually the paths with double backslash \ but only one backslash the python parser add the double backslash \
-
ms_FolderDir
= 'folderdir'¶ It can be name : working directory. The folder where the repository will be clone/checkout. It’s also the project default maker/ide... directory
-
ms_IdeAddInclude
= 'ide_add_include'¶ >>> params["ide_add_include"] = [r'X:\libA\include', r'X:\libB\include']
-
ms_IdeAlias
= 'ide_alias'¶ Use a specific ide to build a workspace/solution/project. To do that you can create manually a prefab to retrieve the ide section name.
- Example
See test_codeblocks.py
>>> aConfigFile = GDeps.ConfigFile( settings.g_CurrendFolder + "\\test_codeblocks.cfg" ) >>> aIdeAlias = GDeps.Alias( aConfigFile, 'codeblocks' ) >>> >>> aCompilers = {} >>> >>> aCodeBlocksIDE = getattr( GDeps, aIdeAlias.m_Type )( aConfigFile, aIdeAlias.m_Name, aCompilers ) >>> >>> gcvs = {} >>> gcvs['#wx'] = self.m_wx28 >>> gcvs['#cb_release_type'] = '-O2' >>> gcvs['#cb'] = aCodeBlocksIDE.m_Dir >>> gcvs['#boost'] = self.m_boost >>> >>> params = {} >>> >>> params["config_filepath"] = settings.g_CurrendFolder + "\\test_codeblocks.cfg" >>> >>> params["folderdir"] = settings.g_CurrendFolder + "\\codeblocks\\src" >>> >>> params["repo_alias"] = "svn" >>> params["repo_url"] = "svn://svn.code.sf.net/p/codeblocks/code/trunk" >>> params["ide_alias"] = aIdeAlias.m_SectionName >>> params["ide_solutionname"] = "CodeBlocks" >>> params["ide_args"] = gcvs >>> params["ide_wildcard"] = "workspace" >>> >>> project = GDeps.Projects(params) >>> project.go()
-
ms_IdeAliasList
= 'ide_alias_list'¶ Use a specific list of ide to build a workspace/solution/project. To do that you can create manually a prefab to retrieve the ides section name.
- Example
See test_codeblocks.py
>>> aConfigFile = GDeps.ConfigFile(settings.g_CurrendFolder + "\\test_codeblocks.cfg") >>> >>> params = {} >>> >>> params["config_filepath"] = settings.g_CurrendFolder + "\\test_codeblocks.cfg" >>> >>> params["folderdir"] = settings.g_CurrendFolder + "\\codeblocks\\src" >>> >>> params["repo_alias"] = "svn" >>> params["repo_url"] = "svn://svn.code.sf.net/p/codeblocks/code/trunk" >>> ide_list = [] >>> >>> cb_section = 'codeblocks' >>> if configFile.getSection(cb_section): >>> aIdeAlias = GDeps.Alias(aConfigFile, cb_section) >>> >>> aCompilers = {} >>> >>> aCodeBlocksIDE = getattr(GDeps, aIdeAlias.m_Type)(aConfigFile, aIdeAlias.m_Name, aCompilers) >>> >>> gcvs = {} >>> gcvs['#wx'] = self.m_wx28 >>> gcvs['#cb_release_type'] = '-O2' >>> gcvs['#cb'] = aCodeBlocksIDE.m_Dir >>> gcvs['#boost'] = self.m_boost >>> >>> ide_1 = {} >>> ide_1["ide_alias"] = aIdeAlias.m_SectionName >>> ide_1["ide_solutionname"] = "Test" >>> ide_1["ide_args"] = gcvs >>> ide_1["ide_wildcard"] = "workspace" >>> >>> ide_list.append(ide_1) >>> >>> ide_2 = {} >>> ide_2["ide_alias"] = 'visual2010' >>> ide_2["ide_solutionname"] = "Test" >>> ide_2["ide_wildcard"] = "sln" >>> ide_list.append(ide_2) >>> >>> params['ide_alias_list'] = ide_list >>> >>> project = GDeps.Projects(params) >>> project.go()
-
ms_IdeAliasPrefix
= 'ide'¶ In your config file define an ide with the prefix “ide” and add the alias key word to link with the ide config By default the prefix is ide.
- Example
>>> [ide_0] >>> type=CodeBlocks >>> name=cb_32 >>> compiler_alias_0=compiler_0 >>> # see also ms_CompilerAliasPrefix example >>> >>> [ide_1] >>> type=Visual2008 >>> name=vc2008_32 >>> compiler_alias_0=compilerOldVC >>> # see also ms_CompilerAliasPrefix example >>> >>> [ide_2] >>> type=Visual2013 >>> name=vc2013_32 >>> compiler_alias_0=compiler_windows >>> # see also ms_CompilerAliasPrefix example >>> >>> [cb_32] >>> dir = C:\CodeBlocks >>> >>> [vc2008_32] >>> dir = C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE >>> >>> [vc2013_32] >>> dir = C:\Program Files (x86)\MSBuild\12.0\Bin
-
ms_IdeArgs
= 'ide_args'¶ To pass a dictionary arguments.
Example
>>> gcvs = {} >>> gcvs['#wx'] = self.m_wx28 >>> gcvs['#cb_release_type'] = '-O2' >>> gcvs['#cb'] = aCodeBlocksIDE.m_Dir >>> gcvs['#boost'] = self.m_boost
[...]
>>> params["ide_args"] = gcvs
-
ms_IdeSolutionName
= 'ide_solutionname'¶ For the ide define the solution name without the wildcard.
Example:
test_codeblocks.py
>>> params["ide_solutionname"] = "cbil" >>> params["ide_args"] = aGCVs >>> params["ide_wildcard"] = "workspace"
-
ms_IdeSolutionSubDir
= 'ide_solutionsubdir'¶ Specify the solution directory inside the folder dir. Usually the associate value it’s a string.
The default value is empty.
A possible value is “src”. In this case the solution path is in folderdir + “\” + “src”
-
ms_IdeTargetName
= 'ide_targetname'¶ Sometime you have to override the usual target name
- Example
Usually the codeblocks solution have the target “all” write in minuscule. For the Codeblecks project we have to redine it with a majuscule.
>>> params["ide_targetname"] = "All"
-
ms_IdeWildcard
= 'ide_wildcard'¶ The wildcard for the ide project
- The possible values are:
- workspace (CB)
- cbp (CB)
- sln (VC90 & VC120)
- vcproj (VC90)
- vcxproj (VC120)
Example
test_codeblocks.py
>>> params["ide_wildcard"] = "workspace"
-
ms_IncludePrefix
= 'include'¶ To merge others config with your config file.
- @remarks be carefully with the full cycle inclusion. There are no
- security for that.
- Example
Config file:
>>> [tag] >>> include_directories="..\\directories.cfg"
-
ms_MakerAlias
= 'maker_alias'¶ To link with a maker define in the config file
- The possible alias type are:
- CMake
- Example
- Project file:
>>> params["maker_alias"] = "cmake"
- Config file:
The cmake Alias:
>>> [cmake] >>> type=CMake >>> name=cmake32
The CMake configuration:
>>> [cmake32] >>> exepath="C:\\Program Files (x86)\\CMake\\bin\\cmake.exe"
- Some maker doesn’t need an application to generate the solution.
- To define them you have to use gdeps.Keys.ms_MakerType and not gdeps.Keys.ms_MakerAlias
-
ms_MakerArgs
= 'maker_args'¶ Specify the arguments to the maker. Usually the associate value it’s a dictionary.
-
ms_MakerExePath
= 'maker_exepath'¶ Define the exepath to execute the maker
- Example
Project file:
>>> params["maker_exepath"] = "C:\\Program Files (x86)\\CMake\\bin\\cmake.exe"
- Config file:
The cmake Alias:
>>> [cmake] >>> type=CMake >>> name=cmake32
he CMake configuration:
>>> [cmake32] >>> exepath="C:\\Program Files (x86)\\CMakexXx\\bin\\cmake.exe"
- In this example the cmake exepath value will be :
- “C:\Program Files (x86)\CMake\bin\cmake.exe”
-
ms_MakerSolutionName
= 'maker_solutionname'¶ Define the solution name for the maker
Example
[...]
>>> params["maker_type"] = "Bakefile029" >>> params["maker_solutionname"] = "makefile"
[...]
-
ms_MakerSubDir
= 'maker_subdir'¶ Specify the makfile directory inside the folder dir. Usually the associate value it’s a string.
-
ms_MakerType
= 'maker_type'¶ Some maker doesn’t need an application to generate the solution. To define them you have to use this key.
- The possible values are:
- boost2
- boostJam
- Bakefile029
Example
>>> params["maker_type"] = "Bakefile029"
-
ms_RepoAlias
= 'repo_alias'¶ Alias to link with a version control system config.
- The possible alias type are:
- Git
- Mercurial
- Svn
- Example
- Project file:
>>> params["repo_alias"] = "hg"
- Config file:
The Mercurial Alias
>>> [hg] >>> type=Mercurial >>> name=hg_64
The Mercurial directory:
>>> [hg_64] >>> exepath="C:\\Program Files (x86)\\CMake\\bin\\cmake.exe"
-
ms_RepoCloneArgs
= 'repo_cloneargs'¶ For some repository use that to add some parameters.
Example
>>> gdeps.Keys.ms_RepoAlias: = "git", >>> gdeps.Keys.ms_RepoUrl: "https://github.com/wxWidgets/wxWidgets.git", >>> gdeps.Keys.ms_RepoCloneArgs: "--branch WX_3_0_BRANCH",
>>> gdeps.Keys.ms_RepoAlias: "git", >>> gdeps.Keys.ms_RepoUrl: "https://github.com/boostorg/boost.git", >>> gdeps.Keys.ms_RepoCloneArgs: "--branch boost-1.64.0",
-
ms_RepoDir
= 'repo_dir'¶ Only for the repository define into the repository list. Please see GDeps.Keys.ms_RepoList. Define the directory inside the folder dir.
-
ms_RepoList
= 'repo_list'¶ For some repository use that to add some parameters. You can mix «repo_alias» and «repo_list».
Example
the repository A will be clone to the project «folderdir» the repository B will be clone to the project «repo_dir» a sub dir of «folderdir» The cloning order will be :
2) repo_a 2) repo_b
>>> params = [] >>> params["folderdir"] = scriptdir + r"\dummy_example" >>> params[gdeps.Keys.ms_RepoAlias] = "git" >>> params[gdeps.Keys.ms_RepoUrl] = "http://git.code.sf.net/p/tinyxml/git" >>> params[gdeps.Keys.ms_RepoCloneArgs] = 'tinyxml-git' >>> >>> repo_a = {} >>> repo_a["repo_alias"] = "hg" >>> repo_a["repo_url"] = "ssh://hg@bitbucket.org/cabalistic/ogredeps" >>> repo_a["repo_updateargs"] = "tip" >>> >>> repo_b = {} >>> repo_b["repo_dir"] = r"\wxwidgets_2_8" >>> repo_b["repo_alias"] = "svn" >>> repo_b["repo_url"] = "http://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH/" >>> >>> params["repo_list"] = [repo_a, repo_b]
-
ms_RepoUpdateArgs
= 'repo_updateargs'¶ For some repository use that to add some parameters.
Example
>>> params["repo_alias"] = "hg" >>> params["repo_url"] = "ssh://hg@bitbucket.org/cabalistic/ogredeps" >>> params["repo_updateargs"] = "tip"
-
ms_RepoUrl
= 'repo_url'¶ This is the repository url/path
Example
>>> params["repo_alias"] = "hg" >>> params["repo_url"] = "https://bitbucket.org/cabalistic/ogredeps"
-
ms_Targets
= 'targets'¶ List of all the build targets. By default is GDeps.Target.release_dynamic without any args.
- The target args values :
- inTargetType :
- inArgs : dictionary
- inx86Args : dictionary
- inx64Args : dictionary
- inCompilersArgs : dictionary
Example
>>> targets = [] >>> targets.append( GDeps.TargetArgs( GDeps.Target.release_dynamic, {}, { "-DOGREDEPS_PLATFORM_X64" : "FALSE" }, { "-DOGREDEPS_PLATFORM_X64" : "TRUE" }, {} ) ) >>> >>> params["targets"] = aTargets
-
ms_boostUserConfigPath
= 'boost_user_config_path'¶ Define another path to find the user-config.jam
gdeps.make module¶
-
class
gdeps.make.
Make
(inConfigFile, inSectionName, inFolderDir, inSolutionName, inArgs, inTargetsArgs, inCompilers=[], inIdes=[], inExePath='', inTypeName='')[source]¶ Bases:
gdeps.reporting.Reporting
,gdeps.config.Config
Define the base class to define a Maker
-
m_Args
= None¶ Array of string for the maker
-
m_Compilers
= None¶ Array of GDeps.Compiler
-
m_ExePath
= None¶ The maker executable path. Can be the working directory for makers include into the sources.
-
m_FolderDir
= None¶ The working directory for the maker
-
m_Ides
= None¶ Array of GDeps.Ide
-
m_SolutionName
= None¶ Define the solution to be build. @remarks Some makers are include into the sources like
boost don’t need it.
-
m_TargetsArgs
= None¶ array of GDeps.TargetArgs
-
m_TypeName
= None¶ The maker type name : Example
CMake32
-
-
gdeps.make.
getAllParamsString
(inArgs, inTargetArgs, inCompiler, inSeparator=' ', inEqualSign='=', inRemoveLastSeparator=False, inMultipleValueSeparator=' ', inMultipleValueBegin='', inMultipleValueEnd='')[source]¶ Parameters: - inArgs (dict) – A associate container key : value
- inTargetArgs (GDeps.TargetArgs) – A build target.
- inCompiler (GDeps.Compiler) – A compiler to find the associate arguments in the target. :members:`GDeps.TargetArgs.m_CompilersArgs`
- inSeparator (str) – the separator between each key-value
- inEqualSign (str) – the affectation character between the key and the value
- inRemoveLastSeparator (bool) – if true remove the last inSeparator
Returns: all the arguments in one string
Return type: Example
>>> inSeperator = ' ', >>> inEqualSign = '=', >>> inRemoveLastSeparator = False the output result will be : 'SHARED=1 MONOLITHIC=1 UNICODE=1'
Note
The compiler arguments has to be create with the good separators, because it’s one string and stay like that.
-
gdeps.make.
getParamsString
(inParams, inSeparator=' ', inEqualSign='=', inRemoveLastSeparator=False, inMultipleValueSeparator=' ', inMultipleValueBegin='', inMultipleValueEnd='')[source]¶ Parameters: - inParams (dict) – is a dictionary
- inSeparator (str) – the separator between each key-value
- inEqualSign (str) – the affectation character between the key and the value
- inRemoveLastSeparator (bool) – if true remove the last inSeparator
- inMultipleValueSeparator (str) – some parameter can have several values, use this parameter to define the separator.
- inMultipleValueBegin (str) –
some parameter can have several values, use this parameter to define the beginning. Example
inMultipleValueBegin = ‘”’ KEY = “value1 value2 ...
- :param inMultipleValueEnd some parameter can have several values, use this parameter to define the ending.
- Example
- inMultipleValueEnd = ‘”’ KEY = ... value_n-2 value_n-1”
Returns: concatenate string with all parameters separate by inSeparator Return type: str Example
>>> getParamsString( { 'SHARED' : '1', 'MONOLITHIC' : '1', 'UNICODE' : '1', "CXXFLAGS": ["-fno-keep-inline-dllexport", "-std=c++11"] }, ' | ', ' = ', False, inMultipleValueSeparator=' ', inMultipleValueBegin='', inMultipleValueEnd='') 'SHARED = 1 | MONOLITHIC = 1 | UNICODE = 1 | CXXFLAGS = -fno-keep-inline-dllexport -std=c++11 | '
gdeps.mingw module¶
-
class
gdeps.mingw.
Mingw
(inConfigFile, inSectionName, inDir, inAdressModel, inTypeName)[source]¶ Bases:
gdeps.compiler.Compiler
-
class
gdeps.mingw.
Mingw_32
(inConfigFile, inSectionName='mingw_32', inDir='C:\\TDM-GCC-32\\bin')[source]¶ Bases:
gdeps.mingw.Mingw
gdeps.project module¶
-
class
gdeps.project.
Projects
(inParams, inListeners=[], inMakeArchive=True)[source]¶ Bases:
object
-
static
getTargets
(inParams)[source]¶ by default a Project build the dynamic release and dynamic debug targets
-
listIgnoredPaths
()[source]¶ Function to return all the ignored paths. We look for every directories inside inDirectory the glob result. The glob result is append to the ignore list. :return: the list of ignored paths. :rtype: array of set of str [0] set of directories [1] set of full file names
-
m_ArchiveIgnore
= None¶ Array to store the files and folder to be exclude in the archive function. Use glob syntax.
-
static
gdeps.reporting module¶
-
class
gdeps.reporting.
MacroReporting
[source]¶ Bases:
object
reporting m_Errors = errors dictionary, m_Warnings = warnings dictionary
- Example :
Print each codblocks.workspace errors from the target all. Don’t use directly a key name like that. In this case it’s to illustrate the key name meaning:
- for error in aMacroReporting.m_Errors[“all - codblocks.workspace”]:
print( error )
Test if there a error:
assert not aMacroReporting.m_Errors, “There some errors.”
@link http://www.pyregex.com/ @link https://regex101.com/#python
-
append
(inReporting, inReportingId, inLogFilePath='output.log', inOnlyError=False)[source]¶ send a GDeps.Reporting object, an Id to represent the log file, the log file name and if you want only the errors.
-
exportJson
(inFileName='report.json', inPath='.\\\\')[source]¶ Export the reporting to a json file :param inFileName: This is the filename and the wildcard has to be include. :type inFileName: str :param inPath: By default the local path :type inPath: str
Note
aFullFileName = inPath + ‘’ + inFileName
:raise if the output file cannot be create
-
class
gdeps.reporting.
Reporting
(inErrorRegEx='error', inWarningRegEx='warning', inSplitRegexp='\n+', inErrorRegexpMultiline='', inWarningRegexpMultiline='')[source]¶ Bases:
object
Define your expression regular to find the error, warnings in your objects log.
-
get
(inLogFilePath='output.log', inOnlyError=False)[source]¶ Get the errors and the warning from inLogFilePath. return an array of arrays [0][ errors ] [1][ warnings ]
-
m_ErrorRegexp
= None¶ if a splitting group match with this expression, this group will be send like a error
-
m_ErrorRegexpMultiline
= None¶ if a group match with this expression, this group will be send like a error. @remarks Multi-line mean the search/match will be execute on the
entire text.
-
m_SplitRegexp
= None¶ slpit the log in group. Each group matching group will be send in the report
-
m_WarningRegexp
= None¶ if a splitting group match with this expression, this group will be send like a warning.
-
m_WarningRegexpMultiline
= None¶ if a group match with this expression, this group will be send like a warning. @remarks Multi-line mean the search/match will be execute on the
entire text.
-
-
gdeps.reporting.
clearLogFile
(inLogFilePath)[source]¶ Use this function before to the first time to write into the log file. :param inLogFilePath: The log file path. :type inLogFilePath: str
-
gdeps.reporting.
getLogFileContent
(inLogFilePath)[source]¶ - Use this function to save the previous log.
>>> GDeps.call('call "app1.exe" > "test.log" 2>&1') >>> aContent = GDeps.getLogFileContent('test.log') >>> GDeps.call('call "app2.exe" > "test.log" 2>&1') >>> GDeps.pushFrontLogFileContent('test.log', aContent)
-
gdeps.reporting.
pushFrontLogFileContent
(inLogFilePath, inContent)[source]¶ - Use this function to save the previous log.
>>> GDeps.call('call "app1.exe" > "test.log" 2>&1') >>> aContent = GDeps.getLogFileContent('test.log') >>> GDeps.call('call "app2.exe" > "test.log" 2>&1') >>> GDeps.pushFrontLogFileContent('test.log', aContent)
gdeps.repository module¶
-
class
gdeps.repository.
Versioning
(inConfigFile, inFolderPath, inLogFileDirectory, inReposUrl, inCloneArgs, inUpdateArgs, inSectionName, inExePath)[source]¶ Bases:
gdeps.config.Config
,gdeps.reporting.Reporting
-
CloneNoEmptyDir
(inCommand, inLogFileName, inReport, inCallInFolderDir=False)[source]¶ Helper to force the cloning inside a non empty directory :param inCommand: the clone command to the temporary directory. This directory has to be obtain by this function :
self.getCloneTmpDir()Parameters: - inLogFileName – See the function
GDeps.Versioning.callWithLogFile()
- inReport – See the function :func: GDeps.Versioning.callWithLogFile
- inCallInFolderDir – If True to call the application self.getCloneTmpDir() will be the current dir.
- inLogFileName – See the function
-
callWithLogFile
(inCommand, inLogFileName, inReport, inReportParser, inAppend=False)[source]¶ Useful to call a command line, add and fill the reporting. :param inLogFileName: the log filename without wildcard. :type inLogFileName: str :param inAppend: if True append standard output at the end of file,
if False overwrite the file
-
clean
()[source]¶ Clean the repository on the current directory before to clone :rtype: GDeps.MacroReporting
-
getFolderRepoConfigPath
()[source]¶ has to return the sub folder repository configuration name : Example
.git .svn .hg
-
m_CloneArgs
= None¶ ( optional argument ) to clone the repository
-
m_FolderPath
= None¶ create this sub folder name and checkout inside it
-
m_LogFileDirectory
= None¶ store the log file directory
-
m_ReposUrl
= None¶ repository url
-
m_UpdateArgs
= None¶ ( optional argument ) to update the repository
-
gdeps.sevenzip module¶
-
class
gdeps.sevenzip.
SevenZip
(inConfigFile, inFolderPath, inLogFileDirectory, inArchiveUrl, inSectionName='7zip', inExePath='C:\\Program Files\\7-Zip\\7z.exe')[source]¶ Bases:
gdeps.archive.Archive
gdeps.svn module¶
-
class
gdeps.svn.
Svn
(inConfigFile, inFolderPath, inLogFileDirectory, inReposUrl, inCloneArgs='', inUpdateArgs='', inSectionName='svn', inExePath='C:\Program Files\TortoiseSVN\bin\svn.exe')[source]¶ Bases:
gdeps.repository.Versioning
gdeps.system module¶
-
gdeps.system.
call
(inCommand, inCheckCall=True, inEnv={})[source]¶ https://docs.python.org/3/library/subprocess.html#subprocess.check_output https://docs.python.org/3/library/subprocess.html https://stackoverflow.com/questions/2502833/store-output-of-subprocess-popen-call-in-a-string https://stackoverflow.com/questions/2715847/python-read-streaming-input-from-subprocess-communicate https://stackoverflow.com/questions/9960133/substract-values-two-dictionaries-python
Returns: returncode, returnstdoutlines: This a code error and an array of the output lines. Return type: int, array of str
-
class
gdeps.system.
call_Report
[source]¶ Bases:
gdeps.reporting.Reporting
-
gdeps.system.
copy
(inSource, inDestination, inLogFilePath='', inWaitUnlock=False, inWaitTime=10)[source]¶ Use dos to copy a directory.
Parameters: - inSource (str) – The directory to be rename
- inDestination (str) – the destination directory path
- inLogFilePath (str) – If it isn’t empty. The output will be redirect to the log file.
- inWaitUnlock (bool) – if it’s True we will wait inWaitTime seconds the inSource unlock to copy past. After this time in any case we will try the copy. Every seconds we will test if the folder has been unlock.
- inWaitTime (int [1: MAX_INT]) – While the inWaitTime timer has not expired we will check every seconds if the folder has been unlock. The minimum value is 1s
Returns: The GDeps.call result
Return type: int, array of str
-
class
gdeps.system.
copy_Report
[source]¶ Bases:
gdeps.reporting.Reporting
-
gdeps.system.
createLocalCommandLine
(inAppName, inAppFullPath, inDestDirectory)[source]¶ If some application like nmake use the command cl to call C:Program Files (x86)Microsoft Visual Studio 12.0 VCbincl.exe. You can use this function to create cl.bat in the working directory.
Parameters: - inAppName (str) – The command line name : cl for the cl.exe
- inAppFullPath – The full path of the application : r’C:Program Files (x86)Microsoft Visual Studio 12.0
VCbincl.exe’ :type inAppFullPath: str
Parameters: inDestDirectory (str) – The destination Directory where a inAppName.bat will be create.
-
gdeps.system.
deleteLocalCommandLine
(inAppName, inAppFullPath, inDestDirectory)[source]¶ Call this function to clean the bat file generate by createLocalCommandLine :param inAppName: The command line name : cl for the cl.exe :type inAppName: str
Parameters: inAppFullPath – The full path of the application : r’C:Program Files (x86)Microsoft Visual Studio 12.0 VCbincl.exe’ :type inAppFullPath: str
Parameters: inDestDirectory (str) – The destination Directory where a inAppName.bat will be create.
-
gdeps.system.
fileIsLock
(inPath)[source]¶ Test if the file is using by another process :param inPath: the directory file :type inPath: str
Returns: False if the file is lock by an other process. Return type: bool
-
gdeps.system.
folderHasFilesLock
(inPath)[source]¶ Test if every files inside the folder are using by another process :param inPath: the directory file :type inPath: str
Returns: False if the folder has a locked file by an other process. Return type: bool
-
gdeps.system.
getDirectories
(inDirectory)[source]¶ Recursive function to return all the directories. :param inDirectory: Path of the parent directory. :type inDirectory: str :return: the list directories inside inDirectory :rtype: array of str
-
gdeps.system.
getParentDir
(inDirectory)[source]¶ Parameters: inDirectory (str) – The children directory Returns: The absolute path of the parent directory. Return type: str
-
gdeps.system.
getPaths
(inDirectory)[source]¶ Recursive function to list every files and directories inside inDirectory :return: List of un-ignoring paths :rtype: array of str
-
gdeps.system.
rename
(inPath, inNewName, inLogFilePath='', inWaitUnlock=False, inWaitTime=10)[source]¶ Use dos to rename a file, a directory...
Parameters: - inPath (str) – The directory to be rename
- inNewName (str) – the new name
- inLogFilePath (str) – If it isn’t empty. The output will be redirect to the log file.
- inWaitUnlock (bool) – if it’s True we will wait inWaitTime seconds the inSource unlock to rename. After this time in any case we will try to rename. Every seconds we will test if the folder has been unlock.
- inWaitTime (int [1: MAX_INT]) – While the inWaitTime timer has not expired we will check every seconds if the folder has been unlock. The minimum value is 1s
Returns: The GDeps.call result
Return type: int, array of str
-
class
gdeps.system.
rename_Report
[source]¶ Bases:
gdeps.reporting.Reporting
Todo
has to be test
-
gdeps.system.
rmdir
(inDir, inLogFilePath='', inWaitUnlock=False, inWaitTime=10)[source]¶ Use dos to remove the directory. :param inDir: The directory to be remove :type inDir: str
Parameters: - inLogFilePath (str) – If it isn’t empty. The output will be redirect to the log file.
- inWaitUnlock (bool) – if it’s True we will wait inWaitTime seconds the inSource unlock to remove the directory. After this time in any case we will try to remove. Every seconds we will test if the folder has been unlock.
- inWaitTime (int [1: MAX_INT]) – While the inWaitTime timer has not expired we will check every seconds if the folder has been unlock. The minimum value is 1s
Returns: The GDeps.call result
Return type: int, array of str
-
class
gdeps.system.
rmdir_Report
[source]¶ Bases:
gdeps.reporting.Reporting
-
gdeps.system.
waitWhilePathIsLock
(inPath, inWaitTime)[source]¶ During the inWaiTime seconds will wait the unblocking of inPath.
Parameters: - inPath (str) – The directory or the file that should be test.
- inWaitTime (int [1: MAX_INT]) – While the inWaitTime timer has not expired we will check every seconds if the folder has been unlock. The minimum value is 1s
Returns: If the path is a folder : return False if the folder has a locked file by an other process. If the path is file : return False if the file is locke.
Return type:
gdeps.target module¶
-
class
gdeps.target.
AdressModel
[source]¶ Bases:
enum.Enum
Define a adress model Wikipedia
-
x64
= <AdressModel.x64: 2>¶
-
x86
= <AdressModel.x86: 1>¶
-
-
class
gdeps.target.
Target
[source]¶ Bases:
enum.Enum
Define the linking : statically or dynamically Associate with the debugging symbol or not.
-
debug_dynamic
= <Target.debug_dynamic: 4>¶
-
debug_static
= <Target.debug_static: 3>¶
-
release_dynamic
= <Target.release_dynamic: 2>¶
-
release_static
= <Target.release_static: 1>¶
-
-
class
gdeps.target.
TargetArgs
(inTargetType, inArgs, inx86Args={}, inx64Args={}, inCompilersArgs={}, inIdeArgs={})[source]¶ Bases:
object
Define the target arguments for each case
-
getAdressModelArgs
(inAdressModel)[source]¶ Parameters: inAdressModel (AdressModel) – The selected address model Returns: The associate arguments Return type: dict { str : str } or dict { str : [str] }
-
getCompilerArgs
(inCompiler, inIde=None)[source]¶ Parameters: - inCompiler (gdeps.Compiler) – A compiler instance to retrieve with the type the associate argument
- inIde (gdeps.Ide) – A ide instance to retrieve with the type the compiler arguments associate with the IDE
Returns: The associate value, usually it’s a string.
Return type: dict { str : str }
-
gdeps.vc module¶
-
class
gdeps.vc.
VC100_32
(inConfigFile, inSectionName='vc100_32', inDir='C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\bin')[source]¶ Bases:
gdeps.vc.Vc
-
class
gdeps.vc.
VC100_64
(inConfigFile, inSectionName='vc100_64', inDir='C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\bin\\x86_amd64')[source]¶ Bases:
gdeps.vc.Vc
-
class
gdeps.vc.
VC110_32
(inConfigFile, inSectionName='vc110_32', inDir='C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\bin')[source]¶ Bases:
gdeps.vc.Vc
-
class
gdeps.vc.
VC110_64
(inConfigFile, inSectionName='vc110_64', inDir='C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC\\bin\\x86_amd64')[source]¶ Bases:
gdeps.vc.Vc
-
class
gdeps.vc.
VC120_32
(inConfigFile, inSectionName='vc120_32', inDir='C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin')[source]¶ Bases:
gdeps.vc.Vc
-
class
gdeps.vc.
VC120_64
(inConfigFile, inSectionName='vc120_64', inDir='C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\x86_amd64')[source]¶ Bases:
gdeps.vc.Vc
-
class
gdeps.vc.
VC140_32
(inConfigFile, inSectionName='vc140_32', inDir='C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin')[source]¶ Bases:
gdeps.vc.Vc
-
class
gdeps.vc.
VC140_64
(inConfigFile, inSectionName='vc140_64', inDir='C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\x86_amd64')[source]¶ Bases:
gdeps.vc.Vc
-
class
gdeps.vc.
VC90_32
(inConfigFile, inSectionName='vc90_32', inDir='C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE')[source]¶ Bases:
gdeps.vc.Vc
-
class
gdeps.vc.
Vc
(inConfigFile, inSectionName, inDir, inAdressModel, inTypeName, inIsExpress=True)[source]¶ Bases:
gdeps.compiler.Compiler
Common base for the VC compilers
-
static
getStaticLibraryWildCard
()[source]¶ Returns: The extension of the static library associate with this compiler. Return type: str
-
getvarsScriptPath
()[source]¶ Returns: The path of the script ”.bat” to setup the environment variables. Return type: str >>> os.path.normpath(self.m_Dir + r"\vcvars32.bat")
-
m_IsExpress
= None¶ True : it’s a express edition if not it’s a professional version
-
static
gdeps.visual module¶
-
class
gdeps.visual.
Visual2008
(inConfigFile, inSectionName, inCompilers, inCompilersAlias=[])[source]¶ Bases:
gdeps.ide.Ide
-
build
(inProjectPath, inProjectName, inCompiler, inTargetName='Release', inLogFilePath='.\\Output_Buid_Visual2008.log', inWildCard='sln', inRebuildAll=True, inIdeParams={}, inCompilerArgs={})[source]¶ Default directory : C:Program Files (x86)Microsoft Visual Studio 9.0VC cpackages
Microsoft (R) Visual C++ Project Builder - Command Line Version 9.00.30729 Copyright (C) Microsoft Corporation. All rights reserved.
Usage: vcbuild [options] [project|solution] [config|$ALL]
Options: /clean (/c) Clean build outputs only /error:<str> Prefix to add to error lines on output to stderr /errfile:<file> Log all errors to the file specified /htmllog:<file> Logs output to html file specified
(default: $(IntDir)BuildLog.htm)/implib Makes an import library for a DLL configuration (does not link) /info:<str> Prefix to add to information lines on output to stdout /link (/l) Performs a link without building sources /logcommands Prints commands and response files to screen /logfile:<file> Log all output and build information to the file specified /override:<file>Override the project settings with the settings in the given
property sheet file/M<number> Specifies the number of concurrent builds to run, if possible /msbuild:<opt> Pass <opt> to msbuild.exe
/nocolor Do not output error and warning messages in color /nohtmllog Do not write an html build log file /noimplib Does not generate an import library. NOTE: this option overrides /implib. /nologo Suppress version and copyright message /nondefmsbuild Do not use the copy of msbuild.exe located in the .NET Frameworks installation /platform:<str> Build only configurations for the given platform /implibobjs:<s> Additional dependencies for the librarian /rebuild (/r) Clean build outputs and perform a build /forcelink Forces a link without building sources /showenv Show environment in the html build log /time Times the build from start to finish /upgrade Upgrades the project file to the latest format supported
NOTE: the upgrade switch does not perform a build NOTE: this option is ignored for solution files/useenv (/u) Use environment variables for INCLUDE and LIB paths /overrideRefVer When upgrading, assume .NET Framework Version 3.5 for any assemb ly references.
Requires /upgrade switch./wrnfile:<file> Log all warnings to the file specified /warning:<str> Prefix to add to warning lines on output to stdout @<file> Read options from the specified response file
If no project is specified, and there is only a single .vcproj file in the directory, that project will be built. If no configuration is specified, and the VCBUILD_DEFAULT_CFG environment variable is set, the configuration it specifies will be built. If it is not set, then all configurations will be built.
The default action is to build the specified configurations without cleaning.
Options will also be read from the VCBUILD_DEFAULT_OPTIONS environment variable. ===============================================================================
For the target with the sln we need to add https://stackoverflow.com/questions/22668149/qprocess-with-non-wrapped-pipe-symbol-in-argument-list
inTargetName + “^|Win32”
https://msdn.microsoft.com/fr-fr/library/kdxzbw9t(v=vs.90).aspx
- $ALL
- Nom symbolique qui signifie que toutes les configurations sont générées.
https://msdn.microsoft.com/fr-fr/library/cz553aa1(v=vs.90).aspx
-
-
class
gdeps.visual.
Visual2010
(inConfigFile, inSectionName, inCompilers, inCompilersAlias=[])[source]¶ Bases:
gdeps.ide.Ide
-
class
gdeps.visual.
Visual2012
(inConfigFile, inSectionName, inCompilers, inCompilersAlias=[])[source]¶ Bases:
gdeps.ide.Ide
-
class
gdeps.visual.
Visual2013
(inConfigFile, inSectionName, inCompilers, inCompilersAlias=[])[source]¶ Bases:
gdeps.ide.Ide
-
class
gdeps.visual.
Visual2015
(inConfigFile, inSectionName, inCompilers, inCompilersAlias=[])[source]¶ Bases:
gdeps.ide.Ide
-
build
(inProjectPath, inProjectName, inCompiler, inTargetName='Release', inLogFilePath='Output_Buid_Visual2015.log', inWildCard='sln', inRebuildAll=True, inIdeParams={}, inCompilerArgs={})[source]¶ https://msdn.microsoft.com/en-us/library/ms164311%28v=vs.140%29.aspx
-
gdeps.zlib module¶
Module contents¶
-
class
gdeps.
boost
(inConfigFile, inSectionName, inFolderDir, inSolutionName, inArgs, inTargetsArgs, inCompilers, inIdes, inExeName='b2.exe', inExePath='*.DEFAULT.*', inTypeName='boost2')[source]¶ Bases:
gdeps.make.Make
To build the boost library is not necessary to use an external boost.build. But if you want you can use your boost.build to build boost.
- To install boost.build :
Todo
Watch for boostJam
- Repository :
clone git@github.com:boostorg/build.git // If you haven’t a Github account or you don’t want add an ssh key use the subversion link on https://github.com/boostorg/build or download the zip file :
-
callexe
(inCompiler, inTargetArgs, inLogFilePath, inVariant='release', inLink='shared', inAdressModel='64', inToolSet='gcc', inEnv={}, inThreading='multi')[source]¶
-
callexes
(inCompiler, inAdressModel='64', inToolSet='gcc', inEnv={})[source]¶ Returns: A dictionary { reportId : log file path } to make the compiler reporting
-
getboostCompilerIds
(inCompiler)[source]¶ Returns: the adress model, compiler id for bootstrap, compiler id for b2/bjam
-
make
()[source]¶ - See:
- http://www.boost.org/doc/libs/1_59_0/more/getting_started/unix-variants.html#identify-your-toolset http://www.boost.org/build/doc/html/bbv2/jam.html http://www.boost.org/build/doc/html/bbv2/reference/tools.html
- Clang:
- http://blog.llvm.org/2010/05/clang-builds-boost.html https://stackoverflow.com/questions/8486077/how-to-compile-link-boost-with-clang-libc
- Digital Mars
- http://www.boost.org/doc/libs/1_33_1/tools/build/v1/dmc-stlport-tools.jam
-
read
(inSection)[source]¶ - If you haven’t «boost.build» to build boost :
- You haven’t to define a config section with the value >>> exepath=r”.\”
- if you have boost.build :
define the boostrap.bat path
- Example
>>> [boost2_build_dir] >>> exepath=r"X:\\boost-build\\"