Easiest way to use Train/HeaderImporter (on Mac)

The application I’m building uses multiple Silver based front ends and a back end written in another language. I’ve used FXGen successfully to create an .fx file to import the external library and build.

Since both the front end and back end are under active development, I’d like to automate this process, which in theory should be pretty easy, since I can get the generated Train script and I have the train application running from the NougatFXGen bundle.

But I don’t know to use it correctly. I get:

bin darko$ ./train /var/folders/qm/9s47yq2x5852hm9qhxqxr7g00000gn/T/476212836745.train RemObjects Train - JavaScript-based build automation Copyright (c) RemObjects Software, 2013-2015. All rights reserved. script(/var/folders/qm/9s47yq2x5852hm9qhxqxr7g00000gn/T/476212836745.train) { include($(GenerateTrainScript)) { Could not find file "/Users/darko/bin/$(GenerateTrainScript)". } include } script

Here is the script I ran:

include("$(GenerateTrainScript)"); var fxBaseFolder = "/Users/darko/app/elements.8.3.90.1925/Nougat SDKs"; var hi = "/Applications/CrossBox.app/Contents/Resources/NougatFXGen.app/Contents/Resources/HeaderImporter.exe"; OSXSdkVersion="10.10"; processOSXLibrary({ library: "libTestLib", headers: ["testlib/testlib-Bridging-Header.h"], includePaths: ["/Users/darko/Dropbox/dev/test/testlib/"], link: ["TestLib", "m3", "m3core"], copyLibs: ["/Users/darko/Dropbox/dev/test/testlib/testlib/libtestlib.a", "/Users/darko/Dropbox/dev/test/testlib/testlib/libm3core.a", "/Users/darko/Dropbox/dev/test/testlib/testlib/libm3.a"], explicitHeaders: true, dummy: null });

Can anyone direct me on how to use it properly?

Thanks,
Darko.

You need to define GenerateTrainScript & co, iirc the command line parameter is -v:

train -vGenerateTrainScript=/path/to/generate.train '-vhi=/path/to/HeaderImporter.exe -vfxBaseFolder=/path/to/SDKs

where generate.train and HeaderImporter.exe would be somewhere inside FxGen, and fxBaseFolder is the folder with all the SDK subfolders (probably called “Nougat SDKs” either inside Fire or in your external Elements install)

In the end I just substituted $(GenerateTrainScript) in the script with the path to the script and it works perfectly (the other vars are in the script already and don’t need to be passed in). It seems a bit obvious in retrospect.

Thanks for your help!

1 Like