PackageVisualStudio.pas 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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.5 2004.11.14 10:35:34 AM czhower
  18. { Update
  19. }
  20. {
  21. { Rev 1.4 12/10/2004 17:52:34 HHariri
  22. { Fixes for VS
  23. }
  24. {
  25. { Rev 1.3 12/10/2004 15:39:30 HHariri
  26. { Fixes for VS
  27. }
  28. {
  29. { Rev 1.2 04/09/2004 12:45:16 ANeillans
  30. { Moved the databasename and output paths into a globally accessible variable
  31. { -- makes it a lot easier to override if you need to (as I did for my local
  32. { file structure).
  33. }
  34. {
  35. { Rev 1.1 2004.05.19 10:01:52 AM czhower
  36. { Updates
  37. }
  38. {
  39. { Rev 1.0 2004.01.22 8:18:36 PM czhower
  40. { Initial checkin
  41. }
  42. unit PackageVisualStudio;
  43. interface
  44. uses
  45. Package;
  46. type
  47. TPackageVisualStudio = class(TPackage)
  48. public
  49. Debug: Boolean;
  50. //
  51. constructor Create; override;
  52. procedure GenHeader; override;
  53. procedure GenOptions(ADesignTime: Boolean = False); override;
  54. procedure Generate(ACompiler: TCompiler); override;
  55. end;
  56. implementation
  57. uses DModule;
  58. { TPackageVisualStudio }
  59. constructor TPackageVisualStudio.Create;
  60. begin
  61. inherited;
  62. FContainsClause := 'uses';
  63. FExt := '.dpr';
  64. end;
  65. procedure TPackageVisualStudio.Generate(ACompiler: TCompiler);
  66. begin
  67. inherited;
  68. if Debug then begin
  69. FName := 'Indy.SocketsDebug';
  70. end else begin
  71. FName := 'Indy.Sockets';
  72. end;
  73. FDesc := '.Net Assembly';
  74. AddUnit('IdAssemblyInfo', 'System');
  75. GenHeader;
  76. GenOptions;
  77. if Debug then begin
  78. GenContains();
  79. end else begin
  80. GenContains('Indy.Sockets.Id', False);
  81. end;
  82. Code('');
  83. Code('begin');
  84. WriteFile(DM.OutputPath + '\Lib\');
  85. end;
  86. procedure TPackageVisualStudio.GenHeader;
  87. begin
  88. Code('library ' + FName + ';');
  89. end;
  90. procedure TPackageVisualStudio.GenOptions(ADesignTime: Boolean);
  91. begin
  92. Code('');
  93. Code('{%DelphiDotNetAssemblyCompiler ''$(SystemRoot)\microsoft.net\framework\v1.1.4322\System.dll''}');
  94. // Dont seem to need .Delphi? But internal errors when not included sometimes
  95. Code('{%DelphiDotNetAssemblyCompiler ''$(CommonProgramFiles)\borland shared\bds\shared assemblies\3.0\Borland.Delphi.dll''}');
  96. // Doesnt seem to need this either - likely the visual parts are here
  97. //Code('{%DelphiDotNetAssemblyCompiler ''$(CommonProgramFiles)\borland shared\bds\shared assemblies\3.0\Borland.Vcl.dll''}');
  98. Code('{%DelphiDotNetAssemblyCompiler ''$(CommonProgramFiles)\borland shared\bds\shared assemblies\3.0\Borland.VclRtl.dll''}');
  99. Code('');
  100. end;
  101. end.