Generating premake .lua script from solution / project...

231 views
Skip to first unread message

Tarmo Pikaro

unread,
Jan 3, 2017, 5:57:23 PM1/3/17
to Premake Development
Hi !

I've now started to sketch script for parsing out .sln files, will try to expand my support to visual studio projects if possible, and
later on generate / re-generate .lua scripts out of them.

I had also an idea of making my own premake like system, but I think I will make premake compliant language syntax first - at least it's looks like easy to use.

Bit afraid that I will not be able to tackle all generation cases. solution - project model structure is not so clear.

Here is a link to svn repository: https://sourceforge.net/p/syncproj/code/HEAD/tree/

(With only source code currently)

Tarmo Pikaro

unread,
Jan 10, 2017, 1:21:47 PM1/10/17
to Premake Development
Added initial support for solution-only generation, for winvlc ( https://github.com/sunqueen/vlc-2.2.1.32-2013 )
Throws up over 2000 lines of lua script...


solution "winvlc"
    configurations { "Debug","Release" }
    platforms { "Win32" }

    externalproject "winvlc"
        location "winvlc"
        uuid "29BF0A47-AAC8-4297-9F18-710FDCB04108"
        language "C++"
        kind "SharedLib"

        dependson "libcompat"
        dependson "libvlccore"
        dependson "libvlc"

    externalproject "libcompat"
        location "libcompat"
        uuid "5E40B384-095E-452A-839D-E0B62833256F"
        language "C++"
        kind "SharedLib"

    externalproject "libvlccore"
        location "libvlccore"
        uuid "B901F7D9-104E-45C8-B58A-BD1D1083A6DA"
        language "C++"
        kind "SharedLib"

        dependson "libcompat"

    externalproject "libvlc"
        location "libvlc"
        uuid "10DEA1F9-4B2E-4ABB-B520-49B27465FDEE"
        language "C++"
        kind "SharedLib"
...

And so on...

Tarmo Pikaro

unread,
Jan 13, 2017, 5:33:54 PM1/13/17
to Premake Development
Hi !

Added initial support for solution generation using .cs script.

Syntax currently resembles quite much .lua syntax, but only written in C#. C# script interpreter (cscs.exe) is currently needed, but it's possible that I will replace that one with built-in .cs compilation.

So produced C# script looks like this:

//css_ref C:\Prototyping\Tools\syncproj\syncproj.exe
using System;         //Exception

class Script: SolutionProjectBuilder
{

  static void Main()
  {

    try {

    solution("TestWinVlc");
        configurations(  "Debug","Release" );
        platforms( "Win32" );

        externalproject("winvlc");
            location("winvlc");
            uuid("29BF0A47-AAC8-4297-9F18-710FDCB04108");
            language("C++");
            kind("SharedLib");

            dependson("libcompat");
            dependson("libvlccore");
            dependson("libvlc");

        externalproject("libcompat");
            location("libcompat");
            uuid("5E40B384-095E-452A-839D-E0B62833256F");
            language("C++");
            kind("SharedLib");

        externalproject("libvlccore");
            location("libvlccore");
            uuid("B901F7D9-104E-45C8-B58A-BD1D1083A6DA");
            language("C++");
            kind("SharedLib");

            dependson("libcompat");

...

        externalproject("swscale");
            location("plugins/video_chroma/swscale");
            uuid("09FDDE4D-3FA3-4847-AC06-FDCEAC16158F");
            language("C++");
            kind("SharedLib");

            dependson("libcompat");
            dependson("libvlccore");

    } catch( Exception ex )
    {
        ConsolePrintException(ex);
    }
  } //Main
}; //class Script

Also 2907 (.cs script) <> lua 2890 lines - so slightly bigger.

I will try now to check in depth individual project support.

Reply all
Reply to author
Forward
0 new messages