Command line to get latest version and compile an App.

530 views
Skip to first unread message

Philippe Bayard (Belgium)

unread,
Nov 21, 2017, 10:36:57 AM11/21/17
to
Hi everyone,

Is it possible to create a batch file or a script to automatise a deployment?

Which means :

1) Get latest module one by one
2) Compile
3) Generate executables

And if possible get some log of what happens if something goes wrong.

It would be nice in order to integrate it in something like TeamCity.

Best regards,
Philippe Bayard

JohnMartens

unread,
Nov 21, 2017, 2:11:52 PM11/21/17
to
I use VO Script to build an exe for every customer
https://www.grafxsoft.com/voscript.htm
By filling a .PRG file ons can compile customer specific parameters into
the EXE file

John


Op 21-11-2017 om 16:36 schreef Philippe Bayard (Belgium):

Philippe Bayard (Belgium)

unread,
Nov 22, 2017, 5:26:42 PM11/22/17
to
Thank you John for your answer.

What i'm looking for is more like a command line tool for the VO IDE.
It's kinda like what VOPP does, but with the "Get Latest" in addition.

I think i've read somewhere in the newsgroup that there are some class to manage Adam.

But i'm not really sure about it.

Wolfgang Riedmann

unread,
Nov 23, 2017, 12:06:21 AM11/23/17
to
Hi Philippe,

you could look at RepoScript:

http://www.bbrowser.com/english/tools/reposcript.htm

I have not used it, but I know a few people that use it regularly.
Maybe it can do what you need.

Wolfgang
--

JohnMartens

unread,
Nov 23, 2017, 12:55:46 AM11/23/17
to
I meant RepoScript as well (and not VOScript) ...

http://www.votools.com/german/tools/reposcript.htm

This scripting tool controls Adam


Op 23-11-2017 om 06:06 schreef Wolfgang Riedmann:

Wolfgang Riedmann

unread,
Nov 23, 2017, 1:15:49 AM11/23/17
to
Hi John,

> I meant RepoScript as well (and not VOScript) ...
>
> http://www.votools.com/german/tools/reposcript.htm
>
> This scripting tool controls Adam


if RepoScript is not enough: Adam has a documented API so one could
build the tools itself - or pay Joachim or Paul to do some custom
development.

Wolfgang
--

jeanph...@igsoft.be

unread,
Nov 23, 2017, 8:08:51 AM11/23/17
to
Thank you that's exactly what i'm looking for.

The only thing missing is the possibility to load the latest version from source control (Visual source safe) through the tool.

Where can i find the documentation of Adam API ?

If i can automatize this task through the API, it could be perfect !

Robert van der Hulst

unread,
Nov 23, 2017, 8:58:41 AM11/23/17
to
Philippe,
Look in the SDK subfolder of VO 2.8. There is a SDKDEf28.AEF
It has the prototypes of all functions that you would need.
The SCC module has the functions related to SCC.
The SCC functions are not documented, but most names are pretty obvious.
- Open a project
- Get the AppID of an app
- Use VOSCCAppIsUnderSCC() to check if an app is under SCC
- Use VOSCCAllGet() to get the latest modules and compiler options

Most of the other stuff is documented in vo28sdk.chm in the help folder.

If you have questions, feel free to ask.

Robert

jeanph...@igsoft.be

unread,
Nov 23, 2017, 10:52:48 AM11/23/17
to
Nice !
Thank you very much for the detailed explanation !

I have now an executable which lists all projects, open them, list apps, and if it is under SCC run a get latest all for this app.

The only thing is that it sometimes open a dialog to ask me what to do when there is a conflict. Is there a way to manage this to force "Replace existing"?

Thank you very much again ;)

Robert van der Hulst

unread,
Nov 23, 2017, 12:27:40 PM11/23/17
to
JP,

If you delete the files from the SCC folder that belongs to the app before doing a getlatest then you should not get this message.
You can read the local path in the .SCC file that matches the .VOA file for the app.

I do not think there is a public Adam API function that gives you the name of the .VOA or .SCC name for an app

To lookup the file name of the .VOA and .SCC file you could read the the _catalog.vo file. The first 8 bytes of this file are a header. Then for each App there is the following record:

typedef struct _APPDIRENTRY
{
CHAR achName[MAXAPPNAMELEN + 1];
AID aid;
CHAR achFileName[10];
BOOL fSysLib;
} APPDIRENTRY;


