11.7
I have made a compilingprogram does some compile of dirctories and files. Basically it travers a directory, finds *.p *.w *.cls and does a compile to a pregiven area.
&scope-defined Environment Test
&scope-defined Target001 \\serverA\$D\{&Environment}\myApp
myCompile = new Compile().
myCompile:addDirectory('.\directoryA','{&Target001}\directoryA').
myCompile:addDirectory('.\directoryB','{&Target001}\directoryB').
myCompile:addCommand('.\oo\myClassA.cls','{&Target001}\oo').
myCompile:addCommand('.\oo\DataHelper\myClassB.cls','{&Target001}\').
and so on... I could have done this different, but when I did it I was not very familiar with oo. Anyway, now to my question:
if I have
myClassA.cls that is defined without namespace
class myClassA :
end.
and myClassB that is defined with namespace
class oo.DataHelper.myClassB.cls :
end.
then I have to differentiate between how I do the compile statement. If I say compile myClass.cls save into .... it will store the class where it points to in save + the namespace.
How can I ensure that it is compiled into the area I tell it store (save into) as it is now, I have to check if the code has a namespace before I do the compile?
PS! I know I should use namespace, but there is a lot of legacy code that do not have that....
//Geir Otto
//Geir Otto
I am not sure I got what you are trying to do completely, but if you are trying to get the class that has a namespace on the directory you specified with SAVE INTO without the namespace, that will not happen. When there is a namespace, we require it to be compiled with the namespace, and we will need to store the rcode in the directory based on the namespace, since that is how we will need to find it at runtime. You do want the directory structure for a class with a namespace, otherwise we wouldn't be able to find it at runtime. So not sure what the issue you are having is.
Allowing classes with no package name is IMHO the biggest design flaw (maybe the only one) of OOABL.
Utilizing that is a great way of shooting yourself in the foot.
Geir, I strongly suggest you refactor your legacy:
Every class should have a package name and that must match the relative directory name
Otto,
Why are you not using PCT (github.com/.../wiki) It takes care of the directory issues for you, with or without package names. (of course I second the package name issue...always use them).
Matt, the link is broken...
Try removing the ")?" from the end of the hyperlink.