Free cookie consent management tool by TermsFeed Policy Generator

Changes between Version 21 and Version 22 of Documentation/DevelopmentCenter/CreateNewPluginUsingVS


Ignore:
Timestamp:
07/25/14 13:25:47 (10 years ago)
Author:
abeham
Comment:

added information for core developers

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/DevelopmentCenter/CreateNewPluginUsingVS

    v21 v22  
     1[[PageOutline]]
    12= Quick guide: Create a new plugin using Visual Studio =
    23We assume that you have obtained the source as described in [[Documentation/DevelopmentCenter/DownloadAndBuildSource|Quick guide: Download and build sources]]. We assume your directory structure looks as follows:
     
    8687
    8788
     89== For HL core developers ==
     90HL core developers must check out the trunk, branches and stable folders, though not all of the individual branches need to be checked out. //New functionality should be developed in a branch and not in the trunk. The merge back into the trunk will occur, after a new feature reaches maturity. This requires at least a code review and clearance by head developer Stefan Wagner!//
     91 * SVN repository main: [[https://svn.heuristiclab.com/svn/core]] (use "Choose Items" in the checkout dialog to limit the depth of the branches)
     92
     93If you develop new projects, they must reside inside a directory that denotes major.minor version. If a plugin is named HeuristicLab.Problems.Mine, the project files should be placed inside `HeuristicLab.Problems.Mine\3.3\HeuristicLab.Problems.Mine-3.3.csproj`. Note that the version number is also appended to the .csproj file.
     94
     95=== Configuring the project properties ===
     96Once a project has been created and the directory structure has been adapted, the project properties need to be adjusted.
     97
     98 * The output name of the project should include the version number, e.g. HeuristicLab.Problems.Mine-3.3
     99 * The default namespace should be free from version numberings, e.g. HeuristicLab.Problems.Mine
     100 * The target framework needs to be set to .NET Framework 4.0 (not the client profile!).
     101 * On the build tab please choose the appropriate output path. In case a branch is merged into the trunk this should be changed as well!
     102  * `..\..\bin` for projects inside the trunk
     103  * `..\..\..\..\trunk\sources\bin\` for projects inside the branches directory
     104 * We typically use pre-build events for automatic versioning. This expects a `Plugin.cs.frame` and `Properties\AssemblyInfo.cs.frame` file to be present in your project (see below). It will replace the version placeholder with the SVN version and overwrite the respective .cs file. Note that you must at least add your code in the working copy for this to work. Typically, these are the pre-build commands:
     105{{{
     106set Path=%Path%;$(ProjectDir);$(SolutionDir)
     107set ProjectDir=$(ProjectDir)
     108set SolutionDir=$(SolutionDir)
     109set Outdir=$(Outdir)
     110
     111call PreBuildEvent.cmd
     112}}}
     113  * If you are on a branch, copy the `PreBuildEvent.cmd` to your branch directory
     114
     115=== Adding references to a project ===
     116If you are working within the HeuristicLab solution, you can reference other projects through ''project references''. If you are working in your own solution, reference the assemblies in {{{trunk\sources\bin\}}}. In both cases, if you add references, '''switch the "Copy local" option to false''' in the properties of the reference. Otherwise your build might break!
     117
     118=== Use the configuration manager ===
     119Create configurations for debug and release builds and all platforms (Any CPU, x86, x64). Make sure that the respective solution configurations target the right configuration of your projects and that they are checked.
     120
     121=== Create frame files ===
     122Each HeuristicLab plugin has two frame template files, AssemblyInfo.cs.frame and Plugin.cs.frame. We use these .frame files and `SubWCRev` to automatically convert those into .cs files and add the repository version number to the revision-version.
     123 * AssemblyInfo.cs.frame
     124   * AssemblyVersion --> if this one changes all dependent plugins must be rebuilt as well, should be set to e.g. 3.3.0.0 and touched only again when major or minor version changes
     125   * AssemblyFileVersion --> not relevant for build process, should be set to e.g. 3.3.10.$WCREV$
     126 * Plugin.cs.frame
     127   * Used to replace your plugin version number with the build number on SVN commit, e.g. 3.3.10.$WCREV$
     128 * If you check in your sources make sure to exclude and ignore AssemblyInfo.cs and Plugin.cs on commit
     129
     130=== Configuring the plugin file ===
     131 * Plugin attribute [Plugin("HeuristicLab.Problems.Mine", "3.3.0.$WCREV$")]
     132 * PluginDependencies --> Please make sure that you list all referenced plugins. There is a unit test that checks if you have included all or if you have specified too many
     133   * Version numbers: Major and minor must be set for all plugins, e.g. 3.3 or 3.4
     134
     135=== Trunk integration ===
     136When your branch has matured and is ready for trunk integration, you should remove your branch and add your projects to the trunk solution.
     137
     138 * Remember that the output path for trunk projects is different, change it!
     139 * Convert all references to project references (don't forget to set Copy Local to false!)
     140 * Add your project to the build dependencies of the HeuristicLab-3.3 project to ensure that your project is also built on every rebuild. To do this right click on the solution, Properties, Project Dependencies, select the HeuristicLab-3.3 project.
     141 * Add your plugin as a reference to the HeuristicLab.Tests project
     142 * Sign the project with the HeuristicLab key (if you haven't done so already)
     143 * Check all source files and Designer generated source files for a GPL license header
     144 * If you want to add a custom resource (say, an image), it belongs into HeuristicLab.Common.Resources. Mail Stefan Wagner if you require custom resources. Note that the image should have a license that is compatible with the GPL.
     145