You've already forked lazarus-ccr
iphonelazext: changed update Xcode project. Only create info.plist, if file doesn't exist, reuse, if existing info.plist
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4417 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -19,6 +19,7 @@ unit ideext;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
{$ifdef darwin}BaseUnix, Unix,{$endif}
|
||||||
process,
|
process,
|
||||||
Classes, SysUtils, contnrs,
|
Classes, SysUtils, contnrs,
|
||||||
Graphics, Controls, Forms, Dialogs, LazFileUtils,
|
Graphics, Controls, Forms, Dialogs, LazFileUtils,
|
||||||
|
@ -19,7 +19,7 @@ unit iPhoneBundle;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LazFileUtils;
|
Classes, SysUtils, LazFileUtils, PlistFile;
|
||||||
|
|
||||||
const
|
const
|
||||||
platform_iPhoneSim = 'iphonesimulator';
|
platform_iPhoneSim = 'iphonesimulator';
|
||||||
@ -47,6 +47,7 @@ procedure MakeSimSpaceStruct(const iPhoneSimUserPath, SpaceName, BundleName: Wid
|
|||||||
function GetBundleExeName(const BundleAppDir, ExeName: WideString): WideString;
|
function GetBundleExeName(const BundleAppDir, ExeName: WideString): WideString;
|
||||||
|
|
||||||
procedure WritePkgFile(const FileName: WideString);
|
procedure WritePkgFile(const FileName: WideString);
|
||||||
|
function WriteDefInfoList_(const InfoFileName, BundleName, ExeName: WideString; const info: TiPhoneBundleInfo): Boolean;
|
||||||
function WriteDefInfoList(const InfoFileName, BundleName, ExeName: WideString; const info: TiPhoneBundleInfo): Boolean;
|
function WriteDefInfoList(const InfoFileName, BundleName, ExeName: WideString; const info: TiPhoneBundleInfo): Boolean;
|
||||||
|
|
||||||
procedure CreateBundle(const BundleName, ExeName: WideString; const Info: TiPhoneBundleInfo; var FullBundlePath, FullExeName: WideString);
|
procedure CreateBundle(const BundleName, ExeName: WideString; const Info: TiPhoneBundleInfo; var FullBundlePath, FullExeName: WideString);
|
||||||
@ -198,7 +199,55 @@ begin
|
|||||||
fs.Free;
|
fs.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure InitDefaultPlist(pl: TPListFile);
|
||||||
|
var
|
||||||
|
arr : TPListValue;
|
||||||
|
begin
|
||||||
|
SetStr(pl, 'CFBundleDevelopmentRegion', 'English');
|
||||||
|
SetStr(pl, 'CFBundleDisplayName', '');
|
||||||
|
SetStr(pl, 'CFBundleExecutable', '');
|
||||||
|
SetStr(pl, 'CFBundleIdentifier', '');
|
||||||
|
SetStr(pl, 'CFBundleInfoDictionaryVersion', '6.0');
|
||||||
|
SetStr(pl, 'CFBundleName', '');
|
||||||
|
SetStr(pl, 'CFBundlePackageType', 'APPL');
|
||||||
|
SetStr(pl, 'CFBundleSignature', '????');
|
||||||
|
SetArr(pl, 'CFBundleSupportedPlatforms');
|
||||||
|
SetStr(pl, 'CFBundleVersion', '1.0');
|
||||||
|
SetStr(pl, 'DTPlatformName', '');
|
||||||
|
SetStr(pl, 'DTSDKName', '');
|
||||||
|
SetBool(pl, 'LSRequiresIPhoneOS', true);
|
||||||
|
arr:=SetArr(pl, 'UISupportedInterfaceOrientations');
|
||||||
|
AddStr(arr, 'UIInterfaceOrientationPortrait');
|
||||||
|
AddStr(arr, 'UIInterfaceOrientationLandscapeLeft');
|
||||||
|
end;
|
||||||
|
|
||||||
function WriteDefInfoList(const InfoFileName, BundleName, ExeName: WideString; const info: TiPhoneBundleInfo): Boolean;
|
function WriteDefInfoList(const InfoFileName, BundleName, ExeName: WideString; const info: TiPhoneBundleInfo): Boolean;
|
||||||
|
var
|
||||||
|
pl : TPListFile;
|
||||||
|
arr : TPListValue;
|
||||||
|
begin
|
||||||
|
pl := TPListFile.Create;
|
||||||
|
try
|
||||||
|
if not FileExists(InfoFileName) then begin
|
||||||
|
InitDefaultPlist(pl);
|
||||||
|
end else
|
||||||
|
LoadFromFile(InfoFileName, pl);
|
||||||
|
SetStr(pl, 'CFBundleDisplayName', info.DisplayName);
|
||||||
|
SetStr(pl, 'CFBundleExecutable', ExeName);
|
||||||
|
SetStr(pl, 'CFBundleIdentifier', info.AppID);
|
||||||
|
SetStr(pl, 'CFBundleName', BundleName);
|
||||||
|
arr:=SetArr(pl, 'CFBundleSupportedPlatforms');
|
||||||
|
SetStr(arr, 0, info.iPlatform);
|
||||||
|
SetStr(pl, 'DTPlatformName', info.iPlatform);
|
||||||
|
SetStr(pl, 'DTSDKName', info.SDKVersion);
|
||||||
|
|
||||||
|
SaveToXMLFile(pl, InfoFileName);
|
||||||
|
finally
|
||||||
|
pl.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function WriteDefInfoList_(const InfoFileName, BundleName, ExeName: WideString; const info: TiPhoneBundleInfo): Boolean;
|
||||||
const
|
const
|
||||||
BundleFormat : AnsiString =
|
BundleFormat : AnsiString =
|
||||||
'<?xml version="1.0" encoding="UTF-8"?>'#10+
|
'<?xml version="1.0" encoding="UTF-8"?>'#10+
|
||||||
@ -219,6 +268,11 @@ const
|
|||||||
' <key>DTPlatformName</key>'#10+ ' <string>%s</string>'#10+ {platform}
|
' <key>DTPlatformName</key>'#10+ ' <string>%s</string>'#10+ {platform}
|
||||||
' <key>DTSDKName</key>'#10+ ' <string>%s</string>'#10+ {sdk version}
|
' <key>DTSDKName</key>'#10+ ' <string>%s</string>'#10+ {sdk version}
|
||||||
' <key>LSRequiresIPhoneOS</key>'#10+ ' <true/>'#10+
|
' <key>LSRequiresIPhoneOS</key>'#10+ ' <true/>'#10+
|
||||||
|
' <key>UISupportedInterfaceOrientations</key>'#10+
|
||||||
|
' <array>'#10+
|
||||||
|
' <string>UIInterfaceOrientationPortrait</string>'#10+
|
||||||
|
' <string>UIInterfaceOrientationLandscapeLeft</string>'#10+
|
||||||
|
' </array>'#10+
|
||||||
'</dict>'#10+
|
'</dict>'#10+
|
||||||
'</plist>';
|
'</plist>';
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ unit PlistFile;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, DOM, XMLRead;
|
Classes, SysUtils, DOM, XMLRead{$ifdef darwin},process{$endif};
|
||||||
|
|
||||||
type
|
type
|
||||||
TPlistType = (ltString, ltArray, ltDict, ltData, ltDate, ltBoolean, ltNumber);
|
TPlistType = (ltString, ltArray, ltDict, ltData, ltDate, ltBoolean, ltNumber);
|
||||||
@ -29,6 +29,8 @@ type
|
|||||||
TPListValue = class(TObject)
|
TPListValue = class(TObject)
|
||||||
private
|
private
|
||||||
fType : TPlistType;
|
fType : TPlistType;
|
||||||
|
protected
|
||||||
|
function GetValueIndex(const aname: string; force: Boolean): Integer;
|
||||||
public
|
public
|
||||||
str : WideString;
|
str : WideString;
|
||||||
binary : array of byte;
|
binary : array of byte;
|
||||||
@ -42,21 +44,20 @@ type
|
|||||||
constructor Create(AType: TPlistType);
|
constructor Create(AType: TPlistType);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function AddValue: Integer;
|
function AddValue: Integer;
|
||||||
property ValueType: TPListType read fType;
|
|
||||||
function FindValue(const nm: string): Integer;
|
function FindValue(const nm: string): Integer;
|
||||||
|
procedure Delete(idx: Integer);
|
||||||
|
procedure Clear;
|
||||||
|
property ValueType: TPListType read fType;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TPListFile }
|
{ TPListFile }
|
||||||
|
|
||||||
TPListFile = class(TObject)
|
TPListFile = class(TObject)
|
||||||
protected
|
protected
|
||||||
function GetValueIdx(const aname: string; force: Boolean): Integer;
|
|
||||||
public
|
public
|
||||||
root : TPListValue;
|
root : TPListValue;
|
||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function GetStrValue(const valname: string): string;
|
|
||||||
procedure SetStrValue(const AName: string; const AValue: WideString; AValType: TPlistType = ltString);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function LoadFromXML(const fn: string; plist: TPListFile): Boolean; overload;
|
function LoadFromXML(const fn: string; plist: TPListFile): Boolean; overload;
|
||||||
@ -68,9 +69,47 @@ procedure DebugPlistFile(const fl: TPListFile);
|
|||||||
|
|
||||||
function LoadFromFile(const fn: string; plist: TPListFile): Boolean;
|
function LoadFromFile(const fn: string; plist: TPListFile): Boolean;
|
||||||
|
|
||||||
|
function GetStr(dict: TPListValue; const AName: string): string; overload;
|
||||||
|
function GetStr(pl: TPListFile; const AName: string): string; overload; inline;
|
||||||
|
|
||||||
|
procedure SetStr(vl: TPListValue; const AValue: WideString); overload;
|
||||||
|
procedure SetStr(dict: TPListValue; const AName: string; const AValue: WideString); overload;
|
||||||
|
procedure SetStr(arr: TPListValue; idx: Integer; const AValue: WideString); overload;
|
||||||
|
procedure SetStr(pl: TPListFile; const AName: string; const AValue: WideString); overload; inline;
|
||||||
|
|
||||||
|
procedure SetBool(dict: TPListvalue; const AName: string; AValue: Boolean); overload;
|
||||||
|
procedure SetBool(pl: TPListFile; const AName: string; AValue: Boolean); overload; inline;
|
||||||
|
|
||||||
|
function AddItem(vl: TPListValue; const name: string; tp: TPListType = ltString): Integer; overload;
|
||||||
|
function AddItem(vl: TPListValue; tp: TPListType = ltString ): Integer; overload;
|
||||||
|
procedure AddStr(arr: TPListValue; const AValue: WideString);
|
||||||
|
|
||||||
|
function SetArr(vl: TPListValue; const AName: string): TPListValue; overload;
|
||||||
|
function SetArr(pl: TPListFile; const AName: string): TPListValue; overload; inline;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
function AddItem(vl: TPListValue; const name: string; tp: TPListType = ltString): Integer; overload;
|
||||||
|
begin
|
||||||
|
Result:=AddItem(vl, tp);
|
||||||
|
if vl.ValueType=ltDict then
|
||||||
|
vl.names[Result]:=name;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function AddItem(vl: TPListValue; tp: TPListType = ltString ): Integer; overload;
|
||||||
|
var
|
||||||
|
idx : integer;
|
||||||
|
begin
|
||||||
|
if not Assigned(vl) then begin
|
||||||
|
Result:=-1;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
idx:=vl.AddValue;
|
||||||
|
if not Assigned(vl.items[idx]) then
|
||||||
|
vl.items[idx]:=TPListValue.Create(tp);
|
||||||
|
Result:=idx;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure DebugValue(kv: TPListValue; const prefix: string );
|
procedure DebugValue(kv: TPListValue; const prefix: string );
|
||||||
var
|
var
|
||||||
i : integer;
|
i : integer;
|
||||||
@ -120,7 +159,7 @@ begin
|
|||||||
else begin
|
else begin
|
||||||
{$ifdef darwin}
|
{$ifdef darwin}
|
||||||
// the utility is not available anywhere else but OSX
|
// the utility is not available anywhere else but OSX
|
||||||
if not ExecCmdLineStdOut('plutil -convert xml1 -o - "'+fn+'"', xs, err) then begin
|
if not RunCommand('plutil', ['-convert','xml1','-o' ,'-', fn], xs) then begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
@ -184,12 +223,16 @@ begin
|
|||||||
if (Result='') and (b<>'') then
|
if (Result='') and (b<>'') then
|
||||||
Result:=b
|
Result:=b
|
||||||
else begin
|
else begin
|
||||||
if j<length(b) then begin
|
if b='' then
|
||||||
i:=length(b)+1;
|
Result:=''
|
||||||
Move(b[j], Result[k], i-j);
|
else begin
|
||||||
inc(k, i-j);
|
if j<length(b) then begin
|
||||||
|
i:=length(b)+1;
|
||||||
|
Move(b[j], Result[k], i-j);
|
||||||
|
inc(k, i-j);
|
||||||
|
end;
|
||||||
|
SetLength(Result, k-1);
|
||||||
end;
|
end;
|
||||||
SetLength(Result, k-1);
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -361,16 +404,16 @@ begin
|
|||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPListFile.GetValueIdx(const aname: string; force: Boolean): Integer;
|
function TPListValue.GetValueIndex(const aname: string; force: Boolean): Integer;
|
||||||
var
|
var
|
||||||
idx: integer;
|
idx: integer;
|
||||||
begin
|
begin
|
||||||
idx:=root.FindValue(aname);
|
idx:=FindValue(aname);
|
||||||
if (idx<0) and (force) then begin
|
if (idx<0) and (force) then begin
|
||||||
idx:=root.AddValue;
|
idx:=AddValue;
|
||||||
if not Assigned(root.Items[idx]) then
|
if not Assigned(Items[idx]) then
|
||||||
root.items[idx]:=TPListValue.Create(ltString);
|
items[idx]:=TPListValue.Create(ltString);
|
||||||
root.names[idx]:=aname;
|
names[idx]:=aname;
|
||||||
end;
|
end;
|
||||||
Result:=idx;
|
Result:=idx;
|
||||||
end;
|
end;
|
||||||
@ -387,34 +430,93 @@ begin
|
|||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPListFile.GetStrValue(const valname: string): string;
|
function GetStr(dict: TPListValue; const AName: string): string;
|
||||||
var
|
var
|
||||||
i : integer;
|
i : integer;
|
||||||
begin
|
begin
|
||||||
if not Assigned(root) or (root.ValueType<>ltDict) then begin
|
if not Assigned(dict) or (dict.ValueType<>ltDict) then begin
|
||||||
Result:='';
|
Result:='';
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
for i:=0 to root.count-1 do
|
for i:=0 to dict.count-1 do
|
||||||
if root.names[i]=valname then begin
|
if dict.names[i]=AName then begin
|
||||||
Result:=UTF8Encode(root.items[i].str);
|
Result:=UTF8Encode(dict.items[i].str);
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
Result:='';
|
Result:='';
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPListFile.SetStrValue(const AName: string; const AValue: WideString; AValType: TPlistType);
|
procedure SetStr(vl: TPListValue; const AValue: WideString);
|
||||||
|
begin
|
||||||
|
if not Assigned(vl) then Exit;
|
||||||
|
vl.str:=AValue;
|
||||||
|
vl.fType:=ltString;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure SetStr(dict: TPListValue; const AName: string; const AValue: WideString);
|
||||||
var
|
var
|
||||||
idx: integer;
|
idx: integer;
|
||||||
begin
|
begin
|
||||||
idx:=GetValueIdx(aname, true);
|
idx:=dict.GetValueIndex(AName, true);
|
||||||
writeln('idx= ', idx,' ',length(root.items),' ',root.count,' ',Assigned(root.items[idx]));
|
SetStr(dict.items[idx], Avalue);
|
||||||
root.items[idx].str:=avalue;
|
end;
|
||||||
writeln('222');
|
|
||||||
root.items[idx].fType:=AValType;
|
procedure SetBool(dict: TPListvalue; const AName: string; AValue: Boolean); overload;
|
||||||
writeln('333');
|
var
|
||||||
|
idx: integer;
|
||||||
|
begin
|
||||||
|
idx:=dict.GetValueIndex(AName, true);
|
||||||
|
dict.items[idx].bool:=AValue;
|
||||||
|
dict.items[idx].fType:=ltBoolean;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure SetStr(pl: TPListFile; const AName: string; const AValue: WideString); overload; inline;
|
||||||
|
begin
|
||||||
|
SetStr(pl.root, AName, AValue);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure SetBool(pl: TPListFile; const AName: string; AValue: Boolean); overload; inline;
|
||||||
|
begin
|
||||||
|
SetBool(pl.root, AName, AValue);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure SetStr(arr: TPListValue; idx: Integer; const AValue: WideString); overload;
|
||||||
|
begin
|
||||||
|
if not Assigned(arr) or (arr.ValueType<>ltArray) or (idx<0) or (idx>arr.count) then Exit;
|
||||||
|
if idx=arr.count then
|
||||||
|
AddStr(arr, Avalue)
|
||||||
|
else begin
|
||||||
|
if not Assigned(arr.items[idx]) then arr.items[idx]:=TPListValue.Create(ltString);
|
||||||
|
SetStr(arr.items[idx], AValue);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure AddStr(arr: TPListValue; const AValue: WideString);
|
||||||
|
var
|
||||||
|
idx: integer;
|
||||||
|
begin
|
||||||
|
idx:=AddItem(arr, ltString);
|
||||||
|
arr.items[idx].str:=AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetStr(pl: TPListFile; const AName: string): string; overload; inline;
|
||||||
|
begin
|
||||||
|
Result:=GetStr(pl.root, AName);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function SetArr(vl: TPListValue; const AName: string): TPListValue; overload;
|
||||||
|
var
|
||||||
|
idx: integer;
|
||||||
|
begin
|
||||||
|
idx:=vl.GetValueIndex(AName, true);
|
||||||
|
Result:=vl.items[idx];
|
||||||
|
Result.fType:=ltArray;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function SetArr(pl: TPListFile; const AName: string): TPListValue; overload; inline;
|
||||||
|
begin
|
||||||
|
Result := SetArr(pl.root, AName);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TPListValue }
|
{ TPListValue }
|
||||||
@ -426,12 +528,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TPListValue.Destroy;
|
destructor TPListValue.Destroy;
|
||||||
var
|
|
||||||
i : integer;
|
|
||||||
begin
|
begin
|
||||||
for i:=0 to length(items)-1 do
|
Clear;
|
||||||
if Assigned(items[i]) then
|
|
||||||
items[i].Free;
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -462,5 +560,36 @@ begin
|
|||||||
Result:=-1;
|
Result:=-1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPListValue.Delete(idx: Integer);
|
||||||
|
var
|
||||||
|
i : integer;
|
||||||
|
begin
|
||||||
|
if (idx<0) or (idx>=count) then Exit;
|
||||||
|
items[idx].Free;
|
||||||
|
if ValueType=ltDict then names[idx]:='';
|
||||||
|
|
||||||
|
if idx<count-1 then begin
|
||||||
|
Move(items[idx+1], items[idx], (count-idx)*sizeof(TPListValue));
|
||||||
|
if ValueType=ltDict then begin
|
||||||
|
Move(names[idx+1], names[idx], (count-idx)*sizeof(PtrUInt));
|
||||||
|
names[count-1]:='';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
dec(count);
|
||||||
|
items[count]:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TPListValue.Clear;
|
||||||
|
var
|
||||||
|
i : Integer;
|
||||||
|
begin
|
||||||
|
for i:=0 to length(items)-1 do
|
||||||
|
if Assigned(items[i]) then
|
||||||
|
items[i].Free;
|
||||||
|
count:=0;
|
||||||
|
SetLength(names, 0);
|
||||||
|
SetLength(items, 0);
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -16,14 +16,38 @@ begin
|
|||||||
pl:=TPlistFile.Create;
|
pl:=TPlistFile.Create;
|
||||||
try
|
try
|
||||||
LoadFromXML(fn, pl);
|
LoadFromXML(fn, pl);
|
||||||
writeln(pl.GetStrValue('CFBundleDevelopmentRegion'));
|
writeln(GetStr(pl.root, 'CFBundleDevelopmentRegion'));
|
||||||
pl.SetStrValue('DTPlatformName','TESTPLATFORMNAME');
|
SetStr(pl.root, 'DTPlatformName','TESTPLATFORMNAME');
|
||||||
SaveToXMLFile(pl, ChangeFileExt(fn, '.xml.out'));
|
SaveToXMLFile(pl, ChangeFileExt(fn, '.xml.out'));
|
||||||
finally
|
finally
|
||||||
pl.Free;
|
pl.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TestDefault;
|
||||||
|
var
|
||||||
|
pl: TPListFile;
|
||||||
|
arr: TPListValue;
|
||||||
|
begin
|
||||||
|
pl:=TPListFile.Create;
|
||||||
|
SetStr(pl, 'CFBundleDevelopmentRegion', 'English');
|
||||||
|
SetStr(pl, 'CFBundleDisplayName', '');
|
||||||
|
SetStr(pl, 'CFBundleExecutable', '');
|
||||||
|
SetStr(pl, 'CFBundleIdentifier', '');
|
||||||
|
SetStr(pl, 'CFBundleInfoDictionaryVersion', '6.0');
|
||||||
|
SetStr(pl, 'CFBundleName', '');
|
||||||
|
SetStr(pl, 'CFBundlePackageType', 'APPL');
|
||||||
|
SetStr(pl, 'CFBundleSignature', '????');
|
||||||
|
SetArr(pl, 'CFBundleSupportedPlatforms');
|
||||||
|
SetStr(pl, 'CFBundleVersion', '1.0');
|
||||||
|
SetStr(pl, 'DTPlatformName', '');
|
||||||
|
SetStr(pl, 'DTSDKName', '');
|
||||||
|
SetBool(pl, 'LSRequiresIPhoneOS', true);
|
||||||
|
arr:=SetArr(pl, 'UISupportedInterfaceOrientations');
|
||||||
|
write(WriteXML(pl));
|
||||||
|
pl.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
fn : string;
|
fn : string;
|
||||||
begin
|
begin
|
||||||
@ -32,6 +56,7 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
fn := ParamStr(1);
|
fn := ParamStr(1);
|
||||||
TestRead(fn);
|
if fn='-def' then TestDefault
|
||||||
|
else TestRead(fn);
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -51,9 +51,9 @@ begin
|
|||||||
try
|
try
|
||||||
plistfile.LoadFromFile(FileName, plist);
|
plistfile.LoadFromFile(FileName, plist);
|
||||||
|
|
||||||
Descr.Name:=plist.GetStrValue('CanonicalName');
|
Descr.Name:=GetStr(plist, 'CanonicalName');
|
||||||
Descr.Alternate:=plist.GetStrValue('AlternateSDK');
|
Descr.Alternate:=GetStr(plist, 'AlternateSDK');
|
||||||
Descr.Version:=plist.GetStrValue('Version');
|
Descr.Version:=GetStr(plist, 'Version');
|
||||||
finally
|
finally
|
||||||
plist.Free;
|
plist.Free;
|
||||||
end;
|
end;
|
||||||
@ -168,8 +168,8 @@ begin
|
|||||||
if AnsiLowerCase(ExtractFileExt(files[j]))='.plist' then begin
|
if AnsiLowerCase(ExtractFileExt(files[j]))='.plist' then begin
|
||||||
plist:=TPListFile.Create;
|
plist:=TPListFile.Create;
|
||||||
plistfile.LoadFromFile(files[j],plist);
|
plistfile.LoadFromFile(files[j],plist);
|
||||||
xib:=plist.GetStrValue('MainTemplateFile');
|
xib:=GetStr(plist, 'MainTemplateFile');
|
||||||
descr:=plist.GetStrValue('Description');
|
descr:=GetStr(plist, 'Description');
|
||||||
name:=ChangeFileExt(xib, '');
|
name:=ChangeFileExt(xib, '');
|
||||||
Break;
|
Break;
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user