Perforce software makes a plug-in for Eclipse that makes life a lot easier when using the two together. This setup guide is directed specifically at using Perforce with Flex Builder 3.
As we know, Flex Builder 3 (FB3) is based on Eclipse 3.3.1. Since Flex Builder 2 is based on Eclipse 3.1.2, it probably won’t work – the release notes for the plug-in suggest is works on 3.2 and 3.3 only. I have not tested it, but if you were to upgrade Eclipse and use the Flex Builder plug-in then you should be OK.
Setup
- Open Flex Builder 3.
- Choose the following menu command: HELP > Software Updates > Find and Install.
- Select “Search for new features to install” and click Next >.
- Click “New Remote Site”.
- In the dialogue box, enter the Name “Perforce Plugin”.
- In the dialogue box, enter the URL: http://www.perforce.com/downloads/http/p4-wsad/install/
- Click OK.
- Click Finish.
- You will be prompted to “Select the features to install”.
- Be sure to check, “Show the latest version of a feature only” (at the bottom of the window)
- Fully expand the “Perforce Plugin” tree.
- Choose the last item in the tree that begins, “P4WSAD”.
- Click Next.
- Accept the terms in the license agreement to continue.
- Click Next.
- Click Finish.
- The feature will be downloaded and you may receive a Feature Verification warning
- Click “Install” if you receive the Feature Verification warning.
- The installation should occur and you need to restart Flex Builder.
- When Flex Builder restarts, we’ll tell the plugin where it can find Perforce on our system.
- Choose: Window > Preferences.
- In the left column, browse to: Team > Perforce.
- Under “Location of p4 executable” select “Location” and click “Browse”, then locate and select p4.exe. The default location is C:\Program Files\Perforce\p4.exe.
- Click Open.
- Click Apply.
- Click OK.
- Now, locate and open the project that you wish to use with Perforce.
- Right click on the project folder and choose: Team > Share Project.
- Select Perforce and click Next.
- The “Recent” field will probably be blank and that’s fine.
- Port will be the IP address and port of your Perforce server. (ex. 192.168.254.55) If you already have P4V or P4Win setup then you can find this in the title bar of the application.
- User is going to be your Perforce username, likely given you to by an administrator.
- Client Workspace should also be found in the title bar of P4V or P4Win if you’ve got those setup.
- Charset can probably be left to the default (none) but may require changing in certain circumstances.
- Click Finish.
- You will likely be prompted for your Perforce password – the one that goes with the Perforce username you entered.
Assuming everything went smoothly, you should now be able to edit files and Flex Builder will automatically add that file to the default changelist and make the file writable so you don’t get that annoying message.
Some other useful things that this plug-in does. Go to Window > Other Views…
In this dialogue box you can open the Perforce folder and select “P4 Pending Changelists”. This view will show you the files you have opened for editing and allow you to right click on the changelist or individual file for submitting.
Also, you’re probably used to seeing error and warning messages in the Problems view. Now you’ll see info messages when some things are out of sync with the repository. For example, if you add a new file your project but it’s not in the repository then you’ll see an info message warning you. Right click on the file and choose “Open for Add” then Submit the changelist and it will be added.
I hope this makes your life easier and please send me a quick line if you found any errors in my instructions, that will help other people!
Further details on setup are available at the Perforce website: http://www.perforce.com/perforce/doc.073/user/p4wsadnotes.txt
Pingback: Setting up Perforce for Flash Builder 4.5 / Eclipse 3.6 | Objects of Interest