Development System Set-Up
Total Page:16
File Type:pdf, Size:1020Kb
Inhaltsverzeichnis Development System Set-Up.................................................................................................1 Required............................................................................................................................1 Optional..............................................................................................................................2 Next steps..........................................................................................................................3 Known problems....................................................................................................................3 Exceptions when starting Gnuaccounting from Eclipse....................................................3 Ant Exceptions ..................................................................................................................3 Conflicts with previous data/Re-”installing” gnuaccounting...............................................3 Videos for Gnuaccounting developers...................................................................................3 How the source code is organized.........................................................................................4 How to develop the GUI.....................................................................................................5 Superglobals, Important classes.......................................................................................5 Code Examples..................................................................................................................6 Helpful commands.................................................................................................................6 Using the database view....................................................................................................6 Print the linecount..............................................................................................................6 Linux support..........................................................................................................................6 Mac OS X support..................................................................................................................6 Libraries used.........................................................................................................................6 OpenTRANS..........................................................................................................................8 osCommerce OpenTRANS connector..............................................................................8 Tests.....................................................................................................................................10 Mandatory (Smoke test)..................................................................................................10 Optional............................................................................................................................10 Extended..........................................................................................................................11 Release checklist.................................................................................................................12 Development System Set-Up Please note that on linux systems it might be possible to compile small changes without eclipse using ant. Otherwise Required 1. Get Eclipse 4.3 (Kepler) or higher. If you get the 64bit version please additionally install and select a 32bit JDK. 2. Get subversive via Help|Eclipse Marketplace. Restart Eclipse. 3. Check out gnuaccounting from subversion: File|New|Other|SVN|Checkout projects from SVN. Repository location: http://svn.code.sf.net/p/gnuaccounting/code/trunk (suggested manual SVN command would be “svn checkout http://svn.code.sf.net/p/gnuaccounting/code/trunk gnuaccounting-code”). The download is around 38mb. 4. Create a new Run configuration (Run|Run Configurations), click on Java Application in the left pane and then on the blank-page icon for new configuration on the top of the left pane. Search for the main class -- it's GUILayer.MainWindow 1 / 12 5. On a 64 bit windows please make sure you install and use a 32-bit SDK (Window| Preferences|Java|Installed JREs and Run|Run configurations|JRE) Optional 6. It is advisable to have "always launch the previously launched application" selected in Window|Preferences>Run/Debug>Launching, otherwise Eclipse might try to launch the individual windows instead of the generic project. 7. Should you have write access to the repository: please do not check in files related to compiling the project in Windows (=the new .classpath) 8. If you want to translate, the Resource Bundle Editor might help (web page http://sourceforge.net/projects/eclipse-rbe/, update site http://www.nightlabs.de/updatesites/development/), Development tools/ResourceBundle Editor Plug-in 9. if you want to run an ant build in the eclipse standard installation you will receive a BUILD FAILED C:\Users\jstaerk\workspace\gnuaccounting\build.xml:24: Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK. It is currently set to "C:\Program Files\Java\jre6" Error. Download and install a Java JDK and back in eclipse click Window|Preferences|Java|Installed JREs . Click “Add”, select “standard VM” and select the “bin” subdirectory of your JDK Installation, e.g. C:\Program Files\Java\jdk1.6.0_21 . Afterwards click the checkbox next to the new entry to activate the new JRE/JDK. Ant builds will now be possible (by right-clicking build.xml and selecting “Run as Ant build”). An ant build is required to release an installer package. 10.If you want to release the windows installer version you will need NSIS http://nsis.sourceforge.net/ and the Shelllink plugin http://nsis.sourceforge.net/ShellLink_plug-in 11.To edit the documentation or run the software please download OpenOffice.org. You can also install the Eclipse integration NOA4E (update site http://ubion.ion.ag/update/noa4e ) 12.Most windows were created with a Guibuilder, Windowbuilder/SWT Designer. I did not get http://www.eclipse.org/downloads/packages/eclipse-rcp-and-rap- developers/keplerr, neither by installing it with Help > Install New Software... Select - Work With: Kepler, The WindowBuilder items are under "General Purpose Tools", Select SWT Designer, Install dependencies nor with the update site at http://download.eclipse.org/windowbuilder/WB/release/R201306261200/4.3/. The only solution was to install the all-in-one RCP developer from http://www.eclipse.org/downloads/packages/eclipse-rcp-and-rap-developers/keplerr. 13.Window|Preferences General>Workspace, select “Unix” in “new text file line delimters” and “UTF-8” in text file encoding. 2 / 12 Next steps 1. In Run|Run Configurations, click on “Java application” and click on the “New launch configuration” icon over “type filter text”. Enter GUILayer.MainWindow as main class. 2. If you are working under Linux, right-click the project in the package explorer, click “properties” and select the tab “Libraries” in “Java Build Path”. Edit org.eclipse.swt.win32.win32.x86_3.7.0.v3735b.jar and change it to org.eclipse.swt.gtk.linux.x86_3.7.0.v3735b.jar or org.eclipse.swt.gtk.linux.x86_64_3.7.0.v3735b.jar if you are compiling in a 64 bit JVM. Known problems Exceptions when starting Gnuaccounting from Eclipse 1. Please confirm you are using a 32bit JVM 2. Please confirm you are trying to start MainWindow 3. Please rename or delete your ~/.gnuaccounting in particular if you started the stable gnuaccounting version in between: the head development version may not always necessarily have a migration path, i.e. it might crash on not being able to migrate existing data Ant Exceptions 1. If you installed and seleced a Java 1.6 JDK as described in the optional set up section, you may receive a “com/sun/tools/javac/Main : Unsupported major.minor version 51.0” if you additionally have a 1.7 installed. In this case make sure Window|Preferences Ant Runtime in the classpath's Global Entries you have the lib/tools.jar of the JDK 1.6 selected. Conflicts with previous data/Re-”installing” gnuaccounting If you have run gnuaccounting (development or production version) before and you want to start with a clean installation and all data removed just delete or rename your ~/.gnuaccounting directory, which will be re-created. You can also refer to the user manual and the portable version for instructions how to save in a different directory to e.g. have a production and test system on the same computer. Videos for Gnuaccounting developers There are four introductory videos 1) How to use Gnuaccounting (general introduction, also for users) http://www.gnuaccounting.org/screencasts/videos/Gnuaccounting-20131223-1.mp4 8,25mb 31:26min 2) Gnuaccounting development for beginners incl. Architecture and so on: http://www.gnuaccounting.org/screencasts/videos/Gnuaccounting-20131223-2.mp4 16MB 28:58 min 3 / 12 3) Intermediate development: Including e.g. how to add attributes also in the database: http://www.gnuaccounting.org/screencasts/videos/Gnuaccounting-20140107.mp4 37,8MB 1:21:01 h Additionally, there is also the video of Jochen's Speech on the Libocon regarding the introduction into NOA-Libre, the library used to embed OpenOffice.org: http://www.gnuaccounting.org/screencasts/videos/LibreOfficeStream_2_27.flv 453 MB 37:49 min How the source code is organized There are