New build system for Qt?



  • This just stroke my... A new build system for Qt apps? :)

    @
    import QtQuick 1.0
    import QtBuild 1.0

    Build {

    Target {
        name: "myexecutable"
    
        dependencies: deps
    
        resources [
            app_resource
        ]
    
        Component.onCompleted: {
            if (isUnix) resources.append(unix_resources)
        }
    }
    
    Dependencies {
        id: deps
        QtCore {}
        QtDeclarative {}
    
        Repo {
           // Fetch dependencies from a repo (which caches artifact locally, as maven does)?
           url: "repo://com.company.comp"
           repoBase: "url to repo if not standard"
        }
    }
    
    Resource {
        id: unix_resources
        content: {
            Resource { file: "asfk" }
        }
    }    
    
    Resource {
        id: common_resource
        file: "myresourcefile"
    }
    

    }
    @

    Or plain stupid? :)



  • May I ask where this comes from?



  • People (including yours truly) have toyed with this (and other) ideas yes. At first sight, it seems to make sense to use QML this way, but it turns out build systems are very, very complex beasts. There have been raging discussions on what would be needed for Qt, several existing condenders have been discussed, and no conclusion was reached.



  • My head, a couple of minutes ago... Maybe it isn't such a stupid idea after all.

    Just think how easy it is to provide plugins to the build system.

    The basic stuff should be too hard to do (by the trolls :)



  • Andre: I've been using maven (mostly a build system for java apps) and it also has a declarative approach which works very well.

    I know that native apps is different and more complex to build than java apps but still I think it would be a great replacement for qmake for smaller project. I don't see why it couldn't replace qmake. The syntax is more cleaner and modern.

    Complexity is solved with plugins which you enable:
    @
    Loader {
    source: "plugins://complex-plugin"
    }
    @

    Well, I think it's fun to explore other opportunities with QML than just UIs. It actually shows that QML is very flexible, I wouldn't even thinking of doing the same thing in, for example, C++



  • Declarative alone doesn't cut it for build systems. They need to be able to do some imperative stuff as well to get even some basic needs done. Lots has been discussed on the Qt5 mailing list as well about this.



  • Sure, you are absolutely right, but QML can have imperative sections, right?

    I think it might be a nice experiment to, instead of only discussing this over and over again, build a proto type based on QML and just see if it is feasable.



  • [quote author="Andre" date="1313662063"]Sure, you are absolutely right, but QML can have imperative sections, right?[/quote]I have little experience with QML.

    [quote author="Andre" date="1313662063"]I think it might be a nice experiment to, instead of only discussing this over and over again, build a proto type based on QML and just see if it is feasable. [/quote]I think a working proto would indeed be a good one.



  • A new build system needs to fit into Qt Creator as well. From what I've heard so far, this is very hard to achieve with some QML based system.



  • [quote author="Volker" date="1313662349"]A new build system needs to fit into Qt Creator as well. From what I've heard so far, this is very hard to achieve with some QML based system.[/quote]
    Really? Creator is able to visually edit current UI QML's. Why would it be so hard to fit the needs of Creator for building then?

    I will be the first to admit that I don't understand half the requirements for build systems, but I find the idea of something based on QML interesting. However, I seem to remember that CMake also started out in a declarative way, and look where that ended up :-)



  • That's my point too... You already have the framework, tooling and IDE support. Heck, even qmlviewer can be used to build your app!

    The imperative stuff shouldn't be too hard to fix, there's a great javascript evaluater in QML and please don't forget that qml has a great support for plugins which can "hide" complex and ugly imperative parts :)

    I mean, if you can create application (quite complex one) with just qml (no additional c++ logic) I can't see why it can't be a better choice than both cmake and qmake.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.