Module: MxxRu
- Defined in:
- lib/mxx_ru/ex.rb,
lib/mxx_ru/util.rb,
lib/mxx_ru/compat.rb,
lib/mxx_ru/cpp/qt.rb,
lib/mxx_ru/cpp/mode.rb,
lib/mxx_ru/cpp/target.rb,
lib/mxx_ru/cpp/analyzer.rb,
lib/mxx_ru/binary_target.rb,
lib/mxx_ru/cpp/composite.rb,
lib/mxx_ru/cpp/rucodegen.rb,
lib/mxx_ru/binary_library.rb,
lib/mxx_ru/abstract_target.rb,
lib/mxx_ru/binary_unittest.rb,
lib/mxx_ru/cpp/source_file.rb,
lib/mxx_ru/cpp/toolsets/vc7.rb,
lib/mxx_ru/cpp/obj_placement.rb,
lib/mxx_ru/textfile_unittest.rb,
lib/mxx_ru/cpp/detect_toolset.rb,
lib/mxx_ru/cpp/lib_collection.rb,
lib/mxx_ru/makestyle_generator.rb,
lib/mxx_ru/cpp/toolsets/c89_nsk.rb,
lib/mxx_ru/cpp/toolsets/gcc_linux.rb,
lib/mxx_ru/cpp/toolsets/gcc_mingw.rb,
lib/mxx_ru/cpp/toolsets/gcc_cygwin.rb,
lib/mxx_ru/cpp/toolsets/gcc_family.rb,
lib/mxx_ru/cpp/toolsets/bcc_win32_5.rb,
lib/mxx_ru/cpp/toolsets/c89_etk_nsk.rb,
lib/mxx_ru/cmd_line_option_processor.rb,
lib/mxx_ru/generators/bin-unittest/g.rb,
lib/mxx_ru/cpp/toolsets/c89_nsk_family.rb,
lib/mxx_ru/cpp/toolsets/gcc_unix_family.rb,
lib/mxx_ru/generators/impl/std_receiver.rb,
lib/mxx_ru/cpp/toolsets/bcc_win32_family.rb,
lib/mxx_ru/cpp/toolsets/gcc_sparc_solaris.rb,
lib/mxx_ru/generators/impl/cpp/generation.rb,
lib/mxx_ru/cpp/obj_placements/custom_subdir.rb
Overview
– Copyright © 1996-2004, Yauheni Akhotnikau Copyright © 2004-2006, JSC Intervale Copyright © 2006, The Mxx_ru Project All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++
Defined Under Namespace
Modules: Cpp, Generators, Util Classes: AbstractGenerator, AbstractMethodEx, AbstractTarget, BinaryLibrary, BinaryLibraryTypeConflictEx, BinaryTarget, BinaryUnittestTarget, BuildEx, CmdLineOptionProcessor, Ex, GlobalOptionConflictEx, GlobalOptionDisallowedValueEx, InvalidCastEx, InvalidValueEx, MakestyleGenerator, MissingDependFileEx, TargetState, TargetUnknownEx, TextfileUnittestTarget, UnsupportedModeEx, UnsupportedTargetTypeEx
Constant Summary collapse
- Abstract_method_ex =
For compatibility with previous versions.
AbstractMethodEx
- Invalid_cast_ex =
For compatibility with previous versions.
InvalidCastEx
- Build_ex =
For compatibility with previous versions.
BuildEx
- Unsupported_target_type_ex =
For compatibility with previous versions.
UnsupportedTargetTypeEx
- Target_unknown_ex =
For compatibility with previous versions.
TargetUnknownEx
- Global_option_conflict_ex =
For compatibility with previous versions.
GlobalOptionConflictEx
- Global_option_disallowed_value_ex =
For compatibility with previous versions.
GlobalOptionDisallowedValueEx
- Unsupported_mode_ex =
For compatibility with previous versions.
UnsupportedModeEx
- Missing_depend_file_ex =
For compatibility with previous versions.
MissingDependFileEx
- Invalid_value_ex =
For compatibility with previous versions.
InvalidValueEx
- Binary_target =
For compatilibily with previous versions.
BinaryTarget
- BUILD_ROOT =
File name of root project file.
"build.rb"
- Target_state =
For compatibility with previous versions.
TargetState
- Abstract_generator =
For compatibility with previous versions.
AbstractGenerator
- Abstract_target =
For compatibility with previous versions.
AbstractTarget
- Binary_unittest_target =
For compatibility with previous versions.
BinaryUnittestTarget
- Textfile_unittest_target =
For compatibility with previous versions.
TextfileUnittestTarget
- Makestyle_generator =
For compatibility with previous versions.
MakestyleGenerator
- @@defined_targets =
Map of targets loaded. Key is target alias – file name with definition of a target.
Hash.new
- @@first_target_alias =
Root target alias. This target will be used in setup_target function to start building process.
nil
Class Method Summary collapse
-
.enable_show_brief ⇒ Object
Manually enable ‘show-brief’ mode.
- .query_target(prj_alias, mandatory) ⇒ Object
- .setup_target(target, build_enabled = true) ⇒ Object
-
.show_brief(message) ⇒ Object
Show a brief message.
- .target_defined_for?(prj_alias) ⇒ Boolean
- .try_set_first_target_alias(a_alias) ⇒ Object
Class Method Details
.enable_show_brief ⇒ Object
Manually enable ‘show-brief’ mode.
Intended to use in project files:
MxxRu::Cpp::exe_target( 'some.prj' ) {
...
MxxRu::enable_show_brief
...
}
‘show-brief’ is global mode. Once enabled it cannot be disabled form inside another project file.
Call to MxxRu::enable_show_brief ignored if ‘–mxx-show-brief-disabled’ specified in command-line.
413 414 415 |
# File 'lib/mxx_ru/util.rb', line 413 def MxxRu.enable_show_brief Util::Mode.instance.try_enable_show_brief end |
.query_target(prj_alias, mandatory) ⇒ Object
140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/mxx_ru/abstract_target.rb', line 140 def MxxRu.query_target( prj_alias, mandatory ) target = @@defined_targets[ prj_alias ] # If target was required, we already should found it. # Build should be stopper otherwise. if target.nil? && mandatory raise TargetUnknownEx.new( prj_alias ) end return target end |
.setup_target(target, build_enabled = true) ⇒ Object
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/mxx_ru/abstract_target.rb', line 105 def MxxRu.setup_target( target, build_enabled = true ) begin if !( target_defined_for?( target.prj_alias ) ) @@defined_targets[ target.prj_alias ] = target; end if build_enabled && nil != @@first_target_alias && @@first_target_alias == target.prj_alias # It is a root project, required to build. # If this project is not root project file and root project file # exists, then we will load root project file and start build process # after that. if BUILD_ROOT != target.prj_alias if FileTest.exists?( BUILD_ROOT ) require BUILD_ROOT end end target.clean if MxxRu::Util::Mode.instance.is_clean or MxxRu::Util::Mode.instance.is_rebuild target.reset if MxxRu::Util::Mode.instance.is_rebuild MxxRu::Util::build_call_wrapper( target ) if !MxxRu::Util::Mode.instance.is_clean end return target rescue MxxRu::Ex => ex $stderr.print "<<<[#{ex.class.name}]\t#{ex}>>>\n" exit( -2 ) end end |
.show_brief(message) ⇒ Object
Show a brief message. The message shown only if ‘show-brief’ mode is on.
418 419 420 421 |
# File 'lib/mxx_ru/util.rb', line 418 def MxxRu.show_brief( ) puts [ 0, 1 ].capitalize << [ 1...size ] << ' ...' if Util::Mode.instance.is_brief_desc and end |
.target_defined_for?(prj_alias) ⇒ Boolean
152 153 154 155 |
# File 'lib/mxx_ru/abstract_target.rb', line 152 def MxxRu.target_defined_for?(prj_alias) return true if @@defined_targets.has_key?( prj_alias ) return false end |
.try_set_first_target_alias(a_alias) ⇒ Object
99 100 101 102 103 |
# File 'lib/mxx_ru/abstract_target.rb', line 99 def MxxRu.try_set_first_target_alias( a_alias ) if nil == @@first_target_alias @@first_target_alias = a_alias.clone end end |