bake-toolkit 2.43.2 → 2.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/bake/options/options.rb +6 -1
- data/lib/bake/options/usage.rb +2 -0
- data/lib/bake/subst.rb +10 -0
- data/lib/bake/toolchain/gcc.rb +1 -1
- data/lib/blocks/block.rb +8 -11
- data/lib/blocks/compile.rb +63 -14
- data/lib/blocks/library.rb +1 -1
- data/lib/common/crc32.rb +57 -0
- data/lib/common/ext/stdout.rb +15 -28
- data/lib/common/version.rb +1 -1
- data/lib/multithread/job.rb +1 -2
- data/lib/tocxx.rb +0 -2
- metadata +3 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 3661ce41b15cb95daa7e30356c5436621bb9b9d8
         | 
| 4 | 
            +
              data.tar.gz: 58ada38722104cc9f3a83348fa839428ffadc648
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 5a95bb26915962630ba32e6693cfb7caa611b7ff3f729f8993d5c882a51587486ffbbe8be2e6ad90aaebf86b67a9ef78ee52ddde5827720ff17f43f5bab14173
         | 
| 7 | 
            +
              data.tar.gz: 75f577c43f0d7ffc103e425cd33d86965bf8ad138c0c5697a2e4adb85731b064f7b6aaf45567969b1bc43f96d529eaec8759b3069deee35b3f7103a0a63c26ca
         | 
    
        data/lib/bake/options/options.rb
    CHANGED
    
    | @@ -7,6 +7,7 @@ require 'bake/options/usage' | |
| 7 7 | 
             
            require 'bake/options/create'
         | 
| 8 8 | 
             
            require 'common/options/finder'
         | 
| 9 9 | 
             
            require 'common/root'
         | 
| 10 | 
            +
            require 'common/crc32'
         | 
| 10 11 |  | 
| 11 12 | 
             
            module Bake
         | 
| 12 13 |  | 
| @@ -22,7 +23,7 @@ module Bake | |
| 22 23 | 
             
                attr_reader :main_dir, :project, :filename, :main_project_name, :buildDirDelimiter, :dot, :cc2j_filename # String
         | 
| 23 24 | 
             
                attr_reader :include_filter, :exclude_filter, :adapt # String List
         | 
| 24 25 | 
             
                attr_reader :conversion_info, :stopOnFirstError, :clean, :rebuild, :show_includes, :show_includes_and_defines, :projectPaths, :qac, :dry, :syncedOutput, :debug_threads, :skipBuildingLine # Boolean
         | 
| 25 | 
            -
                attr_reader :linkOnly, :compileOnly, :no_autodir, :clobber, :docu, :debug, :prepro, :oldLinkOrder, :prebuild, :printTime, :json, :wparse # Boolean
         | 
| 26 | 
            +
                attr_reader :linkOnly, :compileOnly, :no_autodir, :clobber, :docu, :debug, :prepro, :oldLinkOrder, :prebuild, :printTime, :json, :wparse, :caseSensitivityCheck # Boolean
         | 
| 26 27 | 
             
                attr_reader :threads, :socket # Fixnum
         | 
| 27 28 | 
             
                attr_reader :vars, :include_filter_args # map
         | 
| 28 29 | 
             
                attr_reader :verbose
         | 
| @@ -34,6 +35,7 @@ module Bake | |
| 34 35 | 
             
                def initialize(argv)
         | 
| 35 36 | 
             
                  super(argv)
         | 
| 36 37 |  | 
| 38 | 
            +
                  @caseSensitivityCheck = Bake::Utils::OS.windows?
         | 
| 37 39 | 
             
                  @skipBuildingLine = false
         | 
| 38 40 | 
             
                  @debug_threads = false
         | 
| 39 41 | 
             
                  @dry = false
         | 
| @@ -115,6 +117,7 @@ module Bake | |
| 115 117 | 
             
                  add_option(["--debug-threads"                              ], lambda {     @debug_threads = true                   })
         | 
| 116 118 | 
             
                  add_option(["--set"                                        ], lambda { |x| set_set(x)                              })
         | 
| 117 119 | 
             
                  add_option(["-nb"                                          ], lambda {     @skipBuildingLine = true                })
         | 
| 120 | 
            +
                  add_option(["--no-case-check"                              ], lambda {     @caseSensitivityCheck = false           })
         | 
| 118 121 |  | 
| 119 122 | 
             
                  add_option(["--clobber"                                    ], lambda {     @clobber = true; @clean = true          })
         | 
| 120 123 | 
             
                  add_option(["--ignore-cache",       "--ignore_cache"       ], lambda {     @nocache = true                         })
         | 
| @@ -141,6 +144,8 @@ module Bake | |
| 141 144 |  | 
| 142 145 | 
             
                  add_option(["--dry"                                        ], lambda {     @dry = true                             })
         | 
| 143 146 |  | 
| 147 | 
            +
                  add_option(["--crc32"                                      ], lambda { |x| CRC32.printAndExit(x)                   })
         | 
| 148 | 
            +
             | 
| 144 149 | 
             
                  add_option(["--version"                                    ], lambda {     Bake::Usage.version                     })
         | 
