I did a major revamp for the publish feature and dialog in r58785. Please test.
Fundamental changes were needed. Then respecting the existing code too much would lead to ugly hacks. So, fundamental changes I did.
Now the main function is to copy the project / package member files. Additional filters can be used to copy extra files but hopefully they will not be needed much. Form files (.lfm) and project main resource file (.res) are copied automatically even if they are not part of the project / package. That should cover most files then.
There is only one enable-CheckBox for the filters. The idea is that an empty filter means "not used" or "no effect". I realized I did not test that one but now I am too lazy and tired to test more...
I scratched my head for a while to get the directory structures right. A typical structure is like:
SoftWare
﹂ MyProject
-- ReadMe.txt
﹂ MainDir
-- Project1.lpr
-- Project1.lpi
﹂ AnotherDir
-- SomeSrc.pas
From Lazarus POV the project directory is "MainDir" because it contains the projects main source and info files. Logically it is directory "MyProject" because all sources are collected under it in subdirectories.
So, I built a logic to traverse project/package files and move the effective top directory "up" always when a relative '../' reference was found in front of a file name. It works with infinite number of directory levels.
Then the files are copied using the new top directory as a reference point. Perfect, even if I say it myself!
The "Command after" was used only for compressing the result but it was not very cross-platform.
I removed it and added a CheckBox for compressing finally the directory. It is not implemented yet. May I ask somebody to please implement it and provide a patch, or commit it directly if having SVN rights. There is a Zipper in FPC's libs and example code somewhere. Should be easy.
There are also other ToDo items in the code. Please take a look.
I removed the CheckBox for binary files. The compiled project executable should never be copied. This feature is about publishing sources. Are there other binaries to consider?
I also removed 2 CheckBoxes for projects which made no sense in my opinion. They only added confusion.
What do you think? Is the feature set right? Was it OK to remove "Command after" and others?
Actual bugs can be reported either here or in the report which I keep open for a while.
https://bugs.freepascal.org/view.php?id=34102Anybody who is interested in this feature must get the SVN trunk version of Lazarus. There is no excuse especially because it is so easy to do.