Skip to content, Skip to search

Changes

Overview of Fiji's source code

2,245 bytes removed, 09:02, 9 July 2019
Jenkins -> Travis
== The Fiji launcher ==
The [[Developing Fiji#The_Fiji_launcher|Fiji launcherLauncher]] is a relatively small C++ program whose source sits now called ''ImageJ launcher'' and lives {{GitHub|org=imagej|repo=imagej-launcher|label=in its own repository}}. It is [httphttps://pacific.mpitravis-cbgci.deorg/cgi-binimagej/gitweb.cgi?p=fiji.git;a=blob;f=fiji.cxx;hb=HEAD <Fijiimagej-root>/fiji.cxxlauncher built by Travis CI].
== The whole purpose of the launcher is to make launching Java and Fiji easier, but there are a few other niceties in there, such as running Jython scripts or .jar files with the same classpath as Fiji.plugins ==
The generated launcher is 'plugins served from Fiji'<Fijis update site are all [[Why Closed-root>/Source Is Wrong|Open Source]]. The source code lives {{GitHub|org=fiji|repo=|label=on GitHub}}, in repositories reflecting the name of the ''.jar'' (or on Windows, file generated from the source code. Example: the source code for ''fijiFiji_Plugins.exejar'')lives in https://github.com/fiji/Fiji_Plugins.
== The only special rule applies for plugins ==whose file names end in an underscore: that underscore will be stripped. Example: the sources of ''Arrow_.jar'' are stored in https://github.com/fiji/Arrow. All of our plugins are maintained as [[Maven]] projects; this allows developers to build the code with their integrated development environment of choice.
We try to [[Why Closed-Source Is Wrong|avoid]] plugins without sources, but even those are not tracked Plugins maintained in <Fiji-root>/plugins/, but rather in [http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=fiji.git;a=tree;f=staged-plugins;hb=HEAD <Fiji-root>/staged-plugins]. The reason is that we would want to provide our very own ''plugins.config'' files with them, i.e. we want to have custom locations/names Maven projects consist of the plugins contained in the ''.jar'' file.
Such ''plugins# a pom.config'' files that are to be inserted xml file in certain ''.jar'' also live the top-level directory# the Java sources in the ''staged-pluginssrc/main/java/''directory, as ''<basename-of-jar>.configand# the ''. Example: the plugins.config for ''loci_tools.jarfile in '' is stored in [http:src/main/pacific.mpi-cbg.de/cgi-binresources/gitweb.cgi?p=fiji.git;a=blob;f=staged-plugins/loci_tools.config;hb=HEAD <Fiji-root>/staged-plugins/loci_tools.config].''
The If the plugin sources for many plugins shipped with (and maintained contain unit tests, their sources are in) Fiji live in [http:''src/test/pacific.mpi-cbg.de/cgi-binjava/gitweb.cgi?p=fiji.git;a=tree;f=src-plugins;hb=HEAD <Fiji-root>/src-plugins]. The subdirectories in ''src-plugins'' mostly correspond to so that the basename of the .jar file generated from it. Example: test classes will not be included in the sources of final ''plugins/Fiji_Updater.jar'' are stored in [http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=fiji.git;a=tree;f=src-plugins/Fiji_Updater;hb=HEAD <Fiji-root>/src-plugins/Fiji_Updater/]file.
== Libraries ==
Some plugins require third-party Most libraries such are available as ''Jama''. Such libraries are not stored in ''pluginsregular [[Maven]] dependencies (you can [http:/'' (lest an underscore in their filenames would make ImageJ mistake them for plugins), but in ''jars/'' insteadsearchSome of the libraries' sources are stored in ''src-pluginsmaven.org/'' (in subdirectories corresponding to the basename of the respective ''.jar'' filesearch for them on Maven Central]).
== Submodules ==
Some components of Fiji are stored in used to maintain relationships with projects developed outside the ''submodulesfiji.git'', i.e. in [[repository via Git]] repositories of their own rightsubmodules. This is proved too cumbersome and too unintuitive for the case for [[ImageJA]], many third-party libraries, and some plugins collections that existed before Fiji, such as [[TrakEM2]] or [[Bio-Formats]]affected parties.
These submodules All submodule couplings are subdirectories in now replaced by proper [http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=fiji.git;a=tree;f=modules;hb=HEAD <Fiji-root>/modules/[Maven], and they may, or may not, be checked out. Every submodule is "committed" at a certain revision, i.e. Git not only records where, say, ImageJA is to be cloned from, but also what revision is current for any given commit in ''fiji.git''. If submodules are checked out, you can cd into the respective directories and work with them as with other Git repositories. Our policy, however, is that you do not need to check out the submodules if you do not want to work <u>on</u> them: the result of the most recently committed revision needs to be committed as binary in [http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=fiji.git;a=tree;f=precompiled;hb=HEAD <Fiji-root>/precompiled/]. For example, the ''.jar'' file generated from the ''bio-formats'' submodule is committed as ''precompiled/loci_tools.jar''dependency management.
== The Fiji Build system ==
For historical reasons, the Fiji Build used to have its home-brewn build system's source code lives . We switched to using [[Maven]] in ''<Fiji-root>/fake/Fake.java''. It will be compiled into ''<Fiji-root>/fake.jar''2012, though.
To avoid a chicken-and-egg problemFor convenience, there is a {{GitHub|org=scijava|repo=minimaven|label=''fake.jarMini Maven'' }} project that can compile the current allows building Fiji Build system is committed to ''precompiled/'' (and without a full-blown Maven; however, for the same reasonserious development, precompiled versions of the Fiji launchers for all supported platforms live therereal Maven, or even better, too)Eclipse or Netbeans is recommended.
== The For backwards-compatibility, ''Mini Maven'precompiled/'can be called via ' directory == Precompiled versions of all ''.jar/Build.sh'' files generated from submodules, ' in the top-level directory of a ''fakefiji.jargit'' and of checkout. Despite the name, it does not really build anything, but only draws in all Fiji launchers live in ''precompiled/''components as [[Maven]] dependencies.
== The ''bin/'' directory ==
Quite a few tasks -- such as committing a new submodule or sources for a plugin, or releasing a new version of Fiji -- are performed by scripts. These scripts live in the ''<Fiji-root>/bin/'' subdirectory.
Some of these scripts are shell scripts, others are Jython scripts with special [http[wikipedia://en.wikipedia.org/wiki/Shebang_Shebang (Unix) |shebang]] lines which trigger them to be called with the current Fiji launcher. == The ''nightly-build/'' directory == We have a ''cronjob'' that builds Fiji every night, from then-current sources. The responsible script is ''bin/nightly-build.sh''. Of course, it might often be quite handy to do the same locally, i.e. compile from a completely pristine state (e.g. to ensure that your latest commit includes all necessary files). You can easily do that by calling ''./bin/nightly-build.sh HEAD'', which will automatically create an appropriate ''nightly-build/'' subdirectory (if it does not exist yet), and simulate a from-scratch build.
[[Category:Development]]
Bureaucrat, emailconfirmed, incoming, administrator, uploaders
12,110
edits