| 145 150 | 
             
                  add_option(["--list",               "--show_configs"       ], lambda {     @showConfigs = true                     })
         | 
| 146 151 | 
             
                  add_option(["--compilation-db"                             ], lambda { |x,dummy| @cc2j_filename = (x ? x : "compilation-db.json" )})
         | 
    
        data/lib/bake/options/usage.rb
    CHANGED
    
    | @@ -30,6 +30,7 @@ module Bake | |
| 30 30 | 
             
                  puts " --link-only              Only link executables - doesn't update objects and archives or start PreSteps and PostSteps."
         | 
| 31 31 | 
             
                  puts "                          Forces executables to be relinked."
         | 
| 32 32 | 
             
                  puts " --compile-only           Only the compile steps are executed, equivalent to -f '.'"
         | 
| 33 | 
            +
                  puts " --no-case-check          Disables case-sensitivity-check of included header files (only relative paths on Windows are checked)."
         | 
| 33 34 | 
             
                  puts " --generate-doc           Builds docu instead of compiling sources."
         | 
| 34 35 | 
             
                  puts " --ignore-cache           Rereads the original meta files - usefull if workspace structure has been changed."
         | 
| 35 36 | 
             
                  puts " -j <num>                 Set NUMBER of parallel compiled files (default is 8)."
         | 
| @@ -57,6 +58,7 @@ module Bake | |
| 57 58 | 
             
                  puts " --compilation-db [<fn>]  Writes compilation information into filename fn in json format, default for fn is compilation-db.json"
         | 
| 58 59 | 
             
                  puts " --create exe|lib|custom  Creates a project with exe, lib or custom template"
         | 
| 59 60 | 
             
                  puts " --nb                     Suppresses the lines \"**** Building x of y: name (config) ****"
         | 
| 61 | 
            +
                  puts " --crc32 <string>         Calulates the CRC32 of string (0x4C11DB7, init 0, final xor 0, input and result not reflected), used for Uid variable calculation"
         | 
| 60 62 | 
             
                  puts " --link-2-17              DEPRECATED: Using link order of libraries which was used until bake 2.17"
         | 
| 61 63 | 
             
                  puts " --build_                 DEPRECATED: build directories will be build_<name> instead of build/<name>"
         | 
| 62 64 | 
             
                  puts " --version                Print version."
         | 
    
        data/lib/bake/subst.rb
    CHANGED
    
    | @@ -188,6 +188,16 @@ module Bake | |
| 188 188 | 
             
                     substStr << @@configName
         | 
| 189 189 | 
             
                    elsif var == "ToolchainName" and defined?@@toolchainName
         | 
| 190 190 | 
             
                     substStr << @@toolchainName
         | 
| 191 | 
            +
            #        elsif var == "PathToMainProject"
         | 
| 192 | 
            +
            #          substStr << File.rel_from_to_project(@@config.parent.get_project_dir, Bake.options.main_dir, false)
         | 
| 193 | 
            +
            #        elsif var == "PathToMainProjectSanitized"
         | 
| 194 | 
            +
            #          path = File.rel_from_to_project(@@config.parent.get_project_dir, Bake.options.main_dir, false).gsub(/\.\./,"__").gsub(/:/,"")
         | 
| 195 | 
            +
            #          path = path[1..-1] if path.start_with?("/")
         | 
| 196 | 
            +
            #          substStr << path
         | 
| 197 | 
            +
            #        elsif var == "UidNoMainConfigName"
         | 
| 198 | 
            +
            #          substStr << CRC32.calc(File.rel_from_to_project(@@config.parent.get_project_dir, Bake.options.main_dir, false))
         | 
| 199 | 
            +
                    elsif var == "Uid"
         | 
| 200 | 
            +
                      substStr << CRC32.calc(File.rel_from_to_project(@@config.parent.get_project_dir, Bake.options.main_dir, false) + "," + Bake.options.build_config)
         | 
| 191 201 | 
             
                    elsif var == "ProjectName"
         | 
| 192 202 | 
             
                      substStr << @@projName
         | 
| 193 203 | 
             
                    elsif var == "FilterArguments" or (splittedVar.length == 2 and splittedVar[0] == "FilterArguments")
         | 
    
        data/lib/bake/toolchain/gcc.rb
    CHANGED
    
    | @@ -15,7 +15,7 @@ module Bake | |
| 15 15 | 
             
                  gccVersionStr = getGccRawVersionInfo()
         | 
| 16 16 | 
             
                  splitted = gccVersionStr.split("\n")[0].split(" ")
         | 
| 17 17 | 
             
                  vSubstr = splitted[splitted.length-1]
         | 
| 18 | 
            -
                  vSubstr = splitted[splitted.length-2] if ((!vSubstr.include?".") && (splitted.length >= 2))
         | 
| 18 | 
            +
                  vSubstr = splitted[splitted.length-2] if ((!vSubstr.include?(".") || vSubstr.match(/[a-z\-]/)) && (splitted.length >= 2))
         | 
| 19 19 | 
             
                  return vSubstr.split(".").map { |v| v.to_i }
         | 
| 20 20 | 
             
                end
         | 
