Code Monkey home page Code Monkey logo

xcode-scripts's Introduction

Xcode-scripts

Here are utility script for Xcode development. Removing local project files from git repository, replacing Xcode header copyright description and ignoring Emacs's ^X^S keystroke to avoid mis-operation.

Removing Xcode local project files from git repository

By default, when a new Xcode project is created with git repository, it adds local project files to git automatically. This is very annoying when we are developing the project with other engineers.

Executing xcode-remove-local-project-from-git.sh at the top directory of the project which includes .git will remove local project files such as below file from git repository.

${PROJECT}.xcodeproj/project.xcworkspace/contents.xcworkspacedata
${PROJECT}.xcodeproj/xcuserdata/${USER}.xcuserdatad/xcschemes/${PROJECT}.xcscheme
${PROJECT}.xcodeproj/xcuserdata/${USER}.xcuserdatad/xcschemes/xcschememanagement.plist

To run the script, please change directory to the top level of the Xcode project then execut xcode-remove-local-project-from-git.sh

$ cd ${ProjectDir}
$ xcode-remove-local-project-from-git.sh

This will automatically add .gitignore file to the current directory. Then removing local project files form git repository.

Replacing copyright description in the Xcode templates

Xcode automatically insert header description using File Templates. Sometimes we want to customize the header description. xcode-copyright-replace.sh is for it.

Before executing the command, please check first part of the script.

#! /bin/sh
##
## Replace Xcode header template's copyright with ${COPYRIGHT}
##
#XCODE=Xcode
XCODE=Xcode6-Beta3

## Copyright string.
COPYRIGHT="Copyright (c) 2014 Enamel Systems. All rights reserved."

Please change XCODE and COPYRIGHT string accordingly. Then execute:

$ xcode-copyright-replace.sh

will replace the Header's copyright string. When you execute the command first time, you might to need the initialize git repository to keep original file. To do that please execute the command with -i option. Then you can execute xocode-copyright-replace.sh after that.

$ xcode-copyright-replace.sh -i
$ xcode-copyright-replace.sh

Disabling Xcode Emacs ^X^S keystroke

For emacs users, it is very common to press ^X^S keystroke during editiong. By default, Xcode puts strange character to the editing buffer. To avoid the mis-operation, Emacs.idekeybindings reassign ^X^S to "mark buffer" operation. To reflect the change, please copy Emacs.idekeybindings to ~/Library/Developer/Xcode/UserData/KeyBindings/.

$ cp Emacs.idekeybindings ~/Library/Developer/Xcode/UserData/KeyBindings/

Then Xcode->Preferences->Key Bindings menu, select Emacs from "Key Bindings Set" dropdown menu. After that you will see that ^X^S just mark the buffer.

xcode-scripts's People

Contributors

enamelsystems avatar yt-app avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.