69 lines
1.8 KiB
Plaintext
Executable File
69 lines
1.8 KiB
Plaintext
Executable File
----
|
|
-- File:: zip_build.rbs
|
|
-- Description:: Build ZIP file for testing.
|
|
--
|
|
-- Author:: David Muir <david.muir@rockstarnorth.com>
|
|
-- Date:: 2 March 2011
|
|
--
|
|
|
|
-----------------------------------------------------------------------------
|
|
-- Uses
|
|
-----------------------------------------------------------------------------
|
|
-- None
|
|
|
|
-----------------------------------------------------------------------------
|
|
-- File Globals
|
|
-----------------------------------------------------------------------------
|
|
local compress = false
|
|
local in_filenames = {
|
|
"x:\\gta5\\tools\\config.xml",
|
|
"x:\\gta5\\tools\\local.xml",
|
|
"x:\\gta5\\tools\\install.bat",
|
|
}
|
|
local out_filename = "x:\\gta5\\tools\\test.zip"
|
|
local temp_dir = "c:\\temp\\"
|
|
local mount_point = "zip:/"
|
|
|
|
-----------------------------------------------------------------------------
|
|
-- Functions
|
|
-----------------------------------------------------------------------------
|
|
|
|
--
|
|
-- Build test ZIP file.
|
|
--
|
|
function build_zip( filename )
|
|
|
|
-- Build
|
|
local build_start = os.clock()
|
|
start_zip( )
|
|
|
|
--files = find_files( in_filenames )
|
|
for key, value in in_filenames do
|
|
|
|
local file = get_filename_from_path( value )
|
|
local mtime = filetime( file )
|
|
|
|
print( "File: " .. file .. ";\tmodified: " .. mtime )
|
|
add_to_zip( value, "folder_test/" .. file )
|
|
end
|
|
add_to_zip( in_filenames[1], get_filename_from_path( in_filenames[1] ) )
|
|
|
|
|
|
save_zip( out_filename )
|
|
close_zip()
|
|
local build_duration = ( os.clock() - build_start )
|
|
|
|
return build_duration
|
|
end
|
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
-- Entry-Point
|
|
-----------------------------------------------------------------------------
|
|
|
|
create_leadingpath( temp_dir .. "blah.txt" )
|
|
|
|
build_zip( out_filename )
|
|
|
|
-- zip_build.rbs
|