| 21 21 |  | 
    
        data/lib/blocks/block.rb
    CHANGED
    
    | @@ -201,14 +201,14 @@ module Bake | |
| 201 201 | 
             
                      return true if @config.step
         | 
| 202 202 | 
             
                    else
         | 
| 203 203 | 
             
                      return true if @config.files.length > 0
         | 
| 204 | 
            -
             | 
| 204 | 
            +
                    end
         | 
| 205 | 
            +
                    if ((@config.startupSteps && @config.startupSteps.step.length > 0) ||
         | 
| 205 206 | 
             
                      (@config.preSteps && @config.preSteps.step.length > 0) ||
         | 
| 206 207 | 
             
                      (@config.postSteps && @config.postSteps.step.length > 0) ||
         | 
| 207 208 | 
             
                      (@config.exitSteps && @config.exitSteps.step.length > 0) ||
         | 
| 208 209 | 
             
                      (@config.cleanSteps && @config.cleanSteps.step.length > 0) ||
         | 
| 209 210 | 
             
                      (@config.preSteps && @config.preSteps.step.length > 0))
         | 
| 210 211 | 
             
                        return true
         | 
| 211 | 
            -
                      end
         | 
| 212 212 | 
             
                    end
         | 
| 213 213 | 
             
                    return false
         | 
| 214 214 | 
             
                  end
         | 
| @@ -280,7 +280,7 @@ module Bake | |
| 280 280 | 
             
                    depResult = true
         | 
| 281 281 | 
             
                    dependencies.each do |dep|
         | 
| 282 282 | 
             
                      depResult = (ALL_BLOCKS[dep].send(method) and depResult)
         | 
| 283 | 
            -
                      break if  | 
| 283 | 
            +
                      break if (!depResult) && Bake.options.stopOnFirstError
         | 
| 284 284 | 
             
                    end
         | 
| 285 285 | 
             
                    return depResult
         | 
| 286 286 | 
             
                  end
         | 
| @@ -303,10 +303,9 @@ module Bake | |
| 303 303 | 
             
                      return if blockAbort?(true)
         | 
| 304 304 |  | 
| 305 305 | 
             
                      tmpstdout = Thread.current[:tmpStdout].nil? ? nil : Thread.current[:tmpStdout].dup
         | 
