Creating/Using Procedure Libraries

Posted by Admin on 07-Jun-2010 16:26

We don't have much experience with PL libraries so apologies if these are really obvious/off-the-wall questions.  I did read up in docs and here before posting this but I may have overlooked something.

Currently, we handle dependencies between projects by including the path to the required projects code in the propath of the dependent project.  For a variety of reasons we're thinking it may make more sense to generate PL files and include them in the dependent project instead.  This forces us to be more deliberate/explicit about taking on changes in dependencies.

We're assuming that we need to preserve the same pathing that we have with our propath approach today.  For instance, if we have USING statements that refer to Acme.Common.*. in dependent projects and we create a PL for Acme.Common then the files added should all be added such that the paths begin Acme\Common\.  Is this correct?

Also, is there any way to add all the R-code in a directory structure to a PL easily?  In other words, if I add a directory somewhere under Acme\Common I don't want to have to remember to update a batch file with an explicit prolib <lib name> -add <dir name>\*.r entry.  I'd like to have one call to prolib that can create the PL and recursively add all the R-code in a given directory structure.  Is this possible?

Not sure if it helps but the context is build automation.  Projects that serve as dependencies will have PLs generated from scratch whenever they build.

All Replies

Posted by Admin on 08-Jun-2010 09:20

Hi,

We're assuming that we need to preserve the same pathing that we have with our propath approach today.  For instance, if we have USING statements that refer to Acme.Common.*. in dependent projects and we create a PL for Acme.Common then the files added should all be added such that the paths begin Acme\Common\.  Is this correct?


Yes.

Also, is there any way to add all the R-code in a directory structure to a PL easily?  In other words, if I add a directory somewhere under Acme\Common I don't want to have to remember to update a batch file with an explicit prolib -add \*.r entry.  I'd like to have one call to prolib that can create the PL and recursively add all the R-code in a given directory structure.  Is this possible?


Yes, prolib commands (list, add, replace, ...) can use wildcards.

Not sure if it helps but the context is build automation.  Projects that serve as dependencies will have PLs generated from scratch whenever they build.

If you're doing build automation, you may have a look at Ant and PCT ( http://pct.rssw.eu ), which lets you automate standard OpenEdge tasks

Posted by Admin on 08-Jun-2010 09:28

Hi Gilles,

Thanks for the response.

So, if I want to add all the r-code in the Acme.Common directory _tree_ (i.e. Acme.Common and all descendant directories) what would that look like?

I've tried prolib Acme.Common.pl -add *.r (from the Acme.Common) and it tells me there is no r-code in the directory.  This is true since the actual r-code directories are 2 levels down.  I haven't been able to figure out what the command should look like to add all r-code found anywhere under Acme.Common.

Regards,

everett

Posted by Admin on 08-Jun-2010 09:45

Hi,

You should use prolib Acme.Common.pl -add Acme/Common/*.r

And you can verify with prolib Acme.Common.pl -list

Gilles

Posted by Stefan Drissen on 09-Jun-2010 17:50

What is creating your r-code?

We have a custom compile process that writes all r-code to a text file, the text file is then used as input for prolib. The text file contains:

Acme.Common/blaat.r

Acme.Common/sub/blaat2.r

Acme.Common/sub/subbed/blaat3.r

The PL is then created with:

prolib Acme.Common.pl -create -add -pf compiled.txt

The text file can also be created with:

DIR Acme.Common/*.r /S /B > compiled.txt

This will however result in

c:\whatever\Acme.Common\blaat.r

c:\whatever\Acme.Common\sub\blaat2.r

c:\whatever\Acme.Common\sub\subbed\blaat3.r

So you will then need to pass this thru something first (I find a simple Progress import / exoprt .p easiest) to strip of c:\whatever and (preferably) replace the backslashes with forward slashes.

Regards,

Stefan

This thread is closed