PackageProtocols.pas 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. {
  2. $Project$
  3. $Workfile$
  4. $Revision$
  5. $DateUTC$
  6. $Id$
  7. This file is part of the Indy (Internet Direct) project, and is offered
  8. under the dual-licensing agreement described on the Indy website.
  9. (http://www.indyproject.org/)
  10. Copyright:
  11. (c) 1993-2005, Chad Z. Hower and the Indy Pit Crew. All rights reserved.
  12. }
  13. {
  14. $Log$
  15. }
  16. {
  17. { Rev 1.10 3/4/2005 3:22:12 PM JPMugaas
  18. { Updated for fix.
  19. }
  20. {
  21. { Rev 1.9 3/4/2005 3:12:40 PM JPMugaas
  22. { Attempt to make D5 package work.
  23. }
  24. {
  25. { Rev 1.8 3/4/2005 3:02:06 PM JPMugaas
  26. { Remove D5 VCL dependancy in run-time package.
  27. }
  28. {
  29. { Rev 1.7 3/3/2005 7:46:24 PM JPMugaas
  30. { Backdoors for BDS assembly version information.
  31. }
  32. {
  33. { Rev 1.6 25/11/2004 8:10:22 AM czhower
  34. { Removed D4, D8, D10, D11
  35. }
  36. {
  37. { Rev 1.5 9/7/2004 3:50:46 PM JPMugaas
  38. { Updates.
  39. }
  40. {
  41. { Rev 1.4 04/09/2004 12:45:18 ANeillans
  42. { Moved the databasename and output paths into a globally accessible variable
  43. { -- makes it a lot easier to override if you need to (as I did for my local
  44. { file structure).
  45. }
  46. {
  47. { Rev 1.3 2004.08.30 11:27:58 czhower
  48. { Updates
  49. }
  50. {
  51. { Rev 1.2 03/06/2004 7:50:26 HHariri
  52. { Fixed Protocols Package Description
  53. }
  54. {
  55. { Rev 1.1 02/06/2004 17:00:46 HHariri
  56. { design-time added
  57. }
  58. {
  59. { Rev 1.0 2004.02.08 2:28:38 PM czhower
  60. { Initial checkin
  61. }
  62. {
  63. { Rev 1.0 2004.01.22 8:18:34 PM czhower
  64. { Initial checkin
  65. }
  66. unit PackageProtocols;
  67. interface
  68. uses
  69. Package;
  70. type
  71. TPackageProtocols = class(TPackage)
  72. public
  73. procedure Generate(ACompiler: TCompiler); override;
  74. procedure GenerateDT(ACompiler: TCompiler); override;
  75. end;
  76. implementation
  77. uses DModule;
  78. { TPackageProtocols }
  79. procedure TPackageProtocols.Generate(ACompiler: TCompiler);
  80. begin
  81. inherited;
  82. FName := 'IndyProtocols' + GCompilerID[Compiler];
  83. FDesc := 'Protocols';
  84. GenHeader;
  85. GenOptions;
  86. Code('');
  87. Code('requires');
  88. if ACompiler in DelphiNet then begin
  89. Code('Borland.Delphi,');
  90. Code('Borland.VclRtl,');
  91. end
  92. else if ACompiler = ctDelphi5 then begin
  93. Code(' Vcl50,');
  94. end else begin
  95. Code(' rtl,');
  96. end;
  97. Code(' IndySystem' + GCompilerID[Compiler] + ',');
  98. Code(' IndyCore' + GCompilerID[Compiler] + ';');
  99. GenContains;
  100. //back door for embedding version information into an assembly
  101. //without having to do anything to the package directly.
  102. if ACompiler in DelphiNet then
  103. begin
  104. Code('{$I IdProtocols90ASM90.inc}');
  105. end;
  106. WriteFile(DM.OutputPath + '\Lib\Protocols\');
  107. end;
  108. procedure TPackageProtocols.GenerateDT(ACompiler: TCompiler);
  109. begin
  110. inherited;
  111. FName := 'dclIndyProtocols' + GCompilerID[Compiler];
  112. FDesc := 'Protocols Design Time';
  113. GenHeader;
  114. GenOptions(True);
  115. Code('');
  116. Code('requires');
  117. if ACompiler in DelphiNet then
  118. begin
  119. Code(' System.Windows.Forms,');
  120. Code(' Borland.Studio.Vcl.Design,');
  121. end
  122. else if ACompiler = ctDelphi5 then
  123. begin
  124. Code(' Vcl50,');
  125. end else
  126. begin
  127. if ACompiler in [ctDelphi6, ctDelphi7] then
  128. begin
  129. Code(' vcl,');
  130. end;
  131. Code(' designide,');
  132. end;
  133. Code(' IndyProtocols' + GCompilerID[Compiler] + ',');
  134. Code(' IndySystem' + GCompilerID[Compiler] + ',');
  135. Code(' IndyCore' + GCompilerID[Compiler] + ',');
  136. Code(' dclIndyCore' + GCompilerID[Compiler] + ';');
  137. GenContains;
  138. //back door for embedding version information into an assembly
  139. //without having to do anything to the package directly.
  140. if ACompiler in DelphiNet then
  141. begin
  142. Code('{$I IddclProtocols90ASM90.inc}');
  143. end;
  144. WriteFile(DM.OutputPath + '\Lib\Protocols\');
  145. end;
  146. end.