I have a big unit, and I want to send the used functions code to my friend, so he can read the code but don't have problem with all other not used functions.
I know compiler knows what is used and does not link not used functions, is there a way or tool somewhere that I can use to generate a unit out of another one automatically?
Something like this sample:
unit SourceUnit;
{$DEFINE IncludeCode}
interface
{$IFDEF IncludeCode} //Include this code in a new unit
procedure Test1;
{$ENDIF}
{$IFNDEF IncludeCode} //Do not include
procedure Test2;
{$ENDIF}
implementation
{$IFDEF IncludeCode}
procedure Test1;
begin
end;
{$ENDIF}
{$IFNDEF IncludeCode}
procedure Test2;
begin
end;
{$ENDIF}
end.
unit GeneratedUnit;
interface
procedure Test1;
implementation
procedure Test1;
begin
end;
end.