| 306 | 
            -
                      @@threads << Thread.new(Thread.current[:stdout],  | 
| 306 | 
            +
                      @@threads << Thread.new(Thread.current[:stdout], tmpstdout, steps) { |outStr, tmpStdout, steps|
         | 
| 307 307 | 
             
                        STDOUT.puts "DEBUG_THREADS: Started: #{Thread.current.object_id} (#{@projectName}, #{@config.name})" if Bake.options.debug_threads
         | 
| 308 308 | 
             
                        Thread.current[:stdout] = outStr
         | 
| 309 | 
            -
                        Thread.current[:errorStream] = errStr
         | 
| 310 309 | 
             
                        Thread.current[:tmpStdout] = tmpStdout
         | 
| 311 310 | 
             
                        Thread.current[:steps] = steps
         | 
| 312 311 | 
             
                        exceptionOccured = false
         | 
| @@ -352,11 +351,9 @@ module Bake | |
| 352 351 | 
             
                  def callSteps(method)
         | 
| 353 352 | 
             
                    @config.writeEnvVars()
         | 
| 354 353 | 
             
                    Thread.current[:lastCommand] = nil
         | 
| 355 | 
            -
             | 
| 356 354 | 
             
                    allSteps = (preSteps + mainSteps + postSteps)
         | 
| 357 355 |  | 
| 358 356 | 
             
                    # check if we have to delay the output (if the last step of this block is not in a thread)
         | 
| 359 | 
            -
                    # todo: sync output if commandline and makefile!!!!!!!!!!!!!!!!!!!
         | 
| 360 357 | 
             
                    @outputStep = nil
         | 
| 361 358 | 
             
                    allSteps.each { |step| @outputStep = independent?(method, step) ? step : nil }
         | 
| 362 359 | 
             
                    while !allSteps.empty?
         | 
| @@ -379,13 +376,14 @@ module Bake | |
| 379 376 | 
             
                               break if blockAbort?(@result)
         | 
| 380 377 | 
             
                             end
         | 
| 381 378 | 
             
                           ensure
         | 
| 382 | 
            -
                             SyncOut.stopStream( | 
| 379 | 
            +
                             SyncOut.stopStream() if lastStep == @outputStep if Bake.options.syncedOutput
         | 
| 383 380 | 
             
                           end
         | 
| 384 381 | 
             
                         }
         | 
| 385 382 | 
             
                      else
         | 
| 386 383 | 
             
                        step = allSteps.shift
         | 
| 387 384 | 
             
                        Blocks::Block::waitForAllThreads()
         | 
| 388 385 | 
             
                        @result = executeStep(step, method) if @result
         | 
| 386 | 
            +
                        @outputStep = nil if !@result && blockAbort?(@result)
         | 
| 389 387 | 
             
                      end
         | 
| 390 388 | 
             
                      return @result if blockAbort?(@result)
         | 
| 391 389 | 
             
                    end
         | 
| @@ -412,7 +410,6 @@ module Bake | |
| 412 410 | 
             
                    return @result && depResult if blockAbort?(depResult)
         | 
| 413 411 |  | 
| 414 412 | 
             
                    Bake::IDEInterface.instance.set_build_info(@projectName, @configName)
         | 
| 415 | 
            -
             | 
| 416 413 | 
             
                    begin
         | 
| 417 414 | 
             
                      SyncOut.mutex.synchronize do
         | 
| 418 415 | 
             
                        @outputStep = nil
         | 
| @@ -440,14 +437,14 @@ module Bake | |
| 440 437 | 
             
                    ensure
         | 
| 441 438 | 
             
                      if Bake.options.syncedOutput
         | 
| 442 439 | 
             
                        if !@outputStep
         | 
| 443 | 
            -
                          SyncOut.stopStream( | 
| 440 | 
            +
                          SyncOut.stopStream()
         | 
| 444 441 | 
             
                        else
         | 
| 445 442 | 
             
                          SyncOut.discardStreams()
         | 
| 446 443 | 
             
                        end
         | 
| 447 444 | 
             
                      end
         | 
| 448 445 | 
             
                    end
         | 
| 449 446 |  | 
| 450 | 
            -
                    return (depResult && @result) | 
| 447 | 
            +
                    return (depResult && @result)
         | 
| 451 448 | 
             
                  end
         | 
| 452 449 |  | 
| 453 450 | 
             
                  def clean
         | 
    
        data/lib/blocks/compile.rb
    CHANGED
    
    | @@ -7,6 +7,41 @@ require 'common/utils' | |
| 7 7 | 
             
            require 'bake/toolchain/colorizing_formatter'
         | 
| 8 8 | 
             
            require 'bake/config/loader'
         | 
| 9 9 |  | 
| 10 | 
            +
             | 
| 11 | 
            +
            begin
         | 
| 12 | 
            +
            require 'Win32API'
         | 
| 13 | 
            +
             | 
| 14 | 
            +
            def longname short_name
         | 
| 15 | 
            +
              max_path = 1024
         | 
| 16 | 
            +
              long_name = " " * max_path
         | 
| 17 | 
            +
              lfn_size = Win32API.new("kernel32", "GetLongPathName", ['P','P','L'],'L').call(short_name, long_name, max_path)
         | 
| 18 | 
            +
              return long_name[0..lfn_size-1]
         | 
| 19 | 
            +
            end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
            def shortname long_name
         | 
| 22 | 
            +
              max_path = 1024
         | 
| 23 | 
            +
              short_name = " " * max_path
         | 
| 24 | 
            +
              lfn_size = Win32API.new("kernel32", "GetShortPathName", ['P','P','L'],'L').call(long_name, short_name, max_path)
         | 
| 25 | 
            +
              return short_name[0..lfn_size-1]
         | 
| 26 | 
            +
            end
         | 
| 27 | 
            +
             | 
| 28 | 
            +
            def realname file
         | 
| 29 | 
            +
                longname(shortname(file))
         | 
| 30 | 
            +
            end
         | 
| 31 | 
            +
             | 
| 32 | 
            +
            rescue LoadError
         | 
| 33 | 
            +
             | 
| 34 | 
            +
            def realname file
         | 
| 35 | 
            +
                file
         | 
| 36 | 
            +
            end
         | 
| 37 | 
            +
             | 
| 38 | 
            +
            end
         | 
| 39 | 
            +
             | 
| 40 | 
            +
             | 
| 41 | 
            +
             | 
| 42 | 
            +
             | 
| 43 | 
            +
             | 
| 44 | 
            +
             | 
| 10 45 | 
             
            module Bake
         | 
| 11 46 |  | 
| 12 47 | 
             
              module Blocks
         | 
| @@ -220,7 +255,7 @@ module Bake | |
| 220 255 | 
             
                        Dir.mutex.synchronize do
         | 
| 221 256 | 
             
                          Dir.chdir(@projectDir) do
         | 
| 222 257 | 
             
                            incList = Compile.read_depfile(dep_filename, @projectDir, @block.tcs[:COMPILER][:DEP_FILE_SINGLE_LINE]) if incList.nil?
         | 
| 223 | 
            -
                            Compile.write_depfile(incList, dep_filename_conv, @projectDir)
         | 
| 258 | 
            +
                            Compile.write_depfile(source, incList, dep_filename_conv, @projectDir)
         | 
| 224 259 | 
             
                          end
         | 
| 225 260 | 
             
                        end
         | 
| 226 261 |  | 
| @@ -274,18 +309,34 @@ module Bake | |
| 274 309 | 
             
                  end
         | 
| 275 310 |  | 
| 276 311 | 
             
                  # todo: move to toolchain util file
         | 
| 277 | 
            -
                  def self.write_depfile(deps, dep_filename_conv, projDir)
         | 
| 312 | 
            +
                  def self.write_depfile(source, deps, dep_filename_conv, projDir)
         | 
| 278 313 | 
             
                    if deps && !Bake.options.dry
         | 
| 314 | 
            +
                      wrongCase = false
         | 
| 279 315 | 
             
                      begin
         | 
| 280 316 | 
             
                        File.open(dep_filename_conv, 'wb') do |f|
         | 
| 281 317 | 
             
                          deps.each do |dep|
         | 
| 282 318 | 
             
                            f.puts(dep)
         | 
| 319 | 
            +
             | 
| 320 | 
            +
                            if (Bake.options.caseSensitivityCheck)
         | 
| 321 | 
            +
                              if dep.length<2 || dep[1] != ":"
         | 
| 322 | 
            +
                                real = realname(dep)
         | 
| 323 | 
            +
                                if dep != real && dep.upcase == real.upcase
         | 
| 324 | 
            +
                                  Bake.formatter.printError("Case sensitivity error in #{source}:\n  included: #{dep}\n  realname: #{real}")
         | 
| 325 | 
            +
                                  wrongCase = true
         | 
| 326 | 
            +
                                end
         | 
| 327 | 
            +
                              end
         | 
| 328 | 
            +
                            end
         | 
| 329 | 
            +
             | 
| 283 330 | 
             
                          end
         | 
| 284 331 | 
             
                        end
         | 
| 285 332 | 
             
                      rescue Exception
         | 
| 286 333 | 
             
                        Bake.formatter.printWarning("Could not write '#{dep_filename_conv}'", projDir)
         | 
| 287 334 | 
             
                        return nil
         | 
| 288 335 | 
             
                      end
         | 
| 336 | 
            +
                      if wrongCase
         | 
| 337 | 
            +
                        FileUtils.rm_f(dep_filename_conv)
         | 
| 338 | 
            +
                        raise SystemCommandFailed.new
         | 
| 339 | 
            +
                      end
         | 
| 289 340 | 
             
                    end
         | 
| 290 341 | 
             
                  end
         | 
| 291 342 |  | 
| @@ -301,12 +352,11 @@ module Bake | |
| 301 352 | 
             
                      compileJobs = Multithread::Jobs.new(@source_files) do |jobs|
         | 
| 302 353 | 
             
                        while source = jobs.get_next_or_nil do
         | 
| 303 354 |  | 
| 304 | 
            -
                          if ( | 
| 355 | 
            +
                          if (jobs.failed && Bake.options.stopOnFirstError) or Bake::IDEInterface.instance.get_abort
         | 
| 305 356 | 
             
                            break
         | 
| 306 357 | 
             
                          end
         | 
| 307 358 |  | 
| 308 359 | 
             
                          SyncOut.startStream()
         | 
| 309 | 
            -
                          SyncOut.reset_errors()
         | 
| 310 360 | 
             
                          begin
         | 
| 311 361 | 
             
                            Thread.current[:filelist] = Set.new if Bake.options.filelist
         | 
| 312 362 | 
             
                            Thread.current[:lastCommand] = nil
         | 
| @@ -326,8 +376,7 @@ module Bake | |
| 326 376 |  | 
| 327 377 | 
             
                            jobs.set_failed if not result
         | 
| 328 378 | 
             
                          ensure
         | 
| 329 | 
            -
                            SyncOut.stopStream( | 
| 330 | 
            -
                            SyncOut.flush_errors()
         | 
| 379 | 
            +
                            SyncOut.stopStream()
         | 
| 331 380 | 
             
                          end
         | 
| 332 381 | 
             
                          self.mutex.synchronize do
         | 
| 333 382 | 
             
                            fileListBlock.merge(Thread.current[:filelist]) if Bake.options.filelist
         | 
| @@ -417,22 +466,22 @@ module Bake | |
| 417 466 | 
             
                    @source_files = []
         | 
| 418 467 |  | 
| 419 468 | 
             
                    exclude_files = Set.new
         | 
| 420 | 
            -
                    @config.excludeFiles.each do | | 
| 421 | 
            -
                      Dir.glob_dir( | 
| 469 | 
            +
                    @config.excludeFiles.each do |pr|
         | 
| 470 | 
            +
                      Dir.glob_dir(pr.name, @projectDir).each {|f| exclude_files << f}
         | 
| 422 471 | 
             
                    end
         | 
| 423 472 |  | 
| 424 473 | 
             
                    source_files = Set.new
         | 
| 425 474 | 
             
                    @config.files.each do |sources|
         | 
| 426 | 
            -
                       | 
| 427 | 
            -
                       | 
| 475 | 
            +
                      pr = sources.name
         | 
| 476 | 
            +
                      pr = pr[2..-1] if pr.start_with?"./"
         | 
| 428 477 |  | 
| 429 | 
            -
                      res = Dir.glob_dir( | 
| 478 | 
            +
                      res = Dir.glob_dir(pr, @projectDir).sort
         | 
| 430 479 | 
             
                      if res.length == 0 and cleaning == false
         | 
| 431 | 
            -
                        if not  | 
| 432 | 
            -
                          Bake.formatter.printError("Source file '#{ | 
| 480 | 
            +
                        if not pr.include?"*" and not pr.include?"?"
         | 
| 481 | 
            +
                          Bake.formatter.printError("Source file '#{pr}' not found", sources)
         | 
| 433 482 | 
             
                          raise SystemCommandFailed.new
         | 
| 434 483 | 
             
                        elsif Bake.options.verbose >= 1
         | 
| 435 | 
            -
                          Bake.formatter.printInfo("Source file pattern '#{ | 
| 484 | 
            +
                          Bake.formatter.printInfo("Source file pattern '#{pr}' does not match to any file", sources)
         | 
| 436 485 | 
             
                        end
         | 
| 437 486 | 
             
                      end
         | 
| 438 487 | 
             
                      res.each do |f|
         | 
    
        data/lib/blocks/library.rb
    CHANGED
    
    
    
        data/lib/common/crc32.rb
    ADDED
    
    | @@ -0,0 +1,57 @@ | |
| 1 | 
            +
            require 'common/exit_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Bake
         | 
| 4 | 
            +
             | 
| 5 | 
            +
              class CRC32
         | 
| 6 | 
            +
                TABLE = [
         | 
| 7 | 
            +
                    0x00000000, 0x04C11DB7, 0x09823B6E, 0x0D4326D9, 0x130476DC, 0x17C56B6B, 0x1A864DB2, 0x1E475005,
         | 
| 8 | 
            +
                    0x2608EDB8, 0x22C9F00F, 0x2F8AD6D6, 0x2B4BCB61, 0x350C9B64, 0x31CD86D3, 0x3C8EA00A, 0x384FBDBD,
         | 
| 9 | 
            +
                    0x4C11DB70, 0x48D0C6C7, 0x4593E01E, 0x4152FDA9, 0x5F15ADAC, 0x5BD4B01B, 0x569796C2, 0x52568B75,
         | 
| 10 | 
            +
                    0x6A1936C8, 0x6ED82B7F, 0x639B0DA6, 0x675A1011, 0x791D4014, 0x7DDC5DA3, 0x709F7B7A, 0x745E66CD,
         | 
| 11 | 
            +
                    0x9823B6E0, 0x9CE2AB57, 0x91A18D8E, 0x95609039, 0x8B27C03C, 0x8FE6DD8B, 0x82A5FB52, 0x8664E6E5,
         | 
| 12 | 
            +
                    0xBE2B5B58, 0xBAEA46EF, 0xB7A96036, 0xB3687D81, 0xAD2F2D84, 0xA9EE3033, 0xA4AD16EA, 0xA06C0B5D,
         | 
| 13 | 
            +
                    0xD4326D90, 0xD0F37027, 0xDDB056FE, 0xD9714B49, 0xC7361B4C, 0xC3F706FB, 0xCEB42022, 0xCA753D95,
         | 
| 14 | 
            +
                    0xF23A8028, 0xF6FB9D9F, 0xFBB8BB46, 0xFF79A6F1, 0xE13EF6F4, 0xE5FFEB43, 0xE8BCCD9A, 0xEC7DD02D,
         | 
| 15 | 
            +
                    0x34867077, 0x30476DC0, 0x3D044B19, 0x39C556AE, 0x278206AB, 0x23431B1C, 0x2E003DC5, 0x2AC12072,
         | 
| 16 | 
            +
                    0x128E9DCF, 0x164F8078, 0x1B0CA6A1, 0x1FCDBB16, 0x018AEB13, 0x054BF6A4, 0x0808D07D, 0x0CC9CDCA,
         | 
| 17 | 
            +
                    0x7897AB07, 0x7C56B6B0, 0x71159069, 0x75D48DDE, 0x6B93DDDB, 0x6F52C06C, 0x6211E6B5, 0x66D0FB02,
         | 
| 18 | 
            +
                    0x5E9F46BF, 0x5A5E5B08, 0x571D7DD1, 0x53DC6066, 0x4D9B3063, 0x495A2DD4, 0x44190B0D, 0x40D816BA,
         | 
| 19 | 
            +
                    0xACA5C697, 0xA864DB20, 0xA527FDF9, 0xA1E6E04E, 0xBFA1B04B, 0xBB60ADFC, 0xB6238B25, 0xB2E29692,
         | 
| 20 | 
            +
                    0x8AAD2B2F, 0x8E6C3698, 0x832F1041, 0x87EE0DF6, 0x99A95DF3, 0x9D684044, 0x902B669D, 0x94EA7B2A,
         | 
| 21 | 
            +
                    0xE0B41DE7, 0xE4750050, 0xE9362689, 0xEDF73B3E, 0xF3B06B3B, 0xF771768C, 0xFA325055, 0xFEF34DE2,
         | 
| 22 | 
            +
                    0xC6BCF05F, 0xC27DEDE8, 0xCF3ECB31, 0xCBFFD686, 0xD5B88683, 0xD1799B34, 0xDC3ABDED, 0xD8FBA05A,
         | 
| 23 | 
            +
                    0x690CE0EE, 0x6DCDFD59, 0x608EDB80, 0x644FC637, 0x7A089632, 0x7EC98B85, 0x738AAD5C, 0x774BB0EB,
         | 
| 24 | 
            +
                    0x4F040D56, 0x4BC510E1, 0x46863638, 0x42472B8F, 0x5C007B8A, 0x58C1663D, 0x558240E4, 0x51435D53,
         | 
| 25 | 
            +
                    0x251D3B9E, 0x21DC2629, 0x2C9F00F0, 0x285E1D47, 0x36194D42, 0x32D850F5, 0x3F9B762C, 0x3B5A6B9B,
         | 
| 26 | 
            +
                    0x0315D626, 0x07D4CB91, 0x0A97ED48, 0x0E56F0FF, 0x1011A0FA, 0x14D0BD4D, 0x19939B94, 0x1D528623,
         | 
| 27 | 
            +
                    0xF12F560E, 0xF5EE4BB9, 0xF8AD6D60, 0xFC6C70D7, 0xE22B20D2, 0xE6EA3D65, 0xEBA91BBC, 0xEF68060B,
         | 
| 28 | 
            +
                    0xD727BBB6, 0xD3E6A601, 0xDEA580D8, 0xDA649D6F, 0xC423CD6A, 0xC0E2D0DD, 0xCDA1F604, 0xC960EBB3,
         | 
| 29 | 
            +
                    0xBD3E8D7E, 0xB9FF90C9, 0xB4BCB610, 0xB07DABA7, 0xAE3AFBA2, 0xAAFBE615, 0xA7B8C0CC, 0xA379DD7B,
         | 
| 30 | 
            +
                    0x9B3660C6, 0x9FF77D71, 0x92B45BA8, 0x9675461F, 0x8832161A, 0x8CF30BAD, 0x81B02D74, 0x857130C3,
         | 
| 31 | 
            +
                    0x5D8A9099, 0x594B8D2E, 0x5408ABF7, 0x50C9B640, 0x4E8EE645, 0x4A4FFBF2, 0x470CDD2B, 0x43CDC09C,
         | 
| 32 | 
            +
                    0x7B827D21, 0x7F436096, 0x7200464F, 0x76C15BF8, 0x68860BFD, 0x6C47164A, 0x61043093, 0x65C52D24,
         | 
| 33 | 
            +
                    0x119B4BE9, 0x155A565E, 0x18197087, 0x1CD86D30, 0x029F3D35, 0x065E2082, 0x0B1D065B, 0x0FDC1BEC,
         | 
| 34 | 
            +
                    0x3793A651, 0x3352BBE6, 0x3E119D3F, 0x3AD08088, 0x2497D08D, 0x2056CD3A, 0x2D15EBE3, 0x29D4F654,
         | 
| 35 | 
            +
                    0xC5A92679, 0xC1683BCE, 0xCC2B1D17, 0xC8EA00A0, 0xD6AD50A5, 0xD26C4D12, 0xDF2F6BCB, 0xDBEE767C,
         | 
| 36 | 
            +
                    0xE3A1CBC1, 0xE760D676, 0xEA23F0AF, 0xEEE2ED18, 0xF0A5BD1D, 0xF464A0AA, 0xF9278673, 0xFDE69BC4,
         | 
| 37 | 
            +
                    0x89B8FD09, 0x8D79E0BE, 0x803AC667, 0x84FBDBD0, 0x9ABC8BD5, 0x9E7D9662, 0x933EB0BB, 0x97FFAD0C,
         | 
| 38 | 
            +
                    0xAFB010B1, 0xAB710D06, 0xA6322BDF, 0xA2F33668, 0xBCB4666D, 0xB8757BDA, 0xB5365D03, 0xB1F740B4
         | 
| 39 | 
            +
                ].freeze()
         | 
| 40 | 
            +
             | 
| 41 | 
            +
                def self.calc(str)
         | 
| 42 | 
            +
                  res = 0
         | 
| 43 | 
            +
                  str.each_char do |c|
         | 
| 44 | 
            +
                    lookupTableIndex = c[0].ord ^ (res >> 24)
         | 
| 45 | 
            +
                    res = TABLE[lookupTableIndex] ^ (res << 8) % 0x100000000
         | 
| 46 | 
            +
                  end
         | 
| 47 | 
            +
                  return sprintf("%08X", res)
         | 
| 48 | 
            +
                end
         | 
| 49 | 
            +
             | 
| 50 | 
            +
                def self.printAndExit(str)
         | 
| 51 | 
            +
                  puts calc(str)
         | 
| 52 | 
            +
                  ExitHelper.exit(0)
         | 
| 53 | 
            +
                end
         | 
| 54 | 
            +
             | 
| 55 | 
            +
              end
         | 
| 56 | 
            +
             | 
| 57 | 
            +
            end
         | 
    
        data/lib/common/ext/stdout.rb
    CHANGED
    
    | @@ -97,42 +97,29 @@ class SyncOut | |
| 97 97 | 
             
                end
         | 
| 98 98 | 
             
              end
         | 
| 99 99 |  | 
| 100 | 
            -
              def self.stopStream( | 
| 101 | 
            -
                 | 
| 102 | 
            -
             | 
| 103 | 
            -
             | 
| 104 | 
            -
             | 
| 105 | 
            -
             | 
| 106 | 
            -
             | 
| 107 | 
            -
             | 
| 108 | 
            -
             | 
| 109 | 
            -
                     | 
| 110 | 
            -
             | 
| 111 | 
            -
                      puts s.string
         | 
| 112 | 
            -
                    end
         | 
| 100 | 
            +
              def self.stopStream()
         | 
| 101 | 
            +
                mutex.synchronize do
         | 
| 102 | 
            +
             | 
| 103 | 
            +
                  s = Thread.current[:stdout]
         | 
| 104 | 
            +
                  return if s.nil?
         | 
| 105 | 
            +
                  Thread.current[:stdout] = Thread.current[:tmpStdout] ? Thread.current[:tmpStdout].pop : nil
         | 
| 106 | 
            +
             | 
| 107 | 
            +
                  if s.string.length > 0
         | 
| 108 | 
            +
                    convertConfNum(s.string)
         | 
| 109 | 
            +
                    puts s.string
         | 
| 110 | 
            +
                    s.reopen("")
         | 
| 113 111 | 
             
                  end
         | 
| 114 | 
            -
             | 
| 112 | 
            +
             | 
| 115 113 | 
             
                end
         | 
| 114 | 
            +
             | 
| 116 115 | 
             
              end
         | 
| 117 116 |  | 
| 118 117 |  | 
| 119 118 | 
             
              def self.discardStreams()
         | 
| 120 | 
            -
                 | 
| 121 | 
            -
             | 
| 122 | 
            -
             | 
| 123 | 
            -
              def self.flush_errors
         | 
| 124 | 
            -
                if !Thread.current[:errorStream].empty?
         | 
| 125 | 
            -
                  mutex.synchronize do
         | 
| 126 | 
            -
                    convertConfNum(Thread.current[:errorStream])
         | 
| 127 | 
            -
                    puts Thread.current[:errorStream]
         | 
| 128 | 
            -
                    reset_errors
         | 
| 129 | 
            -
                  end
         | 
| 119 | 
            +
                mutex.synchronize do
         | 
| 120 | 
            +
                  Thread.current[:stdout] = Thread.current[:tmpStdout] ? Thread.current[:tmpStdout].pop : nil
         | 
| 130 121 | 
             
                end
         | 
| 131 122 | 
             
              end
         | 
| 132 123 |  | 
| 133 | 
            -
              def self.reset_errors
         | 
| 134 | 
            -
                Thread.current[:errorStream] = ""
         | 
| 135 | 
            -
              end
         | 
| 136 | 
            -
             | 
| 137 124 | 
             
            end
         | 
| 138 125 |  | 
    
        data/lib/common/version.rb
    CHANGED
    
    
    
        data/lib/multithread/job.rb
    CHANGED
    
    | @@ -24,9 +24,8 @@ module Bake | |
| 24 24 | 
             
                    @jobs = jobs
         | 
| 25 25 | 
             
                    @threads = []
         | 
| 26 26 | 
             
                    nr_of_threads.times do
         | 
| 27 | 
            -
                      @threads << ::Thread.new(Thread.current[:stdout] | 
| 27 | 
            +
                      @threads << ::Thread.new(Thread.current[:stdout]) do |outStr|
         | 
| 28 28 | 
             
                        Thread.current[:stdout] = outStr
         | 
| 29 | 
            -
                        Thread.current[:errorStream] = errStr
         | 
| 30 29 | 
             
                        begin
         | 
| 31 30 | 
             
                          Jobs.incThread()
         | 
| 32 31 | 
             
                          block.call(self)
         | 
    
        data/lib/tocxx.rb
    CHANGED
    
    | @@ -371,7 +371,6 @@ module Bake | |
| 371 371 | 
             
                  result = true
         | 
| 372 372 | 
             
                  startBlocks.each do |block|
         | 
| 373 373 | 
             
                    begin
         | 
| 374 | 
            -
                      SyncOut.reset_errors
         | 
| 375 374 | 
             
                      result = callBlock(block, method) && result
         | 
| 376 375 | 
             
                    ensure
         | 
| 377 376 | 
             
                      Blocks::Block::waitForAllThreads()
         | 
| @@ -554,7 +553,6 @@ module Bake | |
| 554 553 | 
             
                    rescue AbortException
         | 
| 555 554 | 
             
                      ideAbort = true
         | 
| 556 555 | 
             
                    end
         | 
| 557 | 
            -
                    SyncOut.flush_errors
         | 
| 558 556 | 
             
                    result = callBlocks(startBlocks, :exits, true) && result
         | 
| 559 557 |  | 
| 560 558 | 
             
                    if ideAbort || Bake::IDEInterface.instance.get_abort
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: bake-toolkit
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 2. | 
| 4 | 
            +
              version: 2.44.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Alexander Schaal
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2018-02- | 
| 11 | 
            +
            date: 2018-02-26 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rtext
         | 
| @@ -225,6 +225,7 @@ files: | |
| 225 225 | 
             
            - lib/blocks/showIncludes.rb
         | 
| 226 226 | 
             
            - lib/common/abortException.rb
         | 
| 227 227 | 
             
            - lib/common/cleanup.rb
         | 
| 228 | 
            +
            - lib/common/crc32.rb
         | 
| 228 229 | 
             
            - lib/common/exit_helper.rb
         | 
| 229 230 | 
             
            - lib/common/ext/dir.rb
         | 
| 230 231 | 
             
            - lib/common/ext/file.rb
         |