Recent Changes - Search:

DelphiDabbler Wiki


CodeSnipAppSource

CodeSnip Compiling & Source Code FAQ

This FAQ is about compiling and using the source code of the DelphiDabbler CodeSnip Code Snippets Repository Application. If your question was about using CodeSnip itself please see the Using CodeSnip FAQ instead.

If you can't find your answer below add your question to the Unanswered Questions page.

Contents


1: Where can I get the CodeSnip source code?

The best place is the CodeSnip Subversion repository on SourceForge.net. There are three main branches:

  1. trunk: Contains the latest v4 development code tree.
  2. tags: Contains source code for every CodeSnip release going back to v3.0. Each release is under a sub-branch named version-x.x.x where x.x.x is the release number, for example 3.5.5 or 3.8.0. Note that some special releases (e.g. beta) may have a suffix after the version number. See the tags branch for a full list of available versions.
  3. branches: Contains feature and release branches. Feature branches, if present, contain new features or experimental code. Release branches contain maintenance code for some releases: at the time of writing there is just one release branch named 3.x where any maintenance code for the v3 code base is developed.

Please note that any code in the trunk or branches branches may be unstable.

You can download a GNU Tarball of any of the branches. Alternatively you can check out code from the repository using a Subversion command like:

svn co https://codesnip.svn.sourceforge.net/svnroot/codesnip codesnip

Please note that this will check out the whole repository. You are strongly advised to append a further directory to the URL. For example to checkout the trunk use:

svn co https://codesnip.svn.sourceforge.net/svnroot/codesnip/trunk codesnip

Zip files containing the source of each release from v3.0 onwards are also available from SourceForge, in the CodeSnip project's Files section.

Finally, the source code of the latest stable release only can be downloaded from DelphiDabler.com.


2: Which compiler is needed to compile CodeSnip?

CodeSnip is written in Delphi Object Pascal. It must be compiled with Delphi 2010, although later Delphi compilers may be suitable.

Some other utilities are also needed. See the "Build Tools" section of this file for details.


3: Is CodeSnip open source?

CodeSnip's original code is open source and most of it is covered by the Mozilla Public License 1.1.

Any third party libraries are also open source.

The only exception is the code linked in from the Delphi RTL and VCL libraries. Given that you need Delphi to compile CodeSnip, that's not really an issue providing you don't distribute the Delphi library source code.


4: How do I build CodeSnip from source?

This is all covered in detail in the file Build.html1 that can be found in the "root" of each source code release or development tree2.

1 the linked file is in the trunk of CodeSnip's Subversion repository. Versions for other releases etc. may vary.
2 v3.0.x releases do not have a Build.html file. Look instead for Docs/ReadMe-Src.txt.


5: Do you have a version of the source code that compiles with Delphi versions earlier than 2010?

No, sorry.

The code base makes use of Delphi 2010 features. With a few changes it may compile on Delphi 2009 (no promises). But, since the code now assumes that string = UnicodeString it definitely can't be compiled with anything before Delphi 2009.


6: Will you publish the PHP source code for the web services that CodeSnip accesses?

Sorry but no. CodeSnip is open source but the scripts that drive my website are not. To publish all the relevant code would be a security risk.

However, for each web service CodeSnip uses, there's a separate unit in the source code. In those unit's you'll find documentation about how to access the web services.


7: I want to use some of the CodeSnip source code in my project, what are the rules?

The answer assumes that the code is covered by the Mozilla Public License 1.1 (MPL).

This answer is not authoritative - please refer to the license itself for that. This is just a brief overview for which I make no warranty of accuracy. If this answer conflicts with the license then the license takes precedence.

If your project is for private use (i.e. you will not be distributing the project) then you can use the code as you wish.

If you do intend to distribute your project, then the following rules apply to the CodeSnip code:

  1. If you just use one or more source files unchanged you must not change the comments in a file's MPL "license block". You must also advertise1 that your product uses some MPLd code and provide a means by which users can obtain the source code2.
  2. If you modify one or more source files then simply add yourself as a contributor to the MPL "license block", leaving the rest of the text unchanged. You must then advertise1 the use of MPLd code and provide a means to obtain the modified source files3.
  3. If you copy and paste some code from one of the MPLd source files into one of you own source files then that file must also adopt the MPL. You must add a suitable MPL license block to the source file, putting yourself as original author and myself and any other contributors to the original unit as contributors. As you will now expect you must advertise1 that the product contains MPLd code and provide a means to obtain the relevant files3.

Using MPLd code from CodeSnip does not mean you have to make your other source files available. But there's no way out of complying with these requirements for MPLd code.

If your project is licensed under the GPL or LGPL please read FAQ 10.

Footnotes:

1 "Advertise" means you must mention that your product uses MPLd code in some suitable place in your documentation, help files, about box etc. The documentation must also tell users how to obtain the source code. You must also acknowledge the names of the original developers of the files you are using.

2 In the case of unchanged source files you may link to the CodeSnip Subversion repository on SourceForge, providing that you specify the names, paths and revision numbers of the files you are using. Alternatively provide your own means of obtaining the files3.

3 Make your own arrangements for making the MPLd available to users of your project. You could upload the files to some web space and provide a URL in your documentation or distribute the source files with your product.

If you're in doubt about anything, or want help linking to CodeSnip's Subversion repo, ask me!


8: How do I contribute code / bug fixes to the project?

You can contribute code in two ways:

  1. Send your code / changes. I prefer to receive them as a patch file so I can apply them directly to the repository for review. To do this check out the code using Subversion1, make your changes, then generate a patch file for those changes. Zip it up and submit it2.
  2. Commit changes directly to the Subversion repository. To do this you must be a project member. If you want to join the project see here.

Do not change the license on any code you modify. If you are submitting new source code units please license them using the Mozilla Public License v2.0 without an "Incompatible With Secondary Licenses" Notice. If you don't want to use the MPL v2.0 please discuss it with me first.

1 For info on checking out code from the Subversion repository, see FAQ 1.

2 To submit code use the issue tracker. Open the relevant bug report and / or feature request and attach the patch file, leaving a comment so that I get notified. If you don't make a comment I won't get a notification email. If there's no suitable bug report or feature request, create one first and attach the file to that.


9: How do I use TortoiseSVN to check out the CodeSnip source code?

  1. Create a suitable folder on your computer, say C:\CodeSnip.
  2. In Windows Explorer right click the folder you just created and choose SVN Checkout from the context menu.
  3. Enter the required URL for the CodeSnip source:

The required source code should download into the folder.

Note: You won't be able to commit changes unless you are a project member. However you can still submit changes to the author. See FAQ 8 for details.


10: Can I use CodeSnip source code in my GPL or LGPL licensed project?

If the CodeSnip code is covered by the Mozilla Public License (MPL) v1.1 and does not have the MPL / GPL / LGPL tri-license you can't use it as is. This is because MPL v1.1 and the GPL / LGPL are not considered to be compatible.

It is my intention to change the CodeSnip v4 code to the Mozilla Public License v2.0, which is GPL / LGPL compatible.

If the files you want are not compatible I will try to accommodate you, providing:

  1. You're not requesting hundreds of files
  2. You give me plenty of notice
  3. The files are not in the tags directory of the Subversion repo - I never change these.

For code in the trunk I will change to MPL v2.0 and for other code either MPL v2.0 or the tri-license as I see fit.

If you want to do this, please get in touch, naming the files you are interested in.

For other licenses, please read the license concerned and check out what the Free Software Foundation has to say about it.

Edit - History - Print - Recent Changes - Search
Page last modified on April 21, 2012, at 04:58 PM