MAXAPPNAMELEN = 63
AID = 16 bits unsigned int
BOOL = 32 bits int. 0 = FALSE, any other value = TRUE
Total record = 80 bytes

Robert

jeanph...@igsoft.be

unread,
Nov 23, 2017, 1:20:47 PM11/23/17
to
The conflicts is always over the ".MDF" file in the project folder.
I've tried to delete it before doing a get latest and it has been rewrited.

I'm not sure of what this file contains and if deleting it is dangerous or not... ;)

jeanph...@igsoft.be

unread,
Nov 23, 2017, 2:32:52 PM11/23/17
to
Ok, i did have 2 libraries with OLE compontents, so i set up a specific MDF filename in the project properties.

I will try like this.

Jean-Luc Stassen

unread,
Dec 17, 2017, 6:53:44 AM12/17/17
to
Hello Robert,

I'm look to a function to touch all the modules of an app (like touch all in the ide)
I don't find it, do you know if it exists ?

Jean-Luc

Philippe Bayard (Belgium)

unread,
Apr 6, 2018, 6:39:31 AM4/6/18
to
Hi everyone,

i'm now able to update from source control, touch, compile, and build my app from an external exe.

One more question, is there a way to reindex project from my app like the reindex exe does?

And is there a way to attach to an existing instance of adam?
Right now, i must close my current IDE to do any action, it would be nice, like VOPP to attach myself to the IDE

Thanks in advance,
Jean-Philippe

Philippe Bayard (Belgium)

unread,
Apr 6, 2018, 6:57:30 AM4/6/18
to
For the reindex, there was a project:reindex method... got it ;)
So there is only my question about attaching to an existing instance of adam.

Ronny K. Rodrigues

unread,
May 29, 2019, 10:47:36 AM5/29/19
to
Hi Philippe, good afternoon.

I have the same need as you.

I already have a routine using RepoScript to increment version, give a touch and compile the applications to generate and publish a new version.
However I am not supported to execute a GetLastVersion in RepoScript.

Can you share an example code that you are using for this?
I tried to do it, but when I gave prjSelect () I already encountered an error: 40256 and I could not move forward.

Thanks in advance.

Ronny Kleverson Rodrigues
Email: ron...@gmail.com
Maringá - Paraná - Brazil

jeanph...@igsoft.be

unread,
Jun 4, 2019, 3:22:46 AM6/4/19
to
Hello Ronny,

sorry for the late answer.

Here the sample of my method GetLatest with my class Adam with PrjSelect and Project to manage it.

