Memnarch / Delphinus

An alternative Packagemanager for the Delphi-IDE
Mozilla Public License 2.0
235 stars 63 forks source link

Add platform #14

Closed rareMaxim closed 8 years ago

rareMaxim commented 8 years ago

unit DN.Compiler.Intf

...

TDNCompilerPlatform = (cpWin32, cpWin64, cpOSX32, cpAndroid, cpiOS32, cpiOS64, cpiOSSimulator, cpLINUX, cpLINUX64);

...

TDNCompilerPlatformName: array[Low(TDNCompilerPlatform)..High(TDNCompilerPlatform)] of string = ('Win32', 'Win64', 'OSX32', 'Android', 'iOSDevice32', 'iOSDevice64', 'iOSSimulator', 'LINUX', 'LINUX64');

unit DN.JSonFile.Installation;

...

function TInstallationFile.GetPlatforms( const APlatforms: string): TDNCompilerPlatforms; var LPlatforms: TStringDynArray; LPlatform: string; begin LPlatforms := SplitString(APlatforms, ';'); if Length(LPlatforms) > 0 then begin Result := []; for LPlatform in LPlatforms do begin if SameText(LPlatform, 'Win32') then Result := Result + [cpWin32] else if SameText(LPlatform, 'Win64') then Result := Result + [cpWin64] else if SameText(LPlatform, 'OSX32') then Result := Result + [cpOSX32] else if SameText(LPlatform, 'Android') then Result := Result + [cpAndroid] else if SameText(LPlatform, 'iOSDevice32') then Result := Result + [cpiOS32] else if SameText(LPlatform, 'iOSDevice64') then Result := Result + [cpiOS64] else if SameText(LPlatform, 'iOSSimulator') then Result := Result + [cpiOSSimulator] else if SameText(LPlatform, 'LINUX') then Result := Result + [cpLINUX] else if SameText(LPlatform, 'LINUX64') then Result := Result + [cpLINUX64] end; end else begin Result := [cpWin32]; end; end;

...

unit DN.ProjectInfo;

...

function TDNProjectInfo.LoadFromFile(const AProjectFile: string): Boolean; ... if LPlatform.HasAttribute('value') then begin if SameText(LPlatform.Attributes['value'], 'Win32') then FSupportedPlatforms := FSupportedPlatforms + [cpWin32] else if SameText(LPlatform.Attributes['value'], 'Win64') then FSupportedPlatforms := FSupportedPlatforms + [cpWin64] else if SameText(LPlatform.Attributes['value'], 'OSX32') then FSupportedPlatforms := FSupportedPlatforms + [cpOSX32] else if SameText(LPlatform.Attributes['value'], 'Android') then FSupportedPlatforms := FSupportedPlatforms + [cpAndroid] else if SameText(LPlatform.Attributes['value'], 'iOS32') then FSupportedPlatforms := FSupportedPlatforms + [cpiOS32] else if SameText(LPlatform.Attributes['value'], 'iOS64') then FSupportedPlatforms := FSupportedPlatforms + [cpiOS64] else if SameText(LPlatform.Attributes['value'], 'iOSSimulator') then FSupportedPlatforms := FSupportedPlatforms + [cpiOSSimulator] else if SameText(LPlatform.Attributes['value'], 'LINUX') then FSupportedPlatforms := FSupportedPlatforms + [cpLINUX] else if SameText(LPlatform.Attributes['value'], 'LINUX64') then FSupportedPlatforms := FSupportedPlatforms + [cpLINUX64] end;

....

unit DN.PackageDetailView;

...

const CDelphiNames: array[9..31] of string = ('2', '3', '3', '4', '5', '6', '7', '8', '2005', '2006', '2007', '2009', '2010', 'XE', 'XE2', 'XE3', 'XE4', 'XE5', 'XE6', 'XE7', 'XE8', 'Seattle', 'London');

Memnarch commented 8 years ago

ah thanks! i'll ad that tomorrow if you don't mind ;) Not sure if i'd add IOSSimulator. I mean if you install something for IOS32/64, is it really needed to add searchpathes and stuff to the SImulator path o.O (at least i don't want to have people add the IOSSimulator tag to the installfiles, since that's something that can be (hopefully) done implicit)

PS: you can do this kind of stuf usually much better by creating a pullrequest. But since the changes are quite small, this is ok right now ;)

rareMaxim commented 8 years ago

Thanks!