Recent

Author Topic: Issues publishing a project (No subdirectories incl., no non-Pas. files incl.?)  (Read 21173 times)

BrainChemistry

  • Jr. Member
  • **
  • Posts: 79
EDIT: Since nobody responded, I try to re-phrase my problems/question:

Hi there,

Problem #1:
If I publish a project, files (mostly units) which are included in subdirectories of the original project are not included in the published project, although I added them to the project in the project inspector. In other words, only the files in the project's main dir. are also found in the folder of the published project.

What I would like to achieve/Question #1:
I would like to have ALL files to be included in the published project within the corresponding relative subdirectories. Is this a lacking feature or am I doing it wrong?

Problem #2:
If I have files which are no units (e.g. configuration files (e.g. *.ini), which are e.g. plain text files), but are still necessary for the project to run (and are located in the project's main dir.), they are not shared in the published project. It doesn't seem to matter if I add them manually to the project in the project inspector or not. - If I add them in the project inspector, they are seen in the project inspector of the published project though, but are stroken through (since the files are not shared along in the published project).

The only partial solution is, to set the include-filter to allow for this type of file ending. In this case though, ALL files with that file ending, regardless if they have been added to the project in the project inspector or not, are shared along with the project.

What I would like to achieve/Question #2:
Well, I would like to accompany all files really necessary for my project to it. But I wouldn't like to find ALL files which happen to have the same ending also to be shared if they do not belong to the project. How can I achieve this? 

Thanks for your help.
« Last Edit: August 03, 2018, 02:47:27 pm by BrainChemistry »

ASBzone

  • Hero Member
  • *****
  • Posts: 678
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
What versions of FPC / Lazarus are you running, btw?
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.2.7-ada7a90186 / FPC v3.2.3-706-gaadb53e72c
(Windows 64-bit install w/Win32 and Linux/Arm cross-compiles via FpcUpDeluxe on both instances)

My Systems: Windows 10/11 Pro x64 (Current)

Handoko

  • Hero Member
  • *****
  • Posts: 5129
  • My goal: build my own game engine using Lazarus
If I publish a project, files (mostly units) which are included in subdirectories of the original project are not included in the published project, although I added them to the project in the project inspector. In other words, only the files in the project's main dir. are also found in the folder of the published project.

I tested on Lazarus 1.8.4 Linux, yes I can reproduce this behavior. The *.pas files in a sub directory won't be included, even it's already included in the project inspector.

I don't use Publish Project feature because I personally think manually copy/paste is easier. But the bug should be fixed, please submit your bug report and feature request at the bug tracker forum:
https://bugs.freepascal.org/my_view_page.php

tudi_x

  • Hero Member
  • *****
  • Posts: 532
@Handoko
what copy / paste does not solve and Publish Project should solve is updating the paths of files to the folder to where the publish is done.

@BrainChemistry
please add the update of the path attribute to new publish folder if possible in the bug. currently we cannot test if this happens due to the bug.
please advise on the bug entry number.
thank you
Lazarus 2.0.2 64b on Debian LXDE 10

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
what copy / paste does not solve and Publish Project should solve is updating the paths of files to the folder to where the publish is done.
What paths do you mean? "Other unit files" and "Include files" should only contain relative paths which are part of the project, thus moving the project to another place always works.

Package dependencies are another issue. Should Publish Project deal with them somehow? Maybe not. Packages must be moved / installed separately.

Anyway the Publish Project feature should be fixed. It should also optionally compress the resulting project.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

tudi_x

  • Hero Member
  • *****
  • Posts: 532
what is Publish Project intended to do?
in other apps (for ex. Reaper FM) project publish takes all files in the project and places them in a folder. the user can take that folder to another computer and continue the work there given it has the same instruments installed would obtain same melody.

I am referring to the path of a file from another folder, ex: project in folder A using one file B1 from folder B and one file C1 from folder C.
Now my expectation is that when I use publish the end result would be folder D that will have all project files from folder A and files B1 and C1.
This will allow if i move the folder to another machine where i have the package dependencies installed to obtain no errors when compiling.
I am not saying anything about dependencies files in folder D, only the files listed in the Files tree in Project Inspector.
(now if you have here dependencies it means that you updated them and needing, isn't it?)

« Last Edit: August 08, 2018, 01:07:49 pm by tudi_x »
Lazarus 2.0.2 64b on Debian LXDE 10

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
what is Publish Project intended to do?
in other apps (for ex. Reaper FM) project publish takes all files in the project and places them in a folder. the user can take that folder to another computer and continue the work there given it has the same instruments installed would obtain same melody.
Yes, that is the goal.

Quote
I am referring to the path of a file from another folder, ex: project in folder A using one file B1 from folder B and one file C1 from folder C.
Now my expectation is that when I use publish the end result would be folder D that will have all project files from folder A and files B1 and C1.
This will allow if i move the folder to another machine where i have the package dependencies installed to obtain no errors when compiling.
I am not saying anything about dependencies files in folder D, only the files listed in the Files tree in Project Inspector.
(now if you have here dependencies it means that you updated them and needing, isn't it?)
So it would copy files B1 and C1 into the project folder. I guess it is doable.
However I think those are library files shared between projects. You should use packages for them instead of adding them directly to a project.
Many people coming from Delphi misuse "Other unit files" for library code. Things are done differently in Delphi.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

tudi_x

  • Hero Member
  • *****
  • Posts: 532
i am not coming from Delphi but from Professional Services. after 8 years of Technical Project Management in a software company i started with Lazarus as a way to perform routine activities as moved to client site as Consultant.

those files can just be files in a new folder where you just mock up something.
at a later point the developer can look into a package but maybe it does not even reach that stage especially in a start-up environment.

i will add you input for the doable part to the bug entry as soon as it is opened.
« Last Edit: August 08, 2018, 01:43:23 pm by tudi_x »
Lazarus 2.0.2 64b on Debian LXDE 10

tudi_x

  • Hero Member
  • *****
  • Posts: 532
Lazarus 2.0.2 64b on Debian LXDE 10

balazsszekely

  • Guest
1. The "Publish Project" will export any allowed file located is in the main directory. It does not matter if it's part of the project or not. You can easily test this by copying a random pas file to the project folder then press the OK button.
2. Exporting all subdirectories inside the main folder it's seems a logical request to me. The attached patch fix this issue. Please apply it against the current trunk. The IDE will ignore the lib and backup folder.

tudi_x

  • Hero Member
  • *****
  • Posts: 532
@GetMem
based on 1. it means that as per above scenario files B1 and C1 would not be published.
this means that files listed in Project Inspector would not be published thus the published folder cannot be transferred to a different machine and continue work.
is this what you want?

user was allowed in a legit way to add files from the system to project inspector. as soon as the file is presented in the project inspector it is part of the project and needs to be exported in the publishing action.
not taking into consideration these files from other folders but presented in project inspector would only degrade the UX.
« Last Edit: August 09, 2018, 12:38:44 pm by tudi_x »
Lazarus 2.0.2 64b on Debian LXDE 10

balazsszekely

  • Guest
@tudi_x
I think you misunderstood me. Anyways all the above issues should be fixed now, namely:
1. Only project files will be published
2. Files from project subdirectories(belonging to project) will be also published
3. Files from backup and lib(unit output directory) folders will be ignored

Please test attached patch against trunk.

tudi_x

  • Hero Member
  • *****
  • Posts: 532
@GetMem
sorry if i misunderstood.
looking forward to a RC version i could help with the testing as I do not know how to apply the patch and no experience with trunk.
Lazarus 2.0.2 64b on Debian LXDE 10

balazsszekely

  • Guest
@tudi_x
Quote
looking forward to a RC version i could help with the testing as I do not know how to apply the patch and no experience with trunk.
OK. Just wait 10 minutes. I will modify the necessary units in Laz. 1.8.4

PS:
1. Download attached zip
2. Extract zip to $(LazarusDir/IDE) folder(make backup first)
3. Rebuild Lazarus(Tools-->Build Lazarus with profile...)
4. Export your project
« Last Edit: August 09, 2018, 02:25:20 pm by GetMem »

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Can the default "include filter" be set to include *.res files?
Otherwise you have to uncheck "ignore binaries" which is not what is desired just to get the project .res included in what is published.
Or have I missed something?

 

TinyPortal © 2005-2018