IOS development Environment Windows Introduction _ios

Source: Internet
Author: User
Tags diff diff patch goto mixed rar svn zip sourcetree
1. XCode

Perference
General
Double click Navigation-the default double click will pop up a new window (use seperate window), this is not the same as VC, the main window location and size usually makes people have a sense of incoherence. Change to same as click as VC

Text Editing
Editing
While editing automatically trim trailing whitespace (remove trailing blanks)
including whitespace-only lines (full blank line also remove blank, note also retains carriage return)
This is actually our normal code will do, but this and the old code after the handover of patch may have a conflict. If you are accustomed to good, recommend not tick.
Default text Encoding Select Simplified Chinese (Mac OS)
Default line Ending Select Windows (CRLF)
Convert existing files on save does not tick

Keep in line with the Windows version code settings, the baseline is usually set on the Do not change, otherwise the Mac port diff will make your diff file full screen are ^m (there are two lines in a single file format)

Indentation 20099011
Prefer indent Using:tabs
Tab width:4 Spaces
Indent Width:4 Space
tab key:inserts Tab charater
Line Wrapping:wrap line to editor width hook
Indent Wrapped lines By:4 space
Syntax-aware indenting does not tick, automatic modification is very annoying, especially when you copy conflicting parts from diff file


Key bindings modify common shortcut keys, try to keep and vc/va consistent, VA ALT + <--> and alt+o alt+m not found, other commonly used, modified as follows:

(\ Shift | Alt left Upper Arrow home)











There is a conflict between some and the system's shortcut keys, which can be modified in the System Preferences-> keyboard-> keyboard shortcuts.

By the way, navigators (the left column) has a filter underneath it, but sometimes you forget to find the result, and look for the last filter keyword in it.


2. Version management tools

Svn:
Versions unfortunately not free. Take the old version a bit of trouble, the upper left corner select, in the revision input version number after the switch After/before can be relatively good to choose the older version.
Hg/git:
Sourcetree than Machg stream better than a little, regardless of efficiency or use habits, and is free, in his official website registered users, guide a lensence file into the private network can be used all the time.

Text editing:
SUBLIMT Text2 Special Refreshing editor, there are a lot of special features, for me is the main can be changed copy, such as the shortcut keys to support a variety of file syntax highlighting, the GBK support is not good, to the next plug-in. However, this plugin can cause large files to open more slowly.

7z Decompression:
7zX and so seems to be thrown into the dock, and then dragged and put in to use, with two large package decompression efficiency seems to be very poor, so I to the Mac have been zip up now.

3. Version Sync

A) the Diff/patch of MacOS

Since the Mac with the Diff/patch, so it does not matter to gnuwin32 those exe (and because the format is not the same, do not support those EXE)
Modify the content under the original Mydiff.bat, add Mac-related filtering,-x.ds_store-x*.xcworkspacedata-xxcuserdata, and then change the original%1 to $ $
Such as
 code as follows:

Diff-nur--IGNORE-FILE-NAME-CASE-XDEBUG-XRELEASE-XDEBUG_KALYDO-XRELEASE_KALYDO-XENV-XENVNORMAL-XENVWEB-XPDB-XVT une-xboost-xstlport-xdxsdk-x.svn-x.hg-x*.hgignore-x.git-x.gitignore-x*.vsp-x*.psess-x*.swp-x*.ncb-x*.opt-x*. scc-x*.plg-x*.clw-x*.aps-x*.org-x*.orig-x*.rej-x*.rar-x*. Administrator.user-x*.suo-x*.bak-x*.map-x*.ico-x*.vcproj.list-x*.vcproj.lnt-x.ds_store-x*.xcworkspacedata- Xxcuserdata $ $


Note that there should be no line breaks after the $ $, otherwise the path will have a problem with the diff.
Then remove the suffix name and place it in the contents of any path in the etc/paths (or on your favorite path, then add to etc/paths), setting the environment variable.
Then chmod 777 Mydiff, give this shell script permission.

