简体   繁体   中英

Do I have to specify the indirect dependencies in the requires section of a package?

Let's say I have these projects:

  • Package1.bpl
  • Package2.bpl (uses units in Package1)
  • Package3.bpl (uses units in both Package1 and Package2)
  • Package4.bpl (uses units in Package2 only)
  • Project1.exe (uses units from all of the above)

What is the correct requires section for each of those?

Package2 clearly depends on Package1.

Package3 depends on both Package1 and Package2? Or is it ok to just specify Package2 if I know that Package2 will depend on Package1?

What about Package4 does it have to specify Package1 in addition to Package2?

What are the rules for what goes into the requires section of a package?

PS: Let's assume I want to be able use static linking as well as dynamic linking.

BTW: I tried running the bpls through Dependencies , but then the actual imports and exports that Delphi generates under the hood are not in a 1:1 relation to the requisites anyway.

Any package required by a required package is seen as indirectly required and need no own reference in the requires section.

Given your example above the requires for each package should at least contain

Package1: 
Package2: Package1
Package3: Package2 (makes Package1 indirectly required)
Package4: Package2 (makes Package1 indirectly required)

Of course each package should list all required standard (RTL, VCL,...) packages. The above rule can be applied for those, too. Fi requiring vcl implicitly requires rtl.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM