====== How to organise your work with packages ====== [[package:WhatIsAPackage | This introduction]] give an overview of what a package is and what it is used for. This section give detailed information on how to use a package, and on the various mechanisms you use to access resources within your projects and your packages. Discussion about style of working: informal, informal plus packages, packaged. ===== Sessions ===== jMax keep track of all loaded packages and patches in what is called the current session. The content of the current session is shown in the jMax Phoenix user interface in the browser, that can be used to browse the patches and the package content (for now, in a limited way). In order to simplify prototyping, when a patch is loaded, a set of defaults are applied for resource location: in particular, abstractions will be looked for in an ''abstraction'' directory at the same level of the patch in the file hierarchy. These defaults are anyway not applied when a patch is loaded as part of a project package; it is assumed that the package provide the configuration needed for the patches that it is loading. In a future version, jMax will be able to optionally save the session at shutdown and to try to restore it at startup. Please note that while this is convenient for the normal, daily development work, it is not a mechanism to save and reproduce a specific project environment. Use packages for that. ===== Identifying resources ===== === Filenames === === jMax URL === jMax Phoenix use a standard way to identify a file resources contained in a package, using the standard URL syntax. A jMax URL is in the form: jmax:/// The URL is dynamically translated to the actual filename of the resource. This allows the use of package resources without knowing its exact location. jMax support two special package names: //home// that always refer to the user home directory, and //core// that refer to the jMax distribution. This allows portable references to personal resources or to jMax core resources. A jMax URL can also contains variables, like for example: jmax://mypackage/$(os.name)/module.so The variable correspond either to the Java System properties (of which os.name, os.arch and user.name are the most interesting) and to command line arguments. This allows to customise a package, mostly to adapt it to multiple architecture, but other customisation are possible, of course. ===== Loading Packages ===== Implicit loading: require, require in packages. The require syntax. Explit loading: loading a directory package. Loading a jar package. ===== Unloading packages ===== ===== The package cache =====