Difference between revisions of "How to build Freeplane"

From Freeplane - free mind mapping and knowledge management software
(Ant options for building freeplane for upload on Source Forge servers)
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==First steps==
+
[[Category:Coding]]
 
 
To build Freeplane, you can:
 
 
 
# Get the source code in one of the following ways:
 
#*  Download the freeplane_src archive from http://sourceforge.net/projects/freeplane/files/ ('''NOT''' the freeplane_srcpure archive -- this does not contain the external libraries required for the build.)
 
#*  Check out the latest source code from the git repository [https://github.com/freeplane/freeplane]
 
# Build the source code, by typing the following commands:
 
#*  <code>cd freeplane_framework/ant</code>
 
#*  <code>ant</code>  [Without parameters, this defaults to 'dist' to build all targets. See the '''Using ant''' section below for more details.]
 
 
 
After the code finishes building, target files can be found inside the <code>freeplane_framework/dist</code> directory.
 
 
 
Information on the Git repository used by Freeplane is available on the [[Git howto]] wiki page.
 
 
 
== Using ant ==
 
Building Freeplane requires that you have [http://ant.apache.org/ ant] installed on your computer.  From the ant directory you can run <code>ant TARGET</code> where <code>TARGET</code> is one of the following:
 
* build (create directory with binaries in freeplane/freeplane_framework/build)
 
* binzip (create binary zipfile in freeplane/freeplane_framework/dist)
 
* srczip (create source zipfile in freeplane/freeplane_framework/dist)
 
* installer (create windows installer in freeplane/freeplane_framework/dist)
 
* portableinstaller (create portable-windows installer in freeplane/freeplane_framework/dist)
 
* dmg4mac (create OS X DMG file in freeplane/freeplane_framework/dist)
 
 
 
Specifying no target will end up building all of the above targets.
 
  
If you wish to specify a destination build directory, you can do so by adding the <code>build</code> property as a commandline argument to ant:
+
== Requirements ==
* <code>ant -Dbuild=<destination directory> build</code> .
+
* You need java 11 or later and gradle >= 6.0
  
 +
== Download gradle ==
 +
* Download gradle: https://gradle.org/releases/
 +
* Unzip to your home directory
  
If you change some translation (.properties) files you may get an error like this:
+
== Clone the freeplane repository ==
 +
git clone https://github.com/freeplane/freeplane.git
 +
cd freeplane
  
check-translation:
+
== Run gradle ==
[check-translation]
+
* Gradle wrapper files are intentionally not committed to the sources but git ignored so that you can add them yourself if you need them.
D:\Freeplane121\freeplane\viewer-resources\translations\Resources_en.properties requires formatting - content changed
+
$ ~/Downloads/gradle-6.0.1/bin/gradle build
BUILD FAILED
 
D:\Freeplane121\freeplane_framework\ant\build.xml:56: The following error occurred while executing this line:
 
D:\Freeplane121\freeplane_framework\ant\build.xml:37: The following error occurred while executing this line:
 
D:\Freeplane121\freeplane\ant\build.xml:50: The following error occurred while executing this line:
 
D:\Freeplane121\freeplane\ant\build.xml:191: 1 files require proper formatting - run format-translation to fix
 
  
In this case you have to format the properties-Files.
+
== Run freeplane ==
 
+
cd BIN
This is done with
+
./freeplane.sh # linux
 +
freeplane.bat
 
   
 
   
  ant format-translation
+
== Create package ==
 +
  ~/git2/freeplane(1.7.x u=)$ ~/Downloads/gradle-6.0.1/bin/gradle clean build dist
 +
ls DIST
  
=== Ant options for building freeplane for upload on Source Forge servers ===
+
== Configuring an IDE ==
Please consider following settings
+
* See [[IDE setup| how to set up IDE]]
 
 
'''For building test versions:'''
 
ant -Dminor=XX
 
*-Dminor=XX adds the testversion number to the file names for creating the test version.
 
 
 
== Build files ==
 
The build is described in build.xml files:
 
 
 
  $ grep -H /freeplane.*jar freeplane/ant/ant.properties; \
 
    egrep '(<jar )|property.*name="free.*jar"' */ant/build.xml
 
  freeplane/ant/ant.properties:  freeplaneviewer.jar = ${freeplane.dist.lib}/freeplaneviewer.jar
 
  freeplane/ant/ant.properties:  freeplaneeditor.jar = ${freeplane.dist.lib}/freeplaneeditor.jar
 
  freeplane/ant/ant.properties:  freeplaneosgi.jar = ${freeplane.dist.lib}/freeplaneosgi.jar
 
  freeplane/ant/ant.properties:  freeplanemac.jar = ${freeplane.ext.lib}/freeplanemac.jar
 
  freeplane/ant/build.xml:  <property name="freeplaneant.jar" value="${workspace}/freeplane_framework/ant/lib/freeplaneant.jar" />
 
  freeplane/ant/build.xml:  <property name="freeplaneplugin.jar" value="${dist.osgi.dir}/org.freeplane.core.jar" />
 
  freeplane/ant/build.xml:  <jar jarfile="${freeplaneviewer.jar}">
 
  freeplane/ant/build.xml:  <jar jarfile="${freeplaneeditor.jar}" manifest="${manifest}">
 
  freeplane/ant/build.xml:  <jar jarfile="${freeplaneosgi.jar}">
 
  freeplane/ant/build.xml:  <jar jarfile="${freeplaneplugin.jar}">
 
  freeplane_mac/ant/build.xml:  <jar jarfile="${workspace}/freeplane/lib/freeplanemac.jar" update="false" >
 
  freeplane_plugin_bugreport/ant/build.xml:  <property name="freeplaneplugin.jar" value="${dist}/org.freeplane.plugin.bugreport.jar"/>
 
  freeplane_plugin_bugreport/ant/build.xml:  <jar jarfile="${freeplaneplugin.jar}">
 
  freeplane_plugin_help/ant/build.xml:  <property name="freeplaneplugin.jar" value="${dist}/org.freeplane.plugin.help.jar"/>
 
  freeplane_plugin_help/ant/build.xml:  <jar jarfile="${freeplaneplugin.jar}">
 
  freeplane_plugin_latex/ant/build.xml:  <property name="freeplaneplugin.jar" value="${dist}/org.freeplane.plugin.latex.jar"/>
 
  freeplane_plugin_latex/ant/build.xml:  <jar jarfile="${freeplaneplugin.jar}">
 
  freeplane_plugin_script/ant/build.xml:  <property name="freeplaneplugin.jar" value="${dist}/org.freeplane.plugin.script.jar"/>
 
  freeplane_plugin_script/ant/build.xml:  <jar jarfile="${freeplaneplugin.jar}">
 
  freeplane_plugin_svg/ant/build.xml:  <property name="freeplaneplugin.jar" value="${dist}/org.freeplane.plugin.svg.jar"/>
 
  freeplane_plugin_svg/ant/build.xml:  <jar jarfile="${freeplaneplugin.jar}">
 
 
 
The additional project <tt>freeplane_framework</tt>, have a higher level scope; the latter is the centralized entry into the build system to build the whole application:
 
 
 
  $ cd freeplane_framework/ant
 
  $ ant build dist
 
 
 
[[Category:Coding]]
 

Latest revision as of 09:16, 28 June 2020


Requirements

  • You need java 11 or later and gradle >= 6.0

Download gradle

Clone the freeplane repository

git clone https://github.com/freeplane/freeplane.git
cd freeplane

Run gradle

  • Gradle wrapper files are intentionally not committed to the sources but git ignored so that you can add them yourself if you need them.

$ ~/Downloads/gradle-6.0.1/bin/gradle build

Run freeplane

cd BIN
./freeplane.sh # linux
freeplane.bat

Create package

~/git2/freeplane(1.7.x u=)$ ~/Downloads/gradle-6.0.1/bin/gradle clean build dist
ls DIST

Configuring an IDE