This allows you to use the same mydiff as Windows.

B using Windows-style diff files under Mac

Because of Macport (Unix) diff, its output (^+++/^---/^@@  etc.) is LF, the output of the difference part is the line end of the original. So, in fact, only the full text of the changes before and after the entire UNIX-formatted line (LF) Support good.

The Conquest project, the universal use of Windows line tail character (CRLF), so the diff file is actually a mixture of two lines of the tail character file. That is, when you use Gvim to view this file, you will see the reason for the ^m symbol.

This is not the same as the Gunwin32 Diff/patch we use in Windows, the output of which is CRLF, and the difference is in the original.

As a result, there is an embarrassing situation, that is, a platform diff patch is difficult to use on another platform. Usually we are synchronizing Windows diff to the Mac version, usually in two ways:

I. Use Gunwin32 patch in Mac's Windows virtual machine

Note At this point patch folders that do not directly support network locations, and after you set up sharing (virtual machine/shared/shared settings), you can resolve this problem by mapping network drives (Explorer/tools/mapped network drives) in a Windows virtual machine.

II. Directly on the Mac with Shell script.

Create a new shell file Iospatch, which reads as follows:

 code as follows:

awk '/^\+\+\+|^---|^@@|^diff|^binary|^file/{sub (/\r$/, "")}; {print} ' > Unixlf.diff
Patch $@ < Unixlf.diff


Note that you want to handle the path as well as the Mydiff shell and give permissions.

The usage is the same as patch, but now we will write Iospatch-arg < file, such as Iospatch-p1 <. \win.diff

This method can avoid the turtle speed Black Apple opened the virtual machine after the worse, and can be compatible with unix/windows two styles of diff, recommended.


C) version function synchronization, conflict resolution

Apple things because of auditing and other reasons, version update relatively infrequent, there are often several major versions of the sync once, synchronization workload is very large, everyone to sync dozens of patches, and because of Windows and Mac branch of the difference is quite large, there will be a lot of conflicts, and because Xcode compile slowly, Resources need to be converted, and so on, it is difficult to do each patch check in once, so it will usually be dozens of patches to synthesize a large change file, and then put this file check in up.
Dozens of patches of conflict resolution, in case something happened behind (such as a conflict unresolved), it is very difficult to see on SVN. It is recommended to use a local version management tool, as described in the Sourcetree, because Hg/git and so are local warehouses, it is very simple to use. And not as SVN does with check in requirements so we can orig/rej file check in to our local warehouse for easy checking.
In order to restore changes locally, clean up redundant files, look at changes, it is particularly convenient, and when the baseline is updated, we can also take another branch, and then merge the branch, the implementation of the local merge after the patch, you can weaken the need for the baseline.

Annex to this article:

iOS Development Environment Windows Introduction _ Code attachment. zip
Download Address:/201306/other/ios_windows_fj_jb51.rar
Content (Note that some space carriage return in the Shell/bat file is sensitive, please download a copy of the problem directly)
Mac batch mixed format diff to unix format diff Diff2unix
code as follows:

