2011년 12월 6일 화요일

How to use Android 4.0 ICS sdk manager on linux behind firewall

I am not 100% sure if there is other ways to use sdk manager on linux for ICS sdk manager.
My tips are:

pre-condition : suppose you have source code of ICS

1. Modify 'sdk/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SettingsController.java'
- In 'getForceHttp' method,
return true;
//return Boolean.parseBoolean(mProperties.getProperty(ISettingsPage.KEY_FORCE_HTTP));

2. 'sdk/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/UrlOpener.java'
- In 'openWithHttpClient' method
add 2 lines of import..

import org.apache.http.conn.params.ConnRoutePNames;
import org.apache.http.HttpHost;

and modify like below

// use the simple one
final DefaultHttpClient httpClient = new DefaultHttpClient();

// newly added
HttpHost proxy = new HttpHost("{proxy address}", {proxy port});
httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);

2011년 12월 5일 월요일

Get Android 4.0 ICS source code behind firewall

I've just pulled Android 4.0 ICS source code by using repo shell command behind firewall.
What I've done are:
1. In home directory
$ mkdir bin # create bin directory as Android recommends
$ vi .bashrc # add bin directory to PATH environment
2. Add below line to .bashrc file
export PATH=/home/{user_name}/bin:$PATH
3. Save and adapt changes
$ source .bashrc
4. Get repo shell
# install curl if you don't have it by using synaptic package installer or apt-get ...
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo
> ~/bin/repo --proxy {proxy_ip}:{proxy_port}
$ chmod a+x ~/bin/repo # add executable attribute to shell file
5. Create working directory and move into it
$ mkdir Android && cd Android
6. export http_proxy attribute
$ export http_proxy={proxy_ip}:{proxy_port}
7. Init repo branch
$ repo init -u https://android.googlesource.com/platform/manifest # for checking out other branches see android developer page
8. Finally you can get the source code
$ repo sync

Enjoy ICS!

2011년 11월 24일 목요일

Cherry-picking specific patch

Hmm.. this seems easier..
git diff commit_before..commit_iwant > path
patch -p1 < path

----
I needed to adapt specific WebKit open source patch while upversioning.
This was from side effect of one open source patch.
What I did are:

1. Get the commit ids of specific patch and just before of it.
For example, see the log by 'git log' then it might show like below..

commit f16c8bee1573c195750b68e4d500ab4982f0471a
Author: weinig@apple.com
Date: Wed Nov 2 02:24:50 2011 +0000
...
commit a1a74a31943577f1426a0fed52470cae064f3b31
Author: nduca@chromium.org
Date: Wed Nov 2 02:18:28 2011 +0000
...

Suppose my wanted commit is weinig's patch, but still I need commit id of (-1).
It can be nduca's patch id.

2. Save patch to the file system.
git format-patch -k --stdout a1a74a31943577f1426a0fed52470cae064f3b31..f16c8bee1573c195750b68e4d500ab4982f0471a > blahblah.patch

3. Adapt this patch to your local
Changes directory to your local git root and type.
git am -3 -k blahblah.patch

Then you can see the cherry-picked patch is on the top of the log list.
Enjoy git learning~

2011년 8월 22일 월요일

How to use 'git diff' on specific commit

Sometimes we might need to create 'diff' file for specific commit(s) and forward it to reviewers.
I also sometimes don't understand why they let me do it because they can but I understand there are a lot of patches for them to review.

Anyway, this is very simple to achieve it.
We just need to know commit-id on each patch.
We can use 'git log' for that.

For example, git shows patches like below when we type 'git log'.
$ git log
+++
commit commit-id1
Author Someone
Date Someday
Blur...blur..

commit commit-id2
Author Someone
Date Someday
Blur...blur..

...
+++

If we want to know diffs on commit-id1, we can do like below.
$ git diff commit-id1 commit-id2
In some cases, we can extract diffs to a file like below.
$ git diff commit-id1 commit-id2 > diff.txt

Hope this helps you.

2011년 8월 2일 화요일

How to exclude multiple patterns in use of doxygen

I usually separate public and private used API in different directories.
But, things aren't likely so when it comes to a massive project.

Anyway, my current work was creating doxygen result and public/private header files were mixed together. :(
So it is clear that I had to exclude private header files from result.

What I did is:
1. Created configure file as doxygen website denoted.
2. Open it with editor program.
3. Find 'EXCLUDE_PATTERNS'.
4. Add patterns with wildcard character.

That's it.
Please note that when you need to add more than two patterns, use space between them.
For example, when you need to exclude with pattern 'hello' and 'world', configure file will be like below.

EXCLUDE_PATTERNS = *hello* *world*

Hope this helps you.

2011년 7월 15일 금요일

How to download svn revision behind firewall in EFL

When I was in company, I needed to download updated EFL libraries.
However, I wasn't able to do it because of firewall.
I succeeded it by using TracBrowser function in SVN.

What I did is:
2. Put revision number what I wanted down on 'view revision' text field.
3. Click 'Zip archive' in the bottom of the page.

Hope this helps.

2011년 7월 4일 월요일

Running DumpRenderTree on GTK port

1. Gets source code and etc from remote repository.
- svn checkout http://svn.webkit.org/repository/webkit/trunk WebKit

2. Builds WebKit GTK+
- $ Tools/Scripts/build-webkit --gtk

3. Runs test
- $ Tools/Scripts/run-webkit-tests --gtk