Class: Rake::Delphi::Dcc32Tool

Inherits:
CustomDelphiTool show all
Defined in:
lib/rake/delphi/dcc32tool.rb

Direct Known Subclasses

DccARMTool

Constant Summary

Constants inherited from CustomDelphiTool

CustomDelphiTool::BDSRegRoot, CustomDelphiTool::DelphiRegRoot, CustomDelphiTool::EDSRegRoot, CustomDelphiTool::EmbarcaderoRegRoot

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CustomDelphiTool

checkToolFailure, find, #initialize, #options, readDelphiDir, readUserOption, reinit, rootForVersion, #toolpath, #version, version4version, #versionInfoClass

Methods inherited from CustomExec

#execute, #to_system_path

Methods inherited from BasicTask

#initialize, #trace?

Constructor Details

This class inherits a constructor from Rake::Delphi::CustomDelphiTool

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env.



9
10
11
# File 'lib/rake/delphi/dcc32tool.rb', line 9

def env
  @env
end

Class Method Details

.toolNameObject



11
12
13
# File 'lib/rake/delphi/dcc32tool.rb', line 11

def self.toolName
    'bin/dcc32.exe'
end

Instance Method Details

#delphidirObject



15
16
17
# File 'lib/rake/delphi/dcc32tool.rb', line 15

def delphidir
    @@delphidir
end

#delphilibObject



19
20
21
# File 'lib/rake/delphi/dcc32tool.rb', line 19

def delphilib
    ENV['BDSLIB']
end

#init_envObject



23
24
25
# File 'lib/rake/delphi/dcc32tool.rb', line 23

def init_env
    @env ||= EnvVariables.new(self.class.rootForVersion(self.version) + '\Environment Variables', self.delphidir)
end

#readLibraryPaths(platform, platform_stripped) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/rake/delphi/dcc32tool.rb', line 27

def readLibraryPaths(platform, platform_stripped)
    Logger.trace(Logger::TRACE, 'Reading library paths for platform: ' + platform.to_s)
    warn "WARNING! You are using Delphi XE or above but no platform defined!" if ENV['DELPHI_VERSION'].to_i >= DELPHI_VERSION_XE && ! platform

    platform = platform.to_s != '' ? '\\' + platform : ''
    # platform not used for old Delphis 'SearchPath'
    libpaths = self.class.readUserOption('Library' + platform, 'Search Path', self.version).split(';') \
        | self.class.readUserOption('Library', 'SearchPath', self.version).split(';')
    Logger.trace(Logger::TRACE, 'Library paths read:')
    Logger.trace(Logger::TRACE, libpaths)
    dev = init_env
    dev['PLATFORM'] = platform_stripped if platform_stripped
    libpaths.map! do |lp|
        unless lp.to_s.empty?
            lp = dev.expand(lp)
        end
        lp
    end
    Logger.trace(Logger::TRACE, 'Library paths expanded:')
    Logger.trace(Logger::TRACE, libpaths)
    return libpaths
end