Menu

#18 Advanced & automated build tools path processing

1.0
accepted
None
2015-02-26
2015-02-18
No

Build tools path processing was added to the managed build plug-in.

Build tools are various tools used during the build process. For Windows, make & rm are considered build tools, and need to be installed separately.

Similarly to the toolchain path, the build tools path is set at global level, and applies to all workspaces used by the same Eclipse instance.

To configure this path, use the Eclipse Preferences -> C/C++ -> Build -> Global Tools Paths.

If needed, you can also define a specific path for a Workspace, or for a Project.

Another special feature is the automated detection of the build tools path; on Windows, the GNU ARM Eclipse Build Tools setup writes a special key in the Windows registry, that is accessed by the plug-in to determine the actual tools location.

For those who want to integrate the plug-ins in a customised pack, it is also possible to define the default path to a specific static location, by defining a preference (ilg.gnuarmeclipse.managedbuild.cross/buildTools.path).

Discussion

  • John Moule

    John Moule - 2015-02-24

    Testing using updates-test (201502200104).
    Added the following to my eclipse/configuration/ilg.gnuarmeclipse.managedbuild.cross/toolchains.prefs

    buildTools.path=${eclipse_home}../bin

    Tested on Linux. I don't see the value above added to my PATH and Window > Preferences > C/C++ > Build > Global Tools Paths > Build tools folder is empty.

    Is the expectation that the Preferences Build tools folder should be populated with the value of buildTools.path?

    Haven't tested on windows yet.

     
  • John Moule

    John Moule - 2015-02-24

    ... ah perhaps you're not evaluating eclipse variables like ${eclipse_home}?

     
  • Liviu Ionescu (ilg)

    buildTools.path is read from preferences, not from that custom file.

    please read the wiki pages for details.

     
  • Liviu Ionescu (ilg)

    please migrate all your defaults to preferences, and no longer use the deprecated custom files.

     
  • John Moule

    John Moule - 2015-02-24

    Which wiki page are you referring to?
    I read this one:

    http://gnuarmeclipse.livius.net/wiki/Ilg.gnuarmeclipse.managedbuild.cross_defaults

    which shows the use of ilg.gnuarmeclipse.managedbuild.cross/buildTools.path alongside ilg.gnuarmeclipse.managedbuild.cross/toolchain.name

     
  • John Moule

    John Moule - 2015-02-24

    I can see the deprecated warnings now. A browser refresh did the trick.

     
  • John Moule

    John Moule - 2015-02-24

    All defaults migrated now. I prefer this new approach because everything can be set in a single place (plugin_customization.ini) - great!

    Now the buildTools.path is used in the build correctly. However when I inspect its value in "Window > Preferences > C/C++ > Build > Global Tools Paths > Build tools folder" the following error appears and the OK button is disabled:

    Value must be an existing directory

    The value I'm using is ${eclipse_home}../bin. Could you relax the check or support Eclipse Variables?

     
  • Liviu Ionescu (ilg)

    The value I'm using is ${eclipse_home}../bin. Could you relax the check or support Eclipse Variables?

    I'm using DirectoryFieldEditor, if you know how to do this, please suggest.

    I just pushed the new version on updates-test and git.

     
  • John Moule

    John Moule - 2015-02-24

    I see your updates. You've added quite a lot of stuff.

    Regarding the "Value must be an existing directory" error, this is crippling my use of the Preference page now. In "Window > Preferences > Team > Git > Default repository folder" there is a path field with Browse button and also Variable button. I think it is the same sort of control and it allows me to enter "${eclipse_home}../bin". Perhaps you could look at how the git team implement it.

    Are you planning on adding more default values for the new Preference and Property pages?

     
  • Liviu Ionescu (ilg)

    Are you planning on adding more default values for the new Preference and Property pages?

    I plan to add some more pages to configure the debuggers (j-link, openocd, qemu).

     
  • Liviu Ionescu (ilg)

    Value must be an existing directory

    I added configurable defaults to disable these checks, please check the wiki.

    did not test them yet.

     
  • John Moule

    John Moule - 2015-02-25

    I see they are now documented in http://gnuarmeclipse.livius.net/wiki/Ilg.gnuarmeclipse.managedbuild.cross_defaults

    Should I define like this:
    ilg.gnuarmeclipse.managedbuild.cross/global.toolchain.path.strict=false

    or this?

    global.toolchain.path.strict=false

    I tried both from my plugin_customization.ini but they didn't seem to take effect.

    However, I think it would be better to allow support for Eclipse Variables directly. Did you look at that egit reference? Here is the exact source file. It looks pretty simply and similar to your code:

    http://git.eclipse.org/c/egit/egit.git/tree/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/preferences/GitPreferenceRoot.java

    Even if you didn't add the actual Variable button you could still add logic to decode any eclipse variables in the path value :

    ~~~~~
    IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
    String substitutedFileName;
    try {
    substitutedFileName = manager.performStringSubstitution(fileName);
    } catch (CoreException e) {
    // It's apparently invalid
    return false;
    }

     
    • Liviu Ionescu (ilg)

      I tried both from my plugin_customization.ini but they didn't seem to take effect.

      the first form is expected.

      allow support for Eclipse Variables directly.

      you mean extend the validator and substitute macros before checking the folder? this can also be done.

      Git... It looks pretty simply and similar to your code:

      hmmm... it completely rewrites the Preferences class, I just use pre-cooked classes.

       
      • John Moule

        John Moule - 2015-02-25

        Apologies; I don't think my git fetch worked correctly. I've checked out your latest now and it works.

        you mean extend the validator and substitute macros before checking the folder? this can also be done.

        Yes.

         
        • Liviu Ionescu (ilg)

          extend the validator and substitute macros before checking the folder?

          done. please check if your macro gets substituted. (you need to set the strict flag to true).

           
  • John Moule

    John Moule - 2015-02-26

    Tested.
    C/C++ Build > Tools Paths
    There's a small fault. When I set build tools folder or toolchain folder to an invalid value (eg: xxx) the dialog is not updated as one types. For an error to appear in the message area at the top of the dialog one has to move focus out of the text field and then back into it.
    And if invalid value exists in only 1 field the error message is only present if focus is in that field.

    Preferences > C/C++ > Build > Global Tools Paths and Workspace Tools Paths. Error checking is not present even though I have following defined:

    ilg.gnuarmeclipse.managedbuild.cross/global.toolchain.path.strict=true
    ilg.gnuarmeclipse.managedbuild.cross/global.buildTools.path.strict=true
    ilg.gnuarmeclipse.managedbuild.cross/workspace.toolchain.path.strict=true
    ilg.gnuarmeclipse.managedbuild.cross/workspace.buildTools.path.strict=true

    ilg.gnuarmeclipse.managedbuild.cross.preferences.DirectoryNotStrictFieldEditor.fIsStrict is always false!

     

    Last edit: John Moule 2015-02-26