Index: dev_eclipse.xml =================================================================== --- dev_eclipse.xml (revision 480516) +++ dev_eclipse.xml (working copy) @@ -21,160 +21,208 @@ - Apache Harmony development using Eclipse + Apache Harmony Development Using Eclipse Harmony Documentation Team
-

- These instructions will help you set up Eclipse to develop Java code - in Apache Harmony. -

-

- There are two sets of instructions -- the fast path - for people who are - already familiar with Eclipse and the source code layout in Harmony's - Subversion repository; and the - step-by-step guide - for people who want to follow the details of a set-up, and see a brief - development example. -

-

- Both sets of instructions assume you satisfy the same Eclipse-based - development prerequsities. -

+

+ The current page provides instructions on how to set up Eclipse to develop Java code + in Apache Harmony. +

+

+ DRLVM specific instructions are only emerging, while class library specific + instructions are in two sets: the fast path + for people familiar with Eclipse and the source code layout in Harmony's + Subversion repository; and the + step-by-step guide + for novices who want to follow the details of a setup and see a brief + development example. +

+

+ All instructions assume you satisfy the same Eclipse-based + development prerequsities. +

- -

- You may have heard or read about Harmony's strict rules for contributor's - eligibility. We take this seriously because a number of parties implement - Java, and we respect their rights to their property. If you have detailed - knowledge of another implementation of Java, and they have not explicitly - approved your participation in Harmony, please check whether we will be able - to accept your contribution by reading the - Apache Harmony contribution policy. -

-
-
- -

- To develop the class library Java code with Eclipse JDT you will need: -

    -
  1. Eclipse : version 3.2 integration build I20060119 or later, from - eclipse.org
  2. -
  3. Subclipse : Subversion plug-in from - tigris.org
  4. -
  5. a snapshot classlib build : from the - - download page. If you prefer to build a snapshot yourself the - instructions are here.
  6. -
  7. a compatible VM : obtain a VM as - described here capable - of running the class libary code, and install it in the same location as - the snapshot.
  8. -
-

+
+

+ To develop Apache Harmony Java code with Eclipse JDT, you need: +

+
    +
  1. + Eclipse: version 3.2 or later, from + eclipse.org +
  2. +
  3. + A Subversion plug-in: Either Subclipse from + tigris.org + or Subversive from + polarion.org + +
  4. +
+

You will surely need the code to work with. Follow one of these ways:

+
    +
  • + Get pre-built snapshot from the + download page. +
    For class library development, you'll need a compatible VM: obtain a VM as + described here capable + of running the class libary code, and install it in the same location as + the snapshot. Analogously, you'll need class libraries for DRLVM development. +
  • +
  • + Download source code to be built manually. For that, create a SVN repository location + using the URL: +
    +///for classlibraries
    +https://svn.apache.org/repos/asf/harmony/enhanced/classlib
    +
    +///for DRLVM
    +https://svn.apache.org/repos/asf/harmony/enhanced/drlvm
    + Check out the code from SVN selecting Checkout... from the context menu of trunk.
  • +
-
+
+ +

For details on how to build DRLVM and other related documentation, please see + the DRLVM web pages. +

+
+ +
-

- If you know your way around Eclipse JDT, then following these steps will - have you hacking Harmony Java code in no time at all! -

+

+ If you know your way around Eclipse JDT, then following these steps will + have you hacking Harmony Java code in no time at all! +

-

- Ensure that you have the development pre-requisites - in place, then: -

    -
  1. Launch Eclipse with the VM argument "-Dpde.jreProfile=none" - (i.e. eclipse -vmargs -Dpde.jreProfile=none).
  2. -
  3. Configure the following settings in Window > Preferences... -
      -
    • Change the Java compiler settings -
        -
      1. In the Java > Compiler preferences ensure the - "Compiler compliance level" is set to - 1.4.
      2. -
      3. In the Java > Compiler > Building preferences, - open the "Build Path Problems" section - and change "Circular Dependencies" from - Error to Warning.
      4. -
    • -
    • Change the PDE settings -
        -
      1. In the Plug-in Development > Compilers preferences - change "Unresolved Dependencies" from - Error to Warning.
      2. -
      3. In the Plug-in Development > Target Platform - preferences, change the "Location:" box to be the - jre/lib/boot directory of the classlib snapshot.
      4. -
    • -
  4. -
  5. Create a SVN repository location to the Harmony classlib, using URL - https://svn.apache.org/repos/asf/harmony/enhanced/classlib
  6. -
-

+

+ Ensure that you have the development prerequisites + in place. Then if you are using Linux start Eclipse as normal with the arguments + -vmargs -Dpde.jreProfile=none -Dpde.allowCycles=true and skip to step 4. If + you are using Windows do the following:

