Wednesday, December 4, 2013

Setting up SVN version control with FlexBuilder

Setting up SVN version control with FlexBuilder


Jump to: navigation, search
This page discusses the integration of Subversion into FlexBuilder.

Installing Subclipse

The following are instructions for setting up Subversion for Adobe Flex Builder 3 (taken from [1] and [2]). It was last verified on 2009-03-10 to work ok:
Open Flex Builder and do the following:
  1. Help menu → Software Updates → Find and Install → Search for New Features to Install → Check Europa Discovery Site (do not check automatically select mirrors) → Finish
  2. Select a mirror from the List that appeared → Ok
  3. In the new list expand Europa Discovery Site → expand Java Development → select Plug-in Development Enviroment and Java Development Tools → Next → Accept the terms and conditions → Next → Finish
  4. Restart Flex Builder
  5. Help menu → Software Updates → Find and Install → Search for New Features to Install → Button: New Remote Site → Enter the following: name: Subclipse, URL: http://subclipse.tigris.org/update_1.0.x/
  6. Then a new entry should appear in the list with the list with sites for search → Expand Subclipse → Expand Subclipse Plug-in → Check Subclipse 1.2.x (available version might be different when you read this) → Next → Accept the terms and conditions → Next → Finish
  7. Restart Flex Builder
If you encounter a bug using Subclipse: The symptoms are a crash of Flexbuilder on Windows as soon as you want to use it. Subversion uses a library called APR (Apache Portable Runtime) which has a component called APR-ICONV used for translating characters in path and file names to/from UTF-8. The release of Apache 2.2 brought new releases of APR and APR-ICONV and these are not binary compatible with previous releases. Subclipse ships with the Apache 2.0 version of these libraries. The crash occurs if you install an application that installs the Apache 2.2 version of these libraries AND ALSO sets the APR_ICONV_PATH environment variable to a path that contains the Apache 2.2 version of the APR-ICONV .so objects. — Fix: Change the name of the environment variable to APR_ICONV1_PATH. The Apache 2.2 library will look for this environment variable name first, and only fallback to the older name if it is not found. You can safely have an APR_ICONV_PATH environment variable pointing to the Apache 2.0 version of these libraries and the APR_ICONV1_PATH environment variable pointing to the Apache 2.2 version.
Subversion 1.5 has resolved this problem by discontinuing the use of APR-ICONV. Instead, Subversion will use translation routines that are provided by the Windows operating system.

Getting the source code from the SVN repository

We use a subversion repository at sourceforge, see IBIS-ID SourceForge repository for the checkout address. Once you have access you can check out the source code. Here are some instructions that are copied from Flexbuilders manual:

Import a new Project into a SVN Repository

Overview This is the process for taking a local project in your Eclipse workspace and importing it into a repository so that it can be managed by SVN. If you have already been using SVN and you have an existing working copy in your workspace that you want to connect to SVN, then you will likely want to follow the procedure for Connecting an Existing Project.
Procedure If you do not yet have your project ready to import into the repository, create a simple project that contains a few files so that they can be stored in the repository. A simple way to achieve this is to create a sample plug-in project by selecting File > New > Project... and Plug-in Development > Plug-in Project. Give the project a name and click through to finish on the wizard.
To import a project into the repository, right click the project you want to import and select Team > Share Project... from the context menu. Do not use "import" and select subversion.

Shareproject.png

This will begin the Share Project wizard. Select SVN as the repository type and click Next.

Share project svn repository.png

If you have already defined the repository location you want to store this project in, then select it in the list and click Next. Otherwise, select the Create a new repository location option and click Next. If you need to create a location then see the section on creating a new repository location in the Flexbuilder user manual for more information.

Share project folder name.png

You must specify the folder name where you want to store the project. The folder name is relative to the URL of the repository location you specified in the previous step. All intermediate folders must already exist in the repository, but the final folder name must not already exist. You can use the Browse... button to select a path from within the repository. The Browse dialog also allows you to create folders, so you could use that option to create any intermediate folders. In the above example, we are going to follow the convention of storing the project in a ProjectName/trunk structure. In this example, the ProjectName folder must already exist and the trunk folder must not exist. Click Next or Finish when you are through.

Share project ready.png

The final page of the wizard is just a final confirmation page. When you click Finish, SVN will issue the mkdir command to create an empty folder in the repository. It will then checkout that folder on top of your local project. This will create the .svn folder inside your project, converting it into a valid Working Copy. Finally, the wizard will bring up the Commit Dialog so that you can commit everything into the repository. You do not have to commit everything or even anything. You may want to cancel the commit dialog and then go back to your workspace and do everything from the Team menu. For example, if you wanted to set SVN properties as part of the commit, you would want to first use the Team > Add to Version Control option and then use the Team > Set Property option etc. Once you have things the way you want them you can then perform a Team > Commit.
For more and the most up to date details on how to do this please refer to the FlexBuilder online help and go to: Workbench User Guide > Getting started > Team SVN tutorial

Monday, December 2, 2013

Flex Formatter - Browse Files at SourceForge.net

  • System Requirements: Eclipse 3.3+, JDK 1.5+. The intent is for this software to be used with FlexBuilder 3 or 4, but there are no actual dependencies.
  • Install (several ways to install)
  • Add a remote update site through Help->Software Updates: http://flexformatter.googlecode.com/svn/trunk/FlexFormatter/FlexPrettyPrintCommandUpdateSite. The exact instructions differ depending on which version of Eclipse you are using. You should be able to turn on Eclipse auto updates and be notified when a new version is published. You may have to set up proxy settings in the Eclipse preferences if you are behind a corporate firewall. Note: if you are running Eclipse 3.5 and the update site doesn't work for you, try adding "/site.xml" on the end and see if that helps.
  • Download the zip file and extract the 3 plugins jars into the Eclipse plugins directory (Eclipse 3.3) or the dropins directory (Eclipse 3.4+) and restart Eclipse (with -clean if you are using 3.3). Enough people have had problems with this with Eclipse 3.4+ that I recommend only using the update site.
  • In FlashBuilder 4.5, Adobe has now defined a formatting command to the Ctrl+shift+F keystroke. This means that that the same keystroke is assigned to 2 different commands. You can go to Windows->Preferences->General-Keys to unassign/reassign the keystroke for one version or the other. If you use "format on save", you will be unaffected.
  • Usage See the docs page for a usage doc that describes the options. https://sourceforge.net/apps/mediawiki/flexformatter/index.php?title=Preferences There is also usage doc in the ? (question mark) help on the preference pages.
  • Bugs: Undoubtedly. If you find something, create a bug/feature report through the 'tracker'.