#diff2unix
#Ruoqian, chen<piao.polar@gmail.com>.
#2013.2.7
#----------
#trans diff patch with Windows Le (CRLF) to Unix le (LF)
#-----------
#usage
#diff2unix Trans curent dir
#diff2unix path Trans dir or file
#when Trans Dir, would trans all files and child dir in it.
#----------
if [$# = 0]
Then
Path= ' pwd '
Else
Path=$1
Fi
If [f $path]
Then
file=${path##*/}
ext=${file##*.}
if [["$file"!= mac*]] && [$ext = "diff"]
Then
New_file= "Mac_" $file
echo $path "->" $new _file
awk '/^\+\+\+|^---|^@@|^diff|^binary|^file/{sub (/\r$/, "")}; {print} ' < $path > $new _file
Fi
Else
For file in ' ls $path '
Todo
Diff2unix $path "/" $file
Done
Fi

Windows batch mixed format diff to windows/dos format diff diff2win.bat
 code as follows:

::d Iff2win
::ruoqian,chen<piao.polar@gmail.com>
::----------
:: Trans file with Unix-Le (LF) or Mix LE (LF/CRLF) to Window LE (CRLF)
::----------
:: 2013.2.16
:: Usage
::d iff2win Trans curent dir
::d iff2win path trans dir or file
::----------
@echo off
Setlocal enabledelayedexpansion
Set workpath=%cd%
If [%1] neq [] set workpath=%1&& (dir/ad%1 >nul 2>nul) && goto Trans_dir | | Goto Trans_file
: Trans_dir
for/f "delims="%%i in (' Dir! workpath! /a-d/b ^| findstr. diff$ ^| Findstr-v ^win_ ') do (
Echo! workpath!/%%i-^> win_%%i
Gawk-v binmode= "rw" "/^\+\+\+|^---|^@@|^diff|^binary|^file/{sub (/$/,\" \r\ ")}; {print} ' <! workpath!/%%i > win_%%i
)
Goto:eof
: Trans_file
for/f "delims="%%i in (' dir%workpath%/b ') do (
echo%workpath%-^> win_%%i
Gawk-v binmode= "rw" "/^\+\+\+|^---|^@@|^diff|^binary|^file/{sub (/$/,\" \r\ ")}; {print} ' <%workpath% > win_%%i
)
:: Gawk-v binmode= "rw" "/^\+\+\+|^---|^@@|^diff|^binary|^file/{sub (/$/,\" \r\ ")}; {print} ' < in > out
::----------
:: 2013.2.8
:: Usage
::d Iff2win < file_in > File_out
:: e.g.
::d Iff2win < Unix.diff > Win.diff
::----------
:: @echo off
:: Gawk 1
:: http://www.gnu.org/software/gawk/manual/html_node/PC-Using.html
:: Under ms-windows, OS/2 and MS-DOS, Gawk (and many other text programs) silently translate end-of-line "\ r \ n" to "\ n" on Input and "\ n" to "\ r \ n" on output.

WINDONWS under the direct dozen various formats diff Winpatch.bat
 code as follows:

:: Winpatch
:: Ruoqian, chen<piao.polar@gmail.com>
:: 2013.2.16
::
:: Call GNU Patch to patch a diff file with Windows Le (CRLF) or Unix le (LF) or mix LE
::----------
:: Usage
:: The same to patch use patch--help to read it
:: e.g Winpatch-p1 <. /mac.diff
:: Or Winpatch-p1-r <.. /mac.diff
::----------
@echo off
Gawk-v binmode= "rw" "/^\+\+\+|^---|^@@|^diff|^binary|^file/{sub (/$/,\" \r\ ")}; {print} ' > Doscrlf.diff
Patch%1%2%3%5%6%7%8%9 < Doscrlf.diff


2013.3.4. Update

1. About versions
In particular, be careful not to omit the deletion of the document. Click Changed, you will see the contents of the changes, where the new file displayed as a round question mark, delete the file displayed as a virtual side question mark, right click Add or delete, make the icon changes to the correct addition and deletion icon can be.
2. About SUBLIMT Text2
A to solve the Chinese garbled plug-ins
See Resources and Notes: HTTPS://GITHUB.COM/SEANLIANG/CONVERTTOUTF8/BLOB/MASTER/README.ZH_CN.MD
b Modify the shortcut key to Windows style
Preferences->key Bindings-user The copy of the Windows version.
Or you can just get https://gist.github.com/piaopolar/5081327 from here.
C Modify the file drag and drop into the window does not open a new window
Preferences->setting-default
"Open_files_in_new_window": false

d) Automatic line wrapping
Preferences->setting-default
' Word_wrap ': ' True '
3. Iospatch and Winpatch's intermediate file directories are not well placed on the current path, often resulting in a reverse to the working directory.
You can circumvent this problem by placing it in front of the file name (Windows) or/(Unix), in the root directory, or directly to the system temp directory or your intended directory.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.