blob: 3bc5aa3b110810a8c2123e9e6e79151cec8b271f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
--
-- premake.lua
-- High-level processing functions.
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
--
--
-- Open a file for output, and call a function to actually do the writing.
-- Used by the actions to generate solution and project files.
--
-- @param obj
-- A solution or project object; will be based to the callback function.
-- @param filename
-- The output filename; see the docs for premake.project.getfilename()
-- for the expected format.
-- @param callback
-- The function responsible for writing the file, should take a solution
-- or project as a parameters.
--
function premake.generate(obj, filename, callback)
filename = premake.project.getfilename(obj, filename)
printf("Generating %s...", filename)
local f, err = io.open(filename, "wb")
if (not f) then
error(err, 0)
end
io.output(f)
callback(obj)
f:close()
end
|