Run an application as pre-build command

Run an application as pre-build command

2
NewbieNewbie
2

    Jun 23, 2011#1

    Is it possible to launch an application on a pre-build event. For an example, on the build button click just before the execution of the compiler commands.

    I know that I can edit and run the make file, however, I am searching for a low maintenance solution for multiple dynamic projects.

    So it would be fine to configure the project as in the application file or, .. anything else in the GUI.

    Thanks.

    6,603548
    Grand MasterGrand Master
    6,603548

      Jun 23, 2011#2

      I don't know why you created a topic in the Scripts forum for your task because a script is definitely not needed for this task.

      If you are using UEStudio with a compiler configuration and press the build or rebuild button, then it would be best to adapt the configuration file to your needs. The configuration file contains the rules for UEStudio, how to create in first step of a build/rebuild process the makefile executed by UEStudio on next step.

      Click in UEStudio on Project - Select Compiler, then click on button Edit Configuration. The dialog changes because a second pane opens on right side of the dialog showing content of the configuration file. Scroll down to red highlighted [Build] section. You will see there some lines. Usually the last one starts with Cmd0= which is the command to build the project. You have to change the number to get Cmd1 and insert a line starting with Cmd0= and the program you want to run first before building the project.

      Alternatively if you want the program executed first on every *.c file (for a C project) compiled during a build process, you have to modify the command list of section [.C]. C++ projects have often also just a [.C] section because in section General there is the line .CPP = .C.

      After the modification of the configuration file you can save the modified configuration using button Save Configuration. Usually I suggest to first press button Make Configuration Locale to save the configuration in the project directory before modifying and not modifying the standard configuration as installed with UEStudio into subdirectory configs in the program files directory of UEStudio. But you want to use the modified configuration for several projects and therefore you probably don't want the configuration file stored in the project directory of the active project.

      Hint: It might be a good idea to open the configuration file as displayed in Select Compiler dialog directly in UEStudio from the appropriate "UEStudio Program Files Directory\configs\Selected Compiler" directory, save it with a new name like MyApplicationConfig using Save As command into the directory, close the file, open now Select Compiler dialog, select MyApplicationConfig for this project (and later also for the others) and edit this configuration. This prevents replacing your modified configuration in the standard compiler configs directory on upgrade of UEStudio by the installer.

      If the configuration file you use contains a [Show Makefile] section you can use the command Build - Run Commands - Show makefile to display the makefile in a new instance of UEStudio. You might need to run first Build - Regenerate Makefile after making the changes on the configuration file before viewing the makefile.

      If you are not using UEStudio, but use UltraEdit, you run the compiler probably via a user or project tool. In this case modify the configuration of this tool by calling a batch file instead of the compiler, put into the batch file the compiler command with appropriate parameters and insert above the command to call your program which should be executed before compilation.

      2
      NewbieNewbie
      2

        Jun 28, 2011#3

        Thanks for the detailed answer, we've already experienced the two following solution:

        >>Click in UEStudio on Project - Select Compiler, then click on button Edit Configuration. The dialog changes because a second pane opens on right side of the dialog showing content of the configuration file. Scroll down >>to red highlighted [Build] section. You will see there some lines. Usually the last one starts with Cmd0= which is the command to build the project. You have to change the number to get Cmd1 and insert a line starting >>with Cmd0= and the program you want to run first before building the project.

        With this solution (Cmd0 = application.exe added in the [build] section), the command is inserted between the compiler and the linker. Our needs is to insert it right before the compiler execution.

        >>Alternatively if you want the program executed first on every *.c file (for a C project) compiled during a build process, you have to modify the command list of section [.C]. C++ projects have often also just a [.C] >>section because in section General there is the line .CPP = .C.

        We actually use this solution, however, as you explain it, the application is executed before the compilation of each source file.


        Our needs is to run the application once before the compiler is launched (not before the compilation of each file and not between the compiler and the linker). Unfortunately the application file does not seems to gives this possibility.

        We know that we can modify the makefile to perform this task, however, it would be more interesting to use the UEstudio GUI instead of editing the makefile. Most of our application use the application file way to configure the projects to be built.

        If you have any idea, it would be fine to inform us.

        Regards,

        6,603548
        Grand MasterGrand Master
        6,603548

          Jun 29, 2011#4

          I have tried several things, but it looks like it is not possible to define pre-build commands in the configuration. I suggest to contact IDM support by email and ask for help on how to add 1 or more pre-build commands to the configuration. If there is really no possibility to do that at the moment, it would be a good idea for an enhancement for next major release of UEStudio.