Skip to content

Getting started with the code

ubergeek42 edited this page Jul 29, 2012 · 21 revisions

Get the Code

You need to get the code first before you can do anything. Clone it from here:

$ git clone git://github.com/ubergeek42/weechat-android.git

Building with maven

If you don't want to use eclipse, or want to automate the build process, you can use maven.(This is how the official releases are created.)

Compiling the code

All you should need to do is run something like:

$ mvn clean install

Which will produce an apk file in weechat-android/target/

##Building and using Eclipse Eclipse is a lost more useful than running maven from the command line, and since it is one of the more popular IDE's for java development I've included the steps below to get it working. These were tested with Eclipse Juno(4.2), but I believe it should be working with Indigo(3.7) as well.

Prerequisites

Since the maven integration for android apklib's isn't 100% working properly, we have a little bit of setup to do. Download actionbarsherlock, and extract it somewhere on your disk. We will be needing the library/ directory.

$ curl -L https://github.com/JakeWharton/ActionBarSherlock/tarball/4.1.0 | tar -zx

Import the ActionBarSherlock library.

  1. Start eclipse. Choose any directory you wish for your workspace.
  2. File->New->Other
  3. Under Android, choose "Android Project from Existing Code"
  4. Point the root directory to the library directory inside the actionbarsherlock directory.
  5. Finish
  6. Edit the project properties, and go to the "Java Compiler" section. Make sure the Compiler Compliance Level is set to 1.6.

Import the weechat-android projects

  1. File->Import...
  2. Under Maven, select "Existing Maven Projects"
  3. Point the root directory to where you cloned the weechat-android repository.
  4. Select only the weechat-relay, and weechat-android projects to import for now.
  5. Finish
  6. Edit the project properties for weechat-android. Under the "Android" section, remove any "Library" entries from the bottom, then click "Add..." and choose the library project we imported earlier.
  7. Force a clean/rebuild of the workspace: Project->Clean.
  8. Verify that there are no errors under the "Problems" tab.

Troubleshooting

Eclipse gets confused sometimes. Force a rebuild by choosing Project->Clean.

Any other problems?
File an issue, send me an email, or join our (small) channel on freenode, #weechat-android.

Clone this wiki locally