Re: [Qbs] Does QBS know about old-school macOS resources / Rez ?

2017-10-19 Thread Jake Petroules
The best thing to do is upstream this module! Currently there is no support but 
I have no opposition to adding it and it would be great to have a user case 
such as yours to validate the implementation.

Please post your module for review once it's ready, I'd be happy to help.

> On Oct 19, 2017, at 8:15 PM, William Gallafent  wrote:
> 
> Hello everyone,
> 
> Does QBS have any awareness of macOS resource files (the extremely 
> old-fashioned ones, which still exist, and which are compiled using 
> /usr/bin/Rez, which has been deprecated since Xcode 6, but not replaced!)?
> 
> These are still needed to compile certain specialised pieces of software (for 
> example, Adobe PhotoShop Plug-Ins …).
> 
> QMake supports these using the rez.prf component.
> 
> The only location I can see Rez mentioned in the github repo is in 
> MacOSX-Product-Types.xcspec — in some of the Xcode boilerplate, so I'm 
> guessing not.
> 
> I thought I'd ask here before embarking on writing my own Rez module for QBS, 
> according to the instructions at http://doc.qt.io/qbs/module-item.html — I 
> assume that's the right thing to do in this case (have been away from QBS for 
> a while and just restarting!).
> 
> Thanks in advance!
> 
> -- 
> Bill Gallafent
> ___
> Qbs mailing list
> Qbs@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qbs

-- 
Jake Petroules - jake.petrou...@qt.io
The Qt Company - Silicon Valley
Qbs build tool evangelist - qbs.io

___
Qbs mailing list
Qbs@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


Re: [Qbs] Writing a custom script by QBS

2017-10-19 Thread Ben Lau
On 20 October 2017 at 00:13, Christian Kandeler 
wrote:

> On Fri, 20 Oct 2017 00:08:27 +0800
> Ben Lau  wrote:
>
> > Thanks for your reply. I have tried to run your example (by removing the
> > dependence). It will complain:
> >
> > *ERROR: *Cannot run: Product 'remote deployer' is not an application.
>
> You're not supposed to run it. Just build it, as described.
>
>
> Christian
>

Sorry for the mistake. And that is the result. It is not triggered.

$ qbs -p "remote deployer"
Restoring build graph from disk
Building for configuration default
Build done for configuration default.
___
Qbs mailing list
Qbs@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


Re: [Qbs] Writing a custom script by QBS

2017-10-19 Thread Christian Kandeler
On Fri, 20 Oct 2017 00:08:27 +0800
Ben Lau  wrote:

> Thanks for your reply. I have tried to run your example (by removing the
> dependence). It will complain:
> 
> *ERROR: *Cannot run: Product 'remote deployer' is not an application.

You're not supposed to run it. Just build it, as described.


Christian
___
Qbs mailing list
Qbs@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


Re: [Qbs] Writing a custom script by QBS

2017-10-19 Thread Ben Lau
Hi Christian,

Thanks for your reply. I have tried to run your example (by removing the
dependence). It will complain:

*ERROR: *Cannot run: Product 'remote deployer' is not an application.

On 19 October 2017 at 16:19, Christian Kandeler 
wrote:

> On Thu, 19 Oct 2017 03:04:15 +0800
> Ben Lau  wrote:
>
> > I am still new to QBS. I am looking for a suggestion about how to write
> and
> > run a custom script by QBS.
> >
> > Besides building the binary, developers may need additional custom
> scripts
> > for deployment, code analysis, starting a mock server for testing etc.
> This
> > kind of task may not have a file output locally.
> >
> > Can I write this kind of script by QBS?  I usually write this kind of
> > script as a shell script, but it is not a cross-platform solution which
> > does not work with Windows.
>
> You should be able to use the normal mechanisms that are also used for
> building. Here's a sketch for for remote deployment (untested):
>
> Product {
> name: "remote deployer"
>
> type: ["mydeploytarget"]
>
> // You typically don't want to do uploads after every build, so this
> product's rules are not
> // executed unless you specifically request it.
> builtByDefault: false
>
> // Assuming you want to upload e.g. some tar archive you've created
> from your build.
> Depends { name: "mypackage" }
>
> // These as well as the rule below would typically be moved into a
> dedicated module
> // for better re-usability, but it's easier to demonstrate with a
> self-contained
> // product.
> property string remoteUser
> property string serverName
> property string targetDir
>
> Rule {
> // The target type(s) of your dependency/dependencies.
> inputsFromDependencies: ["archiver.archive"]
>
> Artifact {
> // Just a dummy. Does not have to get created. We should
> probably
> // have syntactic sugar for this.
> filePath: "deploydummy"
>
> fileTags: ["mydeploytarget"]
> }
>
> prepare: {
> var targetString = product.remoteUser + '@' +
> product.serverName + '/' + product.targetDir;
> var cmd = new Command("scp", [input.filePath, targetString]);
> cmd.description = "uploading " + input.fileName;
> return [cmd];
> }
> }
> }
>
> Now this should upload your archive (possibly rebuilding if necessary):
> $ qbs -p "remote deployer"
>
>
> Christian
> ___
> Qbs mailing list
> Qbs@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qbs
>
___
Qbs mailing list
Qbs@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


Re: [Qbs] Writing a custom script by QBS

2017-10-19 Thread Christian Kandeler
On Thu, 19 Oct 2017 03:04:15 +0800
Ben Lau  wrote:

> I am still new to QBS. I am looking for a suggestion about how to write and
> run a custom script by QBS.
> 
> Besides building the binary, developers may need additional custom scripts
> for deployment, code analysis, starting a mock server for testing etc. This
> kind of task may not have a file output locally.
> 
> Can I write this kind of script by QBS?  I usually write this kind of
> script as a shell script, but it is not a cross-platform solution which
> does not work with Windows.

You should be able to use the normal mechanisms that are also used for 
building. Here's a sketch for for remote deployment (untested):

Product {
name: "remote deployer"

type: ["mydeploytarget"]

// You typically don't want to do uploads after every build, so this 
product's rules are not
// executed unless you specifically request it.
builtByDefault: false

// Assuming you want to upload e.g. some tar archive you've created from 
your build.
Depends { name: "mypackage" }

// These as well as the rule below would typically be moved into a 
dedicated module
// for better re-usability, but it's easier to demonstrate with a 
self-contained
// product.
property string remoteUser
property string serverName
property string targetDir

Rule {
// The target type(s) of your dependency/dependencies.
inputsFromDependencies: ["archiver.archive"] 

Artifact {
// Just a dummy. Does not have to get created. We should probably 
// have syntactic sugar for this.
filePath: "deploydummy"

fileTags: ["mydeploytarget"]
}

prepare: {
var targetString = product.remoteUser + '@' + product.serverName + 
'/' + product.targetDir;
var cmd = new Command("scp", [input.filePath, targetString]);
cmd.description = "uploading " + input.fileName;
return [cmd];
}
}
}

Now this should upload your archive (possibly rebuilding if necessary):
$ qbs -p "remote deployer"


Christian
___
Qbs mailing list
Qbs@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs