Build.bat

Source code related resources

Moderator: Rathinagiri

User avatar
serge_girard
Posts: 1623
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 181 times
Been thanked: 29 times
Contact:

Re: Build.bat

Post by serge_girard » Sun Jun 15, 2014 6:54 am

Good idea Pablo !


Serge

User avatar
Pablo César
Posts: 3992
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 98 times
Been thanked: 159 times

Post by Pablo César » Mon Jun 16, 2014 1:33 pm

serge_girard wrote:Good idea Pablo !
Thank you Serge for your interest. I am saying this a long long time ago... but the main problem is HMG-IDE source codes, are not accessible for us. And Claudio is very busy... :(

You know, I like to participate in this community. But I confess that sometimes I feel very alone. Some did not respond to my messages. Should be the same niggling feeling when they frow upon because I write/speak all that I think. But I tell you, I wish the common good of all of us (including me), whatever the cost. But I will not be quiet, I like innovations, like advances but also like to see all manifesting: either against or in favor. But many prefer to stay in the quiet of silence and not risking say anything ... unfortunately... :(

It's like all things ... people evolve in advancing limitations. But there will come a day that the limitations are not overcome, will open new avenues ...

Sorry everyone for my outflowing... :|
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
Pablo César
Posts: 3992
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 98 times
Been thanked: 159 times

Post by Pablo César » Fri May 29, 2015 4:21 pm

Time ago I presented a solution to the Build.bat carry an extra copy of executable recent file generated, which automatically would make the updating in a different folder where the system runs.
Screen2.png
Screen2.png (49.63 KiB) Viewed 2420 times
But today I found a hbc directives that Harbour performs the same function. :oops:

I decided to publish and keep you informed because I was unaware and unfortunately no one was interested or did not comment on the existence of this resource. :|
  • At our IDE
    • As it has been done in IDE (hmg 3.0.35):
      Screen3.png
      Screen3.png (10.99 KiB) Viewed 2420 times
    • And now in the rest of IDE (upper version hmg 3.0.35):
      Screen4.png
      Screen4.png (10.32 KiB) Viewed 2420 times
     
    This instpaths="c:\In other place\Sys\" Harbour directive will make a copy of executable file (in this case MyApp.exe) to the a second place (in this case at "c:\In other place\Sys" subfolder).
     
  • At Prompt of line command (thru Build.bat)

    You will need to edit <Project_name>.hbc file and add this:
    Screen5.png
    Screen5.png (12.83 KiB) Viewed 2420 times
Information and feature can be useful for automating procedures during compilation.

Keeping you informed. :)
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
Pablo César
Posts: 3992
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 98 times
Been thanked: 159 times

Post by Pablo César » Thu Nov 03, 2016 7:24 pm

Hi Claudio,

Could you please to replace this text block in Build.bat:
:VERSION
ECHO.
ECHO Build [ /n ] [ /d ] [ /c ] <program.prg> | <project.hbp> [<hbmk2 params>]
ECHO.
ECHO.
ECHO.
PAUSE
GOTO END
By this other which does not causes error:

Code: Select all

:VERSION
CLS
ECHO.
ECHO  Syntax:
ECHO  ------
ECHO.
ECHO  BUILD [/n] [/d] [/c] [^<Program.prg^>^|^<Project.hbp^>] [^<HBMK2 parameters...^>]
ECHO.
ECHO.
ECHO.
ECHO.
PAUSE
GOTO END
At the time is executing Build.bat (without any parameters) a boring message is displaying from OS which refused as command by the special characters: <, >, and | in It. :|

The main purpose of VERSION block in build.bat is to display the syntax and compiler options.

Thank you in advanced.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
Pablo César
Posts: 3992
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 98 times
Been thanked: 159 times

Post by Pablo César » Sun Nov 27, 2016 6:11 pm

Hi Claudio,

I usually work almost always with IDE to compile my applications. But we know that the IDE uses the same batch file: Build.bat.

And I did some command-line testing with simple GUI and Console applications. I tried all possible possibilities and encountered some bugs in running Build.bat. :|

We have the parameters (for some time already):

/N No run after build
/D Enabled debugger
/C Console mode


And its syntax:

BUILD [/n] [/d] [/c] [<Program.prg>|<Project.hbp>] [<HBMK2 parameters...>]
  • 1st question: I want to know if Build.bat should accept or not, the combination of parameters [/n] [/d] [/c] ?

    I have prepared this table for appreciation and evaluation of what is working and what is not:
    Original Build_bat.png
    Original Build_bat.png (34.69 KiB) Viewed 2195 times
    Anyone can check and notify us of the bug ...

    Here is my second and third questions below, case Build.bat should accept the combination of these parameters (in my opinion should rather accept), especially the console and not run (I used a lot of it). Because we often do not want the run the generated application where is in the project folder. We only want to run in the folder of user system.
     
  • 2nd and 3rd questions: Do you agree with the "Action (Should be)" column of the image ? Is it correct in the intended action ?
Please note items 7, 9 and 12 that generate an executable file with the name of one of the parameters. This has to be corrected as well as items 5 and 11.

I need your confirmation to proceed to improve and leave it error free with your usual supervision, of course.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
srvet_claudio
Posts: 1904
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 25 times
Been thanked: 82 times
Contact:

Post by srvet_claudio » Mon Nov 28, 2016 1:27 am

Pablo,
I do not remember at this time the exact content of the build.bat file, but if the parameters are placed in the order defined in the documentation should work correctly.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com

User avatar
Pablo César
Posts: 3992
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 98 times
Been thanked: 159 times

Post by Pablo César » Mon Nov 28, 2016 9:58 am

srvet_claudio wrote:I do not remember at this time the exact content of the build.bat file
I have all most of HMG version installed at my old PC and the sequence is build [ /n ] [ /d ] [ /c ] in this order since Harbour has changed (compiling mode/config, mainly) .
srvet_claudio wrote:but if the parameters are placed in the order defined in the documentation should work correctly
So, you mean that it should be not acceptable inverted order or random order switches like as items 5, 7, 9, 11 and 12 (according my table available in my previous post) ? Please confirm this.

Because today, anyone can do the tests in the sequence described in this table and see what in fact is happening.

IMO, in these cases of errors, Build.bat could check the wrong sequence of switches, interrupt the building and display a warning message to the user.

Because some cases the compilation is effective but with the filename totally wrong and even more is executed when not expected... :?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
Pablo César
Posts: 3992
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 98 times
Been thanked: 159 times

Post by Pablo César » Mon Nov 28, 2016 3:34 pm

Noble colega Claudio,

Yo ya resolví el problema de tratar los argumentos de los switches en orden aleatorio en el Build.bat. :D

Funciona PERFECTAMENTE en todos los ordenes, sea en console como GUI con uno, dos y tres switches sin algun problema.
Por lo tanto poderíamos utilizarlo en el nuevo release, si te parece adecuado. Fué relativamente fácil de resolver, le agregué uno nuevo LABEL llamado de CHECKPARAMS.

Solo que me encontré con un otro problema.
Yo leí este mensaje de Roberto en el fórum: viewtopic.php?p=16796#p16796

Me parece muy bien la medida adoptada pero ahora analisando las sintaxis que siempre aprareció en el Build.bat sobre hbmk2 params, no me funciona... :o

build [ /n ] [ /d ] [ /c ] <program.prg> | <project.hbp> [<hbmk2 params>]

No sé si estoy haciendo algo errado, porque hago asi en la linea de comando:

C:\hmg.3.4.3\Build.bat /c demo.hbp -run -runflag="Param1"

Pero me dá este error:
Screen21.png
Screen21.png (16.91 KiB) Viewed 2120 times
Como puedes ver, eses parametros el Build.bat los interpreta como si fueran bibliotecas o módulos PRGs y no como hbmk2 params :?
Algo está mal: la sintaxis del Build.bat o yo estoy haciendo algo errado. :oops:

Esto funciona en Harbour, pero no con el Build.bat. Eses parametros que son do hbmk2 son para atender a esta mi necesidad.

Los argumentos %1 %2 %3 %4 %5 %6 %7 %8 que preceden a %debug% -q (en la linea donde está el HBMK2 del Build.bat) parece que no los accepta... :?

Yo hice una prueba con esta sintaxis:

SET PARAMS="Param1 Param2 Param3"
HBMK2 -mt -run -runflag="%PARAMS%" -o"%~n1" %HMGPATH%\hmg32.hbc %gtdrivers% %debug% -q %1 %2 %3 %4 %5 %6 %7 %8 >hbmk.log 2>&1

Asi de esta forma me dá re-bien. Y ya tengo una solución para compilar y ejecutar la aplicacion pasandole parametros. :P

Aquí en adjunto para su evaluación:
Build_bat.rar
Build.bat (fixed with spaces in param)
(1.94 KiB) Downloaded 28 times
Aquí también el ejemplo para tus pruebas:
IDE_Param.rar
Source files for building
(41.42 KiB) Downloaded 20 times
Un abrazo

--- Google translated ---

Noble colleague Claudio,

I already solved the problem of handling the arguments of the switches in random order in the Build.bat. :D

It works PERFECTLY on all orders, either console or GUI with one, two and three switches without any problems.
Therefore we could use it in the new release, if it seems appropriate. It was relatively easy to solve, I added a new LABEL called CHECKPARAMS.

The only thing that I ran into another problem.
I read this message from Roberto in the forum: viewtopic.php?p=16796#p16796

It seems fine to me the measure adopted but now analyzing the syntax I always endorsed in the Build.bat on [b hbmk2 params[/b], it does not work... :o

build [/n] [/d] [/c] <program.prg> | <Project.hbp> [<hbmk2 params>]

I do not know if I'm doing something wrong, because I do so in the command line:

C:\hmg.3.4.3\Build.bat /c demo.hbp -run -runflag="Param1"

But he gives me this error:
Image
As you can see, these parameters Build.bat interprets as if they were libraries or PRGs modules and not as hbmk2 params :?
Something is wrong: the Build.bat syntax or I am doing something wrong. :Oops:

This works in Harbour, but not with Build.bat. Those parameters that are from hbmk2 are to attend this my necessity.

The arguments % 1% 2% 3% 4% 5% 6% 7% 8 preceding %debug% -q (in the line where the HBMK2 of the Build .bat) does not seem to accept them ... :?

I did a test with this syntax:

SET PARAMS="Param1 Param2 Param3"
HBMK2 -mt -run -runflag="% PARAMS%" -o "% ~ n1"% HMGPATH% \ hmg32.hbc% gtdrivers%% debug% -q% 1 Hbmk.log 2> & 1

This way I get re-well. And I already have a solution to compile and run the application by passing parameters to it. :P

Here in attached for your evaluation:
Build_bat.rar
Build.bat (fixed with spaces in param)
(1.94 KiB) Downloaded 28 times
Here also the example for your tests:
IDE_Param.rar
Source files for building
(41.42 KiB) Downloaded 20 times
 
Added later: This message was re-edited in order to update Build.bat. Which it was fixed to accept spaces in projects names as well.
Last edited by Pablo César on Tue Feb 14, 2017 11:33 am, edited 5 times in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
srvet_claudio
Posts: 1904
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 25 times
Been thanked: 82 times
Contact:

Post by srvet_claudio » Mon Nov 28, 2016 4:56 pm

Pablo,
At this time for me the priority is the HMG source code, the other issues can wait.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com

User avatar
Pablo César
Posts: 3992
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 98 times
Been thanked: 159 times

Post by Pablo César » Mon Nov 28, 2016 5:05 pm

Yes, I understand you.

Take your time.

Build.bat is with bug and I'm just trying to help make a possible solution available.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest