Setup of Development environment

From OpenPetra Wiki
Jump to navigation Jump to search

Windows Development environment

Required software

  • Git (see also some Notes about Git); recommended: TortoiseGit
  • Microsoft .Net 3.5 Redistributable and SDK (we only use .Net 2.0 for OpenPetra, but SharpDevelop requires .Net 3.5)
  • SharpDevelop 3.0
  • NAnt (see also some Notes about NAnt)
  • one of the following Database Management systems:
  • Poedit (for translation) (see also Notes about I18N)
  • Mono (for translation)
  • Inno Setup 5 for building setup files

Linux Development environment

Install required software

Please add information for other distributions that you are working with!

Git

  • on Ubuntu/Debian: apt-get install git-core

MonoDevelop 2.x

  • on Ubuntu: apt-get install mono-2.0-runtime monodevelop mono-xbuild
  • on Debian: need to use Lenny Backports, since Lenny only provides Mono 1.x
echo "deb http://www.backports.org/debian etch-backports main contrib non-free" >> /etc/apt/sources.list
apt-get update
apt-get install debian-backports-keyring
apt-get install git-core postgresql
apt-get -t lenny-backports install mono-runtime nant libmono-microsoft-build2.0-cil
  • on OpenSUSE: use the one click installer from http://monodevelop.com/Download; (when using yast, make sure you are using an uptodate repository with MonoDevelop 2.0 or newer; MonoDevelop 1.0 is too old and gives problems with SharpZipLib etc)

NAnt

  • on Ubuntu/Debian: apt-get install nant
    • Problem: NAnt 0.85 (Build 0.85.2478.0; release; 10/14/2006) does not seem to support the task "solution" on Linux? Invalid element <solution>. Unknown task or datatype.
    • Problem: exec spawn is not supported in 0.85
    • Solution: copy binary zip from sourceforge (http://nant.sourceforge.net/nightly/latest/nant-bin.tar.gz), unzip, and change /usr/bin/nant to point at the latest NAnt.exe
    • to avoid all the warnings "Could not load file or assembly" run: apt-get install libmono-microsoft-build2.0-cil
    • to avoid problems finding log4net etc, make sure the property NAntBin.dir in your OpenPetra.build.config is set correctly
    • Also you need to make a symbolic link:
ln -s /usr/lib/mono/2.0/Microsoft.CSharp.targets /usr/lib/mono/2.0/Microsoft.CSharp.Targets

SQLite or PostgreSQL

  • on Ubuntu/Debian:
    • apt-get install sqlite3 (requires 3.6.1 or higher; might need to use another repository, eg testing)
    • or apt-get install postgresql
  • on OpenSUSE:
    • yast -i postgresql postgresql-server

xgettext and msgfmt

  • on OpenSUSE, yast -i gettext gettext-tools

dos2unix

  • this is needed for building releases (nant buildRelease)
  • ubuntu: apt-get install tofrodos

Mac Development environment

  • You can install the MonoDevelop Preview for Mac by downloading from http://monodevelop.com/Download/Mac_Preview, and just install it.
    • somehow the current Preview does not open all of the OpenPetra projects, but you need MonoDevelop for the mdtool that is used by our nant script to build OpenPetra. Building OpenPetra with nant works, creating a Postgresql database works, and starting the server and the client works. Most screens crash though, unfortunately.
  • I cannot remember how I installed git, probably with fink install git or git-core?
  • MonoDevelop comes with a version of Nant.
  • I did not get the sqlite to work, so prefer Postgresql on Mac. Again, this was installed by downloading from a website, see http://www.postgresql.org/download/macosx

Get the source code

The source code is managed with Git.

Please understand that we will provide write permissions only to the core members of the development team, just to keep the project on one track. We very much need your contributions though, and we will aim to quickly deal with submitted patches and code via the forum. This still has to be worked out how this works best to submit code that way.

You can get the source code in several ways:

Configuration of Windows Development Environment

The recommended way of installing OpenPetra.org for development is to somewhere map a network drive, using the DOS command subst

For example:

mkdir c:\development
subst u: c:\development
download the git repository into u:\openpetraorg (it contains the .git directory, and the OpenPetra.build: U:\openpetraorg\OpenPetra.build, etc)
URL of the git repository:
   anonymous access: git://openpetraorg.git.sourceforge.net/gitroot/openpetraorg/openpetraorg
   developer access: ssh://USERNAME@openpetraorg.git.sourceforge.net/gitroot/openpetraorg/openpetraorg
     make sure that you set your username and email address in your git client
  • you need to make a copy of the file OpenPetra.build-sample-windows.config and call it OpenPetra.build.config
copy OpenPetra.build-sample-windows.config OpenPetra.build.config

Configuration of Linux Development Environment

for anonymous access:

cd ~
git clone git://openpetraorg.git.sourceforge.net/gitroot/openpetraorg/openpetraorg
cd openpetraorg
cp OpenPetra.build-sample-linux.config OpenPetra.build.config

for developer access (with write permissions):

cd ~
eval `/usr/bin/ssh-agent`
ssh-add ~/.ssh/YOURPRIVATEKEYFILE      
git clone ssh://USERNAME@openpetraorg.git.sourceforge.net/gitroot/openpetraorg/openpetraorg
git config user.name "YOUR NAME"
git config user.email "USERNAME@users.sourceforge.net"
cd openpetraorg
cp OpenPetra.build-sample-linux.config OpenPetra.build.config

Configuration of Mac Development Environment

This is very similar to the Linux Development Environment, with the only difference that you should use the sample config file for Mac:

cp OpenPetra.build-sample-mac.config OpenPetra.build.config

NAnt script

There is a central NAnt script that is able to generate a lot of code and is able to do all automated tasks in the OpenPetra project.

get help

To see the available commands, just run on the command line:

cd openpetraorg
nant help

initial steps

First you need to compile the PetraTools which is a set of programs for creating databases and more:

nant compileCommon
nant compilePetraTools

Now you need to create a database. If you don't change the config file, the SQLite database system will be used.

nant recreateDatabase

Then you want to load the database with base data:

nant resetDatabase

You should compile OpenPetra.org this way:

nant compilePetra

Start the OpenPetra.org Server:

nant startPetraServer

Start the OpenPetra.org client:

nant startPetraClient

With the base database, there is the user demo with password demo that you can use to login to your installation of OpenPetra.org.

See Preview: Current functionality for information what is actually working already.

Stop the OpenPetra.org Server:

nant stopPetraServer

Generate the translation files:

nant translation