# 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 ## 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 - 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) - 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.