From 70fe3a5109705fc2f6ab9d57fbf44e12f0b34194 Mon Sep 17 00:00:00 2001 From: skalogryz Date: Fri, 29 Jul 2016 03:34:23 +0000 Subject: [PATCH] iphonelazext: fixing the warning (ansi to wide, wide to ansi) shown on fpc 3. Updating building script. Forcing to use the script file on Xcode project generation. Using custom options in Xcode project. Fix resolving of project paths git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5045 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/iphonelazext/def_buildscript.sh | 90 +++++++++++++++--- components/iphonelazext/ideext.pas | 22 +++-- components/iphonelazext/iphonebundle.pas | 99 ++++++++++++++++++-- components/iphonelazext/iphoneextoptions.pas | 20 ++-- components/iphonelazext/iphonelazext.lpk | 2 +- components/iphonelazext/iphonesimctrl.pas | 1 - components/iphonelazext/pbx/pbxcontainer.pas | 2 +- components/iphonelazext/pbx/xcodeproj.pas | 6 +- components/iphonelazext/plistfile.pas | 5 +- components/iphonelazext/xcodetemplate.pas | 53 ++++------- components/iphonelazext/xibfile.pas | 12 +-- 11 files changed, 224 insertions(+), 88 deletions(-) diff --git a/components/iphonelazext/def_buildscript.sh b/components/iphonelazext/def_buildscript.sh index bb9d59689..7bb975e25 100644 --- a/components/iphonelazext/def_buildscript.sh +++ b/components/iphonelazext/def_buildscript.sh @@ -1,31 +1,93 @@ -## start +## The script builds the project for both 32 and 64-bit architectures +## It's requirement for Apple to support both arm32 and arm64 for a device +## Some Simulators might still be 32-bit (iPhone4, iPads), thus both x86 and x86_64 +## are compiled echo "compiling FPC project" export RESULT_EXE=${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH} -export IOSHEADERS= cd $FPC_MAIN_DIR -#rm $RESULT_EXE -export TargetCPU=${PLATFORM_PREFERRED_ARCH} +export TargetCPU=${PLATFORM_PREFERRED_ARCH} +## default compile options, assuming ARM +export OPT32=${FPC_OPT_A32} +export OPT64=${FPC_OPT_A64} +export CPU32="arm" +export CPU64="aarch64" +export TargetOS="darwin" + +## Simulator has been selected in Xcode project +## switching options to Intel if [ "${PLATFORM_NAME}" == "iphonesimulator" ]; then - export TargetOS="iphonesim" +export OPT32=${FPC_OPT_I32} +export OPT64=${FPC_OPT_I64} +export CPU32="i386" +export CPU64="x86_64" +export TargetOS="iphonesim" fi + +## 64-bit compilation + +export Result64=${RESULT_EXE}_64 +export TargetCPU=${CPU64} export Target=${TargetCPU}-${TargetOS} -pwd -echo ${RESULT_EXE} +## making output directory +export outdir=lib/${Target} +mkdir -p ${outdir} + +## debugging echo +echo ${FPC_DIR}fpc -T${TargetOS} -P${TargetCPU} \ + ${FPC_CUSTOM_OPTIONS} ${OPT64} \ + -Filib/${Target} -FUlib/${Target} \ + -XR${SDKROOT} -FD${PLATFORM_DEVELOPER_BIN_DIR} $FPC_MAIN_FILE \ + -o${Result64} + +${FPC_DIR}fpc -T${TargetOS} -P${TargetCPU} \ + ${FPC_CUSTOM_OPTIONS} ${OPT64} \ + -Filib/${Target} -FUlib/${Target} \ + -XR${SDKROOT} -FD${PLATFORM_DEVELOPER_BIN_DIR} $FPC_MAIN_FILE \ + -o${Result64} -${FPC_DIR}fpc -T${TargetOS} -P${TargetCPU} -MDelphi -Scghi -O1 -l -dIPHONEALL \ - ${FPC_CUSTOM_OPTIONS} \ --Filib/${Target} -FUlib/${Target} \ --XR${SDKROOT} -FD${PLATFORM_DEVELOPER_BIN_DIR} $FPC_MAIN_FILE \ - -o${RESULT_EXE} export RES=$? +## if compiler returned an error, stop the script and exit with error if [ $RES != 0 ]; then exit $RES fi -echo ${RESULT_EXE} -exit $FPCRES \ No newline at end of file +## 32-bit complication + +export Result32=${RESULT_EXE}_32 +export TargetCPU=${CPU32} +export Target=${TargetCPU}-${TargetOS} +## making output directory +export outdir=lib/${Target} +mkdir -p ${outdir} + +echo ${FPC_DIR}fpc -T${TargetOS} -P${TargetCPU} \ + ${FPC_CUSTOM_OPTIONS} ${OPT32} \ + -Filib/${Target} -FUlib/${Target} \ + -XR${SDKROOT} -FD${PLATFORM_DEVELOPER_BIN_DIR} $FPC_MAIN_FILE \ + -o${Result32} + +${FPC_DIR}fpc -T${TargetOS} -P${TargetCPU} \ + ${FPC_CUSTOM_OPTIONS} ${OPT32} \ + -Filib/${Target} -FUlib/${Target} \ + -XR${SDKROOT} -FD${PLATFORM_DEVELOPER_BIN_DIR} $FPC_MAIN_FILE \ + -o${Result32} +export RES=$? + +## if compiler returned an error, stop the script and exit with error +if [ $RES != 0 ]; then +exit $RES +fi + +## both 32 and 64 are done, making the fat binary +lipo -create ${Result32} ${Result64} -output ${RESULT_EXE} + +## removing 32 and 64 bit +rm ${Result32} +rm ${Result64} + +exit $FPCRES diff --git a/components/iphonelazext/ideext.pas b/components/iphonelazext/ideext.pas index 85af94aec..d87b1a2ec 100644 --- a/components/iphonelazext/ideext.pas +++ b/components/iphonelazext/ideext.pas @@ -25,6 +25,7 @@ uses Graphics, Controls, Forms, Dialogs, LazFileUtils, {Lazarus Interface} LazIDEIntf, MenuIntf, ProjectIntf, IDEOptionsIntf, IDEMsgIntf + ,CompOptsIntf ,IDEExternToolIntf ,project_iphone_options, xcodetemplate, iphonelog_form, @@ -395,6 +396,7 @@ var Info : TiPhoneBundleInfo; opt : string; + prjopt : TLazCompilerOptions; begin // the create .plist would be used by XCode project // the simulator .plist in created with InstallAppToSim. @@ -413,12 +415,12 @@ begin build.Add('FPC_MAIN_FILE','"'+LazarusIDE.ActiveProject.MainFile.Filename+'"'); opt:=''; - with LazarusIDE.ActiveProject.LazCompilerOptions do begin - opt:=opt + ' ' +BreakPathsStringToOption(OtherUnitFiles, '-Fu', '\"'); - opt:=opt + ' ' +BreakPathsStringToOption(IncludePath, '-Fi', '\"'); - opt:=opt + ' ' +BreakPathsStringToOption(ObjectPath, '-Fo', '\"'); - opt:=opt + ' ' +BreakPathsStringToOption(Libraries, '-Fl', '\"'); - end; + prjopt:=LazarusIDE.ActiveProject.LazCompilerOptions; + opt:=opt + ' ' +BreakPathsStringToOption(prjopt.GetUnitPath(true, coptParsedPlatformIndependent), '-Fu', '\"'); + opt:=opt + ' ' +BreakPathsStringToOption(prjopt.GetIncludePath(true, coptParsedPlatformIndependent), '-Fi', '\"'); + opt:=opt + ' ' +BreakPathsStringToOption(prjopt.GetObjectPath(true, coptParsedPlatformIndependent), '-Fo', '\"'); + opt:=opt + ' ' +BreakPathsStringToOption(prjopt.GetLibraryPath(true, coptParsedPlatformIndependent), '-Fl', '\"'); + opt:=opt + ' ' +prjopt.CustomOptions; dir:=ResolveProjectPath('xcode'); dir:=dir+'/'; @@ -469,6 +471,14 @@ begin templates.Values['mainfile']:=LazarusIDE.ActiveProject.MainFile.Filename; templates.Values['projoptions']:=opt; + if FileExists(EnvOptions.ScriptTemplate) then begin + try + DefaultBuildScript:=ReadBuildScriptFile( EnvOptions.ScriptTemplate ); + except + end; + end; + + if not UpdateProject(projName, templates, ProjOptions.ResFiles) then IDEMsg(Format(strXcodeUpdFailed,[projdir])) else diff --git a/components/iphonelazext/iphonebundle.pas b/components/iphonelazext/iphonebundle.pas index db05509bf..3f1cd7c21 100644 --- a/components/iphonelazext/iphonebundle.pas +++ b/components/iphonelazext/iphonebundle.pas @@ -61,6 +61,92 @@ function RandomSpaceName: WideString; implementation +(* Build script: +## start +echo "compiling FPC project" + +export RESULT_EXE=${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH} +export IOSHEADERS= +cd $FPC_MAIN_DIR + +export TargetCPU=${PLATFORM_PREFERRED_ARCH} + +export OPT32=${FPC_OPT_A32} +export OPT64=${FPC_OPT_A64} +export CPU32="arm" +export CPU64="aarch64" +export TargetOS="darwin" + +if [ "${PLATFORM_NAME}" == "iphonesimulator" ]; then +export OPT32=${FPC_OPT_I32} +export OPT64=${FPC_OPT_I64} +export CPU32="i386" +export CPU64="x86_64" +export TargetOS="iphonesim" +fi + +# 64-bit compilation +export Result64=${RESULT_EXE}_64 +export TargetCPU=${CPU64} +export Target=${TargetCPU}-${TargetOS} +## making output directory +export outdir=lib/${Target} +mkdir -p ${outdir} + +echo ${FPC_DIR}fpc -T${TargetOS} -P${TargetCPU} -MDelphi -Scghi -O3 -l -dIPHONEALL \ +${FPC_CUSTOM_OPTIONS} ${OPT64} \ +-Filib/${Target} -FUlib/${Target} \ +-XR${SDKROOT} -FD${PLATFORM_DEVELOPER_BIN_DIR} $FPC_MAIN_FILE \ +-o${Result64} + +${FPC_DIR}fpc -T${TargetOS} -P${TargetCPU} -MDelphi -Scghi -O3 -l -dIPHONEALL \ + ${FPC_CUSTOM_OPTIONS} ${OPT64} \ +-Filib/${Target} -FUlib/${Target} \ +-XR${SDKROOT} -FD${PLATFORM_DEVELOPER_BIN_DIR} $FPC_MAIN_FILE \ + -k-F/Users/dmitry/FPC_laz/paseng/tests/testBomber3UI -k-t \ + -o${Result64} +export RES=$? + +if [ $RES != 0 ]; then + exit $RES +fi + + +# 32-bit complication +export Result32=${RESULT_EXE}_32 +export TargetCPU=${CPU32} +export Target=${TargetCPU}-${TargetOS} +## making output directory +export outdir=lib/${Target} +mkdir -p ${outdir} + +echo ${FPC_DIR}fpc -T${TargetOS} -P${TargetCPU} -MDelphi -Scghi -Cg -O3 -l -dIPHONEALL \ +${FPC_CUSTOM_OPTIONS} ${OPT32} \ +-Filib/${Target} -FUlib/${Target} \ +-XR${SDKROOT} -FD${PLATFORM_DEVELOPER_BIN_DIR} $FPC_MAIN_FILE \ +-k-F/Users/dmitry/FPC_laz/paseng/tests/testBomber3UI \ +-o${Result32} + +${FPC_DIR}fpc -T${TargetOS} -P${TargetCPU} -MDelphi -Scghi -Cg -O3 -l -dIPHONEALL \ +${FPC_CUSTOM_OPTIONS} ${OPT32} \ +-Filib/${Target} -FUlib/${Target} \ +-XR${SDKROOT} -FD${PLATFORM_DEVELOPER_BIN_DIR} $FPC_MAIN_FILE \ +-k-F/Users/dmitry/FPC_laz/paseng/tests/testBomber3UI \ +-o${Result32} +export RES=$? + +if [ $RES != 0 ]; then +exit $RES +fi + +lipo -create ${Result32} ${Result64} -output ${RESULT_EXE} +rm ${Result32} +rm ${Result64} + +exit $FPCRES + +*) + uses iPhoneExtOptions; @@ -72,7 +158,7 @@ begin CreateGUID(g); id:=GUIDToString(g); id:=Copy(id, 2, length(id)-2); - Result:=id; + Result:=UTF8Decode(id); end; @@ -119,7 +205,7 @@ begin if DirectoryExistsUTF8(p) then Result:=UTF8Decode(p) else if DirectoryExistsUTF8(path8) then - result:=path8 + result:=UTF8Decode(path8) else result :=''; end; @@ -145,7 +231,7 @@ var begin s := EnvOptions.SimAppsPath; EnvOptions.SubstituteMacros(s); - result := s; + result := UTF8Decode(s); end; { @@ -226,12 +312,13 @@ var pl : TPListFile; arr : TPListValue; begin + Result:=false; pl := TPListFile.Create; try if not FileExists(InfoFileName) then begin InitDefaultPlist(pl); end else - LoadFromFile(InfoFileName, pl); + LoadFromFile( UTF8Encode(InfoFileName), pl); SetStr(pl, 'CFBundleDisplayName', info.DisplayName); SetStr(pl, 'CFBundleExecutable', ExeName); SetStr(pl, 'CFBundleIdentifier', info.AppID); @@ -241,7 +328,7 @@ begin SetStr(pl, 'DTPlatformName', info.iPlatform); SetStr(pl, 'DTSDKName', info.SDKVersion); - SaveToXMLFile(pl, InfoFileName); + Result:=SaveToXMLFile(pl, UTF8Encode(InfoFileName)); finally pl.Free; end; @@ -260,7 +347,7 @@ const ' CFBundleIdentifier'#10+ ' %s'#10+ {company + bundle name} ' CFBundleInfoDictionaryVersion'#10+ ' 6.0'#10+ ' CFBundleName'#10+ ' %s'#10+ {bundle name} - ' CFBundlePackageType'#10+ ' APPL'#10+ + ' CFBundlePackageType'#10+ ' APPL'#10+ // must be present for AppStore deployment! ' CFBundleSignature'#10+ ' ????'#10+ ' CFBundleSupportedPlatforms'#10+ ' '#10+' %s'#10+' '#10+ {platform} '%s'+ // optional MainNib name diff --git a/components/iphonelazext/iphoneextoptions.pas b/components/iphonelazext/iphoneextoptions.pas index 66026b33f..f3961c8a2 100644 --- a/components/iphonelazext/iphoneextoptions.pas +++ b/components/iphonelazext/iphoneextoptions.pas @@ -21,7 +21,7 @@ interface uses Classes, SysUtils, IDEOptionsIntf, LazIDEIntf, ProjectIntf, MacroIntf, - iPhoneBundle, XMLConf, XcodeUtils, PlistFile + iPhoneBundle, XMLConf, XcodeUtils , LazFileUtils, LazFilesUtils , iphonesimctrl, xcodeproj; @@ -306,15 +306,15 @@ begin try xmlcfg.RootName:='config'; xmlcfg.Filename:=XMLFileName; - fPlatformsBaseDir := UTF8Encode(xmlcfg.GetValue('Platforms', fPlatformsBaseDir )); - fCompilerPath := UTF8Encode(xmlcfg.GetValue('Compiler', fCompilerPath)); - fBaseRTLPath := UTF8Encode(xmlcfg.GetValue('RTLPath', fBaseRTLPath)); - fCommonOpt := UTF8Encode(xmlcfg.GetValue('CompilerOptions', fCommonOpt)); - fSimBundle := UTF8Encode(xmlcfg.GetValue('SimBundle', fSimBundle)); - fSimAppsPath := UTF8Encode(xmlcfg.GetValue('SimAppPath', fSimAppsPath)); - fDefaultSDK := UTF8Encode(xmlcfg.GetValue('DefaultSDK', fDefaultSDK)); - fDefaultDeviceID := UTF8Encode(xmlcfg.GetValue('DefaultDevice', fDefaultDeviceID)); - fScriptTemplate := UTF8Encode(xmlcfg.GetValue('ScriptTemplate', fScriptTemplate)); + fPlatformsBaseDir := UTF8Encode(xmlcfg.GetValue('Platforms', UTF8Decode(fPlatformsBaseDir) )); + fCompilerPath := UTF8Encode(xmlcfg.GetValue('Compiler', UTF8Decode(fCompilerPath))); + fBaseRTLPath := UTF8Encode(xmlcfg.GetValue('RTLPath', UTF8Decode(fBaseRTLPath))); + fCommonOpt := UTF8Encode(xmlcfg.GetValue('CompilerOptions', UTF8Decode(fCommonOpt))); + fSimBundle := UTF8Encode(xmlcfg.GetValue('SimBundle', UTF8Decode(fSimBundle))); + fSimAppsPath := UTF8Encode(xmlcfg.GetValue('SimAppPath', UTF8Decode(fSimAppsPath))); + fDefaultSDK := UTF8Encode(xmlcfg.GetValue('DefaultSDK', UTF8Decode(fDefaultSDK))); + fDefaultDeviceID := UTF8Encode(xmlcfg.GetValue('DefaultDevice', UTF8Decode(fDefaultDeviceID))); + fScriptTemplate := UTF8Encode(xmlcfg.GetValue('ScriptTemplate', UTF8Decode(fScriptTemplate))); RefreshVersions; if (fDefaultSDK = '') and (fVersions.Count>0) then diff --git a/components/iphonelazext/iphonelazext.lpk b/components/iphonelazext/iphonelazext.lpk index fc169165a..07d8a2549 100644 --- a/components/iphonelazext/iphonelazext.lpk +++ b/components/iphonelazext/iphonelazext.lpk @@ -24,7 +24,7 @@ - + diff --git a/components/iphonelazext/iphonesimctrl.pas b/components/iphonelazext/iphonesimctrl.pas index 6a63fc99b..664bbe394 100644 --- a/components/iphonelazext/iphonesimctrl.pas +++ b/components/iphonelazext/iphonesimctrl.pas @@ -267,7 +267,6 @@ var l : string; st : TStringList; i : integer; - j : integer; ip : string; // install path fp : string; // content path begin diff --git a/components/iphonelazext/pbx/pbxcontainer.pas b/components/iphonelazext/pbx/pbxcontainer.pas index 81dcb9f01..5f88da364 100644 --- a/components/iphonelazext/pbx/pbxcontainer.pas +++ b/components/iphonelazext/pbx/pbxcontainer.pas @@ -711,7 +711,7 @@ const FlagGet = 3; // 1 + 2 //ptField = 0; FlagSet = 12; // 4 + 8 , 16 + 32 //ptStatic = 1; FlagSP = 16 + 32; //ptVirtual = 2; - FlagIdx = 64; //ptConst = 3; } + FlagIdx = 64; //ptConst = 3; begin if (not Assigned(obj)) or (not Assigned(srz)) then Exit; diff --git a/components/iphonelazext/pbx/xcodeproj.pas b/components/iphonelazext/pbx/xcodeproj.pas index a5fbd8ab0..ee2e1a2d2 100644 --- a/components/iphonelazext/pbx/xcodeproj.pas +++ b/components/iphonelazext/pbx/xcodeproj.pas @@ -698,7 +698,7 @@ end; function ProjectCreateMin: PBXProject; var p : PBXProject; - cfg : XCBuildConfiguration; + //cfg : XCBuildConfiguration; begin // requirements: // * at least one build configuration @@ -709,8 +709,8 @@ begin p.buildConfigurationList._headerComment:='Build configuration list for PBXProject'; p.buildConfigurationList.defaultConfigurationIsVisible:='0'; - cfg:=p.buildConfigurationList.addConfig('Debug'); - cfg:=p.buildConfigurationList.addConfig('Release'); + p.buildConfigurationList.addConfig('Debug'); + p.buildConfigurationList.addConfig('Release'); // default name must be present p.buildConfigurationList.defaultConfigurationName:='Release'; Result:=p; diff --git a/components/iphonelazext/plistfile.pas b/components/iphonelazext/plistfile.pas index b3a96c802..1fad55d53 100644 --- a/components/iphonelazext/plistfile.pas +++ b/components/iphonelazext/plistfile.pas @@ -145,7 +145,6 @@ var res : integer; {$ifdef darwin} xs : string; - err : LongWord; m : TStringStream; doc : TXMLDocument; {$endif} @@ -255,7 +254,7 @@ begin ltDict: begin dst.Add(pfx+''); for i:=0 to v.count-1 do begin - dst.Add(XMLPFX+''+XMLEncodeText(v.names[i])+''); + dst.Add(XMLPFX+''+XMLEncodeText(UTF8Decode(v.names[i]))+''); WriteXMLValue(v.items[i], dst, pfx+XMLPFX); end; dst.Add(pfx+''); @@ -374,7 +373,7 @@ var begin Result:=nil; if not Assigned(valnode) then Exit; - if not NodeNameToPListType(valnode.NodeName, tp) then Exit; + if not NodeNameToPListType( UTF8Encode(valnode.NodeName), tp) then Exit; Result:=TPListValue.Create(tp); case tp of ltBoolean: Result.bool:=(valnode.NodeName='true'); // false is false diff --git a/components/iphonelazext/xcodetemplate.pas b/components/iphonelazext/xcodetemplate.pas index d0c7ee3ee..48189bdf7 100644 --- a/components/iphonelazext/xcodetemplate.pas +++ b/components/iphonelazext/xcodetemplate.pas @@ -28,7 +28,7 @@ function UpdateProject(const ProjFileName: string; TemplateValues, ResFiles: TSt procedure UpdateBldConfig(const proj: PBXProject; optName, optVal: string); procedure UpdateMainFile(const proj: PBXProject; mainfile: string); -procedure UpdateCompileOpts(const proj: PBXProject; const options: string); +procedure UpdateCompileOpts(const proj: PBXProject; const aoptions: string); const XCodeProjectTemplateIconID : AnsiString ='0AE3FFA610F3C9AF00A9B007,'; @@ -206,43 +206,19 @@ const ' rootObject = 0A52AE8310F0D05300478C4F /* Project object */;'#10+ '}'#10; - BuildScript = - '## start'#13 - +'echo "compiling FPC project"'#13 - +''#13 - +'export RESULT_EXE=${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'#13 - +'export IOSHEADERS='#13 - +'cd $FPC_MAIN_DIR'#13 - +'#rm $RESULT_EXE'#13 - +'export TargetCPU=${PLATFORM_PREFERRED_ARCH}'#13 - +''#13 - +'if [ "${PLATFORM_NAME}" == "iphonesimulator" ]; then'#13 - +' export TargetOS="iphonesim"'#13 - +'fi'#13 - +'export Target=${TargetCPU}-${TargetOS}'#13 - +''#13 - +'pwd'#13 - +'echo ${RESULT_EXE}'#13 - +''#13 - +'${FPC_DIR}fpc -T${TargetOS} -P${TargetCPU} -MDelphi -Scghi -O1 -l -dIPHONEALL \'#13 - +' ${FPC_CUSTOM_OPTIONS} \'#13 - //-Fu~/iOS_6_0 -Fu. - +'-Filib/${Target} -FUlib/${Target} \'#13 - +'-XR${SDKROOT} -FD${PLATFORM_DEVELOPER_BIN_DIR} $FPC_MAIN_FILE \'#13 - +' -o${RESULT_EXE}'#13 - +'export RES=$?'#13 - +''#13 - +'if [ $RES != 0 ]; then'#13 - +' exit $RES'#13 - +'fi'#13 - +''#13 - +'echo ${RESULT_EXE}'#13 - +''#13 - +'exit $FPCRES'#13; +var + // global variable... a bad pattern must be replaced + DefaultBuildScript : string = ''; +function ReadBuildScriptFile(const fn: string): string; implementation +function EmptyBuildScript: string; +begin + Result:=''; +end; + function GetValueName(const Source: String; idx: Integer): String; var i : integer; @@ -355,8 +331,9 @@ begin Result:=StringReplace(Result, '$(TargetOS)', os, [rfReplaceAll, rfIgnoreCase]); end; -procedure UpdateCompileOpts(const proj: PBXProject; const options: string); +procedure UpdateCompileOpts(const proj: PBXProject; const aoptions: string); var + options : string; opt : string; i32opt : string; i64opt : string; @@ -367,6 +344,7 @@ var begin //UpdateBldConfig(proj, 'FPC_CUSTOM_OPTIONS', options); UpdateBldConfig(proj, 'FPC_CUSTOM_OPTIONS', ''); + options:=aoptions+' '; // trailing space, always to consume the last options i:=1; j:=1; l:=length(options); @@ -521,7 +499,7 @@ begin if not Assigned(TargetFindRunScript(trg)) then begin scr:=TargetAddRunScript(trg); - scr.shellScript:=BuildScript; + scr.shellScript:=DefaultBuildScript; scr.showEnvVarsInLog:=true; end; @@ -563,8 +541,9 @@ begin prj.Free; Exit; end; - end else + end else begin prj:=ProjectCreate3_2; + end; try PrepareTemplateFile(prj, TemplateValues, Resfiles); diff --git a/components/iphonelazext/xibfile.pas b/components/iphonelazext/xibfile.pas index 7faae6613..7f5377439 100644 --- a/components/iphonelazext/xibfile.pas +++ b/components/iphonelazext/xibfile.pas @@ -185,7 +185,7 @@ end; procedure DoReadXibDoc(ADoc: TXMLDocument; var Obj: TXibObject); const - DataNode = 'data'; + //DataNode = 'data'; XibObject = 'object'; var node : TDOMNode; @@ -288,7 +288,7 @@ begin n:=fXibNode.FirstChild; while Assigned(n) do begin if (n.NodeName='string') and (TDOMElement(n).AttribStrings['key']='') then - list.Add(n.TextContent); + list.Add(UTF8Encode(n.TextContent)); n:=n.NextSibling; end; end; @@ -319,13 +319,13 @@ var n : TDOMNode; begin n:=FindProperty(PropName); - if Assigned(n) and (n.NodeName='string') then Result:=n.TextContent + if Assigned(n) and (n.NodeName='string') then Result:=UTF8Encode(n.TextContent) else Result:=''; end; function isKeyAttr(n: TDomNode; const KeyAttrVal: String): Boolean; begin - Result:=Assigned(n) and (n is TDOMElement) and (TDOMElement(n).AttribStrings['key']=KeyAttrVal) + Result:=Assigned(n) and (n is TDOMElement) and (TDOMElement(n).AttribStrings['key']=UTF8Decode(KeyAttrVal)) end; function TXibObject.FindProperty(const PropName:String):TDOMNode; @@ -344,7 +344,7 @@ begin Result:=''; Exit; end; - Result:=TDOMElement(fXibNode).AttribStrings['key']; + Result:=UTF8Encode(TDOMElement(fXibNode).AttribStrings['key']); end; function TXibObject.GetXibClass:String; @@ -353,7 +353,7 @@ begin Result:=''; Exit; end; - Result:=TDOMElement(fXibNode).AttribStrings['class']; + Result:=UTF8Encode(TDOMElement(fXibNode).AttribStrings['class']); end; procedure ListClassesDescr(const FileName: AnsiString; DstList : TList); overload;