Size: 5084
Comment: replace cvs with svn
|
Size: 1582
Comment: Instructions on checking out and doing an initial build entirely within Eclipse.
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
ClarkUpdike, incept: 2005-02-10 = Setting up the jython development environment in Eclipse = Eclipse has a plugin to become a SVN client and can be used to get the project from the repository. It takes a few steps to set it up, but seems to work well once you do. Please correct any mistakes. (Works for Eclipse 3.1-3.2) |
1. Run the checkout and ant build steps from the regular JythonDeveloperGuide 1. In your Eclipse preferences, go to Java > Build Path > Classpath Variables and add a new variable named ANT_HOME that points to your ant install. That directory should have a lib/ant.jar inside of it. 1. Go to File > Import > General > "Existing Projects into Workspace" in Eclipse 1. Select your Jython checkout directory as the root |
Line 5: | Line 6: |
== Installing the Subclipse plugin == | This could be made to work entirely in Eclipse with a few more additions to the external builders. For now, it requires running ant in the first step to make the build/gensrc and build/jarjar directories and then every time after a clean. |
Line 7: | Line 8: |
* Go to Help -> Software Updates -> Find and Install... * Go to Search for new features to install * Add a new remote site: http://subclipse.tigris.org/update_1.2.x (see http://subclipse.tigris.org/callisto.html for more details) * Install the plugin by selecting the product from the subclipse site. |
'''Proposed new instructions''' |
Line 12: | Line 10: |
== Checking out the Jython project == | Using Eclipse 3.5 + Subversive: |
Line 14: | Line 12: |
* Switch to SVN Repository Exploring perspective * Add a new SVN repository, URL: https://svn.sourceforge.net/svnroot/jython * Select trunk/jython or branches/2.3 depending on your development desires from the repository tree and Checkout the project using the New Project Wizard. *Set up source folders for the project You only want the `com` and `org` folders under `<yourProjectName>` to be set as source folder, otherwise things will be messy. To do this, set up `Include` filters: *Access the properties of `<yourProjectName>` (Right-click on the project and select `Properties`) *Click on `Java Build Path` and select the `Source` tab *KEY: Don't click `OK` yet, you need to first add filters *Click on the `+` sign next to `<yourProjectName>` *Select the `Included:` entry *Click `Edit` then `Add Multiple` and browse to add the `com` and `org` directories. == Building the project using ANT == [[Anchor(ANT)]] At this point, you should be able to build the project using Eclipse's `Java Builder`. This will only compile the classes though --you'll want to use `<yourProjectName>/build.xml` to get the full ant build. To do this: *First, set up an `ant.properties` file to supply "parameters" to `build.xml` *Put the file directly under `<yourProjectName>/`. It seems like it '''must''' be in the same directory as `build.xml`. Eclipse seems to let you specify other locations, but I couldn't ever get it to work unless it was right along side `build.xml`. If anyone knows why, please add details. *Put in info such as {{{ build.compiler=modern debug=false #debuglevel=lines,vars,source optimize=false #javaccHome=/Users/bzimmer/Library/Java/Extras/javacc-3.2 ht2html.dir= #python.home= python.lib=<pythonHome>\\Lib python.exe=<pythonHome>\\ ### zxJDBC ### #oracle.jar= #mysql.jar=/Users/bzimmer/Library/Java/Extras/mysql-connector-java-3.1.6-bin.jar #informix.jar= #postgresql.jar=/Users/bzimmer/Library/Java/Extras/pg74.215.jdbc2.jar #jdbc.jar= #servlet.jar= }}} I left stuff commented out, but you can see how you can add jars, etc. using this file. *Navigate to `build.xml` and Right-Click and select `Run` | `External Tools`. *Select `New` and on the `Main` tab *For `Buildfile:`, the default of `${workspace_loc:/<yourProjectName>/build.xml}` should be fine *For `Base Directory:`, click `Browse Workspace` and navigate to the `<yourProjectName>` directory and select it *Click on the `Properties` tab *Unselect the `Use global properties as specified...` check box *Click the `Add External` button and navigate to and select `<yourProjectName>/ant.properties` *Select `Apply` and `Run` A successful build should output something like the following: {{{ Buildfile: c:\workspace\JythonTip\jython\build.xml init: [echo] --- Build environment for jython --- [echo] --- Flags (Note: If the {property name} is displayed, [echo] --- then the component is not present) [echo] --- Optional Libraries --- [echo] java2 coll = true [echo] servlet = ${servlet.present} [echo] readline = ${readline.present} [echo] oracle = ${oracle.present} [echo] informix = ${informix.present} [echo] mysql = ${mysql.present} [echo] postgresql = ${postgresql.present} [echo] jndi = true [echo] jdbc = true [echo] jdbc3.0 = true dist-prepare: prepare: parser: compile: jar: [delete] Deleting: C:\workspace\JythonTip\jython\build\mainClass.mf copy-xml: copy-dist: BUILD SUCCESSFUL Total time: 2 seconds }}} Note that this sample was actually a re-build, so it didn't do that much (you'll see more output on the first build) and ran pretty fast (2 seconds). Also, note that I did not link in the optional "user-supply-able" jars. To do so, just add those entries to your ant.properties (look for the placeholders). Also, you can specify the ant targets that you want to run using the `Targets` tab under `External Tools` dialog. For example, the `copy-dist` seems to run by default. To force a full build, check the `all` target. And here is a [wiki:Self:/JythonDeveloperGuide#sampleBatch sample batch file (windows)] that runs the eclipse-built jython.jar |
1. Open the SVN Repository Exploring perspective and create a new repository for the Jython SVN repository. 1. Open the new repository, expand trunk, right click on Jython, and select Check Out. (You'll be prompted to accept an SSL certificate.) 1. Once the project is finished checking out, it will show build errors. Right click on the jython-trunk project. Select Build Path > Configure Build Path. 1. In the Libraries tab, Add Variable > Configure Variables, and add a classpath variable for ANT_HOME. 1. In the Package Explorer, open the build.xml file under jython-trunk. 1. In the Outline view, find the "developer build" target. Right click and Run As > Ant Build. 1. In the Package Explorer view, right click on the jython-trunk project, and select Refresh. 1. The problems view should no longer show any errors. |
Run the checkout and ant build steps from the regular JythonDeveloperGuide
In your Eclipse preferences, go to Java > Build Path > Classpath Variables and add a new variable named ANT_HOME that points to your ant install. That directory should have a lib/ant.jar inside of it.
Go to File > Import > General > "Existing Projects into Workspace" in Eclipse
- Select your Jython checkout directory as the root
This could be made to work entirely in Eclipse with a few more additions to the external builders. For now, it requires running ant in the first step to make the build/gensrc and build/jarjar directories and then every time after a clean.
Proposed new instructions
Using Eclipse 3.5 + Subversive:
- Open the SVN Repository Exploring perspective and create a new repository for the Jython SVN repository.
- Open the new repository, expand trunk, right click on Jython, and select Check Out. (You'll be prompted to accept an SSL certificate.)
Once the project is finished checking out, it will show build errors. Right click on the jython-trunk project. Select Build Path > Configure Build Path.
In the Libraries tab, Add Variable > Configure Variables, and add a classpath variable for ANT_HOME.
- In the Package Explorer, open the build.xml file under jython-trunk.
In the Outline view, find the "developer build" target. Right click and Run As > Ant Build.
- In the Package Explorer view, right click on the jython-trunk project, and select Refresh.
- The problems view should no longer show any errors.