README.md #7

  • //
  • guest/
  • jaime_rios/
  • XcodePerforcePlugin/
  • README.md
  • Markdown
  • View
  • Commits
  • Open Download .zip Download (3 KB)

Xcode Perforce Plugin

Native Xcode Plugin that allows for Perforce integration

Features

  • Allows for p4 or p4vc commands to be executed on the currently selected file
  • Currently supported perforce commands
    • p4 edit
    • p4 info
    • p4 revert
    • p4 add
    • p4vc revgraph
    • p4vc timelapse

Prerequisites

  • IDE: Xcode 6
  • Perforce command line apps: p4 and p4vc
    • Command line apps must be installed in /usr/bin or any other path exported by Xcode
    • Check environment variable settings returned by env
  • Bash shell startup file: ~/.bash_login
    • Startup file exports the P4CONFIG variable with the name of the configuration file on your computer
  • Configuration file: named in P4CONFIG variable
    • Workspace settings variable(s) are set in configuration file with connection specific settings
    • Configuration file is placed at root of workspace folder.

Configuration file examples

The configuration files on your local computer set up the Perforce connections settings need to allow Xcode to interact with p4 or p4vc.

Example 1:

In this example, you have most of your settings in your ~/.bash_login file; this may reflect a user who only connects to 1 Perforce server for all of their work; the workspace specific info is then held in a perforce config file, set up in the P4CONFIG variable.

File: .bash_login

export P4CONFIG=perforce.rc

export P4PORT=myawesomedomain.com:1666

export P4USER=jaime_rios

export P4PASSWD=PFourIzGr8

File: perforce.rc (located at the root of the workspace)

P4CLIENT=jaime_rios_XcodePerforcePlugin

Example 2:

In this example, the user connects to many different Perforce servers, so the ~/.bash_login file only specifies the name of the configuration file in the P4CONFIG variable and the rest of the connection specific information is put into the configuration file

File: .bash_login

export P4CONFIG=perforce.rc

File: perforce.rc (located at the root of the workspace)

P4CLIENT=jaime_rios_XcodePerforcePlugin

P4PORT=myawesomedomain.com:1666

P4USER=jaime_rios

P4PASSWD=PFourIzGr8

Installation

  • Option A: Install using Alcatraz
  • Option B: Build the project, then restart Xcode

Usage

  • Select the "Source Control" menu -- Select any p4 or p4vc command you desire for the current active file

Uninstall

Run rm -r ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/XcodePerforcePlugin.xcplugin/

Known Issues

  • May be buggy, so use at your own risk
  • Only a limited set of p4 or p4vc commands were implemented
  • p4 edit only works on the currently selected file and does not checkout project files (at the moment)
  • All p4 or p4vc commands currently only work on source files; resource files, for example, don't work'
  • plugin does not (at the moment) capture errors thrown in the command line by either p4 or p4vc

FAQ

  • Q: I have the p4 command line installed and available when I type "which p4" in the Terminal.app command line, but the plugin says that p4 is not installed. What's wrong?

  • A: The plugin works inside of the Xcode environment, which does not pick up your local path settings; so, to be able to find p4, the p4 command line app has to be installed in the same search folders that Xcode has set up, such as /usr/bin/. If you want to get a listing of those paths, either invoke env in a custom build shell script or check off the "Environment variables" checkbox on any shell script build step.

# Xcode Perforce Plugin

Native Xcode Plugin that allows for Perforce integration

## Features

- Allows for p4 or p4vc commands to be executed on the currently selected file
- Currently supported perforce commands
  - p4 edit
  - p4 info
  - p4 revert
  - p4 add
  - p4vc revgraph
  - p4vc timelapse

## Prerequisites

* IDE: Xcode 6
* Perforce command line apps: p4 and p4vc
  * Command line apps must be installed in /usr/bin or any other path exported by Xcode
  * Check environment variable settings returned by env
* Bash shell startup file: ~/.bash_login
  * Startup file exports the P4CONFIG variable with the name of the configuration file on your computer
* Configuration file: named in P4CONFIG variable
  * Workspace settings variable(s) are set in configuration file with connection specific settings
  * Configuration file is placed at root of workspace folder.


## Configuration file examples
The configuration files on your local computer set up the Perforce connections
settings need to allow Xcode to interact with p4 or p4vc.



###Example 1:
In this example, you have most of your settings in your ~/.bash_login file;
this may reflect a user who only connects to 1 Perforce server for all of their
work; the workspace specific info is then held in a perforce config file, set
up in the P4CONFIG variable.


####File: .bash_login
export P4CONFIG=perforce.rc

export P4PORT=myawesomedomain.com:1666

export P4USER=jaime_rios

export P4PASSWD=PFourIzGr8


####File: perforce.rc (located at the root of the workspace)
P4CLIENT=jaime_rios_XcodePerforcePlugin



###Example 2:
In this example, the user connects to many different Perforce servers, so the ~/.bash_login
file only specifies the name of the configuration file in the P4CONFIG variable and the rest
of the connection specific information is put into the configuration file


####File: .bash_login
export P4CONFIG=perforce.rc


####File: perforce.rc (located at the root of the workspace)
P4CLIENT=jaime_rios_XcodePerforcePlugin

P4PORT=myawesomedomain.com:1666

P4USER=jaime_rios

P4PASSWD=PFourIzGr8



## Installation

- Option A: Install using [Alcatraz](alcatraz.io)
- Option B: Build the project, then restart Xcode


## Usage

- Select the "Source Control" menu
-- Select any p4 or p4vc command you desire for the current active file

## Uninstall

Run `rm -r ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/XcodePerforcePlugin.xcplugin/`


## Known Issues

- May be buggy, so use at your own risk
- Only a limited set of p4 or p4vc commands were implemented
- p4 edit only works on the currently selected file and does not checkout project files (at the moment)
- All p4 or p4vc commands currently only work on source files; resource files, for example, don't work'
- plugin does not (at the moment) capture errors thrown in the command line by either p4 or p4vc


## FAQ

* Q: I have the p4 command line installed and available when I type "which p4" in the Terminal.app command line, but the plugin says that p4 is not installed. What's wrong?

* A: The plugin works inside of the Xcode environment, which does not pick up your local path settings; so, to be able to find p4, the p4 command line app has to be installed in the same search folders that Xcode has set up, such as /usr/bin/. If you want to get a listing of those paths, either invoke env in a custom build shell script or check off the "Environment variables" checkbox on any shell script build step.
# Change User Description Committed
#9 16549 Jaime Rios Added debugging code to see paths exported by Xcode; modified MD readme file to include preferred location of p4 and p4vc binaries
#8 16417 Jaime Rios Added UUID for Xcode 7.1; Updated plugin icons to use newer Helix themed icons.
#7 13688 Jaime Rios Added Alcatraz in installation section of readme doc.
#6 12123 Jaime Rios Added compatibility for Xcode 6.2; modified the menu layout; added additional screenshot; updated URL for Alcatraz Package Manager.
#5 11740 Jaime Rios Updated readme text with additional known issues; refactored p4 revert function; added perforce icon to alert message.
#4 11737 Jaime Rios Minor change to error checking in debug mode; updated readme document with information pertaining to how to set up settings for workspace and edited MD markup formating.
#3 11736 Jaime Rios Added extra "known issue" in README.md document.
#2 11714 Jaime Rios Added unit tests; fixed bugs found during testing; added Jon Reid's XcodeCoverage files http://qualitycoding.org/xcode-code-coverage/ modified project to produce code coverage reports.
#1 11694 Jaime Rios Initial add of XcodePerforcePlugin project to guest depot.