Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
add support for creating android projects
Browse files Browse the repository at this point in the history
  • Loading branch information
ervandew committed Aug 16, 2012
1 parent 4c36b63 commit ecde6e2
Show file tree
Hide file tree
Showing 43 changed files with 1,638 additions and 92 deletions.
2 changes: 2 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<classpathentry kind="var" path="FORMIC_HOME/lib/miglayout-3.5.0.jar"/>
<classpathentry kind="output" path="build/bin"/>
<classpathentry kind="src" path="org.eclim/java"/>
<classpathentry kind="src" path="org.eclim.adt/java"/>
<classpathentry kind="src" path="org.eclim.adt/test/junit"/>
<classpathentry kind="src" path="org.eclim.cdt/java"/>
<classpathentry kind="src" path="org.eclim.cdt/test/junit"/>
<classpathentry kind="src" path="org.eclim.core/java"/>
Expand Down
14 changes: 14 additions & 0 deletions ant/build.gant
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ target(name: 'init'){
))
}

// prep plugin specific classpath additions
pluginNames.each(){ name ->
if (hasVariable("${name}.classpath.prepare")){
binding.getVariable("${name}.classpath.prepare")()
}
}

classpaths = [getVariable('eclipse')]
if (getVariable('eclipse') != getVariable('eclipse.local')){
classpaths << getVariable('eclipse.local')
Expand All @@ -109,6 +116,13 @@ target(name: 'init'){
// for gentoo
fileset(dir: '/usr/share/', erroronmissingdir: false,
includes: 'swt-*/lib/*.jar')

// plugin specific classpath additions
pluginNames.each(){ name ->
if (hasVariable("${name}.classpath")){
binding.getVariable("${name}.classpath")()
}
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@
<antcall target="gant"> <param name="target" value="org.eclim.dltkruby.test"/> </antcall>
</target>

<target name="test.adt">
<antcall target="gant"> <param name="target" value="org.eclim.adt.test"/> </antcall>
</target>

<target name="dist">
<antcall target="gant"> <param name="target" value="dist"/> </antcall>
</target>
Expand Down
9 changes: 9 additions & 0 deletions doc/content/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
History of Changes
==================

.. _2.2.1:

2.2.1 (Aug. XX, 2012)
----------------------

Android:
- Eclim now has support for :ref:`creating android projects
<gettingstarted-android>`.

.. _2.2.0:

2.2.0 (Aug. 07, 2012)
Expand Down
78 changes: 62 additions & 16 deletions doc/content/gettingstarted.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. Copyright (C) 2005 - 2011 Eric Van Dewoestine
.. Copyright (C) 2005 - 2012 Eric Van Dewoestine
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -29,12 +29,21 @@ with eclim's features.
First make sure eclimd is running (see the :ref:`eclimd docs <eclimd>` if you
are unsure how to start eclimd).

.. _gettingstarted-create:

Creating your first project
---------------------------

Once you've got eclimd running open an instance of vim and create your project
like so (maven users, please see the :ref:`maven docs <gettingstarted-maven>`
for an alternate method):
like so:

.. note::

**Android Users:** the :ref:`android section <gettingstarted-android>` below
contains additional info regarding the creation of android projects.

**Maven Users:** you may refer to the :ref:`maven section
<gettingstarted-maven>` below for an alternate way to create a java project.

::

Expand All @@ -46,6 +55,7 @@ the nature accordingly:

::

:ProjectCreate /path/to/my_java_project -n android
:ProjectCreate /path/to/my_c_project -n c
:ProjectCreate /path/to/my_cpp_project -n c++
:ProjectCreate /path/to/my_java_project -n java
Expand All @@ -65,7 +75,7 @@ third party libraries your project uses reside. The name of this file will
vary depending on your project's nature, but in all cases eclim will provide
you with commands to manage this file:

* java - :ref:`.classpath file <vim/java/classpath>`
* java, android - :ref:`.classpath file <vim/java/classpath>`
* php, ruby - :ref:`.buildpath file <vim/dltk/buildpath>`
* c, c++ - ``.cproject``, managed via the :ref:`:CProjectConfigs
<:CProjectConfigs>` command
Expand Down Expand Up @@ -96,7 +106,7 @@ We will use a java project in this example but the steps for other languages
are very similar. Please see the relevant docs for your language for more
details:

* :ref:`java <vim/java/classpath>`
* :ref:`java and android <vim/java/classpath>`
* :ref:`php and ruby <vim/dltk/buildpath>`
* :ref:`c and c++ <:CProjectConfigs>`
* :ref:`python <vim/python/rope>`
Expand Down Expand Up @@ -258,6 +268,43 @@ using **:ProjectSettings** to update them.
overridden them with values via **:ProjectSettings**.
.. _gettingstarted-android:
Android Users
-------------
Creating an android project is the same as creating a regular java project, but
you use the `android` nature instead:
::
:ProjectCreate /path/to/my_project -n android
This will result in a series of prompts for you to input your project's information:
**Note:** at any point in this process you can use Ctrl+C to cancel the project
creation.
1. First you will be asked to choose the target android platform. If you have
only one platform installed on your system, this prompt will be skipped and
that platform will be used when creating the project. If you have no
platforms installed then you will receive an error directing you to install
a platform using the Android SDK Manager. If you install a new platform you
will need to either restart eclipse/eclimd or run the eclim supplied
:ref:`:AndroidReload <:AndroidReload>` command.
2. Next you will be asked to supply a package name (Ex: `com.mycompany.myapp`).
3. Then you will need to supply a name for your application.
4. The next prompt will ask you if you are creating a library project or not.
Most likely you are not, so type 'n' here to proceed.
5. Lastly, if you are not creating a library project, you will be asked whether
or not you want to have a new android activity created for you and if so,
you will be asked for the name of that activity.
Once you've finished supplying the necessary information, your android project
will be created. An android project is simply a specialized java project, so
you can now leverage all the eclim provided :ref:`java functionality
<vim/java/index>` while developing your app.
.. _gettingstarted-maven:
Maven Users
Expand All @@ -273,24 +320,23 @@ features to get your project started.
$ mvn archetype:generate
2. Open an instance of vim and set the necessary eclipse classpath variable to
point to your maven repos.
.. code-block:: bash
$ vim
:MvnRepos
3. Run the following command at the root directory of your project to generate
the necessary eclipse files:
2. Once you've created the initial project directory, cd into that directory
and run the following command to generate the necessary eclipse files:
.. code-block:: bash
$ cd <project_dir>
$ mvn eclipse:eclipse
4. Open an instance of vim and import your project:
3. Now you can start an instance of vim at the project's root directory and run
the following commands to:
- set the necessary eclipse classpath variable to point to your maven
repository.
- import your new project into eclipse.
.. code-block:: bash
$ vim
:MvnRepos
:ProjectImport /path/to/new/project
10 changes: 10 additions & 0 deletions doc/content/vim/cheatsheet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ Project Commands
location list.


Android Commands
-----------------

.. _\:AndroidReload:

- :AndroidReload - Reloads the Android SDK environment in the running
eclimd/eclipse instance. Useful if you've made changes to the SDK outside of
eclipse (installed a new target platform, etc).


Ant Commands
------------

Expand Down
12 changes: 0 additions & 12 deletions doc/content/vim/java/search.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,6 @@ on the context of the element.
all references to the element.
- Otherwise, it will search for the declaration of the element.

.. warning::

Searching for classes in the jdk requires the JRE_CONTAINER entry in your
.classpath file. Some third party plugins may create java projects with this
entry ommitted (like android projects created by the Android Development
Tools). In these cases you can manually add the following to your project's
.classpath file:

.. code-block:: xml
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>

Alternate Searching
-------------------
Expand Down
17 changes: 3 additions & 14 deletions notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,22 +234,11 @@ TODO {{{
Java {{{
Android {{{
http://s.android.com/source/index.html
https://android.git.kernel.org/?p=platform/sdk.git;a=tree;f=eclipse;hb=HEAD
$ git clone https://android.git.kernel.org/platform/sdk.git android-sdk
$ cd android-sdk
https://android.googlesource.com/platform/sdk
$ git clone https://android.googlesource.com/platform/sdk android-sdk/src
$ cd android-sdk/src
$ git co android_sdk-adt_<version>
$ cd eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt

https://dl-ssl.google.com/android/eclipse/
com.android.ide.eclipse.adt.feature.group

Android:R cannot be resolved
> My solution to the /R/ nightmare is, especially when first launching
> a new project, to ignore any errors, go in and clean out the
> suppositions that Eclipse was making (specifically the almost always
> misguided import of /com.android.developer.R/), and basically finish
> the structure of my project, in particular fussing over the /.xml/
> files, before giving much credence to what Eclipse says.
}}}

- refactoring
Expand Down
18 changes: 18 additions & 0 deletions org.eclim.adt/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Vendor: eclim.org
Bundle-SymbolicName: org.eclim.adt; singleton:=true
Bundle-Version: ${eclim.version}
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.eclim.plugin.Plugin
Bundle-ClassPath: .,
eclim.adt.jar
Require-Bundle: org.eclim,
org.eclim.core,
org.eclipse.core.resources,
org.eclipse.core.runtime,
org.eclipse.jdt.core,
com.android.ide.eclipse.adt,
com.android.ide.eclipse.base
7 changes: 7 additions & 0 deletions org.eclim.adt/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
See <a href="../org.eclim_${eclim.version}">org.eclim_${eclim.version}</a>.
</body>
</html>
28 changes: 28 additions & 0 deletions org.eclim.adt/build_adt.gant
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
feature_adt = 'com.android.ide.eclipse.adt'

target(name: 'org.eclim.adt.classpath.prepare'){
unjar(dest: 'build/temp/lib/android'){
fileset(dir: '${eclipse}'){
include(name: 'dropins/**/plugins/com.android.*.jar')
include(name: 'plugins/com.android.*.jar')
}
patternset{ include(name: '**/*.jar') }
}
}

target(name: 'org.eclim.adt.classpath'){
fileset(dir: '${eclipse}'){
include(name: 'dropins/**/plugins/com.android.*.jar')
include(name: 'plugins/com.android.*.jar')
}
fileset(dir: 'build/temp/lib/android'){
include(name: '**/*.jar')
}
}

target(name: 'org.eclim.adt.test'){
depends('test.init')
runTests('org.eclim.adt'){
//createProject('org.eclim.adt', 'eclim_unit_test_android')
}
}
Loading

0 comments on commit ecde6e2

Please sign in to comment.