Posted: June 17, 2010 in Version Control
Subversion is an open source version control system for managing changes to documents, programs, and other information stored as computer files which are part of a software project. Why do we need it at all? So that in a team of developers(or even when you are working independently) when someone messes up, one can easily get back to a previous working version. When using Eclipse as our working environment(the one which I personally use and recommend), the best way is to go for Subclipse, which is an Eclipse Team Provider plug-in providing support for Subversion within the Eclipse ID. The reason for that is the seamless integration of Subclipse into Eclipse through its Update Manager. The following steps may be followed:
- Start your Eclipse IDE.
- Go over to Help->Install New Software
- In the space for “Work with”, copy paste the following:
- Click on add
- In the space for name, type Subclipse Plugin and press Ok
- If prompted to accept terms and conditions
- Finally restart your eclipse
You should have your Subclipse configured now. Cheers to source control!!
If you use Flex Builder(now called Flash Builder) for your flex development there are no ‘tricks’ involved, so to speak, in compiling flex apps(Imagine having to pay a fortune and then face things NOT working. Annoying isn’t it?) But when it comes to doing things the open source way, we usually experience deadlocks where we cannot decide which approach to follow and we cry “HELP”.
It’s nothing unusual if that is what happens to you(I experience it all the time :P). But what we can do is share the knowledge we have so that we spend less time looking for solutions and more time working on them. That is exactly what I am here for. If you have read my blog entry about “Setting up the Eclipse IDE for Flex“, this tutorial is a direct continuation. Although people who have already set-up their preferred IDE’s will also benefit from this tutorial.
- We will be using the Apache Ant for our compilation tasks. For using the ant build tool, Apache ant run time environment is required to be installed(which is already installed if you have Flex SDK). No work to be done here.
- Running flex action script code on Eclipse requires Java runtime environment to be installed.
- Fire up the terminal(if you are on Linux) and type the following:
sudo apt-get install sun-java6-jdk
and press enter. Just accept the terms and conditions and then , you are good to go.
- Otherwise, you also have the option of going over to the official Sun site(now owned by Oracle) and download the latest JDK version. This link might help.
- I am assuming you already have the Eclipse IDE installed on your machine. You may want to take a look at my previous post(link above) for guidelines.
Now, the following part needs to be done for each project you make in your Eclipse. Yes you got that right, for EACH project(Hey! what are you grumbling about? Don’t forget you are getting all of this for free; even reading my blog). Alright let’s look at the steps:
- Make a new Project in your Eclipse.
- Add a .mxml file in this project, say main.mxml
- Type in the following example code(you can write any flex code here. This one’s just an example)::
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Label text=”Hello World!!”/>
<mx:Button label=”This button does nothing” />
Now comes the most important bit: the build.xml file. What we basically want to do is call the mxml compiler located in the flex directory of your hard drive, with the ant build file through eclipse, for compiling our flex project.
Now to compile your flex app, all you have to do is open the build file in Eclipse, right click somewhere in the body of the file, and then click->Run As->Ant Build. That’s it! Congratulations, you have complied your first Flex app. But a lot more needs to be done to be called a “Flex Developer’. I will be posting some material from time to time on flex and related items. Till then, happy Flex-ing.
It’s been quite a long time since I did some serious coding work. But something came along this Summer and I decided to dive into it. The project I am working on basically uses the Adobe Flex framework(it is open source) for building RIA(rich internet applications). The whole task of setting up an IDE for Flex was so cumbersome, that I thought it would be nice to have a small tutorial, for all those future Flex developers, so that they do not have to go through all the trouble that I faced. Of course, there is always the option of buying yourself the Adobe Flash Builder 4 Premium Edition, the development environment provided by Adobe for only US $699.00. I prefer to go the Open Source way.
Alright. Without further ado let’s get to business::
- Get the latest version of the Adobe Flex SDK. At the writing of this post, it was Flex SDK version 220.127.116.1159. You can get the current latest version HERE.
- Next get your preferred IDE. I would strongly recommend Eclipse as..
it is a highly successful open source application platform…. also an open source ecosystem populated by hundreds of companies and thousands of developers producing and consuming components.
As quoted from the Eclipse site. And since even the rest of the post is written assuming you have Eclipse on your machine, you better get it. You can download Eclipse from HERE. [Make sure you download the Eclipse IDE for Java and Report Developers, about 220 MB file]
- Next we need the Eclipse Web Tools Platform to be installed. More specifically we need the Web Standards portion for editing the .mxml files. The following are the four packages need to be downloaded::
Note that the versions mentioned here are the ones which were the latest during the writing of this post. Please check for newer versions.
- Now, extract each of the four files and copy the contents of the Features and Plugins directories of each package into Eclipse’s Features and Plugins directories respectively. Restart Eclipse if it is running. Now WST(Web Standards Tools) is installed in your machine. Congratulations!! Give yourself a pat on the back. But wait, it is not over yet. A little more needs to be done.
- By now, we have got the plugins installed. We now need to configure Eclipse for proper syntax highlighting of .mxml files. Start Eclipse and select a workspace on your hard drive, if you haven’t done it already. All your Flex apps will reside in this directory when you make new projects. Ok, now from the Menu Bar select Window->Preferences. Then expand ‘General’ and select ‘Content Types’. Expand Text and click on(do not expand) XML. In the file associations, select ‘Add’ and in the Content Type, write “*.mxml” without the quotes. Click on OK and then once again, to close the preferences window.Eclipse should now recognize any mxml tags using the mx: namespace and highlight them with proper colors. With all those colors in your editor, you will surely experience the joy of coding.
Flex uses two languages for its working: mxml and ActionScript. In the above segment we saw how to add code highlighting for .mxml files. But as you move ahead in Flex development, you will discover that coding in ActionScript enables you to leave hard-coding practices of mxml, and introduces more opportunities for re-use of code. So might as well add ActionScript Support for Eclipse.
This part is way easier than the previous segment:support for mxml.
- Start Eclipse. In the Menu bar, select Help->Install new Software. Click the Addbutton. Type ASDT in the space for name and type:http://aseclipseplugin.sourceforge.net/updatesin the space for Location (ASDT is basically ActionScript Development Tools, which we want to install in our Eclipse). Select Release or Beta whichever one you want and click on Next. It will show “calculating dependencies and requirements”.
- In the next page, select the file shown in the Panel and click Next. Accept terms and click Finish. Eclipse will now download the required files for its working. Accept any warnings that may crop up in between. And that’s it! Restart Eclipse and next time when you make a .as (ActionScript file), it will have code highlighting and syntax support. Presto!
This concludes the tutorial for Setting up the Eclipse IDE for Flex. So, what are you waiting for? Go out there and make some breathtaking Flex apps. Cheers!😀.
For compiling Flex apps in Eclipse, I have a separate tutorial here. Enjoy!