: m_HaveBuildVer(
false), m_HaveRevision(
false)
62 stringkey_file_name(lib);
64key_file_name +=
".installed";
66 if(
CDirEntry(key_file_path).Exists() ) {
74 constlist<string> libs_to_install,
82 GetApp().GetRegSettings().m_CompilersSubdir);
87 "Makefile.third_party.mk");
92 CDirmakefile_dir(dir);
93 if( !makefile_dir.
Exists() ) {
103 ITERATE(list<string>,
n, libs_to_install) {
104 const string& lib = *
n;
110 if(bin_path.empty()) {
111bin_path =
site.GetThirdPartyLibsBinSubDir();
120 key+=
site.GetThirdPartyLibsBinPathSuffix();
122ofs <<
key<<
" = "<< bin_dir <<
"\n";
125 site.SetThirdPartyLibBin(lib, bin_dir);
128lib <<
"|"<<
config.GetConfigFullName()
129<<
" disabled, path not found");
133lib <<
"|"<<
config.GetConfigFullName()
134<<
": no LIBPATH specified");
141 constlist<SConfigInfo>& configs,
142 const string& root_dir)
144 _TRACE(
"*** Analyzing 3rd party libraries availability ***");
146 site.InitializeLibChoices();
148 site.ProcessMacros(configs);
153 _TRACE(
"*** Creating Makefile.third_party.mk files ***");
155list<string> third_party_to_install;
156 site.GetThirdPartyLibsToInstall(&third_party_to_install);
158 ITERATE(list<SConfigInfo>, p, configs) {
161third_party_to_install,
163 GetApp().GetBuildType());
169 constlist<SConfigInfo>& configs,
170 const string& root_dir)
174 ITERATE(list<SConfigInfo>, p, configs) {
184 _TRACE(
"*** Creating local ncbiconf headers ***");
186 ITERATE(list<SConfigInfo>, p, configs) {
201eConfigureDefinesPath,
202 "Configure defines file name is not specified");
208 "No configurable macro definitions specified.");
210 _TRACE(
"Configurable macro definitions: ");
222 if( !
site.IsDescribed(define) ) {
224define <<
": Macro not defined");
227list<string> components;
228 site.GetComponents(define, &components);
229 ITERATE(list<string>, p, components) {
230 const string& component = *p;
231 if(
site.IsBanned(component)) {
233component <<
"|"<<
config.GetConfigFullName()
234<<
": "<< define <<
" not provided, disabled");
237 if(
site.IsProvided( component,
false)) {
241 site.GetLibInfo(component,
config, &lib_info);
242 if( !
site.IsLibOk(lib_info) ||
243!
site.IsLibEnabledInConfig(component,
config)) {
246component <<
"|"<<
config.GetConfigFullName()
247<<
": "<< define <<
" not satisfied, disabled");
259 stringcfg_root_inc(root_dir);
263 stringextra =
site.GetConfigureEntry(
"ExtraDefines");
267 if(extra.empty() || random_count <= 0 ||
CFile(filename).Exists()) {
282 stringprefix(
"#define NCBI_RANDOM_VALUE_");
283ofs << prefix <<
"TYPE Uint4"<< endl;
284ofs << prefix <<
"MIN 0"<< endl;
286<< std::showbase <<
rnd.GetMax() << endl << endl;
287 for(
int i= 0;
i< random_count; ++
i) {
288ofs << prefix << std::noshowbase <<
i 289<< setw(16) << std::showbase <<
rnd.GetRand() << endl;
302 stringcfg_root_inc(root_dir);
320 if(filename_cache) {
342 stringprop_file_info;
343 if(!prop_file_name.empty()) {
348 if(!prop_file_info.empty()) {
349 CRegexpre(
"teamcity.build.id=(\\d+)");
350tc_build_id = re.
GetMatch(prop_file_info, 0, 1);
355 if(tree_root.empty()) {
358 if(!tree_root.empty()) {
362 string cmd=
"git -C "+ tree_root +
" log -1 --format=%h > "+ tmp_file;
370 cmd=
"svn info "+ tree_root +
" > "+ tmp_file;
379 if(!
info.empty()) {
380 CRegexpre(
"Revision: (\\d+)");
390 if(!
info.empty()) {
391 CRegexpre(
"/production/components/[^/]*/(\\d+)");
398 if(sc_ver.empty()) {
402 if(svn_rev.empty() && !prop_file_info.empty()) {
403 CRegexpre(
"build.vcs.number=(\\d+)");
404svn_rev = re.
GetMatch(prop_file_info, 0, 1);
408 if(tc_build.empty()) {tc_build =
"0";}
409 if(sc_ver.empty()) {sc_ver =
"0";}
410 if(svn_rev.empty()) {svn_rev =
"0";}
413build_vars[
"NCBI_TEAMCITY_BUILD_NUMBER"] = tc_build;
414build_vars[
"NCBI_TEAMCITY_BUILD_ID"] = tc_build_id;
415build_vars[
"NCBI_TEAMCITY_PROJECT_NAME"] = tc_prj;
416build_vars[
"NCBI_TEAMCITY_BUILDCONF_NAME"] = tc_conf;
417build_vars[
"NCBI_REVISION"]
418= (git_rev.empty() && svn_rev !=
"0") ? svn_rev : git_rev;
419build_vars[
"NCBI_SUBVERSION_REVISION"] = svn_rev;
420build_vars[
"NCBI_SC_VERSION"] = sc_ver;
424 autoconverter = [](
const string& file_in,
const string& file_out,
const map<string,string>& vocabulary) {
425 stringcandidate = file_out +
".candidate";
427 if( ofs.is_open() ) {
432 while( getline(ifs, line) ) {
433 for(string::size_type from = line.find(
"@"); from != string::npos; from = line.find(
"@")) {
434string::size_type to = line.find(
"@", from + 1);
435 if(to != string::npos) {
436 string key= line.substr(from+1, to-from-1);
437 if(vocabulary.find(
key) != vocabulary.end()) {
438line.replace(from, to-from+1, vocabulary.at(
key));
440line.replace(from, to-from+1,
"");
454converter(file_in, filename, build_vars);
461converter(file_in, filename, build_vars);
481 const string& define = *p;
483 _TRACE(
"Macro definition Ok "<< define);
487 "Macro definition not satisfied: "<< define);
503signature =
"XCODE";
509signature +=
"-"+
config.GetConfigFullName();
514 #ifdef NCBI_XCODE_BUILD 517signature +=
"_"+
tmp;
520 if(uname(&u) == 0) {
534 if(0 == gethostname(hostname, 255))
541signature +=
"i386-pc-";
552 stringcandidate_path = filename +
".candidate";
558 "Configuration file modified");
561 "Configuration file unchanged");
567ofs <<
"/* $"<<
"Id"<<
"$"<< endl;
568ofs <<
"* ==========================================================================="<< endl;
570ofs <<
"* PUBLIC DOMAIN NOTICE"<< endl;
571ofs <<
"* National Center for Biotechnology Information"<< endl;
573ofs <<
"* This software/database is a \"United States Government Work\" under the"<< endl;
574ofs <<
"* terms of the United States Copyright Act. It was written as part of"<< endl;
575ofs <<
"* the author's official duties as a United States Government employee and"<< endl;
576ofs <<
"* thus cannot be copyrighted. This software/database is freely available"<< endl;
577ofs <<
"* to the public for use. The National Library of Medicine and the U.S."<< endl;
578ofs <<
"* Government have not placed any restriction on its use or reproduction."<< endl;
580ofs <<
"* Although all reasonable efforts have been taken to ensure the accuracy"<< endl;
581ofs <<
"* and reliability of the software and data, the NLM and the U.S."<< endl;
582ofs <<
"* Government do not and cannot warrant the performance or results that"<< endl;
583ofs <<
"* may be obtained by using this software or data. The NLM and the U.S."<< endl;
584ofs <<
"* Government disclaim all warranties, express or implied, including"<< endl;
585ofs <<
"* warranties of performance, merchantability or fitness for any particular"<< endl;
586ofs <<
"* purpose."<< endl;
588ofs <<
"* Please cite the author in any work or product based on this material."<< endl;
590ofs <<
"* ==========================================================================="<< endl;
592ofs <<
"* Author: ......."<< endl;
594ofs <<
"* File Description:"<< endl;
595ofs <<
"* ......."<< endl;
597ofs <<
"* ATTENTION:"<< endl;
598ofs <<
"* Do not edit or commit this file into SVN as this file will"<< endl;
599ofs <<
"* be overwritten (by PROJECT_TREE_BUILDER) without warning!"<< endl;
607 const string& full_path,
const string& signature)
const 617 if(p->second ==
'1') {
618ofs <<
"#define "<< p->first <<
" "<< p->second << endl;
620ofs <<
"/* #undef "<< p->first <<
" */"<< endl;
624ofs <<
"#define NCBI_SIGNATURE \\"<< endl <<
" \""<< signature <<
"\""<< endl;
626list<string> customH;
628 ITERATE(list<string>, c, customH) {
632<< endl <<
"* ===========================================================================" 633<< endl <<
"* Included contents of "<<
file 643is.read(
buf,
sizeof(
buf));
644ofs.write(
buf, is.gcount());
Utility class for distinguish between static and dll builds.
string GetTypeStr(void) const
static EMsvcPlatform GetMsvcPlatform(void)
static const string & GetMsvcVersionName(void)
static const string & GetMsvcPlatformName(void)
static string GetConfigNameKeyword(void)
static const string & GetRequestedArchs(void)
CNcbiOfstream & WriteNcbiconfHeader(CNcbiOfstream &ofs) const
list< string > m_ConfigureDefines
void Configure(CMsvcSite &site, const list< SConfigInfo > &configs, const string &root_dir)
void WriteNcbiconfMsvcSite(const string &full_path, const string &signature) const
void WriteBuildVer(CMsvcSite &site, const string &root_dir, const SConfigInfo &config)
bool ProcessDefine(const string &define, const CMsvcSite &site, const SConfigInfo &config) const
void WriteExtraDefines(CMsvcSite &site, const string &root_dir, const SConfigInfo &config)
void CreateConfH(CMsvcSite &site, const list< SConfigInfo > &configs, const string &root_dir)
void AnalyzeDefines(CMsvcSite &site, const string &root_dir, const SConfigInfo &config, const CBuildType &build_type)
string m_ConfigureDefinesPath
void InitializeFrom(const CMsvcSite &site)
string GetPlatformInfo(const string &sysname, const string &type, const string &orig) const
CProjBulderAppException â.
void GetCustomConfH(list< string > *files) const
void RegisterGeneratedFile(const string &file)
const SProjectTreeInfo & GetProjectTreeInfo(void)
const CMsvcSite & GetSite(void)
std::ofstream out("events_result.xml")
main entry point for tests
const CNcbiEnvironment & GetEnvironment(void) const
Get the application's cached environment.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
const string & Get(const string &name, bool *found=NULL) const
Get environment value by name.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
static TExitCode System(const char *cmdline)
Execute the specified command.
int TExitCode
Exit code type.
static string NormalizePath(const string &path, EFollowLinks follow_links=eIgnoreLinks)
Normalize a path.
virtual bool Copy(const string &new_path, TCopyFlags flags=fCF_Default, size_t buf_size=0) const
Copy a file.
bool CreatePath(TCreateFlags flags=fCreate_Default) const
Create the directory path recursively possibly more than one at a time.
bool IsNewer(time_t tm, EIfAbsent if_absent) const
Check if the current entry is newer than a specified date/time.
virtual bool Remove(TRemoveFlags flags=eRecursive) const
Remove a directory entry.
virtual bool Exists(void) const
Check if directory "dirname" exists.
static string CreateRelativePath(const string &path_from, const string &path_to)
Create a relative path between two points in the file system specified by their absolute paths.
static string ConvertToOSPath(const string &path)
Convert "path" on any OS to the current OS-dependent path.
static string GetTmpName(ETmpFileCreationMode mode=eTmpFileGetName)
Get temporary file name.
static string ConcatPath(const string &first, const string &second)
Concatenate two parts of the path for the current OS.
const string & GetPath(void) const
Get entry path.
virtual bool Exists(void) const
Check existence of file.
static void SplitPath(const string &path, string *dir=0, string *base=0, string *ext=0)
Split a path string into its basic components.
@ fCF_Overwrite
The following flags define what to do when the destination entry already exists:
@ eGetRand_Sys
Use system-dependent random generator.
CTempString GetMatch(CTempString str, size_t offset=0, size_t idx=0, TMatch flags=fMatch_default, bool noreturn=false)
Get matching pattern and subpatterns.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
size_t NcbiStreamToString(string *s, CNcbiIstream &is, size_t pos=0)
Input the entire contents of an istream into a string (NULL causes drain).
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
static string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static string & ToUpper(string &str)
Convert string to upper case â string& version.
static string & ToLower(string &str)
Convert string to lower case â string& version.
@ fConvErr_NoThrow
Do not throw an exception on error.
static void hex(unsigned char c)
void s_ResetLibInstallKey(const string &dir, const string &lib)
static void s_CreateThirdPartyLibsInstallMakefile(CMsvcSite &site, const list< string > libs_to_install, const SConfigInfo &config, const CBuildType &build_type)
bool PromoteIfDifferent(const string &present_path, const string &candidate_path, const string &ignore)
const struct ncbi::grid::netcache::search::fields::KEY key
static size_t rnd(size_t minimal, size_t maximal)
Defines a portable execute class.
std::istream & in(std::istream &in_, double &x_)
CProjBulderApp & GetApp(void)
access to App singleton
#define PTB_INFO_EX(file, err_code, msg)
#define PTB_ERROR_EX(file, err_code, msg)
@ ePTB_ConfigurationError
#define PTB_WARNING_EX(file, err_code, msg)
#define PTB_ERROR(file, msg)
@ rtMultiThreadedDebugDLL
string m_Root
Root of the project tree.
string m_Compilers
<compilers> branch of tree
C++ wrappers for the Perl-compatible regular expression (PCRE) library.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4