+
    +
  1. Copy the vsvars32.bat file from your Visual Studio install directory + to any convenient location. If you have chosen the defaults when installing, you + will find the given file in the + C:\Program Files\Microsoft Visual Studio.NET 2003\Common7\Tools directory.
  2. +
  3. Edit the vsvars32.bat file adding the following line right after the + last line beginning with @set...: +
    start C:\...\eclipse\eclipse.exe -vmargs -Xmx512M -Dpde.jreProfile=none -Dpde.allowCycles=true
    + In the line above, "..." is the path to your Eclipse installation directory. + +

    Note

    +

    Using -vmargs -Xmx512M is optional, + but helpful to stop Eclipse running out of memory.

  4. +
  5. To start Eclipse, double click on the vsvars32.bat file. +
  6. + +
  7. + Configure the following settings in Window > Preferences: +
  8. +
      +
    • Change the Java compiler settings: +
        +
      1. In the Java > Compiler preferences ensure the + Compiler compliance level is set to + 1.4. +
      2. +
      3. In the Java > Compiler > Building preferences, + open the Build Path Problems section + and change Circular Dependencies from + Error to Warning. + +
      4. +
    • +
    • Change the PDE settings: +
        +
      1. In the Plug-in Development > Compilers preferences + change Unresolved Dependencies from + Error to Warning. +
      2. +
      3. In the Plug-in Development > Target Platform + preferences, change the Location box to be the + jre/lib/boot directory of the classlib snapshot.
      4. +
    • +
    +
  9. Copy the ecj_3.2.jar file into the + ...\eclipse\plugins\org.apache.ant_1.6.5\lib directory.
  10. +
  11. To include the given file, configure the following Ant settings in + Window > Preferences > Ant > Runtime: +
  12. +
      +
    • Select Global Entries +
    • +
    • Select Add External Jars +
    • +
    • Add the ecj_3.2.jar file from + the org.apache.ant_1.6.5\lib directory. +
    • +
    +
+ + - -

- The Apache Harmony class library is structured to allow developers to work on individual - modules in the class library without having to load and compile the entire - project source tree. -

-

- This is best illustrated by a worked example. In this example, assume you want to make - a change to the NIO module. This is how you would proceed: -

    -
  1. Go to the SVN repository view, open the Harmony URL and browse to - "trunk > modules". Select - "nio" and from the context menu select - Checkout..., and on the checkout dialog just - click "Finish"
  2. -
  3. In the resulting project in your workspace the implementation code - is in the source folder src/main/java and the unit tests - are in the source folder src/test/java.
  4. -
  5. Hack away! Developers are encouraged to produce JUnit tests for new - implementation code.
  6. -
  7. To test the code you need to set-up a JUnit Run Configuration for the - unit test. You can either run a single test case, or run the - AllTests suite for all tests in a package or module. - For example, to run the test suite - org.apache.harmony.tests.nio.AllTests set up a - run configuration with the following characteristics: -
      -
    • bootclasspath : the folder nio/bin/main, followed by - the Harmony JRE library.
    • -
    • classpath : the folder nio/bin/test, followed by the - JUNIT JAR file.
    • -
      - Java run configuration -
    • VM : the Harmony JRE as the launching VM.
    • -
    -
  8. -
  9. If everything looks good, go ahead and - contribute a patch.
  10. -
-

+ +

+ The Apache Harmony class library is structured to allow developers to work on individual + modules in the class library without having to load and compile the entire + project source tree. +

+

+ This is best illustrated by a worked example. In this example, assume you want to make + a change to the NIO module. This is how you would proceed: +

    +
  1. Go to the SVN repository view, open the Harmony URL and browse to + trunk > modules. Select + nio and from the context menu select + Checkout..., and on the checkout dialog box click Finish.
  2. +
  3. In the resulting project in your workspace the implementation code + is in the source folder src/main/java and the unit tests + are in the source folder src/test/java.
  4. +
  5. Hack away! Developers are encouraged to produce JUnit tests for new + implementation code.
  6. +
  7. To test the code you need to set-up a JUnit Run Configuration for the + unit test. You can either run a single test case, or run the + AllTests suite for all tests in a package or module. + For example, to run the test suite + org.apache.harmony.tests.nio.AllTests set up a + run configuration with the following characteristics: +
      +
    • bootclasspath: the folder nio/bin/main, followed by + the Harmony JRE library.
    • +
    • classpath: the folder nio/bin/test, followed by the + JUNIT JAR file.
    • +
      + Java run configuration +
    • VM: the Harmony JRE as the launching VM.
    • +
    +
  8. +
  9. If everything looks good, go ahead and + contribute a patch.
  10. +
+

-
+
-

- We have produced a brief webcast for those who want to see a step-by-step guide - to configuring Eclipse, and developing a patch to the classlibrary code. The webcast - starts assuming you have already installed the pre-requisities for Eclipse-based - development, and launched Eclipse with the following commandline: -

eclipse -vmargs -Dpde.jreProfile=none
- We
pick up the story here... (Warning 8Mb flash download!) -

+

+ We have produced a brief webcast for those who want to see a step-by-step guide + to configuring Eclipse, and developing a patch to the classlibrary code. The webcast + starts assuming you have already installed the pre-requisities for Eclipse-based + development, and launched Eclipse with the following commandline: +

eclipse -vmargs -Dpde.jreProfile=none -Dpde.allowCycles=true
+ We pick up the story here... (Warning 8Mb flash download!) +

- \ No newline at end of file +