Setup of Development Environment for MacOS: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
No edit summary
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
= Required software =
= Required software =


== Git ==
== Bazaar ==
* the easiest to install git is from compiled installer http://code.google.com/p/git-osx-installer
TODO: how to install a version of Bazaar that is compatible with the bzr 2.2.2 on the server


== Mono 2.x ==
== Mono 2.x ==
Line 17: Line 17:


= Get the source code =
= Get the source code =
The source code is managed with Git.  
The source code is managed with Bazaar.  


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 (refered to as '' 'developer access' '' below). We very much need your contributions though, and we will aim to quickly deal with submitted patches and code. Please see our document on [[submitting patches and features]]!
Follow the instructions at [[How to work with bazaar on the command line]] to get the source code.


You can get the source code in several ways:
Please have a look at the following page: [[Submitting patches and features]]!
* see the [https://sourceforge.net/scm/?type=git&group_id=260632 Git instructions at Sourceforge]
** that page describes how you can download anonymously from Git
* you can also browse the [http://git.openpetra.org Git repository online], and you can download a tar.gz snapshot of each version there
* for developers: more detailed instructions how to create the ssh key and where to upload it to Sourceforge: https://sourceforge.net/apps/trac/sourceforge/wiki/SSH%20keys
 
for anonymous access, you can use this URL to clone the repository on the command line:
git clone git://openpetraorg.git.sourceforge.net/gitroot/openpetraorg/openpetraorg
 
for developer access (with write permissions), use this URL to clone the repository on the command line:
git clone ssh://USERNAME@openpetraorg.git.sourceforge.net/gitroot/openpetraorg/openpetraorg
 
For development, I recommend you create a local branch, and switch to it. Then you pull updates from the server ("master") into your local branch, and push your updates up to the server in the master branch. Otherwise you get all sorts of problems with pushing and pulling, so don't commit to master at all. see also [[Notes about Git]]


= Configuration of Development Environment =
= Configuration of Development Environment =
for anonymous access:
Please check your OpenPetra.build.config file and make sure the paths are all adjusted to your system and the version numbers in the paths are correct.
cd ~
git clone git://openpetraorg.git.sourceforge.net/gitroot/openpetraorg/openpetraorg
cd openpetraorg
cp OpenPetra.build-sample-mac.config OpenPetra.build.config


for developer access (with write permissions):
This OpenPetra.build.config file is also the file where you set the database you want to use. If you want to switch the database system later, see [[Setup_of_Development_environment#Use_another_database_system]].
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-mac.config OpenPetra.build.config
 
Please check your OpenPetra.build.config file and make sure the paths are all adjusted to your system and the version numbers in the paths are correct.


= NAnt script =
= NAnt script =
Line 58: Line 32:


Please see [[Setup_of_Development_environment#NAnt_script|OpenPetra NAnt script]] for details
Please see [[Setup_of_Development_environment#NAnt_script|OpenPetra NAnt script]] for details
If you want to switch from SQLite to PostgreSQL which we recommend for serious development, please follow the instructions at [[Setup_of_Development_environment#Use_another_database_system]].


= Problems we encountered =
= Problems we encountered =

Revision as of 10:27, 7 January 2011

Required software

Bazaar

TODO: how to install a version of Bazaar that is compatible with the bzr 2.2.2 on the server

Mono 2.x

  • You can install the MonoDevelop Preview for Mac by downloading from http://monodevelop.com/Download, 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.

NAnt

  • MonoDevelop comes with a version of Nant. Unfortunately, that version is quite old (from 2007).

SQLite or PostgreSQL or MySQL

Get the source code

The source code is managed with Bazaar.

Follow the instructions at How to work with bazaar on the command line to get the source code.

Please have a look at the following page: Submitting patches and features!

Configuration of Development Environment

Please check your OpenPetra.build.config file and make sure the paths are all adjusted to your system and the version numbers in the paths are correct.

This OpenPetra.build.config file is also the file where you set the database you want to use. If you want to switch the database system later, see Setup_of_Development_environment#Use_another_database_system.

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.

Please see OpenPetra NAnt script for details

If you want to switch from SQLite to PostgreSQL which we recommend for serious development, please follow the instructions at Setup_of_Development_environment#Use_another_database_system.

Problems we encountered

Problems during setup and installation on MacOS X Snow Leopard

  • NAnt gives an error saying that mono isn't found. for NAnt to work, the Mono framework path must be exported to PKG_CONFIG_PATH:
export PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Home/lib/pkgconfig:/opt/local/lib/

It should be added to the .profile file so it's set on login.

  • After updating MonoDevelop and the Mono framework, it would just crash before it could start, so it turns out it needs to be run as root.
  • When trying to compile OpenPetra with NAnt, the file 'csharp/ICT/PetraTools/_bin/Debug/Ict.Tools.NAntTasks.dll' is not found, and in fact the directory 'csharp/ICT/PetraTools/_bin' is not created, but it should have been created by the script itself.
    • TIMO: it seems mbuild does not work at all. replace in OpenPetra.build.config the line mbuild with name="xbuild" value="xbuild"

Problems during setup and installation on MacOS X Leopard

BUILD FAILED

Failed to initialize the ‘Mono 3.5 Profile’ (mono-3.5) target framework. 

Function call failed.
Expression: ${not pkg-config::exists(’mono’)}
^^^^^^^^^^^^^^^^^^^^^^^^^^

‘pkg-config’ failed to start.

for the solution, see also http://jlinx.de/blog/?p=551:

export PATH=$PATH:/Library/Frameworks/Mono.framework/Commands/