daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest Oct 6th, 2017 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- output:
  2. -- $ ./obj/main
  3. -- Original.
  4. -- $ ./obj2/main
  5. -- Replacement.
  6.  
  7. -- test.gpr
  8. project Test is
  9.    for Source_Dirs use ("src");
  10.    for Main use ("main.adb");
  11.    for Object_Dir use "obj";
  12. end Test;
  13. -- test2.gpr
  14. project Test2 extends "test" is
  15.    for Source_Dirs use ("replacement");
  16.    for Source_Files use ("foo.adb");
  17.    for Object_Dir use "obj2";
  18. end Test2;
  19.  
  20. -- src/foo.adb
  21. with Ada.Text_IO;
  22.  
  23. package body Foo is
  24.    procedure Foobar is
  25.    begin
  26.       Ada.Text_IO.Put_Line ("Original.");
  27.    end Foobar;
  28. end Foo;
  29. -- src/foo.ads
  30. package Foo is
  31.    procedure Foobar;
  32. end Foo;
  33. -- src/main.adb
  34. with Foo;
  35.  
  36. procedure Main is
  37. begin
  38.    Foo.Foobar;
  39. end Main;
  40.  
  41. -- replacement/foo.adb
  42. with Ada.Text_IO;
  43.  
  44. package body Foo is
  45.    procedure Foobar is
  46.    begin
  47.       Ada.Text_IO.Put_Line ("Replacement.");
  48.    end Foobar;
  49. end Foo;
RAW Paste Data
Top