BATCH Build.bat

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

BATCH Build.bat

Post by Pablo César »

Hi All,

This is a explaination for whom want to compile your own applications without IDE, ie., by prompt command.

Normally at all HMG installations will be copy a batch file named Build.bat at root of your HMG folder.

When you create your project you will do it at specific and separated folder in your hard disk.
Here, lets say with name MyAppFolder folder name and the project name (hbp file name) MyApp.hbp as example here during this instructions.

You need to make position in line command by typing at prompt:

CD\MyAppFolder

Then you can call the main Build.bat at HMG folder. Actually lets say C:\hmg.3.4.4 folder name where HMG was installed, for example.

Build.bat will need the name of main prg or the hbp file name as parameter.
Build.bat has switches (parameter with slashbar) for console, for debugger and for not running after building the application.

So, you will use as follows by typing:

C:\hmg.3.4.4\Build    MyApp

Please note above is positioned from your app folder and calls the Build.bat at HMG folder. ;)

There are others Build.bat files at sub folders called SAMPLES that is for only SAMPLES/DEMO proposes only.
Is not useful for compiling your applications made by you. Because these Build.bat are searching the root of HMG folder that is contained at SAMPLES sub-folder. And when you create your application you should do it outside of HMG folder.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: BATCH Build.bat

Post by andyglezl »

Hola
Yo lo hago dentro el mismo Notepad++ de la siguiente forma y el ciclo de trabajo es:

Modificar, Guardar (Ctrl-S), Compilar y Ejecutar (Ctrl-F6)

Previamente, hay que instalar en el Notepad++ un plugin llamado "NppExec"
Los puntos 1 al 5 estan autoexplicados, en el paso 6 muestro que ya lo tengo instalado,
pero debe de aparecer en la pestaña "Available" para instalarlo.

Teniendo lo anterior, creamos un archivo "Mybuild.bat" en la carpeta donde tenemos nuestro .prg
con lo siguiente:

ECHO OFF
CLS
D:\HMG\3.4.4\build.bat MyArchivo.prg

Y listo, abrimos nuestro .prg, Modificamos, Guardamos (Ctrl-S), Compilamos y Ejecutamos (Ctrl-F6)
-------------------------------------------------------------------------------------------------------------------------
Hello
I do it inside the same Notepad ++ in the following way and the duty cycle is:

Modify, Save (Ctrl-S), Compile and Execute (Ctrl-F6)

Previously, you must install in Notepad ++ a plugin called "NppExec"
Points 1 to 5 are self-explanatory, in step 6 I show that I already have it installed,
But it should appear on the "Available" tab to install it.

Having the above, we create a file "Mybuild.bat" in the folder where we have our .prg
with the following:

ECHO OFF
CLS
D: \ HMG \ 3.4.4 \ build.bat MyFile.prg

And ready, we open our .prg, Modify, Save (Ctrl-S), Compile and Execute (Ctrl-F6)
Attachments
NP++(1).jpg
NP++(1).jpg (108.99 KiB) Viewed 7053 times
Andrés González López
Desde Guadalajara, Jalisco. México.
Marin
Posts: 33
Joined: Tue Dec 20, 2016 1:39 pm
DBs Used: DBF
Location: Bulgaria, Sofia
Contact:

Re: BATCH Build.bat

Post by Marin »

Thank you, Andres, for the shared experience with Notepad++!

Really useful for me, I am working entirely with .bat-file.
BTW, I mentioned that your HMG installation is on drive D. Did you encounter any difficulties in the compile and bulid processes? I mean "libraries can not be found" or anything similar?

I would like to install HMG on a different drive, not on C:.

Thank you once again for your time,
Marin
User avatar
dragancesu
Posts: 920
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: BATCH Build.bat

Post by dragancesu »

Install where you want and add in PATH, it's easiest way
Marin
Posts: 33
Joined: Tue Dec 20, 2016 1:39 pm
DBs Used: DBF
Location: Bulgaria, Sofia
Contact:

Re: BATCH Build.bat

Post by Marin »

Thank you, Dragan, I should use, for example PATH=%PATH%;D:\hmg3.4.4., I suppose?

But were to put this command in order to be executed only once at Windows log on? Autoexec.nt?

Regards,
Marin
User avatar
dragancesu
Posts: 920
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: BATCH Build.bat

Post by dragancesu »

Depend on Windows version, for windows 7

control panel->system->advanced system then tab Advanced->Environmet Variables and add in System variables
Marin
Posts: 33
Joined: Tue Dec 20, 2016 1:39 pm
DBs Used: DBF
Location: Bulgaria, Sofia
Contact:

Re: BATCH Build.bat

Post by Marin »

Thank you for the clarification.

Kind regards,
Marin
chrisjx2002
Posts: 190
Joined: Wed Jan 06, 2010 5:39 pm

Re: BATCH Build.bat

Post by chrisjx2002 »

Very interesting! I made some tests and finally I use :

npp_save --> save the file
cd $(CURRENT_DIRECTORY) --> change to the directory of the file
"C:\hmg.3.4.4\build.bat" "$(FULL_CURRENT_PATH)" --> compile the file prg with the build.bat of hmg.3.4.4
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: BATCH Build.bat

Post by Rathinagiri »

Nice to know about Notepad++ plugin. Thanks.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: BATCH Build.bat

Post by andyglezl »

Marin wrote: Tue May 23, 2017 1:19 pm Thank you, Andres, for the shared experience with Notepad++!

Really useful for me, I am working entirely with .bat-file.
BTW, I mentioned that your HMG installation is on drive D. Did you encounter any difficulties in the compile and bulid processes? I mean "libraries can not be found" or anything similar?

I would like to install HMG on a different drive, not on C:.

Thank you once again for your time,
Marin
Hola Marin
En realidad, desde que instale la primer versión de HMG, no tenido problemas como el que comentas.
Mi "forma" de tener HMG en D: es la siguiente (quizá no es lo óptimo pero me funciona)
1.- Instalo la nueva versión como viene por default.
2.- Copio y pego la carpeta generada de HMG de C: a D:
3.- desinstalo la versión recien instalada y listo ! (complementandolo con lo que postee de Notepad++)
--------------------------------------------------------------------------------------------------------------------------
Hi Marin
Since installing the first version of HMG, I did not have problems like the one you mentioned.
My "form" of having HMG in D: is the following (maybe it is not optimal but it works for me)
1.- Install the new version as it comes by default.
2.- I copy and paste the generated HMG folder from C: to D:
3.- uninstall the newly installed version and go! (Complementing it with what I post from Notepad ++)
Attachments
HMG.jpg
HMG.jpg (54.28 KiB) Viewed 6861 times
Andrés González López
Desde Guadalajara, Jalisco. México.
Post Reply