# Assemble all the libraries and dlls needed for this app COPY_DLLS = [] BUNDLED_DLLS.each do | src_dll | # Chase down symlinks on *nix platform if RUBY_PLATFORM =~ /(linux|darwin)/ while File.symlink?(src_dll) src_dll = File.expand_path( File.readlink(src_dll), File.dirname(src_dll) ) end end copy_dll = File.join( BUILD_DIR, File.basename(src_dll) ) COPY_DLLS << copy_dll file copy_dll do | t | cp src_dll, copy_dll end end # Create a directory containing a copy of all the ruby libraries used by # the application ALL_RUBY_LIBS = FileList[ 'lib/**/*.rb' ] COPY_LIB_DIR = File.join(BUILD_DIR, 'lib') file COPY_LIB_DIR => [ BUILD_DIR, *ALL_RUBY_LIBS ] do | task | sh "ruby -rubygems rake/assemble_libraries.rb weft-qda.rb #{task.name}" end # Create a specially named copy of the ruby.exe COPY_RUBY_EXE = File.join( BUILD_DIR, COPY_RUBY_NAME + Config::CONFIG['EXEEXT']) file COPY_RUBY_EXE => [ BUILD_DIR ] do | task | cp THIS_RUBY_EXE, task.name end # Copy the .so to the bundling dir COPY_RUBY_DLL = File.join(BUILD_DIR, Config::CONFIG["LIBRUBY_SO"]) file COPY_RUBY_DLL => [ BUILD_DIR ] do | task | cp THIS_RUBY_DLL, task.name end # Copy weft's shared resources (icons, templates, translations) COPY_SHARE = File.join(BUILD_DIR, 'share') file COPY_SHARE do cp_r 'share', COPY_SHARE Dir.glob( File.join(COPY_SHARE, '**/.svn') ) do | dir | rm_rf dir end end BASIC_ASSEMBLAGE = [ COPY_RUBY_EXE, COPY_RUBY_DLL, COPY_LIB_DIR, COPY_SHARE, *COPY_DLLS ] case RUBY_PLATFORM when /mingw/, /mswin/ file NSIS_OUTFILE => BASIC_ASSEMBLAGE + EXTRA_ASSEMBLAGE when /darwin/ file APP_BUNDLE => BASIC_ASSEMBLAGE + EXTRA_ASSEMBLAGE when /linux/ # No packaging approach defined at present end