00001 /*****************************************************************************\ 00002 * * 00003 * Name : version_stamper * 00004 * Author : Chris Koeritz * 00005 * * 00006 ******************************************************************************* 00007 * Copyright (c) 1995-$now By Author. This program is free software; you can * 00008 * redistribute it and/or modify it under the terms of the GNU General Public * 00009 * License as published by the Free Software Foundation; either version 2 of * 00010 * the License or (at your option) any later version. This is online at: * 00011 * http://www.fsf.org/copyleft/gpl.html * 00012 * Please send any updates to: fred@gruntose.com * 00013 \*****************************************************************************/ 00014 00015 #include "version_stamper.h" 00016 00017 #include <basis/portable.h> 00018 #include <basis/version_record.h> 00019 #include <opsystem/application_shell.h> 00020 #include <opsystem/byte_filer.h> 00021 #include <loggers/console_logger.h> 00022 #include <opsystem/directory.h> 00023 #include <opsystem/filename.h> 00024 #include <data_struct/static_memory_gremlin.h> 00025 #include <opsystem/version_ini.h> 00026 00027 #undef LOG 00028 #define LOG(to_print) CLASS_EMERGENCY_LOG(program_wide_logger(), to_print) 00029 00030 version_stamper::version_stamper() 00031 : application_shell("version_stamper") 00032 { 00033 } 00034 00035 version_stamper::~version_stamper() {} 00036 00037 int version_stamper::execute() 00038 { 00039 FUNCDEF("execute"); 00040 SET_DEFAULT_CONSOLE_LOGGER; // override the file_logger from app_shell. 00041 if (__argc < 2) { 00042 log("The directory where the 'version.ini' file is located\n" 00043 "must be specified as the first parameter of this program. Another\n" 00044 "version file may optionally be specified as the second parameter of\n" 00045 "the program; the version contained in this file will be used to set\n" 00046 "the version of the file specified in the first parameter.\n" 00047 "Additionally, if the environment variable 'DEBUG' exists, then the\n" 00048 "generated RC file will be marked as a debug build. Otherwise it is\n" 00049 "marked as a release build. Note that the CLAM system automatically\n" 00050 "sets this for you.\n\n"); 00051 return 1; 00052 } 00053 00054 istring path_name = __argv[1]; 00055 istring source_version_file; // blank by default. 00056 if (__argc > 2) 00057 source_version_file = __argv[2]; 00058 bool ret = version_ini::one_stop_version_stamp(path_name, 00059 source_version_file, true); 00060 if (!ret) return 1; // failure. 00061 return 0; // success. 00062 } 00063 00064 HOOPLE_MAIN(version_stamper, ) 00065 00066 #ifdef __BUILD_STATIC_APPLICATION__ 00067 // static dependencies found by buildor_gen_deps.sh: 00068 #include <basis/array.cpp> 00069 #include <basis/byte_array.cpp> 00070 #include <basis/callstack_tracker.cpp> 00071 #include <basis/chaos.cpp> 00072 #include <basis/convert_utf.cpp> 00073 #include <basis/definitions.cpp> 00074 #include <basis/earth_time.cpp> 00075 #include <basis/guards.cpp> 00076 #include <basis/istring.cpp> 00077 #include <basis/log_base.cpp> 00078 #include <basis/memory_checker.cpp> 00079 #include <basis/mutex.cpp> 00080 #include <basis/object_base.cpp> 00081 #include <basis/outcome.cpp> 00082 #include <basis/packable.cpp> 00083 #include <basis/portable.cpp> 00084 #include <basis/sequence.cpp> 00085 #include <basis/set.cpp> 00086 #include <basis/utility.cpp> 00087 #include <basis/version_checker.cpp> 00088 #include <basis/version_record.cpp> 00089 #include <data_struct/amorph.cpp> 00090 #include <data_struct/bit_vector.cpp> 00091 #include <data_struct/byte_hasher.cpp> 00092 #include <data_struct/configurator.cpp> 00093 #include <data_struct/hash_table.cpp> 00094 #include <data_struct/pointer_hash.cpp> 00095 #include <data_struct/stack.cpp> 00096 #include <data_struct/static_memory_gremlin.cpp> 00097 #include <data_struct/string_hash.cpp> 00098 #include <data_struct/string_hasher.cpp> 00099 #include <data_struct/string_table.cpp> 00100 #include <data_struct/symbol_table.cpp> 00101 #include <data_struct/table_configurator.cpp> 00102 #include <loggers/console_logger.cpp> 00103 #include <loggers/file_logger.cpp> 00104 #include <loggers/locked_logger.cpp> 00105 #include <loggers/null_logger.cpp> 00106 #include <loggers/program_wide_logger.cpp> 00107 #include <opsystem/application_base.cpp> 00108 #include <opsystem/application_shell.cpp> 00109 #include <opsystem/byte_filer.cpp> 00110 #include <opsystem/command_line.cpp> 00111 #include <opsystem/critical_events.cpp> 00112 #include <opsystem/directory.cpp> 00113 #include <opsystem/filename.cpp> 00114 #include <opsystem/ini_config.cpp> 00115 #include <opsystem/ini_parser.cpp> 00116 #include <opsystem/path_configuration.cpp> 00117 #include <opsystem/rendezvous.cpp> 00118 #include <opsystem/version_ini.cpp> 00119 #include <textual/byte_format.cpp> 00120 #include <textual/parser_bits.cpp> 00121 #include <textual/string_manipulation.cpp> 00122 #include <textual/tokenizer.cpp> 00123 #endif // __BUILD_STATIC_APPLICATION__ 00124
1.5.1