Search code examples
luapremake

How to clean Premake generated files using 'premake5 clean' command


To create a Visual Studio solution file and its respective project files using premake, I can type premake5.exe vs2019 in cmd and it works perfectly fine.

However, when I command premake5.exe clean to remove all binaries and generated files created by premake it shows

Running action 'clean'...
** The clean action has not yet been ported

What do I have to do to make the clean action work? I'm really appreciate for your help.


Solution

  • You can roll your own in your project script.

    if _ACTION == 'clean' then
       os.rmdir('bin')
       os.rmdir('obj')
       os.remove('*.sln')
       os.remove('*.vcxproj')
       -- etc
    end