You've already forked lazarus-ccr
iphonelazext: automatic update project's nib files for the iPhoneSim
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1206 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -103,15 +103,16 @@ var
|
|||||||
bundlepath : WideString;
|
bundlepath : WideString;
|
||||||
exepath : WideString;
|
exepath : WideString;
|
||||||
nm : String;
|
nm : String;
|
||||||
symlink : String;
|
dstpath : String;
|
||||||
Space : WideString;
|
Space : WideString;
|
||||||
RealSpace : WideString;
|
RealSpace : WideString;
|
||||||
Info : TiPhoneBundleInfo;
|
Info : TiPhoneBundleInfo;
|
||||||
|
|
||||||
|
xiblist : TStringList;
|
||||||
|
i : Integer;
|
||||||
begin
|
begin
|
||||||
Space:=ProjOptions.SpaceName; // LazarusIDE.ActiveProject.CustomData.;
|
Space:=ProjOptions.SpaceName; // LazarusIDE.ActiveProject.CustomData.;
|
||||||
|
|
||||||
{todo:}
|
|
||||||
|
|
||||||
bundleName:=ExtractFileName(LazarusIDE.ActiveProject.ProjectInfoFile);
|
bundleName:=ExtractFileName(LazarusIDE.ActiveProject.ProjectInfoFile);
|
||||||
bundleName:=Copy(bundleName, 1, length(bundleName)-length(ExtractFileExt(bundleName)));
|
bundleName:=Copy(bundleName, 1, length(bundleName)-length(ExtractFileExt(bundleName)));
|
||||||
|
|
||||||
@@ -126,14 +127,30 @@ begin
|
|||||||
CopySymLinks(
|
CopySymLinks(
|
||||||
ResolveProjectPath(ProjOptions.ResourceDir),
|
ResolveProjectPath(ProjOptions.ResourceDir),
|
||||||
bundlepath,
|
bundlepath,
|
||||||
ProjOptions.ExcludeMask
|
// don't copy .xib files, they're replaced by compiled nibs
|
||||||
|
'*.xib; '+ ProjOptions.ExcludeMask
|
||||||
);
|
);
|
||||||
|
|
||||||
if nm<>'' then begin
|
if nm<>'' then begin
|
||||||
symlink:=UTF8Encode(exepath);
|
dstpath:=UTF8Encode(exepath);
|
||||||
FpUnlink(symlink);
|
FpUnlink(dstpath);
|
||||||
fpSymlink(PChar(nm), PChar(symlink));
|
fpSymlink(PChar(nm), PChar(dstpath));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
xiblist := TStringList.Create;
|
||||||
|
try
|
||||||
|
EnumFilesAtDir(ResolveProjectPath(ProjOptions.ResourceDir), '*.xib', xiblist);
|
||||||
|
for i:=0 to xiblist.Count-1 do begin
|
||||||
|
dstpath:=IncludeTrailingPathDelimiter(bundlepath)+ChangeFileExt(ExtractFileName(xiblist[i]), '.nib');
|
||||||
|
ExecCmdLineNoWait(Format('ibtool --compile "%s" "%s"', [dstpath, xiblist[i]]));
|
||||||
|
writeln('compile from: ', xiblist[i]);
|
||||||
|
writeln(' to: ', dstpath);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
xiblist.free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//todo: compile .xib files to .nibs
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FindParam(const Source, ParamKey: String; var idx: Integer; var Content: String): Boolean;
|
function FindParam(const Source, ParamKey: String; var idx: Integer; var Content: String): Boolean;
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ inherited iPhoneProjectOptionsEditor: TiPhoneProjectOptionsEditor
|
|||||||
ClientHeight = 474
|
ClientHeight = 474
|
||||||
ClientWidth = 620
|
ClientWidth = 620
|
||||||
OnClick = FrameClick
|
OnClick = FrameClick
|
||||||
DesignLeft = 246
|
DesignLeft = 611
|
||||||
DesignTop = 121
|
DesignTop = 128
|
||||||
object chkisPhone: TCheckBox[0]
|
object chkisPhone: TCheckBox[0]
|
||||||
Left = 16
|
Left = 16
|
||||||
Height = 18
|
Height = 18
|
||||||
|
|||||||
@@ -3,26 +3,26 @@
|
|||||||
LazarusResources.Add('TiPhoneProjectOptionsEditor','FORMDATA',[
|
LazarusResources.Add('TiPhoneProjectOptionsEditor','FORMDATA',[
|
||||||
'TPF0'#241#27'TiPhoneProjectOptionsEditor'#26'iPhoneProjectOptionsEditor'#6'H'
|
'TPF0'#241#27'TiPhoneProjectOptionsEditor'#26'iPhoneProjectOptionsEditor'#6'H'
|
||||||
+'eight'#3#218#1#5'Width'#3'l'#2#12'ClientHeight'#3#218#1#11'ClientWidth'#3'l'
|
+'eight'#3#218#1#5'Width'#3'l'#2#12'ClientHeight'#3#218#1#11'ClientWidth'#3'l'
|
||||||
+#2#7'OnClick'#7#10'FrameClick'#10'DesignLeft'#3#246#0#9'DesignTop'#2'y'#0#242
|
+#2#7'OnClick'#7#10'FrameClick'#10'DesignLeft'#3'c'#2#9'DesignTop'#3#128#0#0
|
||||||
+#2#0#9'TCheckBox'#10'chkisPhone'#4'Left'#2#16#6'Height'#2#18#3'Top'#2#16#5'W'
|
+#242#2#0#9'TCheckBox'#10'chkisPhone'#4'Left'#2#16#6'Height'#2#18#3'Top'#2#16
|
||||||
+'idth'#3#199#0#7'Caption'#6#29'is iPhone application project'#8'TabOrder'#2#0
|
+#5'Width'#3#199#0#7'Caption'#6#29'is iPhone application project'#8'TabOrder'
|
||||||
+#0#0#242#2#1#6'TLabel'#8'lblAppID'#4'Left'#2#16#6'Height'#2#18#3'Top'#2'X'#5
|
+#2#0#0#0#242#2#1#6'TLabel'#8'lblAppID'#4'Left'#2#16#6'Height'#2#18#3'Top'#2
|
||||||
+'Width'#2'W'#7'Caption'#6#14'Application ID'#11'ParentColor'#8#0#0#242#2#2#5
|
+'X'#5'Width'#2'W'#7'Caption'#6#14'Application ID'#11'ParentColor'#8#0#0#242#2
|
||||||
+'TEdit'#8'edtAppID'#4'Left'#2'p'#6'Height'#2#22#3'Top'#2'U'#5'Width'#3#234#1
|
+#2#5'TEdit'#8'edtAppID'#4'Left'#2'p'#6'Height'#2#22#3'Top'#2'U'#5'Width'#3
|
||||||
+#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#1#4'Text'#6#19
|
+#234#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#1#4'Text'
|
||||||
+'com.mycompany.myapp'#0#0#242#2#3#6'TLabel'#12'lblAppIDHint'#4'Left'#2#16#6
|
+#6#19'com.mycompany.myapp'#0#0#242#2#3#6'TLabel'#12'lblAppIDHint'#4'Left'#2
|
||||||
+'Height'#2#14#3'Top'#2'u'#5'Width'#3#237#1#7'Caption'#6'_It''s recommended b'
|
+#16#6'Height'#2#14#3'Top'#2'u'#5'Width'#3#237#1#7'Caption'#6'_It''s recommen'
|
||||||
+'y Apple to use domain-structured name, i.e. com.mycompany.myApplication as '
|
+'ded by Apple to use domain-structured name, i.e. com.mycompany.myApplicatio'
|
||||||
+'ID'#11'Font.Height'#2#246#11'ParentColor'#8#10'ParentFont'#8#0#0#242#2#4#6
|
+'n as ID'#11'Font.Height'#2#246#11'ParentColor'#8#10'ParentFont'#8#0#0#242#2
|
||||||
+'TLabel'#9'lblSDKVer'#4'Left'#2#16#6'Height'#2#18#3'Top'#2'3'#5'Width'#2'P'#7
|
+#4#6'TLabel'#9'lblSDKVer'#4'Left'#2#16#6'Height'#2#18#3'Top'#2'3'#5'Width'#2
|
||||||
+'Caption'#6#12'SDK version:'#11'ParentColor'#8#0#0#242#2#5#9'TComboBox'#7'cm'
|
+'P'#7'Caption'#6#12'SDK version:'#11'ParentColor'#8#0#0#242#2#5#9'TComboBox'
|
||||||
+'bSDKs'#4'Left'#2'p'#6'Height'#2#20#3'Top'#2'0'#5'Width'#3#184#0#10'ItemHeig'
|
+#7'cmbSDKs'#4'Left'#2'p'#6'Height'#2#20#3'Top'#2'0'#5'Width'#3#184#0#10'Item'
|
||||||
+'ht'#2#0#8'OnChange'#7#13'cmbSDKsChange'#5'Style'#7#14'csDropDownList'#8'Tab'
|
+'Height'#2#0#8'OnChange'#7#13'cmbSDKsChange'#5'Style'#7#14'csDropDownList'#8
|
||||||
+'Order'#2#2#0#0#242#2#6#5'TEdit'#9'edtResDir'#4'Left'#2'x'#6'Height'#2#22#3
|
+'TabOrder'#2#2#0#0#242#2#6#5'TEdit'#9'edtResDir'#4'Left'#2'x'#6'Height'#2#22
|
||||||
+'Top'#3#176#0#5'Width'#3#226#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0
|
+#3'Top'#3#176#0#5'Width'#3#226#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'
|
||||||
+#8'OnChange'#7#15'edtResDirChange'#6'OnExit'#7#13'edtResDirExit'#8'TabOrder'
|
+#0#8'OnChange'#7#15'edtResDirChange'#6'OnExit'#7#13'edtResDirExit'#8'TabOrde'
|
||||||
+#2#3#4'Text'#6#9'Resources'#0#0#242#2#7#6'TLabel'#6'Label1'#4'Left'#2#16#6'H'
|
+'r'#2#3#4'Text'#6#9'Resources'#0#0#242#2#7#6'TLabel'#6'Label1'#4'Left'#2#16#6
|
||||||
+'eight'#2#18#3'Top'#3#176#0#5'Width'#2'Y'#7'Caption'#6#14'Resources dir:'#11
|
+'Height'#2#18#3'Top'#3#176#0#5'Width'#2'Y'#7'Caption'#6#14'Resources dir:'#11
|
||||||
+'ParentColor'#8#0#0#242#2#8#5'TEdit'#10'edtExclude'#4'Left'#2'x'#6'Height'#2
|
+'ParentColor'#8#0#0#242#2#8#5'TEdit'#10'edtExclude'#4'Left'#2'x'#6'Height'#2
|
||||||
+#22#3'Top'#3#224#0#5'Width'#3#226#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRig'
|
+#22#3'Top'#3#224#0#5'Width'#3#226#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRig'
|
||||||
+'ht'#0#8'OnChange'#7#16'edtExcludeChange'#8'TabOrder'#2#4#4'Text'#6#4'.svn'#0
|
+'ht'#0#8'OnChange'#7#16'edtExcludeChange'#8'TabOrder'#2#4#4'Text'#6#4'.svn'#0
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes,SysUtils,FileUtil,LResources,Forms,StdCtrls,Masks,CheckLst,Buttons,
|
Classes,SysUtils,FileUtil,LResources,Forms,StdCtrls,Masks,CheckLst,Buttons,
|
||||||
Menus,IDEOptionsIntf,ProjectIntf,LazIDEIntf,iPhoneExtStr,iPhoneExtOptions, process, Controls;
|
Menus,IDEOptionsIntf,ProjectIntf,LazIDEIntf,iPhoneExtStr,
|
||||||
|
iPhoneExtOptions, process, Controls;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@@ -75,6 +76,9 @@ type
|
|||||||
property OnChanged: TNotifyEvent read fOnChanged write fOnChanged;
|
property OnChanged: TNotifyEvent read fOnChanged write fOnChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure EnumFilesAtDir(const PathUtf8, AMask : AnsiString; Dst: TStrings);
|
||||||
|
procedure ExecCmdLineNoWait(const CmdLineUtf8: AnsiString);
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
procedure EnumFilesAtDir(const PathUtf8, AMask : AnsiString; Dst: TStrings);
|
procedure EnumFilesAtDir(const PathUtf8, AMask : AnsiString; Dst: TStrings);
|
||||||
@@ -99,7 +103,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ExecCmdLine(const CmdLineUtf8: AnsiString; WaitExit: Boolean);
|
procedure ExecCmdLineNoWait(const CmdLineUtf8: AnsiString);
|
||||||
var
|
var
|
||||||
proc : TProcess;
|
proc : TProcess;
|
||||||
begin
|
begin
|
||||||
@@ -169,7 +173,7 @@ var
|
|||||||
begin
|
begin
|
||||||
path:=ChangeFileExt(IncludeTrailingPathDelimiter(edtResDir.Text)+SelXibFile,'.xib');
|
path:=ChangeFileExt(IncludeTrailingPathDelimiter(edtResDir.Text)+SelXibFile,'.xib');
|
||||||
LazarusIDE.ActiveProject.LongenFilename(path);
|
LazarusIDE.ActiveProject.LongenFilename(path);
|
||||||
ExecCmdLine('open ' + path, false);
|
ExecCmdLineNoWait('open ' + path);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TiPhoneProjectOptionsEditor.nibFilesBoxClickCheck(Sender:TObject);
|
procedure TiPhoneProjectOptionsEditor.nibFilesBoxClickCheck(Sender:TObject);
|
||||||
|
|||||||
Reference in New Issue
Block a user