From aec3d4108f8fada41d263426b6675e46c676aea1 Mon Sep 17 00:00:00 2001 From: starkos Date: Fri, 29 Jan 2010 00:26:58 +0000 Subject: [PATCH] More work on example action template --- src/actions/example/_example.lua | 40 ++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/src/actions/example/_example.lua b/src/actions/example/_example.lua index 87780bbd..fbe89d57 100644 --- a/src/actions/example/_example.lua +++ b/src/actions/example/_example.lua @@ -28,10 +28,46 @@ -- Otherwise, this action will use the currently set operating system. -- os = "macosx", - -- Which kinds of targets this action supports. Remove those you don't. + -- Which kinds of targets this action supports; remove those you don't. valid_kinds = { "ConsoleApp", "WindowedApp", "SharedLib", "StaticLib" }, - -- Which programming languagaes this actions supports. Remove those you don't. + -- Which programming languagaes this actions supports; remove those you don't. valid_languages = { "C", "C++", "C#" }, + -- Which compiler sets this action supports; remove those you don't. The set + -- is specified with the /cc and /dotnet command-line options. You can find + -- the tool interfaces at src/tools. + valid_tools = { + cc = { "msc", "gcc", "ow" }, + dotnet = { "mono", "msnet", "pnet" }, + }, + + -- These functions will get called for each solution and project. The function + -- premake.generate() creates a file for you in the correct place, taking into + -- account any location information specified in the script. The sequence "%%" + -- will be replaced by the object name. The last parameter is the function + -- that will actually do the work of generating the file contents. + onsolution = function(sln) + premake.generate(sln, "%%.sln.txt", premake.example.solution) + end, + + onproject = function(prj) + if premake.isdotnetproject(prj) then + premake.generate(prj, "%%.csprj.txt", premake.example.project) + else + premake.generate(prj, "%%.cprj.txt", premake.example.project) + end + end, + + -- These functions are called for each solution, project, and target as part + -- of the "clean" action. They should remove any files generated by the tools. + oncleansolution = function(sln) + end, + + oncleanproject = function(prj) + end, + + oncleantarget = function(trg) + end, } +