Warning that i cannot hide the windows during the get latest via sourceSafe... So to get rid of the warning message for .MDF files, i delete them before getting data (because we don't use it).

oAdam := Adam{}
oAdam:OpenCatalog()
aProjects := oAdam:GetProjects()

IF oProj:ProjectName == self:cProject
IF oProj:SELECT( oProj:ProjectName )
cPath := AllTrim(oProj:GetPath(oProj:ProjectName))
IF !Empty( cPath )
aDir := Directory( cPath+"*.MDF")
for j := 1 to ALen(ADir)
IF At(".MDF", ADir[j][F_NAME]) > 0
FErase( cPath + ADir[j][F_NAME] )
ENDIF
next j
ENDIF

buffer := MemAlloc(100)
oAdam:errorCode := AdamGetFirstApp( @pAID )
DO WHILE oAdam:errorCode == SUCCESS .and. pAID<>0
oAdam:errorCode := AdamGetNextApp( @pAID )
IF oAdam:errorCode == SUCCESS .and. pAID<>0
AppQueryName(pAID,buffer, 100)
VOSCCAppIsUnderSCC(pAID, @lIsUnderSCC)

IF lIsUnderSCC
IF VOSCCAllGet(pAID, false) == SUCCESS
//? "Latest version is loaded!"
ELSE
lRet := false
ENDIF
ENDIF
ENDIF
DoEvents()
ENDDO
MemFree(Buffer)
ELSE
WarningBox{self, "Error", "Project is already open"}:show()
ENDIF
ENDIF

oAdam:CLoseCatalog()
oAdam:CloseAdam()


Class Adam
EXPORT errorCode as DWORD
EXPORT MAX_PROJECT_NAME := 100 as DWORD
EXPORT prjEnum as ptr

//Catalog
DECLARE METHOD OpenCatalog
DECLARE METHOD CLoseCatalog

//Projects
DECLARE METHOD GetProjects

//Adam
DECLARE METHOD CloseAdam





METHOD CloseAdam() as LOGIC PASCAL class Adam
errorCode := AdamExit()

return errorCode == SUCCESS
METHOD CLoseCatalog() as LOGIC PASCAL class Adam

IF PrjCatDestroyEnum(PRJEnum) == SUCCESS
return true
else
return false
endif
METHOD GetProjects() as ARRAY PASCAL CLASS Adam

LOCAL buffer as ptr
LOCAL projectName as STRING
LOCAL projects as ARRAY


IF errorCode == SUCCESS

buffer := MemAlloc(MAX_PROJECT_NAME)
projects := {}

errorCode := PrjGetFirst(prjEnum, buffer, MAX_PROJECT_NAME)
DO WHILE errorCode == SUCCESS .and. PSZLen(psz(_cast, buffer)) > 0

projectName := PSZ2String(psz(_cast, buffer))
AAdd(projects, Project{self, projectName})
errorCode := PrjGetNext(prjEnum, buffer, MAX_PROJECT_NAME)
ENDDO

MemFree(Buffer)

ENDIF


RETURN projects



Method Init() class Adam
LOCAL lNew := false as LOGIC
AdamInit(null_ptr, @lNew)

return self
METHOD OpenCatalog() as LOGIC PASCAL class Adam
LOCAL oPtr as ptr
errorCode := PrjCatCreateEnum(null_ptr, null_ptr, @oPtr)
IF errorCode == SUCCESS
self:prjEnum := oPtr
return true
ELSE
return false
ENDIF



Class Project
PROTECT oAdam as Adam
EXPORT ProjectName as STRING

EXPORT errorCode as DWORD


DECLARE METHOD Open
DECLARE METHOD SELECT
DECLARE METHOD CLOSE
DECLARE METHOD GetPath
DECLARE METHOD Reindex

METHOD Close() as LOGIC PASCAL class Project

errorCode := PrjClose()
IF errorCode == SUCCESS
return true
else
return false
ENDIF
METHOD GetPath(name as STRING) as STRING PASCAL class PROJECT
LOCAL projectPath as STRING
LOCAL buffer as ptr


buffer := MemAlloc(500)
errorCode := PrjQueryDir( String2Psz(name), buffer, 500, null)
IF errorCode == SUCCESS .and. PSZLen(psz(_cast, buffer)) > 0
projectPath := PSZ2String(psz(_cast, buffer))
ENDIF

MemFree(Buffer)

return projectPath
Method Init( oOwner, Project) class Project

self:oAdam := oOWner
self:ProjectName := Project

return self
METHOD Open( cPath as STRING ) as LOGIC PASCAL class Project

errorCode := PrjOpen( String2Psz(cPath))
IF errorCode == SUCCESS
return true
else
return false
ENDIF

METHOD Reindex( name as STRING) as LOGIC PASCAL class Project
errorCode := PrjReindex( String2Psz(name))
IF errorCode == SUCCESS
return true
else
return false
ENDIF


METHOD SELECT( name as STRING) as LOGIC PASCAL class Project

errorCode := PrjSelect( String2Psz(name))
IF errorCode == SUCCESS
return true
else
return false
ENDIF

Stefan Ungemach

unread,
Dec 11, 2021, 7:53:22 AM12/11/21
to
Hi Jean-Philippe,

sorry for the stupid question - but does "external exe" mean you have written something in VO, in RepoScript or in some other way?

I want to solve the same problem, plus importing a list of AEFs from source control into an existing project. If possible I try to avoid reinventing the wheel - could you please share your knowledge (maybe even a whole script if that's not too much of a desire) with me?

Thanks in advance
Stefan

j...@igsoft.be

unread,
Dec 12, 2021, 4:42:31 AM12/12/21
to
hello Stefan
Jean Philippe is working elsewhere now.
But, yes he has build an app in VO that manage the functions of ADAM
With this app we can:
- get latest version from soucre control of all apps in a vo project
- touch all
- index
- compile
- build

Jean Luc
Reply all
Reply to author
Forward
0 new messages